ReportLog
Documentation menu

Scheduled jobs

sudo reportlog jobs                       # the list and schedules
sudo reportlog job sweep                  # run one now
systemctl list-timers 'reportlog-*'       # when each runs next
journalctl -u reportlog-job@backup        # what one said

The schedule lives in apps/api/src/jobs/registry.ts, and the timer files in deploy/systemd/ are generated from it (pnpm --filter @reportlog/api ops timers --write; a test fails if they differ). All times are UTC.

JobWhenWhat
backupdaily 03:00Dump, check, encrypt and send off-site
sweepdaily 03:30Delete expired credentials from named tables
lists-sweepdaily 03:40Erase the personal half of expired list entries; the rows stay (workstream E's sweepLists)
anchordaily 04:00Timestamp the chain heads (DFN) and publish them to the transparency log (workstream D2's runAnchorJob)
filesevery minuteRe-encode and encrypt new files, sweep abandoned uploads, delete what was taken down
anchor-watchdaily 09:00Check from outside the anchor that it ran; fails (and alerts) when the archive has not been anchored
digest-hourlyhourlyEmail hourly subscribers what the board published since their last email
digest-weeklyMondays 07:00The same, for weekly subscribers
journalist-alertsdaily 08:00Email each journalist on the alert list how many new approved reports there are in their states (counts only)
feedback-digestMondays 08:00Email ADMIN_EMAIL every open feedback issue, longest-untouched first

The anchor needs git on the server and the TRANSPARENCY_LOG_* settings in /etc/reportlog/reportlog.env (see .env.example): the checkout under /var/lib/reportlog, and the log's address with a deploy key that has write access. Without a remote it still timestamps, keeps the day on the server and fails the unit. A run that refuses (a logbook gone from the list, or a chain shorter than published) exits 2 and keeps refusing every day: that is what deleting reports looks like, and the doctor puts it first.

anchor-watch exists because the alert below fires only when a job runs and fails. An anchor that never runs (its timer disabled, its unit lost) fails nothing, and the doctor notices only when somebody runs it. So every morning this job asks the doctor's own anchor question from outside the anchor, and fails, which sends the alert, when the newest anchor is over ANCHOR_MAX_AGE_HOURS old, when the last run refused or published nothing, or when the log has nowhere to go. On a day the anchor itself failed you get two emails: the anchor's at about 04:00 and this one at about 09:00.

The two sweeps are different jobs on purpose. The first deletes rows; the second erases columns and must never delete a row. A list table in the first one's list would delete links that are meant to stay.

What the credential sweep deletes, each under the condition its owner's code already treats as dead (SWEPT in apps/api/src/jobs/sweep.ts):

TableDeleted when
otp_codespast expires_at
sessionspast expires_at
site_access_tokenspast expires_at
ownership_transferspast expires_at
organization_invitesstill pending and past expires_at
organization_invite_sendsolder than 14 days
report_submissionsnever confirmed and past expires_at

It never touches contact_keys or report_contacts (deleting a contact key is a reporter's erasure, and the addresses are append-only), and never a list table. A database test fails on any table with an expires_at column that is in neither SWEPT nor NOT_SWEPT.

A job that is not built yet runs, says so and exits successfully; the doctor lists it. A job that fails starts reportlog-alert@, which emails OPS_ALERT_EMAIL the unit's name (never its output, which stays on the server).

Unattended upgrades reboot the machine at 05:30 when an update needs it, after the night's jobs (deploy/apt/52reportlog-unattended-upgrades). Daily jobs that were due while it was off run when it comes back.

See this page's source