Eric Wong [Fri, 15 Nov 2019 09:50:36 +0000 (09:50 +0000)]
init: pass global variables into subs
Avoid 'Variable "%s" will not stay shared' warnings
when the contents of this script eval'ed into a sub.
We also need to rely on ->DESTROY instead of END{}
to unlink the lock file on sub exit.
Eric Wong [Fri, 15 Nov 2019 09:50:35 +0000 (09:50 +0000)]
index: pass global variables into subs
Avoid 'Variable "%s" will not stay shared' warnings
when the contents of this script eval'ed into a sub.
Eric Wong [Fri, 15 Nov 2019 09:50:34 +0000 (09:50 +0000)]
admin: get rid of singleton $CFG var
PublicInbox::Admin::config() just adds an extra layer of
indirection which we barely rely on. So get rid of this
global variable and make it easier to run tests in the
future without relying on global state.
Eric Wong [Fri, 15 Nov 2019 09:50:33 +0000 (09:50 +0000)]
edit: use OO API of File::Temp to shorten lifetime
Instead of relying on END{} blocks, rely on ->DESTROY
so the temporary files go out-of-scope and system
resources get released, sooner.
Eric Wong [Fri, 15 Nov 2019 09:50:32 +0000 (09:50 +0000)]
edit: pass global variables into subs
Avoid 'Variable "%s" will not stay shared' warnings
when the contents of this script eval'ed into a sub.
Eric Wong [Sat, 16 Nov 2019 02:34:39 +0000 (02:34 +0000)]
mboxgz: use Compress::Raw::Zlib instead of IO::Compress::Gzip
IO::Compress::Gzip is a wrapper around Compress::Raw::Zlib,
anyways, and being able to easily detach buffers to return them
via ->getline is nice. This results in a 1-2% performance
improvement when fetching giant mboxes.
Eric Wong [Sat, 16 Nov 2019 02:34:38 +0000 (02:34 +0000)]
mbox: split mboxgz out into a separate file
It'll make using Compress::Raw::Zlib easier, since we
can use that and import constants more easily.
Eric Wong [Sat, 16 Nov 2019 02:34:37 +0000 (02:34 +0000)]
mbox: unused mid_clean import
We're gradually phasing mid_clean out (in favor of mids()).
Eric Wong [Thu, 14 Nov 2019 06:41:14 +0000 (06:41 +0000)]
doc: check-man: save the result of successful runs
We can keep a stamp around if the corresponding manpage hasn't
changed to avoid re-running man(1) and awk(1).
Eric Wong [Thu, 14 Nov 2019 06:41:13 +0000 (06:41 +0000)]
t/psgi_mount: require SearchIdx before using
We may not implicitly load it via other means in the future.
Eric Wong [Thu, 14 Nov 2019 06:41:12 +0000 (06:41 +0000)]
t/common: move unix_server to t/httpd-corner.t
unix_server() is not commonly used, only t/httpd-corner.t uses
it and most HTTP tests use TCP since most HTTP libraries only
support TCP.
Eric Wong [Thu, 14 Nov 2019 06:41:11 +0000 (06:41 +0000)]
t/common: inline stream_to_string into t/feed.t
We only use it in one place and have favored test_psgi
in newer tests, so move it out-of-the-way to reduce startup
overhead of other *.t files.
Eric Wong [Thu, 14 Nov 2019 10:57:32 +0000 (10:57 +0000)]
doc: mknews: support Email::MIME <1.930
Email::MIME::header_str is not available until 1.930, so the
rest of our code uses Email::MIME::header for compatibility
with distros, since CentOS 7.x only has 1.926.
Eric Wong [Thu, 14 Nov 2019 08:47:40 +0000 (08:47 +0000)]
convert: remove duplicated GetOptions() call
We only need to parse the command-line once.
Eric Wong [Thu, 14 Nov 2019 01:12:11 +0000 (01:12 +0000)]
inboxwritable: drop {-importer} cyclic reference
InboxWritable caching the result of ->importer leads to a
circular references with returned (V2Writable|Import) object
holds onto the calling InboxWritable object.
With public-inbox-watch, this leads to a memory leak if a user
is reloading via SIGHUP after a message is imported (it would
only become noticeable with SIGHUPs after every message imported).
I would not expect anybody to to notice this in real-world
usage. I only noticed this since I was making -xcpdb suitable
for long-lived process use (e.g. "mod_perl style") and a flock
remained unreleased on v1 inboxes after resharding.
WatchMaildir (used by -watch) already handles caching of the
importer object itself, and all of our other real-world uses of
->importer are short-lived or designed for batch scripts, so
there's no need to cache the importer result internally.
Eric Wong [Wed, 13 Nov 2019 07:57:38 +0000 (07:57 +0000)]
xapcmd: localize %SIG changes using "local"
Perl's "local" allows changes to %SIG (and %ENV) to be limited
to its enclosing block. This allows us to get rid of a global
variable and ad-hoc method for restoring signal handlers.
Eric Wong [Thu, 14 Nov 2019 01:03:38 +0000 (01:03 +0000)]
solvergit: use --unidiff-zero with git-apply(1)
I sometimes post context-free documentation patches generated
with "-U0" to reduce size and bandwidth overhead when replacing
URLs or updating copyright notices. git-apply(1) needs the
--unidiff-zero switch to work properly with context-free
patches.
Given our search looks for blob OIDs, and we're never going
to be running the code we regenerate, "--unidiff-zero" ought
to be safe.
Kyle Meyer [Sat, 9 Nov 2019 00:38:06 +0000 (19:38 -0500)]
doc: drop a repeated word
Eric Wong [Mon, 4 Nov 2019 03:01:37 +0000 (03:01 +0000)]
t/*.t: disable nntpd/httpd worker processes in most tests
And explicitly test for respawning in t/httpd-corner.t
There's no need to have an extra entries in the process table
for most tests we run, since that's not what we're testing.
Eric Wong [Mon, 4 Nov 2019 03:01:36 +0000 (03:01 +0000)]
t/hl_mod.t: remove IPC::Run (and File::Temp) dependency
We already load PublicInbox::Spawn for which(), so using spawn()
isn't unreasonable. And rely on "skip" to log the omitted test
if w3m is missing, which means we need to update the "&&"
escaping test to be self-referential on the same line.
File::Temp was totally unused, there; and we can use "open ...,undef"
in Perl to easily create anonymous temporary files for use with
spawn().
Eric Wong [Mon, 4 Nov 2019 03:01:35 +0000 (03:01 +0000)]
t/httpd-corner.t: get rid of IPC::Run for running curl
We already load PublicInbox::Spawn, so there's no need to
add another dependency to make life difficult for potential
contributors.
Eric Wong [Mon, 4 Nov 2019 03:01:34 +0000 (03:01 +0000)]
t/httpd-corner.t: drop unnecessary bytes:: for length()
We don't need to force byte semantics for a buffer we clearly
create (via ->read) with byte semantics. Since we didn't
"use bytes" in t/httpd-corner.t, it was inadvertantly made
available by IPC::Run (which goes away, next).
Eric Wong [Mon, 4 Nov 2019 03:01:33 +0000 (03:01 +0000)]
t/*.t: remove IPC::Run dependency for git commands
One small step towards making tests easier-to-run. We can rely
on "local $ENV{GIT_DIR}" for potentially shell-unsafe path
names, and the rest of our path names are relative and don't
contain characters which require escaping.
Eric Wong [Fri, 8 Nov 2019 20:20:18 +0000 (20:20 +0000)]
edit: check for write errors writing "From_" line
We need to check every print to a regular file for errors,
because storage devices inevitably fail.
Eric Wong [Fri, 8 Nov 2019 20:20:17 +0000 (20:20 +0000)]
edit: propagate correct editor exit code
exit($?) is never correct, since ($? >> 8) is needed to extract
the correct exit code, as other information (e.g. such as signal)
is encoded in $? in addition to the exit code.
Eric Wong [Fri, 8 Nov 2019 06:09:02 +0000 (06:09 +0000)]
doc: actually document publicinboxwatch.watchspam
Instead of copy-pasting the documentation for `spamcheck'.
Eric Wong [Mon, 4 Nov 2019 11:28:29 +0000 (11:28 +0000)]
t/edit: use PublicInbox::Git::qx for pathname safety
Another case where spaces can be in TMPDIR and cause
shell expansion with `command` to fail.
Eric Wong [Mon, 4 Nov 2019 11:13:47 +0000 (11:13 +0000)]
tests: rely on PublicInbox::Git for pathname safety
It's possible (but unlikely) a user will put spaces in TMPDIR
and cause File::Temp::tempdir() to return a temporary directory
with spaces in the filename, making it unsafe for shell
expansion.
PublicInbox::Git didn't exist when t/mda.t was written, and
I just forgot about PublicInbox::Git->qx for t/plack.t :x
Eric Wong [Mon, 4 Nov 2019 02:27:23 +0000 (02:27 +0000)]
t/httpd-corner.t: check for curl(1) errors in big async test
curl(1) can fail and we need to invalidate the test in the
rare case it fails.
Eric Wong [Mon, 4 Nov 2019 00:43:14 +0000 (00:43 +0000)]
index: "git log" failures are fatal
While I've never seen "git log" fail on its own, it could happen
one day and we should be prepared to abort indexing when it
happens.
Beef up tests for t/spawn.t to ensure close() behaves
on popen_rd the way we expect it to.
Eric Wong [Sun, 3 Nov 2019 06:48:58 +0000 (06:48 +0000)]
searchidxshard: reuse $SIG{__WARN__} callback from Admin
We don't want to define $SIG{__WARN__} in the worker to call an
existing non-default callback. Instead update ->{current_info}
the same way the V2Writable master process does.
I noticed this while reindexing with a large XAPIAN_FLUSH_THRESHOLD
and seeing the wrong epoch on my terminal from a shard because the
shard worker was spawned while reindexing a higher-numbered epoch.
Eric Wong [Sun, 3 Nov 2019 03:01:40 +0000 (03:01 +0000)]
public-inbox v1.2.0
Eric Wong [Sun, 3 Nov 2019 02:53:39 +0000 (02:53 +0000)]
build: add "git-dist" target for making gzipped tarballs
Since MANIFEST is tied to files tracked by git, adding generated
files such as NEWS to that is more effort than its worth (esp.
when I'm wondering if MakeMaker is useful compared to only using
GNU make).
I also have trouble reading CamelCase, so lower-case names
are nicer and more consistent with previous releases
(which were all generated with "git archive"); but did not
include NEWS.
Eric Wong [Sun, 3 Nov 2019 02:02:04 +0000 (02:02 +0000)]
doc: mknews: force plain-text NEWS to UTF-8
We'll have non-7-bit ASCII in the 1.2.0 release notes.
Eric Wong [Sun, 3 Nov 2019 01:42:03 +0000 (01:42 +0000)]
TODO: update item for multiple Date: headers
That's the only head-scratcher of the bunch remaining, since
that relies on ranges.
Eric Wong [Sat, 2 Nov 2019 21:51:08 +0000 (21:51 +0000)]
doc: add public-inbox.cgi(1) manpage
Yet another case of documenting things which should NOT be used :>
Eric Wong [Sat, 2 Nov 2019 21:34:59 +0000 (21:34 +0000)]
doc: add public-inbox-purge(1) manpage
Tools intended for end users need manpages, and doubly so
to convince potential users NOT to use them :)
Eric Wong [Thu, 31 Oct 2019 09:19:38 +0000 (09:19 +0000)]
hval: replace "'" with "'" for compatibility
While testing 216light.css changes, I managed to hit some cases
where dillo failed to render ' correctly, but I also can't
reproduce it reliably. Anyways, it's definitely a problem with
some old browsers and newer versions of highlight already work
around it, but Debian 10.x has 3.41, so use "'" to maximize
compatibility.
Eric Wong [Thu, 31 Oct 2019 09:19:37 +0000 (09:19 +0000)]
contrib/css/216light: improve contrast a bit
"#ff0" foreground on a "#fff" background is just too difficult
to distinguish, among other things. So choose slightly darker
colors when using a (painful) "#fff" background.
Eric Wong [Thu, 31 Oct 2019 05:36:31 +0000 (05:36 +0000)]
qspawn: psgi_qx: delay callback until waitpid returns
We need to detect "git apply" failures reliably when patches
fail. This is necessary for solving for blob
81c1164ae5 in
https://public-inbox.org/git/ when at least two messages can
solve for it (and one of them fails):
1. https://public-inbox.org/git/
b9fb52b8-8168-6bf0-9a72-
1e6c44a281a5@oracle.com/
2. https://public-inbox.org/git/
56664222-6c29-09dc-ef78-
7b380b113c4a@oracle.com/
Eric Wong [Thu, 31 Oct 2019 03:12:20 +0000 (03:12 +0000)]
solvergit: deal with false-positive dfpost: results
When solving for blob
81c1164ae5 in https://public-inbox.org/git/,
at least two messages get indexed with the dfpost result for
that blob (after fixing MsgIter to decode all text/* parts):
1. https://public-inbox.org/git/
b9fb52b8-8168-6bf0-9a72-
1e6c44a281a5@oracle.com/
2. https://public-inbox.org/git/
56664222-6c29-09dc-ef78-
7b380b113c4a@oracle.com/
However, only the first message contains a usable patch. So
we must adjust SolverGit to account for multiple messages
hitting the same "dfpost:" search result and attempt
"git apply" on all results, not just the first.
In the future, changes to SearchIdx.pm may rid us of invalid
search results and speed up performance (at the expense of
developer/indexing time); but we need to account for old search
indices, first.
Eric Wong [Thu, 31 Oct 2019 03:12:19 +0000 (03:12 +0000)]
msgiter: attempt to decode all text/* bodies
We want to index text/x-patch and text/x-diff, at least,
since "git format-patch" can generate a patch series as
attachments using --attach.
Eric Wong [Thu, 31 Oct 2019 00:33:04 +0000 (00:33 +0000)]
msgiter: do not assume UTF-8 if Email::MIME->body_str succeeds
ISO-2202-JP and other non-UTF-8 messages need to be displayed
correctly.
Fixes: 7d82a8bc04ce ('handle "multipart/mixed" messages which are not multipart')
Eric Wong [Wed, 30 Oct 2019 21:19:46 +0000 (21:19 +0000)]
search: add note about SCHEMA_VERSION 15
--reindex has gotten better over the years, and having parallel
Xapian DB directories would exceed all available disk space for
some users with giant inboxes.
Eric Wong [Wed, 30 Oct 2019 20:46:25 +0000 (20:46 +0000)]
wwwlisting: fix spelling and clarify sub location
Spell "Schwartzian" correctly, and clarify the location of
"modified" since we have multiple subs named "modified"
Eric Wong [Wed, 30 Oct 2019 20:46:44 +0000 (20:46 +0000)]
Merge branch 'learn'
* learn:
doc: add public-inbox-learn(1) manpage
mda: support multiple List-ID matches
mda: prepare for multiple destinations
inboxwritable: add assert_usable_dir sub
mda: skip MIME parsing if spam
mda: hoist out mda_filter_adjust
filter/base: remove MAX_MID_SIZE constant
mda: hoist out List-ID handling and reuse in -learn
learn: hoist out remove_or_add subroutine
learn: GIT_COMMITTER_<NAME|EMAIL> may be "" or "0"
learn: update usage statement
learn: only map recipient list on "ham" or "rm"
learn: support multiple To/Cc headers
Eric Wong [Mon, 28 Oct 2019 10:45:28 +0000 (10:45 +0000)]
doc: add public-inbox-learn(1) manpage
Tools intended for end users need manpages.
Eric Wong [Mon, 28 Oct 2019 10:45:26 +0000 (10:45 +0000)]
mda: support multiple List-ID matches
While it's not RFC2919-conformant, mail software can
theoretically set multiple List-ID headers. Deliver to all
inboxes which match a given List-ID since that's likely the
intended.
Cc: Eric W. Biederman <ebiederm@xmission.com>
Link: https://public-inbox.org/meta/87pniltscf.fsf@x220.int.ebiederm.org/
Eric Wong [Mon, 28 Oct 2019 10:45:25 +0000 (10:45 +0000)]
mda: prepare for multiple destinations
Multiple List-ID headers will be supported in the next commit
Eric Wong [Mon, 28 Oct 2019 10:45:24 +0000 (10:45 +0000)]
inboxwritable: add assert_usable_dir sub
And use it for mda, since "0" could be a usable directory
if somebody insists on using relative paths...
Eric Wong [Mon, 28 Oct 2019 10:45:23 +0000 (10:45 +0000)]
mda: skip MIME parsing if spam
We don't want to waste cycles parsing the message for MIME bits
if it's spam.
Eric Wong [Mon, 28 Oct 2019 10:45:22 +0000 (10:45 +0000)]
mda: hoist out mda_filter_adjust
It makes it easier to document the default -mda behavior is
stricter than normal, including "public-inbox-learn ham"
Eric Wong [Mon, 28 Oct 2019 10:45:21 +0000 (10:45 +0000)]
filter/base: remove MAX_MID_SIZE constant
We don't need it in the filter, here, since we have
one in the MDA package.
Eric Wong [Mon, 28 Oct 2019 10:45:20 +0000 (10:45 +0000)]
mda: hoist out List-ID handling and reuse in -learn
It's now possible to inject false-positive ham into an inbox
the same way -mda does via List-ID.
Eric Wong [Mon, 28 Oct 2019 10:45:19 +0000 (10:45 +0000)]
learn: hoist out remove_or_add subroutine
We'll be reusing it for List-ID processing in the next commit.
Eric Wong [Mon, 28 Oct 2019 10:45:18 +0000 (10:45 +0000)]
learn: GIT_COMMITTER_<NAME|EMAIL> may be "" or "0"
Users may be zeroes or blanks.
Eric Wong [Mon, 28 Oct 2019 10:45:17 +0000 (10:45 +0000)]
learn: update usage statement
Use <foo|bar> since that seems to be the favored notation
for required command args (taking a hint from git(1) manpage).
While we're at it, remove the space after '<' for the redirect
to match git.git coding style.
Eric Wong [Mon, 28 Oct 2019 10:45:16 +0000 (10:45 +0000)]
learn: only map recipient list on "ham" or "rm"
It's assumed that "spam" can end up anywhere due to Bcc:, so we
need to scan every single inbox. However, "rm" is usually more
targeted and and "ham" obviously only belongs in some inboxes.
Eric Wong [Mon, 28 Oct 2019 10:45:15 +0000 (10:45 +0000)]
learn: support multiple To/Cc headers
It's possible to specify these headers multiple times, and
PublicInbox::MDA->precheck takes that into account, so
-learn should, too.
Eric Wong [Wed, 30 Oct 2019 08:47:23 +0000 (08:47 +0000)]
Merge remote-tracking branch 'origin/multi-mid'
* origin/multi-mid:
view: show X-Alt-Message-ID in permalink view, too
index: allow search/lookups on X-Alt-Message-ID
linkify: support adding "(raw)" link for Message-IDs
view: improve warning for multiple Message-IDs
view: move '<' and '>' outside <a>
view: display redundant headers in permalink
search: support multiple From/To/Cc/Subject headers
Eric Wong [Thu, 24 Oct 2019 21:09:42 +0000 (21:09 +0000)]
HACKING: add a note about avoiding recursion
Bad things happen when user data can control our stack size.
Eric Wong [Thu, 24 Oct 2019 00:12:41 +0000 (00:12 +0000)]
view: show X-Alt-Message-ID in permalink view, too
Since we index X-Alt-Message-ID (because we need to placate some
NNTP clients), we now display it as well, since that Message-ID
could be the X-Alt-Message-ID that the reader is actually
interested in.
Eric Wong [Thu, 24 Oct 2019 00:12:40 +0000 (00:12 +0000)]
index: allow search/lookups on X-Alt-Message-ID
Since we replace extra Message-ID headers with X-Alt-Message-ID
to placate NNTP clients, we should allow searching and indexing
on X-Alt-Message-ID just like we do with Message-ID.
Eric Wong [Thu, 24 Oct 2019 00:12:39 +0000 (00:12 +0000)]
linkify: support adding "(raw)" link for Message-IDs
And use it for the per-message permalink display.
Eric Wong [Thu, 24 Oct 2019 00:12:38 +0000 (00:12 +0000)]
view: improve warning for multiple Message-IDs
"refer" is not the correct term, here; since that would mean
multiple messages have the current message in the "References:"
header, and that's a normal occurence.
Instead, we need to warn the reader that the given message
itself has multiple Message-IDs.
Eric Wong [Thu, 24 Oct 2019 00:12:37 +0000 (00:12 +0000)]
view: move '<' and '>' outside <a>
Browsers may underline '<' and '>' in links, which may be
confused with '≤' and '≥'. So have the Message-ID header
display follow what we do with In-Reply-To headers and move the
"<" and ">" outside of <a> in the HTML.
Eric Wong [Thu, 24 Oct 2019 00:12:36 +0000 (00:12 +0000)]
view: display redundant headers in permalink
Mail headers can contain multiple headers of any type, so ensure
we don't hide any information we're getting in the per-message
permalink views.
This means it's possible to have multiple From, Date, To, Cc,
Subject, and In-Reply-To headers displayed.
The thread indices are a special case, I guess, since we run
out of space on the line if the headers too long and tools like
mutt only show the first one.
Eric Wong [Thu, 24 Oct 2019 00:12:35 +0000 (00:12 +0000)]
search: support multiple From/To/Cc/Subject headers
We can easily support searching on messages with
multiple From/To/Cc/Subject headers just like we
do with multiple Message-ID headers.
This matches the normal mutt pager display behavior.
Eric Wong [Tue, 22 Oct 2019 07:45:38 +0000 (07:45 +0000)]
Merge branch 'regen'
* regen:
v2writable: use msgmap as multi_mid queue
v2writable: move git->cleanup to the correct place
v2writable: reindex handles 3-headered monsters
v2writable: improve "num_for" API and disambiguate
v2writable: set unindexed article number
Eric Wong [Tue, 22 Oct 2019 01:31:53 +0000 (01:31 +0000)]
doc: clean-doc: remove generated standards.txt
I need to remove all the generated documentation files
before running "git-set-file-times" for rsync to our
website.
Eric Wong [Mon, 21 Oct 2019 11:22:29 +0000 (11:22 +0000)]
syscall: get rid of sendfile wrappers for now
I'm not sure they'll make a measurable difference or will
be worth the effort in the future given the prevalance
of HTTPS and giant socket buffers.
Using Inline::C for this may make more sense in the
future, too, especially if we want to be able to use
GnuTLS.
Eric Wong [Mon, 21 Oct 2019 11:22:28 +0000 (11:22 +0000)]
hval: remove new_oneline
commit
476fc666c223f0fb ('reduce "PublicInbox::Hval->new_oneline" use')
was mis-titled, since it completely eliminated ->new_oneline use.
Eric Wong [Mon, 21 Oct 2019 11:22:27 +0000 (11:22 +0000)]
git: remove src_blob_url
This was intended for solver, but it's unused since
commit
915cd090798069a4
("solver: switch patch application to use a callback")
Eric Wong [Mon, 21 Oct 2019 11:22:26 +0000 (11:22 +0000)]
watchmaildir: remove redundant _path_to_mime
InboxWritable::maildir_path_load exists and we may support
it for use with standalone scripts.
Eric Wong [Mon, 21 Oct 2019 11:22:25 +0000 (11:22 +0000)]
inboxwritable: import_maildir uses maildir_path_load
I'm not sure if this will get used anywhere, but at least
call a function which exists in dead code.
Eric Wong [Mon, 21 Oct 2019 11:22:24 +0000 (11:22 +0000)]
www: remove unused ctx_get sub
This hasn't been used since commit
48b21cb662c1e17b7 in 2016:
("declare Inbox object for reusability")
Eric Wong [Mon, 21 Oct 2019 11:22:23 +0000 (11:22 +0000)]
overidx: remove unused delete_articles sub
This hasn't been used since commit
1b7e935ab1690e28
("searchidx: fix incremental index with indexlevel=basic on v1")
Eric Wong [Mon, 21 Oct 2019 22:57:50 +0000 (22:57 +0000)]
v2writable: use msgmap as multi_mid queue
Instead of storing Message-IDs in the Msgmap object, we can
store the blob OID.
For initial indexing of mirrors, this lets us preserve
$sync->{regen} by storing the intended article number in
the queue.
On --reindex, the article number we store in Msgmap is ignored
but only used for ordering purposes.
This also allows us to avoid ENOMEM errors if somebody abuses
our system by reusing Message-IDs; but we now risk ENOSPC
instead (but systems tend to have more FS storage than RAM).
Eric Wong [Mon, 21 Oct 2019 19:19:00 +0000 (19:19 +0000)]
v2writable: move git->cleanup to the correct place
We need to stop the git process to avoid leaking FDs
to Xapian if we recurse ->index_sync on reindex.
Eric Wong [Sun, 20 Oct 2019 22:05:05 +0000 (22:05 +0000)]
v2writable: reindex handles 3-headered monsters
And maybe 8-headered ones, too...
I noticed --reindex failing on the linux-renesas-soc mirror due
one 3-headed monster of a message having 3 sets of headers;
while another normal message had a Message-ID that matched one
of the 3 IDs of the 3-headed monster.
We still try to do the majority of indexing backwards, but we
defer indexing multi-Message-ID'd messages until the end to
ensure we get all the "good" messages in before we process the
multi-headered ones.
Link: https://public-inbox.org/meta/20191016211415.GA6084@dcvr/
Eric Wong [Sun, 20 Oct 2019 07:27:52 +0000 (07:27 +0000)]
v2writable: improve "num_for" API and disambiguate
Make it obvious that we're not the Msgmap sub and return an
array because it's less awkward than providing a modifiable ref
to a function to write to.
Eric Wong [Sun, 20 Oct 2019 07:22:07 +0000 (07:22 +0000)]
v2writable: set unindexed article number
We'll actually use the keys of this hash in future commits.
Eric Wong [Mon, 21 Oct 2019 00:17:19 +0000 (00:17 +0000)]
doc: update 1.2 work-in-progress release notes
Will be updating this further after some reindex and
multi-header bugs are fixed.
Eric Wong [Sun, 20 Oct 2019 00:21:26 +0000 (00:21 +0000)]
TODO: DHT (distributed hash table) for Message-IDs
This would encourage SPOF avoidance. It would also make it
easier to do "Certificate Transparency"-style attestation of
messages.
Eric Wong [Fri, 18 Oct 2019 07:54:25 +0000 (07:54 +0000)]
examples/grok-pull.post_update_hook: fix config detection
We need to account for both the old ("mainrepo") and new
("inboxdir") names. But "dir" was just a search+replace
error and we don't use that outside of "coderepo.dir".
Eric Wong [Tue, 15 Oct 2019 20:18:58 +0000 (20:18 +0000)]
TODO: add a few more items around coderepos
Going where no email client/tool has gone before...
Eric Wong [Tue, 15 Oct 2019 18:34:39 +0000 (18:34 +0000)]
doc: v2-format: get man output under 80 cols
We need to better ensure our manpage output is readable with a
standard terminal width. And fix some wording while we're at
it:
* use "inbox" instead of "list" for our storage
* replace the last "$PART" reference with "$SHARD"
Alyssa Ross [Mon, 7 Oct 2019 20:27:26 +0000 (20:27 +0000)]
public-inbox-v2-format(5): fix formatting
This was being rendered as a paragraph, so line breaks weren't
preserved and it was unreadable in man.
Eric Wong [Thu, 17 Oct 2019 08:19:11 +0000 (08:19 +0000)]
Merge remote-tracking branch 'origin/inboxdir'
* origin/inboxdir:
config: remove redundant inboxdir check
config: support "inboxdir" in addition to "mainrepo"
examples/grok-pull.post_update_hook: use "inbox_dir"
Eric Wong [Thu, 17 Oct 2019 08:10:27 +0000 (08:10 +0000)]
doc: enable "check-man" target via "check" in gmake
man(1) on FreeBSD supports pathnames as operands just
fine, so there's hope other BSDs follow suit and we
can enable this check target everywhere.
Eric Wong [Wed, 16 Oct 2019 11:14:51 +0000 (11:14 +0000)]
doc: avoid [<directory>] arg for git-clone(1)
While it is possible to host source code from the root of a URL
using git-http-backend(1), the lack of pathname in the URL can
also be confusing to users. So just add the path name of the
project into the URL itself so users can invoke "git clone"
with one command-line argument instead of two.
Of course, previously documented URLs continue to work as normal.
Eric Wong [Wed, 16 Oct 2019 11:14:50 +0000 (11:14 +0000)]
doc: update public-inbox-overview(7) for v2
The overview was v1-specific and probably confusing/misleading
to new users since v2 is favored.
Hopefully improve wording while we're at it and avoid
overloading terms like "parts" (which could be confused with
Xapian "shards").
Using the word "directly" after "Mirroring mailing lists"
did not make sense to me, either.
Eric Wong [Wed, 16 Oct 2019 11:14:49 +0000 (11:14 +0000)]
doc: check-man: use COLUMNS env for width
That's the environment documented in ncurses(3) and man(1) from
the man-db.nongnu.org distribution of man.
Eric Wong [Wed, 16 Oct 2019 09:58:08 +0000 (09:58 +0000)]
config: remove redundant inboxdir check
This was causing compatibility problems for old configs
when using public-inbox-nntpd.
Eric Wong [Wed, 16 Oct 2019 08:59:55 +0000 (08:59 +0000)]
config: support "inboxdir" in addition to "mainrepo"
"mainrepo" ws a bad name and artifact from the early days when I
intended for there to be a "spamrepo" (now just the
ENV{PI_EMERGENCY} Maildir). With v2, "mainrepo" can be
especially confusing, since v2 needs at least two git
repositories (epoch + all.git) to function and we shouldn't
confuse users by having them point to a git repository for v2.
Much of our documentation already references "INBOX_DIR" for
command-line arguments, so use "inboxdir" as the
git-config(1)-friendly variant for that.
"mainrepo" remains supported indefinitely for compatibility.
Users may need to revert to old versions, or may be referring
to old documentation and must not be forced to change config
files to account for this change.
So if you're using "mainrepo" today, I do NOT recommend changing
it right away because other bugs can lurk.
Link: https://public-inbox.org/meta/874l0ice8v.fsf@alyssa.is/
Eric Wong [Wed, 16 Oct 2019 08:59:54 +0000 (08:59 +0000)]
examples/grok-pull.post_update_hook: use "inbox_dir"
Move away from using "mainrepo" since it's confusing to
new users, especially with v2.
Eric Wong [Wed, 16 Oct 2019 08:18:23 +0000 (08:18 +0000)]
doc: check-man: ignore backspace char
man(1) on FreeBSD unconditionally emits backspace characters
for the bold effect despite its output being piped to awk(1).
Also tested with the man-db.nongnu.org version provided with
Debian (and presumably most other Linux systems).
Eric Wong [Wed, 16 Oct 2019 00:39:56 +0000 (00:39 +0000)]
mda: support --no-precheck option
Since -mda now supports List-ID to better support mirroring of
existing mailing lists, it probably makes sense to support
disabling the precheck function to provide more accurate (though
potentially spammier) mirrors of lists
Eric Wong [Wed, 16 Oct 2019 00:30:28 +0000 (00:30 +0000)]
Merge branch 'listid'
* listid:
wwwtext: show listid config directive(s)
mda, watch: wire up List-ID header support
config: allow "0" as a valid mainrepo path
config: avoid unnecessary '||' use
config: simplify lookup* methods
config: we always have {-section_order}
Config.pm: Add support for mailing list information
Eric Wong [Mon, 7 Oct 2019 20:52:31 +0000 (20:52 +0000)]
admin: show failing directory
Since public-inbox-index may be run against a large list of
(intended) inboxes from the command-line, it's helpful to show
which directory fails the resolution.