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

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
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 21:06:45 +01:00
1 parent 90e74d091a
commit e4ce619fbe
26 files changed
+2386 -82

No files matched your search

+9
View File
@@ -58,6 +58,11 @@ X-Empty:
</div>
<button type="submit">save</button>
</form>
<form data-api="/admin/orgs/o1/limits" data-method="put" id="limits">
<input name="monitors" data-number data-nullable value="">
<input name="status_pages" data-number data-nullable value="0">
<input name="regions_per_monitor" data-number value="">
</form>
<pre id="out"></pre>
<script>
const sent = [];
@@ -139,6 +144,10 @@ window.axios = { create: () => ({ interceptors: { request: { use() {} } }, reque
{ monitor_id: "m2", group_id: "g1", label: "" },
],
});
const limits = document.getElementById("limits");
limits.dispatchEvent(new Event("submit", { bubbles: true, cancelable: true }));
await new Promise((r) => setTimeout(r, 20));
check("empty nullable numbers are null, others numbers", sent.at(-1), { monitors: null, status_pages: 0, regions_per_monitor: 0 });
document.getElementById("out").textContent = out.join("\n");
})();
</script></body></html>