feat(statuspages): email subscriptions, RSS feed and a JSON API #162

Merged
Sebi merged 2 commits from feat/statuspage-subscriptions into main 2026-11-26 19:20:27 +00:00
Owner

Status pages get email subscriptions with double opt-in, an RSS feed and a small read-only JSON API, protected against abuse. The fixed cap of 200 monitors per page is gone.

Email subscriptions

  • Switch per page: "Email subscriptions" in the editor (subscriptions in the API). It is only offered when the platform has a mail server.
  • Double opt-in:
    • The form on the page posts to {page}/subscribe, and the status page server passes it on to POST /agent/v1/subscriptions.
    • The API mails a confirmation link that is valid for 48 h.
    • It answers the same whether the address was subscribed already, so the form does not reveal who is subscribed.
  • Links show a button: Confirmation and unsubscribe links (subscribe/confirm, unsubscribe) only show a button, and acting on them needs a POST. Mail scanners that open links therefore neither confirm nor end subscriptions.
  • Unsubscribe: Every mail carries a link plus List-Unsubscribe and List-Unsubscribe-Post (RFC 8058, one click in the mail program).
  • Tokens: sealed with the keyring (subscriber ID, purpose, expiry). No token table is needed, and a confirmation token is never accepted for unsubscribing.
  • Mails:
    • when an incident opens or resolves, and for every public update (internal notes are not sent),
    • in the subscriber's language (en/de),
    • through an outbox with leasing and retries, like the alert channels.
  • Console: confirmed and pending counts, the list of the newest 1000 subscribers, and removing a subscriber. Removal is audited. Subscribers are part of the org export, and they are deleted with the page or org.

RSS and API

Both are served from the cached snapshot, so they keep working while the API is down:

  • {page}/feed.rss: RSS 2.0 with incidents (including updates) and planned maintenance. The page links it with <link rel="alternate"> and in the footer.
  • {page}/api/v1/status, summary, components, incidents: JSON with CORS *. Answers carry stale: true while the page shows an older state.
  • The editor lists all addresses.

Abuse protection

  • Status page server, per visitor IP:
    • feed and API: 60 per minute,
    • subscription requests: 5 per 10 minutes,
    • link actions: 20 per 10 minutes.
  • API:
    • subscription requests: 5 per hour per IP, 3 per day per mailbox, 100 per hour per page,
    • new limit "new subscribers per week" per org (platform default and override per org in Admin → Organizations; cloud default 1000, self-hosted unlimited).
  • Counting: Unconfirmed subscriptions count towards the weekly limit and are deleted after 7 days, so letting them lapse frees no room.

More than 200 monitors per page

The fixed cap of 200 was in three places: the platform limit, the override and the request validation of PUT /statuspages/:id/monitors. Only the configurable limit "monitors per status page" decides now (0 = unlimited).

Migration 00056

  • status_pages.subscriptions, orgs.limit_subscribers_per_week,
  • tables status_page_subscribers and subscriber_notifications, with RLS.

Tests

  • TestStatusPageSubscriptions (end to end with checker, status page server and SMTP) covers:
    • form, invalid address, double opt-in (the GET does not confirm, a confirmation token does not unsubscribe),
    • no mail for an address that is already confirmed,
    • mails for an outage and a public update, none for an internal note,
    • List-Unsubscribe headers and one-click unsubscribe,
    • RSS and API contents,
    • the weekly limit (429, no mail), pages without subscriptions,
    • per-visitor rate limits for subscriptions and the API.
  • Docs and audit tests cover the new console routes.
  • go test -p 1 ./... green, golangci-lint v2.15.0: 0 issues.
  • Dev stack: migration 56 applied, the subscription form appears on the page, the confirmation mail arrived in a local SMTP sink, and confirmation page and footer were checked in headless Chromium.

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

Status pages get email subscriptions with double opt-in, an RSS feed and a small read-only JSON API, protected against abuse. The fixed cap of 200 monitors per page is gone. ## Email subscriptions - **Switch per page:** "Email subscriptions" in the editor (`subscriptions` in the API). It is only offered when the platform has a mail server. - **Double opt-in:** - The form on the page posts to `{page}/subscribe`, and the status page server passes it on to `POST /agent/v1/subscriptions`. - The API mails a confirmation link that is valid for 48 h. - It answers the same whether the address was subscribed already, so the form does not reveal who is subscribed. - **Links show a button:** Confirmation and unsubscribe links (`subscribe/confirm`, `unsubscribe`) only show a button, and acting on them needs a POST. Mail scanners that open links therefore neither confirm nor end subscriptions. - **Unsubscribe:** Every mail carries a link plus `List-Unsubscribe` and `List-Unsubscribe-Post` (RFC 8058, one click in the mail program). - **Tokens:** sealed with the keyring (subscriber ID, purpose, expiry). No token table is needed, and a confirmation token is never accepted for unsubscribing. - **Mails:** - when an incident opens or resolves, and for every **public** update (internal notes are not sent), - in the subscriber's language (en/de), - through an outbox with leasing and retries, like the alert channels. - **Console:** confirmed and pending counts, the list of the newest 1000 subscribers, and removing a subscriber. Removal is audited. Subscribers are part of the org export, and they are deleted with the page or org. ## RSS and API Both are served from the cached snapshot, so they keep working while the API is down: - `{page}/feed.rss`: RSS 2.0 with incidents (including updates) and planned maintenance. The page links it with `<link rel="alternate">` and in the footer. - `{page}/api/v1/status`, `summary`, `components`, `incidents`: JSON with CORS `*`. Answers carry `stale: true` while the page shows an older state. - The editor lists all addresses. ## Abuse protection - **Status page server, per visitor IP:** - feed and API: 60 per minute, - subscription requests: 5 per 10 minutes, - link actions: 20 per 10 minutes. - **API:** - subscription requests: 5 per hour per IP, 3 per day per mailbox, 100 per hour per page, - **new limit "new subscribers per week"** per org (platform default and override per org in Admin → Organizations; cloud default 1000, self-hosted unlimited). - **Counting:** Unconfirmed subscriptions count towards the weekly limit and are deleted after 7 days, so letting them lapse frees no room. ## More than 200 monitors per page The fixed cap of 200 was in three places: the platform limit, the override and the request validation of `PUT /statuspages/:id/monitors`. Only the configurable limit "monitors per status page" decides now (0 = unlimited). ## Migration 00056 - `status_pages.subscriptions`, `orgs.limit_subscribers_per_week`, - tables `status_page_subscribers` and `subscriber_notifications`, with RLS. ## Tests - `TestStatusPageSubscriptions` (end to end with checker, status page server and SMTP) covers: - form, invalid address, double opt-in (the GET does not confirm, a confirmation token does not unsubscribe), - no mail for an address that is already confirmed, - mails for an outage and a public update, none for an internal note, - `List-Unsubscribe` headers and one-click unsubscribe, - RSS and API contents, - the weekly limit (429, no mail), pages without subscriptions, - per-visitor rate limits for subscriptions and the API. - Docs and audit tests cover the new console routes. - `go test -p 1 ./...` green, golangci-lint v2.15.0: 0 issues. - **Dev stack:** migration 56 applied, the subscription form appears on the page, the confirmation mail arrived in a local SMTP sink, and confirmation page and footer were checked in headless Chromium. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 1 commit 2026-11-26 17:18:50 +00:00
feat(statuspages): email subscriptions, RSS feed and a JSON API
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / test (pull_request) Successful in 9m5s
ci / lint (pull_request) Successful in 10m24s
ci / build (pull_request) Successful in 18m10s
ci / image (pull_request) Successful in 5m16s
cca4e80e54
Visitors can subscribe to a page's incidents by email where the
organization allows it. They confirm their address first; confirmation
and unsubscribe links only show a button, so mail scanners do not act on
them, and mails carry RFC 8058 one-click unsubscribe headers. Subscribers
get a mail when an incident opens or resolves and for every public
update.

Every page also has an RSS feed of incidents and planned maintenance and
a read-only JSON API (status, summary, components, incidents), both
served from the cached snapshot.

Abuse protection: status page servers limit feed and API reads,
subscription requests and link actions per visitor; the API limits
subscription requests per visitor, mailbox and page, and a new limit caps
the subscriptions an organization's pages gain in seven days (platform
default and per-organization override, 1000 in the cloud). Unconfirmed
subscriptions count towards it and are deleted after a week.

The fixed cap of 200 monitors per status page is gone; the configurable
limit alone decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 1 commit 2026-11-26 19:16:42 +00:00
feat(notify): name regions and link the console in alerts; consent to subscribe
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 11m8s
ci / test (pull_request) Successful in 13m45s
ci / build (pull_request) Successful in 19m0s
ci / image (pull_request) In progress
2d4bd10c9b
Alert mails and chat messages named regions by id. They now show the
region's name and mails link the monitor in the console.

Visitors of a status page accept the platform's terms and the page's
privacy policy, where set, before they can subscribe to it; the status
page server and the API both check it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit af992409ef into main 2026-11-26 19:20:26 +00:00
Sebi deleted branch feat/statuspage-subscriptions 2026-11-26 19:20:33 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#162