Personal-folder quota per person and per group #1106

Closed
opened 2026-11-04 03:11:26 +00:00 by Cordy · 5 comments
Owner

Gap (v0.7 feature-gap research, 2026-11-04, decided by Nikola). What Cairn has at 0e0885db (VERIFIED):

  • One per-user cap that applies to every personal folder (internal/settings/settings.go:121-123 QuotaPerUserBytes; Administration › Storage & quotas › Limits, docs/handbook/admin-policy.md "Storage quotas").
  • An instance allowance.
  • Per-space limits, set one by one or in bulk, with a default for new spaces (internal/api/spacequota.go, docs/handbook/spaces-quota.md).

What is missing: a different cap for one person (for example 50 GB for Anna while everyone else has 5 GB), and a default per group or role for personal folders (staff 10 GB, students 2 GB). Group spaces already have their own limits, which covers part of Seafile's department quota.

Competitors. Nextcloud and ownCloud 10 set a quota per user with a default; Seafile has per-user and per-department quotas; OpenCloud sets the personal space quota per user and a default per role.

To research and decide when worked on. Precedence (person override, then group default, then the instance default); several groups with different defaults; directory groups changing; what happens when a lower cap is applied to a fuller folder; admin UI in Users & access; audit verbs; the account page wording; multi-instance (#742).

Refs: scratch/b7e/backlog/gap-v07/research-v07-gaps.md A7 and the quota note under Decisions.

**Gap (v0.7 feature-gap research, 2026-11-04, decided by Nikola).** What Cairn has at 0e0885db (VERIFIED): - One per-user cap that applies to every personal folder (`internal/settings/settings.go:121-123` `QuotaPerUserBytes`; Administration › Storage & quotas › Limits, `docs/handbook/admin-policy.md` "Storage quotas"). - An instance allowance. - Per-space limits, set one by one or in bulk, with a default for new spaces (`internal/api/spacequota.go`, `docs/handbook/spaces-quota.md`). What is missing: a different cap for one person (for example 50 GB for Anna while everyone else has 5 GB), and a default per group or role for personal folders (staff 10 GB, students 2 GB). Group *spaces* already have their own limits, which covers part of Seafile's department quota. **Competitors.** Nextcloud and ownCloud 10 set a quota per user with a default; Seafile has per-user and per-department quotas; OpenCloud sets the personal space quota per user and a default per role. **To research and decide when worked on.** Precedence (person override, then group default, then the instance default); several groups with different defaults; directory groups changing; what happens when a lower cap is applied to a fuller folder; admin UI in Users & access; audit verbs; the account page wording; multi-instance (#742). Refs: `scratch/b7e/backlog/gap-v07/research-v07-gaps.md` A7 and the quota note under Decisions.
Author
Owner

Research done (2026-11-07, at 78c814d7; scratch/b7e/backlog/research-1106.md).

Recommended first version: precedence person's own limit (a size or No limit), then the highest limit among the person's groups (No limit highest), then the personal-folder default, then the config value. Enforcement already has one place (prefixCap, quota.go:76-85) that uploads, TUS reservations, WebDAV free-space properties (RFC 4331) and 507 answers follow from; it gains a per-username lookup. Storage: personal-quota.json like spacequota.json (saved per entry, re-read every 10 s), group limits keyed by #1002 group references, a person's limit stamped with their account start (#1054). Cairn remembers each person's limit-relevant directory groups from their last sign-in, because writes can arrive with no session (shares, drop links, peering). Lowering a limit below usage deletes nothing: growth gets 507, deletes still work. UI: Storage & quotas › Limits (default and group limits) and Users & access › Accounts (Storage column, "Storage limit…").

Bug found: the existing default and instance limits are read from the in-memory settings copy (main.go:2475-2478), not re-read every 10 s, so a second instance misses changes; fix in the same change. Decisions for Nikola follow.

**Research done** (2026-11-07, at 78c814d7; `scratch/b7e/backlog/research-1106.md`). Recommended first version: precedence person's own limit (a size or No limit), then the highest limit among the person's groups (No limit highest), then the personal-folder default, then the config value. Enforcement already has one place (`prefixCap`, `quota.go:76-85`) that uploads, TUS reservations, WebDAV free-space properties (RFC 4331) and 507 answers follow from; it gains a per-username lookup. Storage: `personal-quota.json` like `spacequota.json` (saved per entry, re-read every 10 s), group limits keyed by #1002 group references, a person's limit stamped with their account start (#1054). Cairn remembers each person's limit-relevant directory groups from their last sign-in, because writes can arrive with no session (shares, drop links, peering). Lowering a limit below usage deletes nothing: growth gets 507, deletes still work. UI: Storage & quotas › Limits (default and group limits) and Users & access › Accounts (Storage column, "Storage limit…"). Bug found: the existing default and instance limits are read from the in-memory settings copy (`main.go:2475-2478`), not re-read every 10 s, so a second instance misses changes; fix in the same change. Decisions for Nikola follow.
Author
Owner

Decisions (Nikola, 2026-11-07). Scope: personal folders only; group spaces keep their own separate quota, unchanged.

  • A personal-folder size can be set per person and by directory group (e.g. students 2 GB, staff 10 GB); the group only chooses whose personal folder gets which size, there is no shared pool.
  • Order: a size set for the person wins, then the group size, then the default for all personal folders; a group size may be below the default.
  • In several groups: the larger size wins ("No limit" largest).
  • Groups for writes with no session (drop link, share, federated delivery): from the person's last sign-in.
  • Lowering below usage: nothing deleted, growth refused (507), deletes and non-growing edits still work; dialogs warn first; no grace period in v1.
  • UI: Storage & quotas › Limits (default + sizes by group), Users & access › Accounts (Storage column, "Storage limit…"); no multi-select editing in v1; Deleted files keep not counting (documented, revisited after launch); the account page says where the size comes from; fix: the default size refreshed every 10 s on every instance.
**Decisions (Nikola, 2026-11-07).** Scope: personal folders only; group spaces keep their own separate quota, unchanged. - A personal-folder size can be set per person and by directory group (e.g. students 2 GB, staff 10 GB); the group only chooses whose personal folder gets which size, there is no shared pool. - Order: a size set for the person wins, then the group size, then the default for all personal folders; a group size may be below the default. - In several groups: the larger size wins ("No limit" largest). - Groups for writes with no session (drop link, share, federated delivery): from the person's last sign-in. - Lowering below usage: nothing deleted, growth refused (507), deletes and non-growing edits still work; dialogs warn first; no grace period in v1. - UI: Storage & quotas › Limits (default + sizes by group), Users & access › Accounts (Storage column, "Storage limit…"); no multi-select editing in v1; Deleted files keep not counting (documented, revisited after launch); the account page says where the size comes from; fix: the default size refreshed every 10 s on every instance.
Author
Owner

Mockup approved (Nikola, 2026-11-07): 1106-personal-quota-mockup.html, frames F1-F6 + dark sample; groups shown by name and source ("Directory group · Keycloak"), no folder-like paths. Open points as recommended: "size" for what an admin sets, "limit" where the product already says it; over-size banner in Personal, Recents and Favourites only; directory groups only in v1; lowering the default asks first with the count of people over; "People with this size" counts only people whose size comes from that group; the row whose menu is open is highlighted in admin tables.

**Mockup approved** (Nikola, 2026-11-07): `1106-personal-quota-mockup.html`, frames F1-F6 + dark sample; groups shown by name and source ("Directory group · Keycloak"), no folder-like paths. Open points as recommended: "size" for what an admin sets, "limit" where the product already says it; over-size banner in Personal, Recents and Favourites only; directory groups only in v1; lowering the default asks first with the count of people over; "People with this size" counts only people whose size comes from that group; the row whose menu is open is highlighted in admin tables.
Author
Owner

Spec decisions (Nikola, 2026-11-07; research research-b3v07-unsettled.md): Cairn remembers each person's directory groups from their last sign-in (only groups Cairn references), shown in the person's data export and the data-protection table, and deleted with the account; nothing is remembered before the update (counts from each person's next request); the lower-default confirm appears only when someone would be over; the size preview does not create a group reference; admin route /api/v1/admin/quota/people/{name}. Strings approved with fixes (FR "Mo", IT "archiviazione"). Spec and plan: .superpowers/sdd/2026-11-07-b3v07/spec-1106.md, plan-1106.md. Build starts.

**Spec decisions** (Nikola, 2026-11-07; research `research-b3v07-unsettled.md`): Cairn remembers each person's directory groups from their last sign-in (only groups Cairn references), shown in the person's data export and the data-protection table, and deleted with the account; nothing is remembered before the update (counts from each person's next request); the lower-default confirm appears only when someone would be over; the size preview does not create a group reference; admin route `/api/v1/admin/quota/people/{name}`. Strings approved with fixes (FR "Mo", IT "archiviazione"). Spec and plan: `.superpowers/sdd/2026-11-07-b3v07/spec-1106.md`, `plan-1106.md`. Build starts.
Author
Owner

Shipped in v0.6.403 (PR #1142), live on both dogfoods.

  • A personal folder size per person (Users & access › Accounts, ⋮ › Storage limit…) and by directory group (Storage & quotas › Limits › Sizes by group). Order: own size, then the largest group size, then the default. At least 1 MB, or No limit. Spaces keep their own limits.
  • Groups count as of the person's last sign-in (remembered per person, flushed every 30 s, tombstones on deletion).
  • Lowering a size deletes nothing; growth is refused.
  • Accounts gains a Storage column and filters; the person sees where their size comes from, and a red banner when over it.
  • Fix: the default and the instance allowance are re-read every 10 s on every instance (at most one read per 10 s, also when the read fails).
  • Export: account/storage; remembered groups removed on local delete, OIDC rejection and Delete unread files (LDAP deletions keep them until Delete unread files).
  • Routes /api/v1/admin/quota/…, four audit verbs, the codes and log lines are in the CHANGELOG and admin-policy.md.

Multi-instance residuals (per-process usage, 4 background measures per process, unflushed observations lost on a crash) are in ARCHITECTURE.md.

Shipped in **v0.6.403** (PR #1142), live on both dogfoods. - A personal folder size per person (Users & access › Accounts, ⋮ › Storage limit…) and by directory group (Storage & quotas › Limits › Sizes by group). Order: own size, then the largest group size, then the default. At least 1 MB, or No limit. Spaces keep their own limits. - Groups count as of the person's last sign-in (remembered per person, flushed every 30 s, tombstones on deletion). - Lowering a size deletes nothing; growth is refused. - Accounts gains a Storage column and filters; the person sees where their size comes from, and a red banner when over it. - Fix: the default and the instance allowance are re-read every 10 s on every instance (at most one read per 10 s, also when the read fails). - Export: `account/storage`; remembered groups removed on local delete, OIDC rejection and Delete unread files (LDAP deletions keep them until Delete unread files). - Routes `/api/v1/admin/quota/…`, four audit verbs, the codes and log lines are in the CHANGELOG and admin-policy.md. Multi-instance residuals (per-process usage, 4 background measures per process, unflushed observations lost on a crash) are in ARCHITECTURE.md.
Cordy closed this issue 2026-11-07 19:30:20 +00:00
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#1106
No description provided.