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

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
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-26 18:18:08 +01:00
1 parent df39b765cb
commit cca4e80e54
39 files changed
+4332 -1408

No files matched your search

+12
View File
@@ -6,6 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
"math"
"net/http"
"time"
@@ -335,6 +336,8 @@ type exportStatusPage struct {
CustomDomain *string `json:"custom_domain"`
Groups []pageGroupView `json:"groups"`
Monitors []exportPageMember `json:"monitors"`
Subscriptions bool `json:"subscriptions"`
Subscribers []subscriberView `json:"subscribers"`
}
type exportPageMember struct {
@@ -529,10 +532,19 @@ func (s *Server) buildOrgExport(ctx context.Context, p *principal) (orgExport, e
MonitorID: m.MonitorID, GroupID: m.GroupID, Section: m.Section, Label: m.Label,
})
}
subs, err := q.ListPageSubscribers(ctx, store.ListPageSubscribersParams{PageID: pg.ID, MaxRows: math.MaxInt32})
if err != nil {
return err
}
subscribers := []subscriberView{}
for _, r := range subs {
subscribers = append(subscribers, subscriberView{r.ID, r.Email, r.Locale, r.CreatedAt, r.ConfirmedAt})
}
x.StatusPages = append(x.StatusPages, exportStatusPage{
ID: pg.ID, Slug: pg.Slug, Title: pg.Title, Description: pg.Description,
Published: pg.Published, ShowComponentDetails: pg.ShowComponentDetails,
CustomDomain: pg.CustomDomain, Groups: exportedGroups, Monitors: members,
Subscriptions: pg.Subscriptions, Subscribers: subscribers,
})
}