loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT env (#29788)

It is convenient to skip by setting environment, since it's OK
to use root user in job containers.

It's not a bug, but I want to backport it to v1.21 since it doesn't
break anything.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 487ac9bf6c239ce897f1a2f6c4321d6f1769a22f)

authored by

Jason Song
Giteabot
wxiaoguang
and committed by
Earl Warren
9d08d00d 40694291

+3
+3
modules/setting/setting.go
··· 13 13 14 14 "code.gitea.io/gitea/modules/log" 15 15 "code.gitea.io/gitea/modules/user" 16 + "code.gitea.io/gitea/modules/util" 16 17 ) 17 18 18 19 var ForgejoVersion = "1.0.0" ··· 161 162 func loadRunModeFrom(rootCfg ConfigProvider) { 162 163 rootSec := rootCfg.Section("") 163 164 RunUser = rootSec.Key("RUN_USER").MustString(user.CurrentUsername()) 165 + 164 166 // The following is a purposefully undocumented option. Please do not run Gitea as root. It will only cause future headaches. 165 167 // Please don't use root as a bandaid to "fix" something that is broken, instead the broken thing should instead be fixed properly. 166 168 unsafeAllowRunAsRoot := ConfigSectionKeyBool(rootSec, "I_AM_BEING_UNSAFE_RUNNING_AS_ROOT") 169 + unsafeAllowRunAsRoot = unsafeAllowRunAsRoot || util.OptionalBoolParse(os.Getenv("GITEA_I_AM_BEING_UNSAFE_RUNNING_AS_ROOT")).Value() 167 170 RunMode = os.Getenv("GITEA_RUN_MODE") 168 171 if RunMode == "" { 169 172 RunMode = rootSec.Key("RUN_MODE").MustString("prod")