herbarium

herbarium is a CGI program that shows the archives kept by pollen as threads, with raw messages and thread mboxes for b4 and git am.

Requirements

Installation

cd herbarium
make clean install

Usage

Run herbarium as a CGI program, for example with nginx and fcgiwrap, as a user that can read the list archives (for example through pollen's group), and serve style.css and icon.svg from share/herbarium. herbarium sets no resource limits itself, so run it through a wrapper:

#!/bin/sh
ulimit -t 10
exec /usr/local/bin/herbarium

nginx:

location = /style.css { alias /usr/local/share/herbarium/style.css; }
location = /icon.svg { alias /usr/local/share/herbarium/icon.svg; }
location / {
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /usr/local/bin/herbarium-cgi;
    fastcgi_param SCRIPT_NAME "";
    fastcgi_param PATH_INFO $uri;
    fastcgi_pass unix:/run/fcgiwrap.sock;
}

To fetch a thread with b4:

git config b4.midmask https://lists.example.org/list/%s
b4 am <message-id>

Pages

Only lists whose name matches ^[a-z0-9][a-z0-9-]*$ and that contain a public file are shown. id is a Message-ID without angle brackets.

path page
/ all public lists, with description, address, threads and age
/list/ threads, most recently active first, perpage per page, older pages with ?ofs=n
/list/id/ the thread started by id; any other message redirects to its thread
/list/id/raw the message as archived, text/plain
/list/id/t.mbox.gz the whole thread as a gzipped mboxrd, as fetched by b4

Each request reads the headers of the newest maxmsgs messages, by file modification time. Messages are threaded by In-Reply-To, then References; of several messages sharing a Message-ID, the oldest is kept, and a missing or implausible Date is replaced by the file time.

Plain text and patch parts are shown, decoded to UTF-8, up to maxbody bytes per message. HTML parts and attachments are only named. Every response carries a Content-Security-Policy that only allows the stylesheet and icon from the same origin.

Configuration

setting default meaning
root /srv/lists directory of lists, as in pollen
domain lists.lostduk.com domain of the list addresses
css /style.css stylesheet URL
icon /icon.svg icon URL
title greenhouse name in the top bar and on the index
service lists which entry of services is this one
services git, lists links in the top bar to the other services
perpage 50 threads per page
maxmsgs 20000 newest messages read per request
maxhdr 64 * 1024 header bytes read per message
maxbody 512 * 1024 body bytes shown per message
maxdepth 8 multipart nesting levels followed

See also