mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-11 04:05:10 +02:00
Move ParseBool to optional (#33979)
(cherry picked from commit 25b6f388651c893ecafce918f27bef7e4ae9a967)
This commit is contained in:
parent
9018e5bc19
commit
f68d49cb9e
6 changed files with 31 additions and 33 deletions
|
@ -12,8 +12,8 @@ import (
|
|||
"time"
|
||||
|
||||
"forgejo.org/modules/log"
|
||||
"forgejo.org/modules/optional"
|
||||
"forgejo.org/modules/user"
|
||||
"forgejo.org/modules/util"
|
||||
)
|
||||
|
||||
var ForgejoVersion = "1.0.0"
|
||||
|
@ -162,7 +162,7 @@ func loadRunModeFrom(rootCfg ConfigProvider) {
|
|||
// The following is a purposefully undocumented option. Please do not run Forgejo 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 := ConfigSectionKeyBool(rootSec, "I_AM_BEING_UNSAFE_RUNNING_AS_ROOT")
|
||||
unsafeAllowRunAsRoot = unsafeAllowRunAsRoot || util.OptionalBoolParse(os.Getenv("GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT")).Value()
|
||||
unsafeAllowRunAsRoot = unsafeAllowRunAsRoot || optional.ParseBool(os.Getenv("GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT")).Value()
|
||||
RunMode = os.Getenv("GITEA_RUN_MODE")
|
||||
if RunMode == "" {
|
||||
RunMode = rootSec.Key("RUN_MODE").MustString("prod")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue