Admin setting: default quota for new spaces #800

Closed
opened 2026-09-28 03:57:13 +00:00 by Cordy · 2 comments
Owner

Follow-up to #767 (per-space quota).

Today (after #767a): every newly created app-owned space gets a hard-coded 1 GB quota. Existing spaces are not touched (unlimited until an admin sets one).

This issue: make that default an admin setting.

  • Settings store: spaceDefaultQuota (bytes; 0 = new spaces start unlimited). Seeded to 1 GB so behaviour does not change on upgrade.
  • Admin dashboard: a row in the storage/quota section next to the existing per-user and instance caps (#178 pattern): number + unit (MB/GB/TB) + "No limit".
  • Applied once at creation (POST /api/v1/spaces). Changing the default never rewrites existing spaces' caps; the help text says so.
  • Directory (IdP) spaces: decide whether the default also applies when a directory space is first registered (spaceids.Ensure). Recommendation: no by default, with an opt-in toggle, because a directory space can appear with data already in it and silently capping it would refuse writes the moment it is sighted.
  • Precedent: oCIS/OpenCloud had "Configure default quota for a Space" (owncloud/ocis#2621); Nextcloud Team folders are adding a default quota (nextcloud/groupfolders#5071); Google Workspace sets one "shared drive storage limit" per org unit in the Admin console.

Tests: default applied at creation, 0 = unlimited, change does not touch existing spaces, admin-only.

Follow-up to #767 (per-space quota). **Today (after #767a):** every newly created app-owned space gets a hard-coded **1 GB** quota. Existing spaces are not touched (unlimited until an admin sets one). **This issue:** make that default an admin setting. - Settings store: `spaceDefaultQuota` (bytes; `0` = new spaces start unlimited). Seeded to 1 GB so behaviour does not change on upgrade. - Admin dashboard: a row in the storage/quota section next to the existing per-user and instance caps (#178 pattern): number + unit (MB/GB/TB) + "No limit". - Applied once at creation (`POST /api/v1/spaces`). Changing the default never rewrites existing spaces' caps; the help text says so. - Directory (IdP) spaces: decide whether the default also applies when a directory space is first registered (`spaceids.Ensure`). Recommendation: no by default, with an opt-in toggle, because a directory space can appear with data already in it and silently capping it would refuse writes the moment it is sighted. - Precedent: oCIS/OpenCloud had "Configure default quota for a Space" ([owncloud/ocis#2621](https://github.com/owncloud/ocis/issues/2621)); Nextcloud Team folders are adding a default quota ([nextcloud/groupfolders#5071](https://github.com/nextcloud/groupfolders/pull/5071)); Google Workspace sets one "shared drive storage limit" per org unit in the Admin console. Tests: default applied at creation, `0` = unlimited, change does not touch existing spaces, admin-only.
Author
Owner

Mockup greenlit (2026-09-28): mockup-800-new-space-default.html, rendered in-app on Bao. Decisions:

  1. Placement: Administration › Storage & quotas › Limits, a new row "New spaces start with [1] GB" between Instance allowance and Warn people at. Same style, unit (fractional GB allowed) and Save as the other limits. Unset reads as 1 GB, so nothing changes on upgrade; 0 = new spaces start without a limit.
  2. Directory spaces are included:
    • Spaces created from Cairn get the default whatever their kind (already true since #802).
    • Directory spaces that appear from outside Cairn (group created in the IdP, folder appearing in storage) get it the first time Cairn registers them, unless they already hold more than the default. In that case they stay unlimited and an audit event (space-default-quota-skipped) records it for an admin to decide.
    • Spaces already known are never touched.
  3. Copy fixes:
    • The per-user row reads "Shared spaces have their own limits and never count against a person."
    • The Spaces page › "What a new space inherits" › Quota states the current default with a link to Storage & quotas › Limits.
**Mockup greenlit (2026-09-28):** `mockup-800-new-space-default.html`, rendered in-app on Bao. Decisions: 1. **Placement:** Administration › Storage & quotas › Limits, a new row "New spaces start with [1] GB" between Instance allowance and Warn people at. Same style, unit (fractional GB allowed) and Save as the other limits. Unset reads as 1 GB, so nothing changes on upgrade; 0 = new spaces start without a limit. 2. **Directory spaces are included:** - Spaces created from Cairn get the default whatever their kind (already true since #802). - Directory spaces that appear from outside Cairn (group created in the IdP, folder appearing in storage) get it the first time Cairn registers them, **unless they already hold more than the default**. In that case they stay unlimited and an audit event (`space-default-quota-skipped`) records it for an admin to decide. - Spaces already known are never touched. 3. **Copy fixes:** - The per-user row reads "Shared spaces have their own limits and never count against a person." - The Spaces page › "What a new space inherits" › Quota states the current default with a link to Storage & quotas › Limits.
Cordy closed this issue 2026-09-28 17:29:41 +00:00
Author
Owner

Shipped in v0.6.306 (PR #814, CI green; go test ./... passes, web 303/303), with clean boots on both dogfoods. Verified live on Bao:

  • Boot pass: registering all existing /spaces folders capped nothing. Only the two pre-existing 3 GiB limits exist.
  • Limits tab: "New spaces start with" reads 1 GB while the setting is unset. The per-user description shows the new copy.
  • Spaces › What a new space inherits › Quota: "Starts with a 1 GB limit (Storage & quotas › Limits). …" with the link to #admin/storage/limits.
  • Editing through the real field and save bar:
    • Typed 0.5 → "1 unsaved change" → Save → stored 536870912; the Spaces line followed ("Starts with a 512 MB limit").
    • Set back to 1 → stored 1073741824.
    • Per-user, instance and warn values unchanged both times.
  • The directory first-sighting rule (capped / skipped + audited) is covered by the unit tests. It wasn't exercised live, because that needs a test folder created under /spaces.

Note: the setting is now stored explicitly as 1 GiB rather than unset (same effect).

Shipped in **v0.6.306** (PR #814, CI green; `go test ./...` passes, web 303/303), with clean boots on both dogfoods. Verified live on Bao: - **Boot pass:** registering all existing `/spaces` folders capped nothing. Only the two pre-existing 3 GiB limits exist. - **Limits tab:** "New spaces start with" reads **1** GB while the setting is unset. The per-user description shows the new copy. - **Spaces › What a new space inherits › Quota:** "Starts with a 1 GB limit (Storage & quotas › Limits). …" with the link to `#admin/storage/limits`. - **Editing through the real field and save bar:** - Typed 0.5 → "1 unsaved change" → Save → stored `536870912`; the Spaces line followed ("Starts with a 512 MB limit"). - Set back to 1 → stored `1073741824`. - Per-user, instance and warn values unchanged both times. - The directory first-sighting rule (capped / skipped + audited) is covered by the unit tests. It wasn't exercised live, because that needs a test folder created under `/spaces`. Note: the setting is now stored explicitly as 1 GiB rather than unset (same effect).
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#800
No description provided.