about summary refs log tree commit homepage
DateCommit message (Collapse)
2022-02-18t/lei-sigpipe: attempt to improve diagnostics for stuck test
This may help diagnose a difficult-to-reproduce test failure on NixOS. Link: https://public-inbox/meta/20211209013743.okzgim7bbrpahks7@sourcephile.fr/
2022-02-17git: do not dereference undef as ARRAY ref
When aborting git processes, we must account for the lack of inflight requests.
2022-02-14sharedkv: avoid ambiguity for numeric-like string keys
While we only store URLs and binary SHA-1/SHA-256 values in skv at the moment, we may store potentially ambiguous keys/values in the future. It's possible to store "02" and have it treated as `2' unless explicitly binding parameters as SQL_BLOB. This behavior was independent of the sqlite_unicode parameter as evidenced by the new tests. I only noticed this bug while hacking on another project using DBD::SQLite, and not while hacking on public-inbox itself.
2022-02-14sharedkv: remove unused subs
Some features didn't get used, and they're just getting in the way of upcoming bugfixes.
2022-02-14t/lei-*watch: disable flaky tests by default for now
Properly fixing these tests is too difficult for me at the moment, so just disable these tests for now. A proper fix and fleshing out support for inotify will hopefully happen at some point.
2022-02-11view: remove all CR before LF
While we've rendered CR-LF as LF-only in HTML for many years, some messages end up as CR-CR-LF. So strip ALL all CR bytes preceding LF bytes, while preserving odd CR in the middle of lines. Reported-by: Thomas Weißschuh <thomas@t-8ch.de> Link: https://public-inbox.org/meta/8d13668f-cac7-4984-bb4e-ad90502dc46d@t-8ch.de/
2022-02-03test_lei: use consistent locale for error messages
git-config(1) error messages are locale-dependent, so follow the lead taken by git's own test suite and set LC_ALL=C and LANG=C to ensure error messages we check against are not localized. Reported-by: Julien Moutinho <julm+public-inbox@sourcephile.fr>
2022-02-01syscall: FS_IOC_*FLAGS: define on per-architecture basis
It turns out these Linux ioctls are unfortunately architecture-dependent, and not endian-dependent. Fixup some warning messages while we're at it, too. Fixes: 14fa0abdcc7b6513 ("rewrite Linux nodatacow use in pure Perl w/o system") Link: https://public-inbox.org/meta/YfdYqLhDVQRQ9NGT@codewreck.org/ Noticed-by: Dominique Martinet <asmadeus@codewreck.org>
2022-02-01syscall: fallback to rename on renameat2 EINVAL
ZFS appears to incorrectly return EINVAL on renameat2 when the operation is not supported: renameat2(AT_FDCWD, "...", AT_FDCWD, "...", RENAME_NOREPLACE) = -1 EINVAL Fall back to the racy rename in this case as well:
2022-01-31rewrite Linux nodatacow use in pure Perl w/o system
btrfs is Linux-only at the moment (and likely to remain that way for practical purposes). So rely on Linux ABI stability and use the `syscall' and `ioctl' perlops rather than relying on Inline::C. Inline::C (and gcc||clang) are monstrous dependencies which we can't expect users to have. This makes supporting new architectures more difficult, but new architectures come along rarely and this reduces the burden for the majority of Linux users on popular architectures (while still avoiding the distribution of pre-built binaries). Link: https://public-inbox.org/meta/YbCPWGaJEkV6eWfo@codewreck.org/
2022-01-31http: don't send chunk finalizer on HEAD responses
AFAIK this doesn't affect Varnish or nginx users, but those should eventually become optional dependencies.
2022-01-23t/eml.t: ignore newer Email::MIME behavior
Once again, our message parser class matches the more tolerant behavior of older Email::MIME releases in order to handle ancient messages. This fixes <https://bugs.debian.org/1002219>, but dropping Email::MIME entirely from the test suite may be prudent in the future.
2021-12-08Makefile.PL: fix useless use of push
2021-11-30eliminate some unused subs
->newsgroup_matches was never used, and ->shard_over_check was dropped in 89193578d21f (extindex: --gc checkpoints, 2021-10-06).
2021-11-22lei: always use 3-arg open perlop
Future-proofing in case future versions of Perl warn on this, since 2-arg forms of open may be subject to injection vulnerabilities with non-literal args.
2021-11-22spawn: avoid C++ keyword `try'
This is future-proofing in case we build against Xapian directly in the future, which would require a C++ compiler.
2021-11-22searchidx: avoid modification of read-only `$_'
This fixes the "Modification of a read-only value attempted at ..." error in an initial run of t/reindex-time-range.t. It was reproducible by running `rm -rf t/data-gen/reindex-time-range.v*' before `make && prove -bvw t/reindex-time-range.t'. Thanks to Jörg Rödel for providing the backtrace which helped find this. Debugged-by: Jörg Rödel <joro@8bytes.org> Link: https://public-inbox.org/meta/YZuZEY+WSnm4wlrS@8bytes.org/
2021-11-22t/lei-mirror: skip lei comparisons if lei missing
We can't compare created_at times with lei if lei tests are skipped due to Inline::C or Socket::MsgHdr unavailability. Reported-by: Jörg Rödel <joro@8bytes.org> Link: https://public-inbox.org/meta/YZebmAxlFJy4lqAw@8bytes.org/
2021-11-15lei forget-search: add help for --prune
This enables tab-completion, since I'm using --prune quite a bit and my fingers are about to fall off :<
2021-11-10t/lei-watch: test with with higher sleep
0.1s may not be enough for a task switch and inotify wakeup, so try doubling it and see if it fixes test reliability, for now. A future change may be to implement a watcher/tracer for inotify -> lei/store events. Link: https://public-inbox.org/meta/20211104134327.zrf5jijfz7dsvb7l@meerkat.local/
2021-11-10lei q: make HTTP(S) query strings even less ugly
Following commit 57fed2e4b78ed394 (lei: normalize whitespace in remote queries, 2021-09-11), leaving the trailing `\n' from stdin queries to be normalized to ` ' (SP) causes it to appear as `+' in URLs, which Xapian ignores.
2021-11-10lei q: disallow "\n" in argv[] elements
I don't expect this to be hit in real-world use via normal interactive shells. However, somebody could accidentally add "\n" in languages (e.g. Perl, C) where it's easy to pass "\n" in argv[].
2021-11-10lei up: infer rawstr from old searches via trailing "\n"
For --stdin searches created prior to commit 666dde69a3f6 (lei q|up: fix saved searches for single-phrase search, 2021-11-08) we still want to be able to run "lei up" on them without regressions. So assume nobody manages to enter "\n" as an argv[] element and consider the presence of "\n" as a previous --stdin use. This fixes errors from "lei up" such as: lei_xsearch 2 wq_worker: Exception: Key too long: length was 840 bytes, maximum length of a key is 255 bytes at ../PublicInbox/IPC.pm line 250. Fixes: 666dde69a3f6 ("lei q|up: fix saved searches for single-phrase search")
2021-11-10ipc: note failing sub name
Hopefully problems can get diagnosed more quickly with the sub name in the error message.
2021-11-10solver: support sha256 coderepos
Tested manually on a newish project I'm working on.
2021-11-09build: do not repeatedly build some docs
Text versions of manpages do not need to be generated for normal installations, they're only used for generating HTML and our amazing, award-winning homepage. We'll also rely on touch(1) instead of Perl utime to benefit users w/o git-set-file-times in txt2pre. Perl numeric values cannot represent nanosecond resolution accurately even with Time::HiRes; which causes nanosecond-aware make(1) implementations to repeatedly rebuild.
2021-11-09lei q|up: fix saved searches for single-phrase search
`"' (double-quote) needs to be quoted for stdin searches. We also need to differentiate between "lei q --stdin" usage when calling "lei up", do it by setting an internal "rawstr" knob to ensure we can parse the config properly regardless of whether the initial search used --stdin or not.
2021-11-09searchidx: index "diff --git a/... b/..." headers
While we do detailed indexing of git diffs, the header itself was failing and queries like 'nq:diff' would not work. Noticed-by: Rob Herring <robh@kernel.org>
2021-11-06MANIFEST: update for non-fatal "make check" message
Oops :x
2021-11-04public-inbox 1.7.0 v1.7.0
2021-11-04doc: relnotes: a few more 1.7.0 related updates
Note "--all" for -extindex, and some minor wording fixes.
2021-11-04AUTHORS: clarify my title
Being an anti-centralization, anti-authority project; the traditional meaning of "Benevolent Dictator" never sat well with me. Benevolence is relative; and I've never been benevolent towards monopolist-types who try to consolidate power and influence. Power corrupts, after all. In any case, I'll never be more than a random idiot serving data which anybody can mirror and fork.
2021-11-04doc: design_notes: updates for "newer" things
public-inbox-imapd, public-inbox-watch, and marketing.txt all exist, now.
2021-11-04lei_curl: use http.proxy knob via URL match for curl
Using the --proxy on the command-line affects the entire lei invocation, and users searching HTTP(S) remotes and writing to an IMAP folder may want more fine-grained proxy use: lei q -o imap://no-proxy.example/foo -O https://need-proxy.example/bar ...
2021-11-04doc: txt2pre: linkify a add a few more well-known things
Maybe these will help folks less familiar with some of these things.
2021-11-04doc: switch to man(1) for pod => (text|html)
pod2text(1) will wrap long .onion URLs and cause resulting HTML to be linkified improperly.
2021-11-04doc: add more 3rd-party refs, use Debian manpages for xapian
curl, torsocks, and gitglossary manpages are all newly referenced, so make sure they're linkified properly in HTML. We'll be using Debian's manpages as an ad-free, Tor-accessible host for manpages as a fallback since hosting manpages for all 3rd-party projects we reference doesn't scale.
2021-11-03doc: relnotes: 1.7.0: move extindex, note search results change
extindex is a far more important feature than libgit2 support (which is actually underperforming and might go away). The search results page is also improved (IMHO), nowadays.
2021-11-03doc: -clone|lei add-external: add bit about the Makefile
It's pretty useful, I think.
2021-11-03doc: extindex: document current behavior + knobs
I'm not really sure if extindex writing to the config file is a good idea (since -index doesn't, as -init exists). Just document what it does and let the user handle it, since the config file shouldn't be daunting to new users.
2021-11-03doc: lei-q: document SEARCH TERMS prefixes
The new Documentation/common.perl file will be used for all manpages in the future.
2021-11-03doc: txt2pre: add references to newish manpages
2021-11-02lei <rediff|rm|tag>: stdin implies `-F eml'
These commands are usually run on a single message, so saving the user the trouble of typing `-F eml' on the command-line seems reasonable. I don't think commands like "index" and "import" will be too useful for single messages, though.
2021-11-02lei: simplify common LeiInput users with ->wq1_start
This method replaces a common pattern of starting workers, preparing internal auth ops, and asynchronous waiting of command completion. It also adds missing LeiAuth support to rediff and rm which rarely need auth.
2021-11-02lei mail-diff: do not default to 'eml'
In retrospect, this doesn't make sense, since it needs at least two messages to diff. So go about "normal" input rules and require users to specify the format.
2021-11-02t/lei-refresh-mail-sync: speed up test on FreeBSD 12
And improve reliability while we're at it. It seems closing a TCP listen socket on FreeBSD 12.2 doesn't cause connect()-ing clients to fail. This happens regardless of whether a socket is IPv4 or IPv6 This non-failure was causing tests to timeout slowly on the client side instead of failing immediately. We now fork a new process which does nothing but accept() + shutdown() to emulate a dead server. Reliability improves on all OSes since there's never a point in time when another process can bind the socket.
2021-11-02init: respect umask when creating description
I noticed a description for a new inbox had st_mode=0600.
2021-11-02mbox_reader: do not blindly pass --rsyncable to gzip
FreeBSD gzip does not support --rsyncable, though my VM usually has pigz installed.
2021-11-01treewide: kill problematic "$h->{k} //= do {" assignments
As stated in the previous change, conditional hash assignments which trigger other hash assignments seem problematic, at times. So replace: $h->{k} //= do { $h->{x} = ...; $val }; $h->{k} // do { $h->{x} = ...; $hk->{k} = $val }; "||=" is affected the same way, and some instances of "||=" are replaced with "//=" or "// do {", now.
2021-11-01idx_stack: avoid conditional hash assignment weirdness
I've been seeing the following error on occasion during "make check-run": $PWD/t/data-gen/reindex-time-range.v1-master index failed: Modification of a read-only value attempted at $DIR/lib/PublicInbox/SearchIdx.pm line 899, <$r> line 1. Perhaps this fixes it. In any case, a construct of: $h->{k} //= do { $h->{x} = ...; $val }; seems wrong and may cause Perl to error out depending on how hashes are randomized.