aboutsummaryrefslogtreecommitdiff
path: root/routers/install.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/install.go')
-rw-r--r--routers/install.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/routers/install.go b/routers/install.go
index e4778d82..930c3e4e 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -9,7 +9,6 @@ import (
"net/mail"
"os"
"os/exec"
- "path"
"path/filepath"
"strings"
@@ -144,6 +143,7 @@ func Install(ctx *context.Context) {
form.Domain = setting.Domain
form.SSHPort = setting.SSH.Port
+ form.UseBuiltinSSHServer = setting.SSH.StartBuiltinServer
form.HTTPPort = setting.HTTPPort
form.AppUrl = setting.AppUrl
form.LogRootPath = setting.LogRootPath
@@ -202,16 +202,10 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
models.DbCfg.SSLMode = form.SSLMode
models.DbCfg.Path = form.DbPath
- if (models.DbCfg.Type == "sqlite3" || models.DbCfg.Type == "tidb") &&
- len(models.DbCfg.Path) == 0 {
+ if models.DbCfg.Type == "sqlite3" && len(models.DbCfg.Path) == 0 {
ctx.Data["Err_DbPath"] = true
ctx.RenderWithErr(ctx.Tr("install.err_empty_db_path"), INSTALL, &form)
return
- } else if models.DbCfg.Type == "tidb" &&
- strings.ContainsAny(path.Base(models.DbCfg.Path), ".-") {
- ctx.Data["Err_DbPath"] = true
- ctx.RenderWithErr(ctx.Tr("install.err_invalid_tidb_name"), INSTALL, &form)
- return
}
// Set test engine.
@@ -315,6 +309,7 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
} else {
cfg.Section("server").Key("DISABLE_SSH").SetValue("false")
cfg.Section("server").Key("SSH_PORT").SetValue(com.ToStr(form.SSHPort))
+ cfg.Section("server").Key("START_SSH_SERVER").SetValue(com.ToStr(form.UseBuiltinSSHServer))
}
if len(strings.TrimSpace(form.SMTPHost)) > 0 {