Admin setting for the new-space limit; directory first-sighting rule (#800) #814
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat-800"
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?
Closes #800; implements
mockup-800-new-space-default.htmlwith the decisions in the #800 comment.Server
settings.SpaceDefaultQuotaBytes *int64: nil = 1 GiB, so upgrades change nothing; 0 = none; negative rejected.Settings.SpaceDefaultQuota()returns the effective value. It's a pointer so an explicit 0 survives JSON.POST /spacesusesSpacesAPI.DefaultQuota(the setting) instead of the constant; 0 means no cap.spaceids.SetOnRegister: the hook runs outside the lock, once per newly registered identity.SpacesAPI.OnSpaceRegisteredhandles directory kind only:SpaceBytes→quotaDrv.TreeBytes), it stays unlimited andspace-default-quota-skippedis audited (verb registered);main.gosweeps/spacesat boot and registers every existing folder before installing the hook. Spaces that exist today (including ones an older install never registered) are never capped by it; only genuinely new ones are.Web
#set-spacedef, fractional GB, unset reads 1), saved with the other settings. The input also seeds itself fromserverSettingswhen the row is built, so a row built afterloadSettingsValuescan't save an empty value (= 0) by accident.qdPerUsercopy updated.spcInhQuotaNode); the kv rows accept a node for this one row.Docs:
spaces-quota.mdgains "The default for new spaces".Tests: RED
22144fb1→ green.go test ./...passes (settings, spaceids hook-once, create uses the setting / 0 = none, first sighting small → capped, over → skipped, app-owned ignored). Web 303/303 andnode --checkpass.Noticed, not changed: the existing "Warn people at" input has the same load-order gap the new field guards against. If the admin view opens on another topic first, it can save as empty (= off). That's worth its own small issue.