feat(api): organizations with own status page servers serve their pages alone
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Canceled after 6m3s
ci / test (pull_request) Canceled after 6m2s
ci / build (pull_request) Canceled after 0s
ci / image (pull_request) Canceled after 0s
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Canceled after 6m3s
ci / test (pull_request) Canceled after 6m2s
ci / build (pull_request) Canceled after 0s
ci / image (pull_request) Canceled after 0s
The platform's status page servers handed out every published page, including those of organizations running their own servers. Once one of an organization's own status page servers has connected, the agent API now answers the platform's servers 404 for its pages, so they drop them from their cache, and only the organization's servers serve them. A created but never connected token changes nothing, so moving over does not take the pages offline. The console no longer links such pages to the platform's address, which would not serve them; the editor says who does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
20874a5a87
commit
c0239e15bb
11 files changed
+905
-778
No files matched your search
@@ -318,6 +318,22 @@ func (q *Queries) ListVisibleRegions(ctx context.Context) ([]Region, error) {
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const orgServesOwnPages = `-- name: OrgServesOwnPages :one
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM agents
|
||||
WHERE org_id = $1 AND kind = 'statuspage' AND last_seen_at IS NOT NULL
|
||||
)
|
||||
`
|
||||
|
||||
// An organization serves its status pages itself once one of its own
|
||||
// status page servers has connected.
|
||||
func (q *Queries) OrgServesOwnPages(ctx context.Context, orgID *uuid.UUID) (bool, error) {
|
||||
row := q.db.QueryRow(ctx, orgServesOwnPages, orgID)
|
||||
var exists bool
|
||||
err := row.Scan(&exists)
|
||||
return exists, err
|
||||
}
|
||||
|
||||
const setAgentAllowPrivate = `-- name: SetAgentAllowPrivate :execrows
|
||||
UPDATE agents SET allow_private = $1
|
||||
WHERE id = $2 AND kind = 'checker' AND org_id = $3
|
||||
|
||||
@@ -289,6 +289,9 @@ type Querier interface {
|
||||
OrgIncidentUpdatesExport(ctx context.Context, orgID uuid.UUID) ([]OrgIncidentUpdatesExportRow, error)
|
||||
OrgIncidentsExport(ctx context.Context, orgID uuid.UUID) ([]OrgIncidentsExportRow, error)
|
||||
OrgMembersExport(ctx context.Context, orgID uuid.UUID) ([]OrgMembersExportRow, error)
|
||||
// An organization serves its status pages itself once one of its own
|
||||
// status page servers has connected.
|
||||
OrgServesOwnPages(ctx context.Context, orgID *uuid.UUID) (bool, error)
|
||||
// Organizations user owns, with their member and owner counts.
|
||||
OwnedOrgs(ctx context.Context, userID uuid.UUID) ([]OwnedOrgsRow, error)
|
||||
// The public updates of incidents shown on a status page, newest first.
|
||||
|
||||
@@ -54,3 +54,11 @@ WHERE id = $1 AND (last_seen_at IS NULL OR last_seen_at < now() - interval '30 s
|
||||
-- name: SetAgentAllowPrivate :execrows
|
||||
UPDATE agents SET allow_private = sqlc.arg(allow_private)
|
||||
WHERE id = sqlc.arg(id) AND kind = 'checker' AND org_id = sqlc.arg(org_id);
|
||||
|
||||
-- name: OrgServesOwnPages :one
|
||||
-- An organization serves its status pages itself once one of its own
|
||||
-- status page servers has connected.
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM agents
|
||||
WHERE org_id = $1 AND kind = 'statuspage' AND last_seen_at IS NOT NULL
|
||||
);
|
||||
Reference in new issue
Block a user