mirror of
https://github.com/go-gitea/gitea
synced 2024-09-10 08:27:04 +02:00
Avoid polluting the config (#25345)
Caught by #25330 Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
695f5d170b
commit
a5d0246fff
@ -30,7 +30,7 @@ func loadMirrorFrom(rootCfg ConfigProvider) {
|
||||
// DEPRECATED should not be removed because users maybe upgrade from lower version to the latest version
|
||||
// if these are removed, the warning will not be shown
|
||||
deprecatedSetting(rootCfg, "repository", "DISABLE_MIRRORS", "mirror", "ENABLED", "v1.19.0")
|
||||
if rootCfg.Section("repository").Key("DISABLE_MIRRORS").MustBool(false) {
|
||||
if ConfigSectionKeyBool(rootCfg.Section("repository"), "DISABLE_MIRRORS") {
|
||||
Mirror.DisableNewPull = true
|
||||
}
|
||||
|
||||
|
@ -120,6 +120,7 @@ func loadOAuth2From(rootCfg ConfigProvider) {
|
||||
OAuth2.JWTSigningPrivateKeyFile = filepath.Join(AppDataPath, OAuth2.JWTSigningPrivateKeyFile)
|
||||
}
|
||||
|
||||
if InstallLock {
|
||||
key := make([]byte, 32)
|
||||
n, err := base64.RawURLEncoding.Decode(key, []byte(OAuth2.JWTSecretBase64))
|
||||
if err != nil || n != 32 {
|
||||
@ -135,3 +136,4 @@ func loadOAuth2From(rootCfg ConfigProvider) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ func loadRunModeFrom(rootCfg ConfigProvider) {
|
||||
RunUser = rootSec.Key("RUN_USER").MustString(user.CurrentUsername())
|
||||
// The following is a purposefully undocumented option. Please do not run Gitea as root. It will only cause future headaches.
|
||||
// Please don't use root as a bandaid to "fix" something that is broken, instead the broken thing should instead be fixed properly.
|
||||
unsafeAllowRunAsRoot := rootSec.Key("I_AM_BEING_UNSAFE_RUNNING_AS_ROOT").MustBool(false)
|
||||
unsafeAllowRunAsRoot := ConfigSectionKeyBool(rootSec, "I_AM_BEING_UNSAFE_RUNNING_AS_ROOT")
|
||||
RunMode = os.Getenv("GITEA_RUN_MODE")
|
||||
if RunMode == "" {
|
||||
RunMode = rootSec.Key("RUN_MODE").MustString("prod")
|
||||
|
Loading…
Reference in New Issue
Block a user