about summary refs log tree commit homepage
path: root/examples
DateCommit message (Collapse)
2020-08-26grok-pull.post_update_hook: flock(2) before SQLite check
Unlike DBD::SQLite, the sqlite3(1) CLI does not have a default busy timeout enabled, so it easily times out while acquiring a SHARED lock for read-only queries. We can avoid battery-wasting polling from the SQLite timeout handler by relying on flock(2) as we do in our Perl code. Furthermore, this avoids triggering some locking problems[1] from a long "SELECT COUNT(*) ..." query and reindex. While there may be other SQLite-related parallelism issues[1], this works around one of them by relying on flock(2). [1] https://public-inbox.org/meta/20200825001204.GA840@dcvr/
2020-08-25examples: add imapd systemd examples
We've got examples for all the other daemons, too!
2020-08-14grok-pull.post_update_hook: favor --sequential-shard for HDD
--sequential-shard offers better performance on HDD than -j0 since the on-disk active set can be kept small (with -j $HIGH_NUM). --batch-size can also be helpful for systems with much RAM.
2020-07-29examples/grok-pull.post_update_hook: fix description URL
I finally noticed descriptions weren't showing up in my mirrors :x
2020-07-17doc: add some recommendations around slow HDDs
grok-pull is still painful with serialization on an old USB 2.0 HDD, but at least it can finish with flock(1) and disabling parallelization. While parallel "git fetch" doesn't seem so bad, slow seeks are exacerbated by parallel reads in Xapian. That means some updates can take days instead of hours. The same updates take only seconds or minutes on an SSD.
2020-07-06stop auto-loading Plack::Middleware::Deflater
Instead of gzipping some (mbox.gz, manifest.js.gz) responses and leaving P::M::D to do the rest, we gzip everything ourselves, now, so P::M::D is redundant.
2020-04-06examples/grok-pull.post_update_hook: move url_base to the top
Users are encouraged to edit this script, anyways, so make it easy for them to swap out and use whatever URL they need.
2020-04-06examples/grok-pull.post_update_hook: capture infourl
The value of infourl parameters are shared in the config, so include them in the mirror.
2020-04-06examples/grok-pull.post_update_hook: fetch mirror description
The $INBOX_URL/description endpoint is available since v1.3.0, so use it in mirrors.
2020-03-21examples/*.psgi: add examples for -httpd
public-inbox-httpd should work with any PSGI files, so make it more apparent to people reading .psgi examples.
2020-02-24examples/nginx_proxy: convert CRLF to LF
It was the only file in our tree which had CRLF line endings, so make it consistent with the rest.
2020-02-06treewide: run update-copyrights from gnulib for 2019
I didn't wait until September to do it, this year!
2020-01-12examples/unsubscribe.milter: support unique mailto:
Instead of providing a generic "mailto:foo+unsubscribe@example.com" address in List-Unsubscribe which requires confirmation, replace it with a mailto: header with a unique subject which contains the same unique ID we put in the https:// URL. This makes it easier for some MUAs without https:// support to unsubscribe with a single action via the List-Unsubscribe header.
2020-01-12examples/unsubscribe.milter: skip gmane-mx
Mail to gmane is being delivered to gmane-mx.org, nowadays, and we don't want ordinary readers to be able to trigger unconfirmed unsubscription off any mailing lists which go through our unsubscribe.milter. https://lars.ingebrigtsen.no/2020/01/06/whatever-happened-to-news-gmane-org/
2020-01-03examples: add empty "lib" dir to placate plackup
This is necessary for Filesys::Notify::Simple 0.13 using Linux::Inotify2, since 0.13 started croaking on inotify_add_watch failures.
2019-10-18examples/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".
2019-10-16config: 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/
2019-10-16examples/grok-pull.post_update_hook: use "inbox_dir"
Move away from using "mainrepo" since it's confusing to new users, especially with v2.
2019-10-07examples: add grok-pull post_update_hook example
This requires the latest (to be in 1.2) -init changes for synchronization and has no dependencies on GNU or bash-isms so it should run on *BSD systems without GNU tools. It does attempt to use curl on <$INBOX_URL/_/text/config/raw>, but curl is fairly standard nowadays, and falls back to using an invalid address to initialize.
2019-09-14doc: update nntpd with NNTPS and STARTTLS examples
NNTPS and STARTTLS seems to be working for several months without incident on news.public-inbox.org, so consider it a success and maybe others can try using it. HTTPS technically works, too, but isn't documented at the moment since I can't recommend production deployments without varnish protecting it.
2019-09-09run update-copyrights from gnulib for 2019
2019-06-30examples/*@.service: sockets MUST be NonBlocking
For users running multiple (-nntpd@1, -nntpd@2) instances of either -httpd or -nntpd via systemd to implement zero-downtime restarts; it's possible for a listen socket to become blocking for a moment during an accept syscall and cause a daemons to get stuck in a blocking accept() during PublicInbox::Listener::event_step (event_read in previous versions). Since O_NONBLOCK is a file description flag, systemd clearing O_NONBLOCK momentarily (before PublicInbox::Listener::new re-enables it) creates a window for another instance of our daemon to get stuck in accept(). cf. systemd.service(5)
2019-06-04examples: add sample nginx configuration
The sample configuration can be used to proxy-pass requests to public-inbox-httpd or to a standalone PSGI/Plack server.
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-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-24examples/cgit-commit-filter: remove unused variable
2019-04-04cgit: support running cgit as a standalone CGI
We depend on git-http-backend for smart HTTP clone support, however; since cgit does not support smart clones natively. WWW.pm will be able to cascade down to this as a 404 handler in the future.
2019-02-07examples/newswww.psgi: demonstrate standalone NewsWWW usage
Plack::Builder allows "mounting" on with hostnames as well as path names to enable virtual hosting. This example demonstrates how port 80/443 for "news.example.com" can redirect browser requests when somebody attempts to use a "nntp://" URL and the software assumes "http://"
2019-01-21highlight: initial wrapper and PSGI service
I'll probably expose the PSGI service for cgit; but it could be useful to others as well.
2019-01-20www: admin-configurable CSS via "publicinbox.css"
Maybe we'll default to a dark theme to promote energy savings... See contrib/css/README for details
2018-12-30examples/cgit-commit-filter.lua: escape '&' properly in URL
2018-12-29examples/cgit-commit-filter.lua: update URLs
Let's Encrypt is working out nicely, so we can rely on HTTPS, now. Use 80x24.org instead of bogomips.org while we're at it, since I don't think the latter will remain.
2018-05-30examples: add systemd example for public-inbox-watch
I guess I forgot to include this, but I've been running public-inbox-watch as a systemd service for nearly two years, now.
2018-02-07update copyrights for 2018
Using update-copyrights from gnulib While we're at it, use the SPDX identifier for AGPL-3.0+ to ease mechanical processing.
2016-12-25githttpbackend: simplify compatibility code
Fewer conditionals means theres fewer code paths to test and makes things easier-to-read.
2016-07-08examples: add logrotate sample to show USR1 reopening
Same as nginx :>
2016-07-08examples: minimize differences for systemd examples
Our nntpd and httpd are similar so configuration differences should be minimized
2016-07-03examples/varnish-4.vcl: comments and tweaks
Document and simplify things a bit. The major functional change is we no longer waste space caching objects from dumb HTTP clones.
2016-07-03examples: remove X-Forwarded-For mentions
We don't need to care about client IPs anywhere.
2016-07-01examples: add varnish-4.vcl
Well, I'm fumbling along with this config. Might as well fumble along with it publically :)
2016-07-01examples/README: update URL to point to our HTTPS backend
It's browseable, too!
2016-07-01git: allow cloning from the URL root, too
This means we can still show non-git users a somewhat browseable URL with a link to the README.html file while allowing git users to type less when cloning. All of the following are supported: git clone https://public-inbox.org/ public-inbox git clone https://public-inbox.org/public-inbox git clone https://public-inbox.org/public-inbox.git torsocks git clone http://ou63pmih66umazou.onion/public-inbox
2016-07-01update git repo location to https:// using GitHTTPBackend.pm
Might as well eat our own dogfood...
2016-06-19examples/*@.service: wait one day for graceful shutdown
Because sometimes folks will want to download gigantic mboxes or make large clones over Tor which are not resume-friendly. Note: the timeout logic in nntpd is somewhat over-aggressive and can break some large slrnpulls. This ought to be easily recoverable on the client-side, though, since it's based on per-message fetches.
2016-06-13doc: systemd examples should only kill one process
For our daemons, killing only the master process is enough. Killing the entire control group (as done by default in systemd) may cause subprocesses such as git to shut down unexpectedly. Having systemd kill workers directly will also cause an immediate shutdown since the master would've already signaled the workers; and workers will die after two shutdown requests.
2016-06-13examples: systemd socket and service definitions for daemons
Since our daemons are built to take advantage of socket activation, provide example files to allow systems administrators to hit the ground running with systemd. Example init files for other systems greatly appreciated.
2016-06-07unsubscribe.psgi: disable confirmation
This makes unsubscribing easier and frictionless.
2016-06-07unsubscribe.milter: implement archive blacklist
We don't want people following links from archivers and breaking archival.
2016-06-07Merge branch 'unsubscribe'
* unsubscribe: unsubscribe.milter: use default postfork dispatcher unsubscribe: prevent decrypt from showing random crap examples/unsubscribe-psgi@.service: disable worker processes unsubscribe: bad URL fixup unsubscribe: get off mah lawn^H^H^Hist