mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-23 19:11:58 +01:00
3b70949651
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>
26 lines
494 B
Go
26 lines
494 B
Go
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package setting
|
|
|
|
// Quota settings
|
|
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) {
|
|
mustMapSetting(rootCfg, "quota", &Quota)
|
|
}
|