aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-29 17:50:51 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-29 17:50:51 -0400
commit107a1eadac72e610a9bcb68498751ca51ec8f51a (patch)
tree07830d247f89887882427c0bb910178bde4298ce /modules
parent1f671e5d2900497e2c81e8123cc47fe7ca5ad371 (diff)
downloadgitea-107a1eadac72e610a9bcb68498751ca51ec8f51a.tar.gz
gitea-107a1eadac72e610a9bcb68498751ca51ec8f51a.zip
Finish close and reopen issue, install page, ready going to test stage of v0.2.0
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/auth.go1
-rw-r--r--modules/base/conf.go7
2 files changed, 5 insertions, 3 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go
index ac03a8f126..361f55b2d3 100644
--- a/modules/auth/auth.go
+++ b/modules/auth/auth.go
@@ -172,6 +172,7 @@ type InstallForm struct {
DatabasePath string `form:"database_path"`
RepoRootPath string `form:"repo_path"`
RunUser string `form:"run_user"`
+ Domain string `form:"domain"`
AppUrl string `form:"app_url"`
AdminName string `form:"admin_name" binding:"Required"`
AdminPasswd string `form:"admin_pwd" binding:"Required;MinSize(6);MaxSize(30)"`
diff --git a/modules/base/conf.go b/modules/base/conf.go
index fd77cfd3ce..f696d083f7 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")