diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/repo.go | 1 | ||||
-rw-r--r-- | modules/setting/setting.go | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 0e883cc68d..8dadf3a1e6 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -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() diff --git a/modules/setting/setting.go b/modules/setting/setting.go index c2e4f43a12..923c45674c 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -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) { |