feat: Trivial default quota configuration

This adds a new configuration setting: `[quota.default].TOTAL`, which
will be used if no groups are configured for a particular user. The new
option makes it possible to entirely skip configuring quotas via the API
if all that one wants is a total size.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
Gergely Nagy 2024-08-26 13:25:34 +02:00
parent 190b5a3859
commit 3b70949651
No known key found for this signature in database
4 changed files with 86 additions and 4 deletions

View file

@ -7,9 +7,18 @@ package setting
var Quota = struct {
Enabled bool `ini:"ENABLED"`
DefaultGroups []string `ini:"DEFAULT_GROUPS"`
Default struct {
Total int64
} `ini:"quota.default"`
}{
Enabled: false,
DefaultGroups: []string{},
Default: struct {
Total int64
}{
Total: -1,
},
}
func loadQuotaFrom(rootCfg ConfigProvider) {