about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiAuth.pm
DateCommit message (Collapse)
2021-09-07lei up: support --all for IMAP folders
Since "lei up" is expected to be a heavily-used command, better support for IMAP seems like a reasonable idea. This is inefficient since we waste an IMAP(S) TCP connection since it dies when an auth-only LeiUp worker process dies, but it's better than not working at all, right now.
2021-09-06lei_auth: simplify users
There's no need to alias net_merge_all in each WQ class which uses LeiAuth, `$obj->$sub' works even when `$sub' is a fully-qualified subroutine name with `::' in it. perlobj(1) documents it under "Method Call Variations".
2021-09-06lei_auth: remove net_merge_done1 step
It turns out this step is unnecessary, since SOCK_SEQPACKET ordering is guaranteed and we know wq_broadcast calls will always be handled sequentially.
2021-09-06lei_auth: diagram for current behavior
Before making potentially major changes, lets clarify readers' understanding of how LeiAuth currently works.
2021-06-04pkt_op: make pkt_do an OO method
This will make it easier to use for internal use such as managing Maildir and IMAP IDLE watches.
2021-05-01lei_auth: s/net_merge_complete/net_merge_all_done/
We use the "done" term elsewhere for similar things, and my easily-confused mind equates "complete" with shell completion.
2021-04-03lei_auth: rename {net_merge} to {net_merge_continue}
No reason for the hash key to differ from the subroutine name, here.
2021-04-03lei q: ensure wq workers shutdown on IMAP auth failures
Leaving workers running on after auth failures is bad and messy, cleanup our process management to have consistent worker teardowns. Improve error reporting, too, instead of letting Mail::IMAPClient->exists fail due to undef.
2021-02-24lei <import|convert>: support NNTP sources
We can read NNTP in -watch and Net::NNTP is shipped with Perl5, so lei import and convert have no excuse not to support NNTP as a client. Authentication is not tested, yet; but should be close to what IMAP is like...
2021-02-22lei_auth: trim and remove leftover worker code
LeiAuth is no longer a separate worker process. Instead, it's used directly by LeiToMail and LeiImport for sharing auth info from the first worker to the rest of the workers, using lei-daemon as a message router. So drop the old code to reduce human cognitive load and interpreter memory overhead.
2021-02-22lei q: reduce wasted IMAP connection for auth
We can rework the first lei2mail worker to authenticate, and then share auth info with the rest of the lei2mail workers. As with "lei import", this uses PktOp and lei-daemon to share updated credentials between the first an subsequent l2m workers.
2021-02-22lei_auth: migrate common auth code from lei_import
lei_to_mail will be able to use this, too.
2021-02-22lei: _lei_cfg: return empty hashref if unconfigured
Existing callers in LeiExternal actually depend on this, and LeiAuth shouldn't need to be creating a config file just to do a conversion against an anonymous IMAP server.
2021-02-22lei: keep client {sock} in short-lived workers
For non-persistent workers, there's no harm in keeping the client socket open. This means we can avoid dancing around closing it in PublicInbox::LeiAuth::ipc_atfork_child. Eventually, other WQ workers will trigger "git credential" spawning in script/lei directly.
2021-02-22lei_auth: rename {nrd} field to {net} for clarity
We're authing for both reads and writes, this makes it clear that we support both NetReader and NetWriter.
2021-02-21lei q: support IMAP/IMAPS --output destinations
Augment (and dedupe) aren't parallel, yet, so its more sensitive to high-latency networks.
2021-02-18lei: consolidate the bulk of the IPC code
The backends for "lei add-external --mirror", "lei convert", and "lei import" all share a similar pattern for spawning background workers. Hoist out the common parts to slim down our code base a bit. The LeiXSearch and LeiToMail workers for "lei q" remains a the odd duck due to the deep pipelining and parallelization.
2021-02-18lei convert: mail format conversion sub-command
This will make testing IMAP support for other commands easier, as it doesn't write to lei/store at all. Like the pager and MUA, "git credential" is always spawned by script/lei (and not lei-daemon) so it has a controlling terminal for password prompts. v2: fix missing requires, correct test ordering v3: ensure config exists for IMAP auth