Nobody sees free storage space — surface capacity honestly per backend #178
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/Cairn#178
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dogfood note (Nikola): nowhere in Cairn do admins or users see free storage space.
What exists today:
GET /api/v1/quotaand WebDAV RFC 4331 props report usage — but only where the driver implementsstorage.Usager. posix does; s3 does not (an S3 bucket has no standard capacity notion, so the endpoint honestly answers 501). The dogfood is s3, hence: nothing anywhere. The web UI additionally never displays the number even where it exists — only WebDAV clients show it.Plan:
/api/v1/quota, shown when the backend reports it, honestly absent (not fake) when it doesn't.storage.quota.maxTotalBytesorperUserBytesis configured, display usage against that limit even on s3 — the enforcement walk already computes the numbers.Shipped in v0.6.15 (PR #203), live on the dogfood (
/api/v1/quotareturning 200 in the logs).Usager(internal/storage/s3/usage.go):Usedsummed on demand over a flat bucket listing, cached ~60s. Object stores have no capacity, so the quota layer suppliesTotal.quotaPerUserBytes+quotaInstanceByteslive in the settings store (encrypted state-backend, like retention); the quota decorator reads them live viaSetLimits— no restart. Config quotas remain the seed. The decorator is now always constructed so settings-driven caps enforce even with no config seed.Total; POSIX real capacity is only tightened, never inflated.Usage()overlay inquota.go.GET /api/v1/quotareturns instance figures to admins, per-user to everyone.0= no limit; enabling a cap on an already-over instance blocks new writes (visible "quota exceeded") but never deletes; per-user charges the/home/<user>tree.Closing — the original "nobody sees free space" gap is resolved, and it grew into full editable quotas per your dogfood direction.