summaryrefslogtreecommitdiffstats
path: root/routers/install.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-19 20:36:19 +0800
committerUnknwon <u@gogs.io>2015-08-19 20:36:19 +0800
commitbd1d7d1509e87c8ace6d8372cd1db7535ce06525 (patch)
treedbce69b06521abafb5fe0ad01014e6e5f3826d28 /routers/install.go
parent1453e91f419e52fc74e3ec51b47a080a27a33342 (diff)
downloadgitea-bd1d7d1509e87c8ace6d8372cd1db7535ce06525.tar.gz
gitea-bd1d7d1509e87c8ace6d8372cd1db7535ce06525.zip
Able to set SSH port when install, update Docker docs
Diffstat (limited to 'routers/install.go')
-rw-r--r--routers/install.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/install.go b/routers/install.go
index 4e7dd3904e..3fcaee8db6 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -118,6 +118,7 @@ func Install(ctx *middleware.Context) {
}
form.Domain = setting.Domain
+ form.SSHPort = setting.SSHPort
form.HTTPPort = setting.HttpPort
form.AppUrl = setting.AppUrl
@@ -241,6 +242,13 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
cfg.Section("server").Key("HTTP_PORT").SetValue(form.HTTPPort)
cfg.Section("server").Key("ROOT_URL").SetValue(form.AppUrl)
+ if form.SSHPort == 0 {
+ cfg.Section("server").Key("DISABLE_SSH").SetValue("true")
+ } else {
+ cfg.Section("server").Key("DISABLE_SSH").SetValue("false")
+ cfg.Section("server").Key("SSH_PORT").SetValue(com.ToStr(form.SSHPort))
+ }
+
if len(strings.TrimSpace(form.SMTPHost)) > 0 {
cfg.Section("mailer").Key("ENABLED").SetValue("true")
cfg.Section("mailer").Key("HOST").SetValue(form.SMTPHost)