diff options
author | Unknwon <joe2010xtmf@163.com> | 2015-02-07 10:46:57 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2015-02-07 10:46:57 -0500 |
commit | 2a2596fe615e4f18e0aff02cc8a016fea0463849 (patch) | |
tree | c4a22ca4a195fa4ccdbfee80bae83a1a309548e5 /modules | |
parent | 3f2e99962cd466da2eb09fe4719f258e6f7a39e4 (diff) | |
download | gitea-2a2596fe615e4f18e0aff02cc8a016fea0463849.tar.gz gitea-2a2596fe615e4f18e0aff02cc8a016fea0463849.zip |
able to disable SSH for #883
Diffstat (limited to 'modules')
-rw-r--r-- | modules/middleware/repo.go | 1 | ||||
-rw-r--r-- | modules/setting/setting.go | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index d143d8a86b..1ab158dd6d 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -386,6 +386,7 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner ctx.Data["IsRepositoryTrueOwner"] = ctx.Repo.IsTrueOwner + ctx.Data["DisableSSH"] = setting.DisableSSH ctx.Repo.CloneLink, err = repo.CloneLink() if err != nil { ctx.Handle(500, "CloneLink", err) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index e79e6d6b96..6a205921b8 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -50,7 +50,8 @@ var ( Protocol Scheme Domain string HttpAddr, HttpPort string - SshPort int + DisableSSH bool + SSHPort int OfflineMode bool DisableRouterLog bool CertFile, KeyFile string @@ -209,7 +210,8 @@ func NewConfigContext() { Domain = sec.Key("DOMAIN").MustString("localhost") HttpAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0") HttpPort = sec.Key("HTTP_PORT").MustString("3000") - SshPort = sec.Key("SSH_PORT").MustInt(22) + DisableSSH = sec.Key("DISABLE_SSH").MustBool() + SSHPort = sec.Key("SSH_PORT").MustInt(22) OfflineMode = sec.Key("OFFLINE_MODE").MustBool() DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool() StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir) |