services/status/ and runs at status.allternit.com (D1 database allternit-status). The standby probe runs on allternit-standby and emails alerts from [email protected]. Secrets are in the operator’s Keychain under the account allternit-status. See status labels.
Public view: System status. Contract: services/status/contract/ (status.schema.json, types.ts, fixtures.json, targets.json).
Architecture
- One Cloudflare Worker serves the page, the JSON endpoints, the Atom feed, the admin API and the cron. It runs at
status.allternit.com. - Cron, every minute. Each tick probes the targets assigned to the
cloudflarevantage (at most 30 probes) and writes one D1 batch. At 00:05 UTC the same handler rolls the day up. - Standby vantage. A systemd timer on the
allternit-standbyhost probes the targets assigned to it each minute and posts the results toPOST /api/v1/ingest, signed withX-Allternit-Signature: sha256=<hex>over the raw body (HMAC, shared secretINGEST_HMAC_SECRET; the Worker rejects atsmore than 5 minutes off). The standby also watches the Worker: iflast_checked_atis more than 5 minutes old on 3 runs, it emails the alert address directly through local Postfix, so a dead Worker still alerts. - D1 database
allternit-status. Tables:ticks(per vantage per minute, JSON results, kept 14 days),daily(per component per day, 400 days),component_state,incidents,incident_updates(kept forever).
Targets
services/status/contract/targets.json is the one table of components and checks. The Worker and the standby both read it, and GET /api/v1/targets.json serves it.
To add a target:
- Add a component if needed (
id,name,group,critical; non-critical components may setmax_status: degraded). - Add a target with
component_id,url,expect_status, an optionalbody_marker,role(page,proxy,live,ready),vantagesandtimeout_ms. - Check it validates against
status.schema.jsonand deploy the Worker; the standby picks the table up on its next run.
State rules
- Down: a critical target fails 3 ticks at Cloudflare and in the last 2 standby reports. If the standby report is more than 3 minutes old, the rule is 5 Cloudflare ticks instead.
- Degraded: one vantage fails 3 ticks, a non-critical target fails, a ready check fails while the live check passes, or median latency is over 3 seconds for 5 ticks.
- Recovered: 3 passing ticks from both vantages.
Alerting
Email to the alert address on a change to Down, on recovery, and a reminder every 60 minutes while Down. Alerts are on from the first minute.Incidents
- Automatic incidents use fixed wording and are controlled by the
AUTO_INCIDENTSvariable. It takesoff,on, or an ISO time from which it is on. Production is set to2026-11-13T14:05:00Z, the end of the 24-hour soak, so it turns on by itself with no redeploy; incidents created during the soak stay drafts at/admin. Any manual edit setsauto=falseon that incident; automation then only appends the Resolved update. - Admin API, bearer token:
POST /api/admin/incidentsto open,PATCH /api/admin/incidents/:idto update, resolve or set maintenance. Constant-time token check, rate limit, audit rows. - Script:
services/status/scripts/incident.mjswraps the same API. Run it with no arguments for its usage text. It reads the admin token fromSTATUS_ADMIN_TOKENand the site fromSTATUS_URL(defaulthttps://status.allternit.com), never from a flag. The token is the Worker’sADMIN_TOKENsecret. - The
/adminpage does the same from a browser.
Health endpoint
GET /api/health returns {status, last_checked_at, age_seconds}. status is ok when the last check is 300 seconds old or less, otherwise stale with HTTP 503. Uptime tools can watch it.
Incus host check (cloud computer network)
/api/v1/health/computers reads the database only. It does not see the Incus host, so when dnsmasq for incusbr0 stops (2026-11-10, inotify limit), the page shows it only later, as provisioning failures. The host-side check is in infrastructure/vps-desktop-cloud/apply-nesting.sh:
fs.inotify.max_user_instances is under 8192 or incus network list shows incusbr0 not CREATED. It changes nothing. To run it on a schedule, install it on each Incus host with a systemd timer every 5 minutes, the same way infrastructure/computer-app-update/ installs its timer (ExecStart=/usr/bin/env CHECK_ONLY=1 /usr/local/sbin/allternit-apply-nesting.sh). To show it on the status page as well, the check would have to be served as an HTTP target in targets.json; no host endpoint does that yet. Runbook: Cloud computers: network and sandbox.
Runbooks
The status page says Down
- Open the component’s latest tick in the admin page and see which target and vantage failed.
- Check the target yourself:
curl -ithe target URL and compare with itsexpect_statusandbody_marker. - If only one vantage fails, suspect that vantage (network, the standby host) before the service.
- If the service is really down, follow its own recovery doc (Recovery). Add a manual incident update with what we know.
- If the check is wrong (a changed page title or marker), fix
targets.json.
The Worker itself is down
The standby emails the alert address after 3 stale runs. Then:curl -i https://status.allternit.com/api/health. A 503stalemeans cron stopped; no response means the Worker or route is down.- Check the Worker in the Cloudflare dashboard (Workers, Logs) and the cron trigger.
- Redeploy the last good version with Wrangler. Deploys need approval.
- Until it is back, the standby email and
gizzi status --services(which will report unreachable) are the signals.
Rotating secrets
- Generate a new value.
- Set it on the Worker with
wrangler secret put(INGEST_HMAC_SECRETor the admin token). - For
INGEST_HMAC_SECRET, write the same value to/etc/allternit-status/ingest.keyonallternit-standby(one line, mode 600) in the same sitting; ingest is rejected between the two steps. - Confirm
last_checked_atkeeps moving and the next admin call works.