Merge pull request #50 from 0xbaadf00d/feature/2583-disablehttpcloning

Disable HTTP cloning
This commit is contained in:
Rachid Zarouali 2016-11-07 11:23:30 +01:00 committed by GitHub
commit be5607e510
7 changed files with 40 additions and 12 deletions

View file

@ -254,6 +254,7 @@ func RepoAssignment(args ...bool) macaron.Handler {
ctx.Data["IsRepositoryWriter"] = ctx.Repo.IsWriter()
ctx.Data["DisableSSH"] = setting.SSH.Disabled
ctx.Data["DisableHTTP"] = setting.Repository.DisableHTTPGit
ctx.Data["CloneLink"] = repo.CloneLink()
ctx.Data["WikiCloneLink"] = repo.WikiCloneLink()

View file

@ -117,6 +117,7 @@ var (
MirrorQueueLength int
PullRequestQueueLength int
PreferredLicenses []string
DisableHTTPGit bool
// Repository editor settings
Editor struct {
@ -491,6 +492,7 @@ func NewContext() {
// Determine and create root git repository path.
sec = Cfg.Section("repository")
Repository.DisableHTTPGit = sec.Key("DISABLE_HTTP_GIT").MustBool()
RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gogs-repositories"))
forcePathSeparator(RepoRootPath)
if !filepath.IsAbs(RepoRootPath) {