mirror of
https://codeberg.org/forgejo/forgejo
synced 2025-09-17 03:02:55 +02:00
Bring the code in line with the documentation that claims the `[quota.default].TOTAL` option supports unit suffixes. Resolves forgejo/forgejo#8996 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9252 Reviewed-by: Lucas <sclu1034@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Brook <brook@noreply.codeberg.org> Co-committed-by: Brook <brook@noreply.codeberg.org>
29 lines
583 B
Go
29 lines
583 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)
|
|
|
|
sec := rootCfg.Section("quota.default")
|
|
Quota.Default.Total = mustBytes(sec, "TOTAL")
|
|
}
|