mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
move minimum key sizes to config
This moves the minimum key sizes into the config file, so that anyone can modify the restrictions.
This commit is contained in:
@@ -434,6 +434,7 @@ var Service struct {
|
||||
EnableReverseProxyAuth bool
|
||||
EnableReverseProxyAutoRegister bool
|
||||
DisableMinimumKeySizeCheck bool
|
||||
MinimumKeySizes map[string]int
|
||||
EnableCaptcha bool
|
||||
}
|
||||
|
||||
@@ -449,6 +450,11 @@ func newService() {
|
||||
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()
|
||||
Service.DisableMinimumKeySizeCheck = sec.Key("DISABLE_MINIMUM_KEY_SIZE_CHECK").MustBool()
|
||||
Service.EnableCaptcha = sec.Key("ENABLE_CAPTCHA").MustBool()
|
||||
|
||||
minimumKeySizes := Cfg.Section("service.minimum_key_sizes").Keys()
|
||||
for _, key := range minimumKeySizes {
|
||||
Service.MinimumKeySizes[key.Name()] = key.MustInt()
|
||||
}
|
||||
}
|
||||
|
||||
var logLevels = map[string]string{
|
||||
|
Reference in New Issue
Block a user