diff options
author | Unknwon <u@gogs.io> | 2015-03-25 08:59:48 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-03-25 08:59:48 -0400 |
commit | aae74c793ae859baabead8cebdc760455fb39038 (patch) | |
tree | b1c671ec2466b0f87ceae48a436e88cae521ee7f /modules/setting | |
parent | 5169a0e025d5e250b9bd3b8a194ab7dc6dde32a3 (diff) | |
download | gitea-aae74c793ae859baabead8cebdc760455fb39038.tar.gz gitea-aae74c793ae859baabead8cebdc760455fb39038.zip |
#1133 add config option [service] DISABLE_MINIMUM_KEY_SIZE_CHECK
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 12fd52c999..b676e85cb3 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -339,6 +339,8 @@ func NewConfigContext() { } var Service struct { + ActiveCodeLives int + ResetPwdCodeLives int RegisterEmailConfirm bool DisableRegistration bool ShowRegistrationButton bool @@ -347,19 +349,20 @@ var Service struct { EnableNotifyMail bool EnableReverseProxyAuth bool EnableReverseProxyAutoRegister bool - ActiveCodeLives int - ResetPwdCodeLives int + DisableMinimumKeySizeCheck bool } func newService() { - Service.ActiveCodeLives = Cfg.Section("service").Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180) - Service.ResetPwdCodeLives = Cfg.Section("service").Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180) - Service.DisableRegistration = Cfg.Section("service").Key("DISABLE_REGISTRATION").MustBool() - Service.ShowRegistrationButton = Cfg.Section("service").Key("SHOW_REGISTRATION_BUTTON").MustBool(!Service.DisableRegistration) - Service.RequireSignInView = Cfg.Section("service").Key("REQUIRE_SIGNIN_VIEW").MustBool() - Service.EnableCacheAvatar = Cfg.Section("service").Key("ENABLE_CACHE_AVATAR").MustBool() - Service.EnableReverseProxyAuth = Cfg.Section("service").Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool() - Service.EnableReverseProxyAutoRegister = Cfg.Section("service").Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool() + sec := Cfg.Section("service") + Service.ActiveCodeLives = sec.Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180) + Service.ResetPwdCodeLives = sec.Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180) + Service.DisableRegistration = sec.Key("DISABLE_REGISTRATION").MustBool() + Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!Service.DisableRegistration) + Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool() + Service.EnableCacheAvatar = sec.Key("ENABLE_CACHE_AVATAR").MustBool() + Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool() + Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool() + Service.DisableRegistration = sec.Key("DISABLE_MINIMUM_KEY_SIZE_CHECK").MustBool() } var logLevels = map[string]string{ |