// Does not check run user when the install lock is off.
ifInstallLock{
@ -911,6 +914,15 @@ func NewContext() {
}
}
// check if we run as root
ifos.Getuid()==0{
if!unsafeAllowRunAsRoot{
// Special thanks to VLC which inspired the wording of this messaging.
log.Fatal("Gitea is not supposed to be run as root. Sorry. If you need to use privileged TCP ports please instead use setcap and the `cap_net_bind_service` permission")
}
log.Critical("You are running Gitea using the root user, and have purposely chosen to skip built-in protections around this. You have been warned against this.")