|
|
@ -55,6 +55,7 @@ func Install(ctx *middleware.Context, form auth.InstallForm) { |
|
|
|
ctx.Data["Title"] = "Install" |
|
|
|
ctx.Data["Title"] = "Install" |
|
|
|
ctx.Data["PageIsInstall"] = true |
|
|
|
ctx.Data["PageIsInstall"] = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ctx.Req.Method == "GET" { |
|
|
|
// Get and assign value to install form.
|
|
|
|
// Get and assign value to install form.
|
|
|
|
if len(form.Host) == 0 { |
|
|
|
if len(form.Host) == 0 { |
|
|
|
form.Host = models.DbCfg.Host |
|
|
|
form.Host = models.DbCfg.Host |
|
|
@ -86,8 +87,6 @@ func Install(ctx *middleware.Context, form auth.InstallForm) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
auth.AssignForm(form, ctx.Data) |
|
|
|
auth.AssignForm(form, ctx.Data) |
|
|
|
|
|
|
|
|
|
|
|
if ctx.Req.Method == "GET" { |
|
|
|
|
|
|
|
ctx.HTML(200, "install") |
|
|
|
ctx.HTML(200, "install") |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
@ -109,7 +108,12 @@ func Install(ctx *middleware.Context, form auth.InstallForm) { |
|
|
|
models.DbCfg.Path = form.DatabasePath |
|
|
|
models.DbCfg.Path = form.DatabasePath |
|
|
|
|
|
|
|
|
|
|
|
if err := models.NewEngine(); err != nil { |
|
|
|
if err := models.NewEngine(); err != nil { |
|
|
|
|
|
|
|
if strings.Contains(err.Error(), `unknown driver "sqlite3"`) { |
|
|
|
|
|
|
|
ctx.RenderWithErr("Your release version does not support SQLite3, please download the official binary version "+ |
|
|
|
|
|
|
|
"from https://github.com/gogits/gogs/wiki/Install-from-binary, NOT the gobuild version.", "install", &form) |
|
|
|
|
|
|
|
} else { |
|
|
|
ctx.RenderWithErr("Database setting is not correct: "+err.Error(), "install", &form) |
|
|
|
ctx.RenderWithErr("Database setting is not correct: "+err.Error(), "install", &form) |
|
|
|
|
|
|
|
} |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|