mirror of https://github.com/gogs/gogs.git
Set ProdMode in the correct place
Closes #3696, #3611 Previously, ProdMode can only be true for web server, which always prints dev mode log message to incoming SSH connections and leaks unexpected information.pull/3740/merge
parent
6cc992ea54
commit
79a2745b4a
|
@ -490,6 +490,8 @@ func NewContext() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProdMode = Cfg.Section("").Key("RUN_MODE").String() == "prod"
|
||||||
|
|
||||||
// Determine and create root git repository path.
|
// Determine and create root git repository path.
|
||||||
sec = Cfg.Section("repository")
|
sec = Cfg.Section("repository")
|
||||||
RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gogs-repositories"))
|
RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gogs-repositories"))
|
||||||
|
|
|
@ -38,12 +38,10 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
func checkRunMode() {
|
func checkRunMode() {
|
||||||
switch setting.Cfg.Section("").Key("RUN_MODE").String() {
|
if setting.ProdMode {
|
||||||
case "prod":
|
|
||||||
macaron.Env = macaron.PROD
|
macaron.Env = macaron.PROD
|
||||||
macaron.ColorLog = false
|
macaron.ColorLog = false
|
||||||
setting.ProdMode = true
|
} else {
|
||||||
default:
|
|
||||||
git.Debug = true
|
git.Debug = true
|
||||||
}
|
}
|
||||||
log.Info("Run Mode: %s", strings.Title(macaron.Env))
|
log.Info("Run Mode: %s", strings.Title(macaron.Env))
|
||||||
|
|
Loading…
Reference in New Issue