ReportLog
Documentation menu

Commands

Every command for running a ReportLog server, read from the command itself.

Everything on a server is done through one command, reportlog, run with sudo. Everything that runs the application's code runs as the reportlog user with the site's settings, never as root.

CommandWhat it does
sudo reportlog deploy [ref]deploy a branch, tag or commit
sudo reportlog rollback [id]go back to the previous release
sudo reportlog releaseslist releases, marking current and previous
sudo reportlog doctorcheck this deployment
sudo reportlog backup [--check]take a backup now (or report on them)
sudo reportlog mail-test <addr>send one real message
sudo reportlog site-passwordset the site password (asks twice)
sudo reportlog reset-2fa <email>clear somebody's second factor (the owner's way back in)
sudo reportlog jobslist scheduled jobs and their schedules
sudo reportlog job <name>run one scheduled job now
sudo reportlog updatesis there an update, and what would it change?
sudo reportlog contact-key rotatere-wrap every address under a new CONTACT_KEY

sudo reportlog help prints the same list on the server.

Installing and the files they use#

deploy/install.shInstalls PostgreSQL, Node at a pinned version (refused unless its checksum matches), Caddy and unattended security updates; makes the reportlog user, the database and the keys; asks for the settings. Safe to run again. See Setting up a server.
deploy/install-bugsink.shInstalls Bugsink, for error tracking on the same server. Optional.
/etc/reportlog/reportlog.envThe site's settings. See Settings.
/etc/reportlog/deploy.envWhere the code comes from (REPO_URL), which branch or tag to follow (DEPLOY_REF), the address for the certificate authority (ACME_EMAIL), and other names sent to the site, such as www. (SITE_ALIASES).
/srv/reportlog/releases/One folder per deploy; current and previous point at two of them.

The full layout is in What is where.

Scheduled jobs#

Each job runs from a systemd timer of its own; sudo reportlog jobs lists them on the server and sudo reportlog job <name> runs one now. This list is read from the job registry in the code:

JobWhenWhat it does
backupDaily, 03:00 UTCDump the database, check the dump reads back, encrypt a copy and send it off the server.
sweepDaily, 03:30 UTCDelete expired sign-in codes, sessions and links from the named credential tables.
lists-sweepDaily, 03:40 UTCErase the personal half of expired list entries and the spent address-hashing secrets.
contacts-sweepDaily, 03:50 UTCFrom the set date (31 January 2027 unless changed), delete every report contact.
anchorDaily, 04:00 UTCTimestamp the list of every logbook's chain head and publish it to the transparency log.
anchor-watchDaily, 09:00 UTCCheck from outside the anchor that it ran: fail, and alert, if the archive has not been anchored.
filesEvery minuteRe-encode and encrypt the files reporters sent, sweep abandoned ones, delete what was taken down.
digest-hourlyEvery hourEmail hourly subscribers the reports published since their last digest.
digest-weeklyMondays, 07:00 UTCEmail weekly subscribers the reports published since their last digest.
feedback-digestMondays, 08:00 UTCEmail the administrator every open feedback issue, oldest-untouched first.
journalist-alertsDaily, 08:00 UTCEmail each journalist on the alert list how many new approved reports there are in their states.

Besides these, the server checks for updates every morning around 06:00 as root, and emails OPS_ALERT_EMAIL once about each new release. When a job fails, OPS_ALERT_EMAIL is emailed its name. What each job writes is in the journal: journalctl -u reportlog-job@<name>.

See this page's source