1
0
Fork 0
forked from forgejo/forgejo

Update config option

This commit is contained in:
Unknown 2014-03-28 08:39:35 -04:00
parent 6bd4f34c8d
commit cb05b8325c
9 changed files with 7 additions and 17 deletions

View file

@ -40,8 +40,6 @@ var (
InstallLock bool
EnableHttpsClone bool
LogInRememberDays int
CookieUserName string
CookieRememberName string
@ -286,8 +284,6 @@ func NewConfigContext() {
InstallLock = Cfg.MustBool("security", "INSTALL_LOCK", false)
EnableHttpsClone = Cfg.MustBool("security", "ENABLE_HTTPS_CLONE", false)
LogInRememberDays = Cfg.MustInt("security", "LOGIN_REMEMBER_DAYS")
CookieUserName = Cfg.MustValue("security", "COOKIE_USERNAME")
CookieRememberName = Cfg.MustValue("security", "COOKIE_REMEMBER_NAME")

View file

@ -71,12 +71,8 @@ func RepoAssignment(redirect bool) martini.Handler {
ctx.Repo.IsWatching = models.IsWatching(ctx.User.Id, repo.Id)
}
ctx.Repo.Repository = repo
scheme := "http"
if base.EnableHttpsClone {
scheme = "https"
}
ctx.Repo.CloneLink.SSH = fmt.Sprintf("%s@%s:%s/%s.git", base.RunUser, base.Domain, user.LowerName, repo.LowerName)
ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("%s://%s/%s/%s.git", scheme, base.Domain, user.LowerName, repo.LowerName)
ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("%s%s/%s.git", base.AppUrl, user.LowerName, repo.LowerName)
if len(params["branchname"]) == 0 {
params["branchname"] = "master"