forgejo/modules/setting/quota.go
Brook 60cab1bafd fix: [quota.default].TOTAL config setting supports unit suffixes (#9252)
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>
2025-09-12 00:44:09 +02:00

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")
}