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.
| Command | What it does |
|---|---|
sudo reportlog deploy [ref] | deploy a branch, tag or commit |
sudo reportlog rollback [id] | go back to the previous release |
sudo reportlog releases | list releases, marking current and previous |
sudo reportlog doctor | check 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-password | set the site password (asks twice) |
sudo reportlog reset-2fa <email> | clear somebody's second factor (the owner's way back in) |
sudo reportlog jobs | list scheduled jobs and their schedules |
sudo reportlog job <name> | run one scheduled job now |
sudo reportlog updates | is there an update, and what would it change? |
sudo reportlog contact-key rotate | re-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.sh | Installs 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.sh | Installs Bugsink, for error tracking on the same server. Optional. |
/etc/reportlog/reportlog.env | The site's settings. See Settings. |
/etc/reportlog/deploy.env | Where 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:
| Job | When | What it does |
|---|---|---|
backup | Daily, 03:00 UTC | Dump the database, check the dump reads back, encrypt a copy and send it off the server. |
sweep | Daily, 03:30 UTC | Delete expired sign-in codes, sessions and links from the named credential tables. |
lists-sweep | Daily, 03:40 UTC | Erase the personal half of expired list entries and the spent address-hashing secrets. |
contacts-sweep | Daily, 03:50 UTC | From the set date (31 January 2027 unless changed), delete every report contact. |
anchor | Daily, 04:00 UTC | Timestamp the list of every logbook's chain head and publish it to the transparency log. |
anchor-watch | Daily, 09:00 UTC | Check from outside the anchor that it ran: fail, and alert, if the archive has not been anchored. |
files | Every minute | Re-encode and encrypt the files reporters sent, sweep abandoned ones, delete what was taken down. |
digest-hourly | Every hour | Email hourly subscribers the reports published since their last digest. |
digest-weekly | Mondays, 07:00 UTC | Email weekly subscribers the reports published since their last digest. |
feedback-digest | Mondays, 08:00 UTC | Email the administrator every open feedback issue, oldest-untouched first. |
journalist-alerts | Daily, 08:00 UTC | Email 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>.