diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-29 14:35:54 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-29 14:35:54 +0800 |
commit | f48fc24670b122df069149801459eb55a67045c7 (patch) | |
tree | 04a054e989341953072f854134a50d62f75993c8 /modules/base | |
parent | e085d7738a683785a5d7d7e3a33a0437c87c340b (diff) | |
parent | d01820c125669367b7a585d767d5f11e73a701c2 (diff) |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'modules/base')
-rw-r--r-- | modules/base/conf.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/base/conf.go b/modules/base/conf.go index 2e568839..fd77cfd3 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -38,7 +38,7 @@ var ( RunUser string RepoRootPath string - EnableHttpsClone bool + InstallLock bool LogInRememberDays int CookieUserName string @@ -282,7 +282,7 @@ func NewConfigContext() { os.Exit(2) } - EnableHttpsClone = Cfg.MustBool("security", "ENABLE_HTTPS_CLONE", false) + InstallLock = Cfg.MustBool("security", "INSTALL_LOCK", false) LogInRememberDays = Cfg.MustInt("security", "LOGIN_REMEMBER_DAYS") CookieUserName = Cfg.MustValue("security", "COOKIE_USERNAME") @@ -291,9 +291,14 @@ func NewConfigContext() { PictureService = Cfg.MustValue("picture", "SERVICE") // Determine and create root git reposiroty path. - RepoRootPath = Cfg.MustValue("repository", "ROOT") + homeDir, err := com.HomeDir() + if err != nil { + fmt.Printf("Fail to get home directory): %v\n", err) + os.Exit(2) + } + RepoRootPath = Cfg.MustValue("repository", "ROOT", filepath.Join(homeDir, "git/gogs-repositories")) if err = os.MkdirAll(RepoRootPath, os.ModePerm); err != nil { - fmt.Printf("models.init(fail to create RepoRootPath(%s)): %v\n", RepoRootPath, err) + fmt.Printf("Fail to create RepoRootPath(%s): %v\n", RepoRootPath, err) os.Exit(2) } } |