diff options
Diffstat (limited to 'modules/base/conf.go')
-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) } } |