From 4438b7793b143c71675b0ae954036830b7afd2b7 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 25 Feb 2016 00:21:48 -0500 Subject: Add new config option for builtin SSH server Config option [server] SSH_LISTEN_PORT to the port the builtin SSH server will be listen. It can be different from SSH_PORT which is supposed to be exposed in the clone URL. This should solve the problem when user runs Gogs inside Docker container and still want to use builtin SSH server. --- modules/setting/setting.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/setting') diff --git a/modules/setting/setting.go b/modules/setting/setting.go index d82f16db..c7441661 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -65,6 +65,7 @@ var ( StartSSHServer bool SSHDomain string SSHPort int + SSHListenPort int SSHRootPath string OfflineMode bool DisableRouterLog bool @@ -324,6 +325,7 @@ func NewContext() { } SSHDomain = sec.Key("SSH_DOMAIN").MustString(Domain) SSHPort = sec.Key("SSH_PORT").MustInt(22) + SSHListenPort = sec.Key("SSH_LISTEN_PORT").MustInt(SSHPort) SSHRootPath = sec.Key("SSH_ROOT_PATH").MustString(path.Join(homeDir, ".ssh")) if err := os.MkdirAll(SSHRootPath, 0700); err != nil { log.Fatal(4, "Fail to create '%s': %v", SSHRootPath, err) -- cgit v1.2.3