feat: per-organization limits set by platform admins #115

Merged
Sebi merged 1 commits from feat/org-limits into main 2026-11-22 20:45:08 +00:00
Owner

Admin panel

  • Default limits: monitors per organization (all types, heartbeat/Alertmanager included), status pages, regions per monitor, whether own checker regions count, organizations per account. 0 = unlimited.
  • Organizations: searchable list (name, slug, owner email) with owner, usage vs. limit, per-organization overrides (empty = default, shown as placeholder), the owner's organizations-per-account override, and suspend/delete for organization and owner (from #110).

Semantics

  • Defaults are not copied at creation: changing one applies immediately to every organization/account without an override (versioned cache across replicas).
  • Self-hosted defaults are unlimited; cloud allows 3 organizations per account by default (enforced by #113, which adds creating organizations).
  • Lowering a limit keeps everything: existing monitors and pages keep running; monitors already beyond the region limit stay editable but cannot gain regions. New creations get 422 monitor_limit / status_page_limit / region_limit / platform_region_limit with the limit in the message.
  • Creations count under a per-organization advisory lock, so concurrent requests cannot overshoot (tested with 5 parallel creations under a limit of 1).
  • Organizations see their usage in Settings → Organization and via GET /api/v1/org/limits.

API: GET/PUT /api/v1/admin/limits, GET /api/v1/admin/orgs, PUT /api/v1/admin/orgs/:id/limits, PUT /api/v1/admin/users/:id/limits (audited, documented). Migration 00043. Forms: data-number data-nullable sends null when empty (browser test).

Refs #111

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

**Admin panel** - *Default limits:* monitors per organization (all types, heartbeat/Alertmanager included), status pages, regions per monitor, whether own checker regions count, organizations per account. 0 = unlimited. - *Organizations:* searchable list (name, slug, owner email) with owner, usage vs. limit, per-organization overrides (empty = default, shown as placeholder), the owner's organizations-per-account override, and suspend/delete for organization and owner (from #110). **Semantics** - Defaults are not copied at creation: changing one applies immediately to every organization/account without an override (versioned cache across replicas). - Self-hosted defaults are unlimited; cloud allows 3 organizations per account by default (enforced by #113, which adds creating organizations). - Lowering a limit keeps everything: existing monitors and pages keep running; monitors already beyond the region limit stay editable but cannot gain regions. New creations get `422 monitor_limit` / `status_page_limit` / `region_limit` / `platform_region_limit` with the limit in the message. - Creations count under a per-organization advisory lock, so concurrent requests cannot overshoot (tested with 5 parallel creations under a limit of 1). - Organizations see their usage in *Settings → Organization* and via `GET /api/v1/org/limits`. **API:** `GET/PUT /api/v1/admin/limits`, `GET /api/v1/admin/orgs`, `PUT /api/v1/admin/orgs/:id/limits`, `PUT /api/v1/admin/users/:id/limits` (audited, documented). Migration `00043`. Forms: `data-number data-nullable` sends null when empty (browser test). Refs #111 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added this to the M12 Self-service signup & limits milestone 2026-11-22 20:07:12 +00:00
Sebi added 1 commit 2026-11-22 20:07:13 +00:00
feat: per-organization limits set by platform admins
ci / image (pull_request) Successful in 4m25s
ci / build (pull_request) Successful in 8m15s
ci / test (pull_request) Successful in 8m51s
ci / lint (pull_request) Successful in 12m8s
e4ce619fbe
Admins set default limits for monitors (all types), status pages and
regions per monitor, whether an organization's own checker regions count
towards the region limit, and how many organizations an account may own,
and override them per organization or account. Defaults are not copied:
changing one applies at once to everyone without an override. 0 means
unlimited; self-hosted defaults are unlimited, the cloud allows three
organizations per account.

Creations count under a per-organization advisory lock, so concurrent
requests cannot overshoot. A lowered limit keeps everything that exists:
monitors already beyond the region limit stay editable but may not grow.
Organizations see their usage in their settings and GET /org/limits;
the admin panel lists organizations with owner, usage and limits next
to their suspend and delete actions. Empty numeric form fields marked
data-nullable are sent as null.

Refs #111

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit a71fd6f5e1 into main 2026-11-22 20:45:08 +00:00
Sebi deleted branch feat/org-limits 2026-11-22 20:45:10 +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#115