Mirror fix on #45
This commit is contained in:
parent
b1627672f9
commit
03cc39ea12
3 changed files with 42 additions and 38 deletions
2
gogs.go
2
gogs.go
|
@ -19,7 +19,7 @@ import (
|
||||||
// Test that go1.2 tag above is included in builds. main.go refers to this definition.
|
// Test that go1.2 tag above is included in builds. main.go refers to this definition.
|
||||||
const go12tag = true
|
const go12tag = true
|
||||||
|
|
||||||
const APP_VER = "0.2.0.0329 Alpha"
|
const APP_VER = "0.2.0.0330 Alpha"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
base.AppVer = APP_VER
|
base.AppVer = APP_VER
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label">Host: </label>
|
<label class="col-md-3 control-label">Host: </label>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<input name="host" class="form-control" placeholder="Type database server host" value="{{.host}}" required="required">
|
<input name="host" class="form-control" placeholder="Type database server host" value="{{.host}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<label class="col-md-3 control-label">User: </label>
|
<label class="col-md-3 control-label">User: </label>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<input name="user" class="form-control" placeholder="Type database username" required="required" value="{{.user}}">
|
<input name="user" class="form-control" placeholder="Type database username" value="{{.user}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
<label class="col-md-3 control-label">Password: </label>
|
<label class="col-md-3 control-label">Password: </label>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<input name="passwd" type="password" class="form-control" placeholder="Type database password" required="required" value="{{.passwd}}">
|
<input name="passwd" type="password" class="form-control" placeholder="Type database password" value="{{.passwd}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
<label class="col-md-3 control-label">Database Name: </label>
|
<label class="col-md-3 control-label">Database Name: </label>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<input name="database_name" type="text" class="form-control" placeholder="Type mysql database name" value="{{.database_name}}" required="required">
|
<input name="database_name" type="text" class="form-control" placeholder="Type mysql database name" value="{{.database_name}}">
|
||||||
<p class="help-block">Recommend use INNODB engine with utf8_general_ci charset.</p>
|
<p class="help-block">Recommend use INNODB engine with utf8_general_ci charset.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in a new issue