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

+13 -1
View File
@@ -1318,6 +1318,7 @@ func (s *Server) statusPageEditor(c *gin.Context, p *principal, page web.Page, m
pageGroups []store.StatusPageGroup
orgGroups []store.MonitorGroup
monitors []store.Monitor
subs subscribersView
own bool
)
err = s.db.Tx(ctx, p.scope(), func(q *store.Queries) error {
@@ -1337,6 +1338,9 @@ func (s *Server) statusPageEditor(c *gin.Context, p *principal, page web.Page, m
if monitors, err = q.ListMonitors(ctx, p.Org.ID); err != nil {
return err
}
if subs, err = s.pageSubscribers(ctx, q, id); err != nil {
return err
}
own, err = q.OrgServesOwnPages(ctx, &p.Org.ID)
return err
})
@@ -1359,7 +1363,15 @@ func (s *Server) statusPageEditor(c *gin.Context, p *principal, page web.Page, m
e.RecordName, e.RecordValue = v.DomainRecord.Name, v.DomainRecord.Value
}
e.DomainChangesPerDay = domainChangesPerDay
e.MonitorLimit = s.orgLimits(c.Request.Context(), p.Org).MonitorsPerPage
limits := s.orgLimits(c.Request.Context(), p.Org)
e.MonitorLimit = limits.MonitorsPerPage
e.Subscriptions, e.MailAvailable, e.SubscriberLimit = row.Subscriptions, s.smtp != nil, limits.SubscribersPerWeek
e.SubscribersConfirmed, e.SubscribersPending = subs.Confirmed, subs.Pending
for _, sub := range subs.Subscribers {
e.Subscribers = append(e.Subscribers, web.PageSubscriberRow{
ID: sub.ID.String(), Email: sub.Email, Since: sub.CreatedAt.Local().Format("2006-01-02"), Pending: sub.ConfirmedAt == nil,
})
}
if v.CNAMERecord != nil {
e.CNAMEValue = v.CNAMERecord.Value
}