diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-30 10:19:36 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-30 10:19:36 +0800 |
commit | cd800d7837caefb129e0f006c8973460a2d64d4a (patch) | |
tree | 6c5f06fd3a1802c07332f247e2a1b3d2bc0b5c1b /modules/base/conf.go | |
parent | 50391f434e9f7f216ce0f907b532cbe4ca2bbeb2 (diff) | |
parent | b27c34f39acee3bf7b6594a1f0db2183b343326c (diff) |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'modules/base/conf.go')
-rw-r--r-- | modules/base/conf.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/base/conf.go b/modules/base/conf.go index fd77cfd3..f696d083 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -272,18 +272,19 @@ func NewConfigContext() { Domain = Cfg.MustValue("server", "DOMAIN") SecretKey = Cfg.MustValue("security", "SECRET_KEY") + InstallLock = Cfg.MustBool("security", "INSTALL_LOCK", false) + RunUser = Cfg.MustValue("", "RUN_USER") curUser := os.Getenv("USERNAME") if len(curUser) == 0 { curUser = os.Getenv("USER") } - if RunUser != curUser { + // Does not check run user when the install lock is off. + if InstallLock && RunUser != curUser { fmt.Printf("Expect user(%s) but current user is: %s\n", RunUser, curUser) os.Exit(2) } - InstallLock = Cfg.MustBool("security", "INSTALL_LOCK", false) - LogInRememberDays = Cfg.MustInt("security", "LOGIN_REMEMBER_DAYS") CookieUserName = Cfg.MustValue("security", "COOKIE_USERNAME") CookieRememberName = Cfg.MustValue("security", "COOKIE_REMEMBER_NAME") |