aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-10-27l2md: get l2md to compile and run on MacOSHEADmasterAlexei Starovoitov6-9/+12
Few tweaks to make the code compile on MacOS. As a prerequisite to get it running, `brew install libgit2` is needed. Signed-off-by: Alexei Starovoitov <ast@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2021-08-30l2md: use XDG compliant paths for config file and work dirNicolas Schier2-27/+85
Change the default locations of the config file and the work directory. Prefered config file is taken from ~/${XDG_CONFIG_HOME}/config ('.config' as fallback for XDG_CONFIG_HOME), the old default location ~/.l2mdconfig is used as fallback. To avoid breakage of old setups, use ~/.l2md/ as default base directory iff it exists. Otherwise, use ~/${XDG_DATA_HOME}/l2md/. Signed-off-by: Nicolas Schier <nicolas@fjasle.eu> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2021-08-30l2md: enable -Wextra and fix compilabilityNicolas Schier2-2/+7
Enable -Wextra and add __noreturn to fix compilability. Signed-off-by: Nicolas Schier <nicolas@fjasle.eu> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2021-02-24l2md, Makefile: add PREFIX flagXinglu Chen1-3/+4
This allows the user to choose a different installation directory. Signed-off-by: Xinglu Chen <public@yoctocell.xyz> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2020-07-31l2md: fix infinite loop on reading short filesJakub Kicinski1-3/+10
When (config) files get corrupted and are not the expected size we'd enter an infinite loop. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2020-02-26l2md: enable proxy supportJakub Kicinski1-0/+1
libgit2 requires an explicit opt-in to enable proxies. With the option set it consults gitconfig like git would. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2020-01-16l2md: add per-repo config option to enable or disable syncingAnthony Iliopoulos3-3/+20
Introduce a config option to control the fetching/syncing on a per-repo granularity. Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com> [ Daniel: rename to sync_enabled to make it more self-documenting and enable by default to avoid breaking existing user configs. ] Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2020-01-16l2md: add oneshot option to sync once and exitAnthony Iliopoulos4-4/+12
By default l2md will loop forever and periodically fetch and sync. Add a config option that enables l2md to sync once and exit, so that it could also be invoked for oneshot operation (e.g. via crontab), instead of running as a daemon service. Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2020-01-16l2md: don't panic on umatched git objects during repo walkAnthony Iliopoulos1-2/+5
During repo walking, revparse expects to find objects based on the oid:"m" specification, but public-inbox encodes some specific objects (e.g. spam) differently, and that causes the walk to bail out. Fix by skipping all objects that don't match the default mail specification. Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-12-05l2md: use correct path in error msg when config cannot be openedJakub Kicinski1-1/+1
It's the path variable and not tmp, so use the correct one. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-11-13l2md: warn when revwalk did not succeed in prep stepDaniel Borkmann1-2/+5
If we couldn't even start walking the repo, throw a warning to inform what went wrong. Now that we've bumped the open file limit this issue should be mitigated, but this indicates that potentially the repo needs a repack. Once libgit2 supports this, we can actually do it here instead. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-11-13l2md: bump open file limit for repos with lots of pack filesDaniel Borkmann1-0/+29
Bump the limit to avoid bailing out in git_revwalk_next() without having walked any commits. This happens when the repo has a lot of pack files where we otherwise surpass the open file limit with the default. Ideally doing an equivalent of ... git repack -a -d -f --depth=250 --window=250 ... out of libgit2 would be best and solve this issue, but given GH issue [0], it's not there yet (if ever). [0] https://github.com/libgit2/libgit2/issues/3247 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-03l2md: add todo file to keep track of future improvementsDaniel Borkmann1-0/+12
Add two more suggestions from Konstantin with regards to using the manifest file for checking updates and epoch roll-over. Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-02l2md: document --verbose option in readmeDaniel Borkmann1-0/+14
Seems this was missing in the README. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-02l2md: add support to pipe new mails to stdout for procmail et alDaniel Borkmann10-32/+214
Add very initial/rough support for piping new mails to external MDAs. Konstantin says: Thanks for working on this -- I've started on a similar tool in the past, but got distracted and never completed it. In my implementation, it was piping messages to procmail, which allowed writing complex rules for folders/pre-processing, etc. May I suggest that your tool also offers a stdout that can be piped to procmail? Used test config: $ cat ~/.l2mdconfig [general] base = /tmp/test/ pipe = /usr/bin/procmail period = 30 [repo bpf] url = https://lore.kernel.org/bpf/0 initial_import = 10 Tested l2md -> procmail -> mutt locally which seems to work fine. Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/workflows/20190930212410.GE14403@pure.paranoia.local/
2019-10-01l2md: make output modular to support different modesDaniel Borkmann7-45/+97
Refactor the output handling of new mails in order to allow adding new modes as next step. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-01l2md: rename/generalize oid_maildir into oidDaniel Borkmann3-10/+9
It's not tied in any way to the fact that we're using maildir, plus we want to support different output modes in future, therefore move to a more generic name. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-01l2md: move verbose mode to stderr and get rid of fflushDaniel Borkmann2-3/+1
As not needed for != stdout and also if verbose() is disabled. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-01l2md: minimal sanity check for general vs repo configDaniel Borkmann1-3/+6
Given we may be deriving the repo-specific default paths from the general config, add a sanity check that we have parsed the general one before the repo specific sections, and simply just bail out if this was not the case. Not really a point in making it more complex right now. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-01l2md: define default maildir based on prior set basedirDaniel Borkmann1-2/+2
No need to hard code it once more, so just reuse what we just defined. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-01l2md: make the repo basedir path configurableAnthony Iliopoulos2-0/+14
Enable the config file to override the default global base path where the git repos are cloned and reside, and dump the setting in the verbose output, while at it. Also, add the default base path in the example l2mdconfig file. Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-10-01l2md: add a basic gitignore fileAnthony Iliopoulos1-0/+2
Ignore object files and l2md binary. Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-09-25l2md: initial import of lore 2 maildirDaniel Borkmann13-0/+1557
There it is. See README for more details and setup. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>