about summary refs log tree commit homepage
DateCommit message (Collapse)
2019-05-15doc: add marketing guide
Preventative measures; since marketing is almost always annoying to me. And trying to avoid unintended consequences.
2019-05-14tests: get rid of unnecessary Cwd module use
We only need it for tests that chdir, and maybe for ENV{PATH} portability (dash seems fine, not sure about others). v2: revert change to solver_git.t for FreeBSD 11.2 and document
2019-05-14t/nntp.t: skip if Data::Dumper is missing
We can revisit this, later; but Data::Dumper requires a separate package for CentOS-7 users, at least.
2019-05-14t/config.t: remove Data::Dumper dependency
CentOS-7 needs the perl-Data-Dumper package, and the test is small enough to roll our own escaping, here.
2019-05-14tests: remove unnecessary loading of ::DS and Socket
PublicInbox::DS works for every platform we we care about, nowadays; so checking for it is a waste of time. Cleanup a few POSIX and Socket imports while we're in the area.
2019-05-14httpd: get rid of Deflater warning
Deflating responses may be done by the reverse proxy (e.g. varnish or nginx), so the warning for it could be invalid.
2019-05-14searchidx: fix incremental index with indexlevel=basic on v1
We were reindexing the full history every invocation of -index when Xapian was not used because we were incorrectly relying on 'last_commit' metadata stored in Xapian. Rewrite the indexing logic to be less confusing while we're at it, since we rely on `git merge-base --is-ancestor' nowadays. Furthermore, we need to handle message removals from the overview index correctly when Xapian is not in use. Co-authored-by: Eric W. Biederman <ebiederm@xmission.com>
2019-05-14v2writable: allow setting nproc via creat options
Avoiding reliance on environment variables is a bit cleaner for writing tests
2019-05-14v1writable: new wrapper which is closer to v2writable
Import initialization is a little strange from history, but we also can't change it too much because it's technically a public API which external code may rely on... And we may need to support v1 repos indefinitely. This should make it easier to write tests for both formats.
2019-05-09ci: include some scripts to make CI easier
This should make it easier to test a bunch of package installation profiles across whatever OS isolation one chooses (chroots, containers, jails, VMs).
2019-05-08doc/include.mk: remove git use and redundant declarations
And document that we still have GNU-isms in that include.mk Makefile (and may continue to do so). Finally, take advantage of GNU-isms to warn users to run "gmake" to build all manpages.
2019-05-08Makefile.PL: improve make(1) portability
The `shell' function appears missing, so we'll rely on Bourne shell expansioN, instead. Use "$?" instead of "$<" since the latter is only specified for inference and .DEFAULT rules, not target rules. Tested on FreeBSD make(1) and bmake(1) on Debian.
2019-05-08doc: give txt files proper titles
We can fix the redundant rule in include.mk which causes make(1) on FreeBSD to complain; but HTML docs will likely still require GNU make.
2019-05-08doc: use bullet list for wwwlisting options
Otherwise, pod2man complains about "=item 404" not starting with a letter and thinking it's part of a numbered list.
2019-05-08t/purge.t: fix unreferenced variable
2019-05-08INSTALL: note xapian-compact(1) tool
The Perl Xapian bindings do not support compacting, yet, so we rely on the xapian-compact tool.
2019-05-08INSTALL: depend on Encode instead of Encode::MIME::Header
Email::MIME uses Encode::MIME::Header and depends on that appropriately; however we depend on other parts of the Encode distribution, but that's bundled with Perl by upstream, anyways; and should place no additional burden on users.
2019-05-08INSTALL: update with FreeBSD pkg names and reorder
Fortunately, there is a pattern to most of these package names in all distros I've tested (and hopefully other BSDs have them, too). Then, reorder the INSTALL document to mention the top-level modules, first, so users can avoid needing to type extra dependencies. However, we still list some implicit dependencies in case the upstream package drops dependencies independently of us. Finally, Devel::Peek is not a dependency worth making optional since it's bundled by Perl upstream. Fedora/RH-based distros are the only one which turn it into a non-standard package when Perl5 is installed.
2019-05-08Merge remote-tracking branch 'origin/danga-bundle'
* origin/danga-bundle: DS: epoll: fix misordered EPOLL_CTL_DEL call DS: drop unused "_undef" sub syscall: drop readahead wrapper build: do not manify DS and Syscall pods DS: handle EINTR in IO::Poll path, too DS: workaround IO::Kqueue EINTR (mis-)handling DS: drop profiling support DS: remove unused fields and functions listener: use EPOLLEXCLUSIVE for listen sockets bundle Danga::Socket and Sys::Syscall
2019-05-08DS: epoll: fix misordered EPOLL_CTL_DEL call
Any operations on an fd after POSIX::close() are invalid, so epoll_ctl will fail. Worse off, in a multi-threaded Perl, the fd may be reused by another thread and EPOLL_CTL_DEL can hit the wrong file description as a result. cf. https://rt.cpan.org/Ticket/Display.html?id=129487
2019-05-08DS: drop unused "_undef" sub
No longer used since we removed the *_ip_string fields
2019-05-08syscall: drop readahead wrapper
No backwards compatibility to worry about for us; and fadvise is superior anyways.
2019-05-08build: do not manify DS and Syscall pods
We don't need to increase our install footprint with documentation from our internals (which will surely change).
2019-05-08DS: handle EINTR in IO::Poll path, too
IO::Poll::_poll returns -1, which is "true" to Perl. cf. https://rt.cpan.org/Ticket/Display.html?id=129484
2019-05-08nntp: avoid uninitialized variable from blank requests
We'll ignore blank lines from clients, since that's what innd seems to do.
2019-05-07wwwstream: do not load URI.pm
It's unneeded since commit e358bd7a3833f8c5 (2016-07-02) ("inbox: base_url method takes PSGI env hashref instead") So we only depend on URI::Escape from the "URI" CPAN distribution, at the moment.
2019-05-07spawn (Inline::C): fix off-by-one error
Noticed while testing on FreeBSD 11.2 amd64 with the optional Inline::C extension using clang 6.0.0. The end result on FreeBSD was spawning processes failed badly and things were immediately unusable with this enabled. av_len is a misleading API, and I failed to read the API comments in perl:/av.c which state: > Note that, unlike what the name implies, it returns > the highest index in the array, so to get the size of > the array you need to use "av_len(av) + 1". > This is unlike "sv_len", which returns what you would expect. If this bug affected anybody, it would've only affected users using both the optional Inline::C module AND set the PERL_INLINE_DIRECTORY environment variable. That said, I've never seen any evidence of it on Debian GNU/Linux + gcc on any x86 variant. That includes full 64-bit systems, a full 32-bit system, a 64-bit system with 32-bit userspace, across multiple gcc versions since 2016.
2019-05-06index: warn with info about the message as context
This can help users track down the source of warnings when presented with imperfect emails. While we're at it, make the __WARN__ callback in t/v2writable.t a no-op since we don't check for warnings, there.
2019-05-05Merge remote-tracking branch 'origin/wwwlisting'
* origin/wwwlisting: www: support listing of inboxes start depending on Perl 5.10.1+
2019-05-05DS: workaround IO::Kqueue EINTR (mis-)handling
IO::Kqueue seems unmaintained, so workaround a long-standing bug where it falls over on signals: https://rt.cpan.org/Ticket/Display.html?id=116615
2019-05-05t/search.t: fix permissions check on FreeBSD
FreeBSD does not allow non-root users to set S_ISGID; so git skips this bit on FreeBSD and Debian/kFreeBSD platforms.
2019-05-05DS: drop profiling support
There's other ways to profile and we don't need to add runtime branches to do this.
2019-05-05DS: remove unused fields and functions
More will likely be dropped in the future, but drop the obvious ones we aren't using, for now; especially since some of them are set at ->new time and unavoidable. This saves 579 bytes per-client on my 64-bit Debian stable system as measured by Devel::Size::total_size from PublicInbox::HTTP::event_read. This adds up in C10K or C100K situations. Things we drop are: * corked - MSG_MORE requires fewer syscalls * read_push_back - tried to use it, ate CPU with slow clients * IP/port fields - accept() already returns what we care about
2019-05-05listener: use EPOLLEXCLUSIVE for listen sockets
Since our listen sockets are non-blocking and we may run multiple httpd|nntpd processes; we need a way to avoid thundering herds when there are multiple httpd|nntpd worker processes. EPOLLEXCLUSIVE was added just for that in Linux 4.5
2019-05-04bundle Danga::Socket and Sys::Syscall
These modules are unmaintained upstream at the moment, but I'll be able to help with the intended maintainer once/if CPAN ownership is transferred. OTOH, we've been waiting for that transfer for several years, now... Changes I intend to make: * EPOLLEXCLUSIVE for Linux * remove unused fields wasting memory * kqueue bugfixes e.g. https://rt.cpan.org/Ticket/Display.html?id=116615 * accept4 support And some lower priority experiments: * switch to EV_ONESHOT / EPOLLONESHOT (incompatible changes) * nginx-style buffering to tmpfile instead of string array * sendfile off tmpfile buffers * io_uring maybe?
2019-05-04wwwstream: drop tor2web URL
It was a MITM hazard and been killed off by the DoS subsystem last July: https://marc.info/?i=87d0vwwkbs.fsf@riseup.net
2019-04-29doc/standards: add a link to PSGI specs
2019-04-27extmsg: escape ampersands in @EXT_URL array
We already escape the user-provided Message-IDs (so there's no security problem AFAIK), but the URL templates which exist in our source code were not escaped properly. This quiets down tidy(1).
2019-04-26viewdiff: do not break out of DSTATE_CTX on /^$/
It seems a common case for mangled patches is editors or MUAs dropping trailing whitespace, and lines matching /^ $/ gets the space dropped to only match /^$/.
2019-04-25cgit: improve handling of cgit data path
Document `publicinbox.cgitdata' config directive, but allow it to be unspecified and/or missing for installations which do not wish to serve static data at all. For users installing cgit from source to their home directory, we can usually infer the cgit data path based on the cgit.cgi binary path, even.
2019-04-25examples/cgit-commit-filter.lua: some doc updates
It's been a while since I wrote this, and it needs to be kept up-to-date with some advances in our Perl code.
2019-04-25examples: cgit filter for use with WwwHighlight
I'm using this as the cgit about-filter and source-filter in https://80x24.org/public-inbox.git
2019-04-24wwwhighlight: deal with no-op highlight
Not all inputs are highlight-able, so reuse the original input and just linkify it if it can't be highlighted.
2019-04-24examples/cgit-commit-filter: remove unused variable
2019-04-24wwwhighlight: do linkification, too
Otherwise, there's no reason to use this API over highlight(1). Maybe this can be an option in the future; but I'm struggling to find a reason to not do it by default.
2019-04-23view: avoid "1+ messages" in per-message footer of /t/ and /T/
Try to appear gramatically correct and state: "only message in thread" when there's only one known (to us) message in the thread.
2019-04-23doc: add standards reference
Incomplete at the moment, but this ought to be a handy reference for both implementers and users alike.
2019-04-19www: support listing of inboxes
We will still return a 404 by default to '/' for compatibility with users of Plack::App::Cascade or similar. Inboxes are sorted by modification times to help users detect activity (similar to the /$INBOX/ topic view). New configuration options: * publicinbox.wwwlisting - configure the listing type * publicinbox.<name>.hide - hide a particular inbox from the listing See changes to public-inbox-config.pod for full descriptions of the new options. Requested-by: Leah Neukirchen <leah@vuxu.org> https://public-inbox.org/meta/871sdfzy80.fsf@gmail.com/
2019-04-19start depending on Perl 5.10.1+
I mainly want to start using the '//' (defined-or) operator to simplify code, and Perl 5.10.1 is roughly a decade old at this point. "given/when" would've be nice, but it's future is in doubt AFAIK. I also started using the 'parent' module in WwwHighlight, and 'autodie' in UserContent.pm, both of which were only distributed with Perl since 5.10.1; and testing with ancient versions/distros is time-consuming. Anyways, I think this a small-enough jump to not break any existing installations, given we already depend on fairly recent versions of git and Xapian. Maybe we can use more newish Perl features in the future...
2019-04-19t/hl_mod: workaround w3m not handling &apos;
This fixes a test failure on my Debian buster system. Bug report filed for w3m to handle "&apos;": https://bugs.debian.org/927409 and for "highlight" to favor "&#39;" in case other browsers fail: https://bugs.debian.org/927410