feat: admins suspend or delete status pages, organizations and accounts #110

Merged
Sebi merged 1 commits from feat/admin-moderation into main 2026-11-22 19:54:59 +00:00
Owner

Admin panel → Public status pages: every published page, plus every suspended page/organization/account, with organization and owner; search by title, slug/domain, organization or owner email (newest 500). Per row: suspend (with optional reason, shown to the organization), reinstate, delete — for the page, its organization and its owner account.

Suspended means
Status page not served (FindPublishedPage); status page servers drop it on their next fetch (≤ 30 s); the org sees it marked with the reason
Organization monitors leave the schedule and job/result queries; pages offline; heartbeat pings answered "OK (paused)" but not recorded; Alertmanager webhooks refused; members and API tokens get 403 org_suspended; console banner with reason. Reinstating restarts heartbeat waits.
Account all sessions ended; sign-in → 403 account_suspended (only after the correct password; wrong passwords stay 401), also via TOTP and SSO; the account's API tokens stop working. Reuses users.disabled_at, which sign-in already honored but nothing set.

Deleting uses the existing erasure: purgeOrg for organizations, and eraseAccount (extracted from the GDPR self-deletion) for accounts — refused with 409 owns_shared_orgs while the account owns organizations with other members. Platform admins cannot be suspended or deleted (409 target_is_admin); their rows show no actions.

All routes audited (platform.* actions with reason and target) and documented. Migration 00042.

Tests: full flow against the API: listing/search, admin-only; page suspension → not served → reinstated; org suspension → members/tokens 403, page not served, ping not recorded, monitor not scheduled, console banner → reinstated; account suspension → session ended, token refused, sign-in 403 only with correct password → reinstated; admins protected; shared-org refusal; deletion of page, org and account.

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

**Admin panel → Public status pages:** every published page, plus every suspended page/organization/account, with organization and owner; search by title, slug/domain, organization or owner email (newest 500). Per row: suspend (with optional reason, shown to the organization), reinstate, delete — for the page, its organization and its owner account. | | Suspended means | | --- | --- | | Status page | not served (`FindPublishedPage`); status page servers drop it on their next fetch (≤ 30 s); the org sees it marked with the reason | | Organization | monitors leave the schedule and job/result queries; pages offline; heartbeat pings answered "OK (paused)" but not recorded; Alertmanager webhooks refused; members and API tokens get `403 org_suspended`; console banner with reason. Reinstating restarts heartbeat waits. | | Account | all sessions ended; sign-in → `403 account_suspended` (only after the correct password; wrong passwords stay 401), also via TOTP and SSO; the account's API tokens stop working. Reuses `users.disabled_at`, which sign-in already honored but nothing set. | **Deleting** uses the existing erasure: `purgeOrg` for organizations, and `eraseAccount` (extracted from the GDPR self-deletion) for accounts — refused with `409 owns_shared_orgs` while the account owns organizations with other members. Platform admins cannot be suspended or deleted (`409 target_is_admin`); their rows show no actions. All routes audited (`platform.*` actions with reason and target) and documented. Migration `00042`. **Tests:** full flow against the API: listing/search, admin-only; page suspension → not served → reinstated; org suspension → members/tokens 403, page not served, ping not recorded, monitor not scheduled, console banner → reinstated; account suspension → session ended, token refused, sign-in 403 only with correct password → reinstated; admins protected; shared-org refusal; deletion of page, org and account. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 1 commit 2026-11-22 19:47:14 +00:00
feat: admins suspend or delete status pages, organizations and accounts
ci / image (pull_request) Successful in 3m20s
ci / build (pull_request) Successful in 8m34s
ci / test (pull_request) Successful in 11m41s
ci / lint (pull_request) Successful in 13m0s
90e74d091a
The admin panel lists every published status page, and every suspended
page, organization or account, with the organization and owner behind
it, searchable by title, address, organization or email. Each can be
suspended with a reason, reinstated, or deleted.

A suspended page is not served; status page servers drop it when they
next ask. A suspended organization's monitors leave the schedule, its
pages go offline, heartbeat pings and Alertmanager webhooks are no
longer recorded, and its members and API tokens get 403 org_suspended;
the console explains why. Reinstating restarts heartbeat waits so they
do not fire at once. A suspended account is signed out everywhere and
can neither sign in nor use its tokens; only someone who knows the
password learns of the suspension. Platform admins cannot be suspended
or deleted. Account deletion shares its logic with the GDPR erasure,
including the refusal while the account owns shared organizations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit c8c8727a78 into main 2026-11-22 19:54:59 +00:00
Sebi deleted branch feat/admin-moderation 2026-11-22 19:55:02 +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#110