]> source.dussan.org Git - gitea.git/commitdiff
Mirror fix on #45
authorUnknown <joe2010xtmf@163.com>
Sun, 30 Mar 2014 13:39:44 +0000 (09:39 -0400)
committerUnknown <joe2010xtmf@163.com>
Sun, 30 Mar 2014 13:39:44 +0000 (09:39 -0400)
gogs.go
routers/install.go
templates/install.tmpl

diff --git a/gogs.go b/gogs.go
index 2ef35ca4da8a26a9500c99fdac27ea40209b8f11..bbd654212b08a003e85acae9364b6fdbc7347ac8 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -19,7 +19,7 @@ import (
 // Test that go1.2 tag above is included in builds. main.go refers to this definition.
 const go12tag = true
 
-const APP_VER = "0.2.0.0329 Alpha"
+const APP_VER = "0.2.0.0330 Alpha"
 
 func init() {
        base.AppVer = APP_VER
index 407705b73a552c91db219daed99ba898263081f4..36bba3d41a19c3c772f7b9ddd73f97c62fd7397e 100644 (file)
@@ -55,39 +55,38 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
        ctx.Data["Title"] = "Install"
        ctx.Data["PageIsInstall"] = true
 
-       // Get and assign value to install form.
-       if len(form.Host) == 0 {
-               form.Host = models.DbCfg.Host
-       }
-       if len(form.User) == 0 {
-               form.User = models.DbCfg.User
-       }
-       if len(form.Passwd) == 0 {
-               form.Passwd = models.DbCfg.Pwd
-       }
-       if len(form.DatabaseName) == 0 {
-               form.DatabaseName = models.DbCfg.Name
-       }
-       if len(form.DatabasePath) == 0 {
-               form.DatabasePath = models.DbCfg.Path
-       }
-
-       if len(form.RepoRootPath) == 0 {
-               form.RepoRootPath = base.RepoRootPath
-       }
-       if len(form.RunUser) == 0 {
-               form.RunUser = base.RunUser
-       }
-       if len(form.Domain) == 0 {
-               form.Domain = base.Domain
-       }
-       if len(form.AppUrl) == 0 {
-               form.AppUrl = base.AppUrl
-       }
+       if ctx.Req.Method == "GET" {
+               // Get and assign value to install form.
+               if len(form.Host) == 0 {
+                       form.Host = models.DbCfg.Host
+               }
+               if len(form.User) == 0 {
+                       form.User = models.DbCfg.User
+               }
+               if len(form.Passwd) == 0 {
+                       form.Passwd = models.DbCfg.Pwd
+               }
+               if len(form.DatabaseName) == 0 {
+                       form.DatabaseName = models.DbCfg.Name
+               }
+               if len(form.DatabasePath) == 0 {
+                       form.DatabasePath = models.DbCfg.Path
+               }
 
-       auth.AssignForm(form, ctx.Data)
+               if len(form.RepoRootPath) == 0 {
+                       form.RepoRootPath = base.RepoRootPath
+               }
+               if len(form.RunUser) == 0 {
+                       form.RunUser = base.RunUser
+               }
+               if len(form.Domain) == 0 {
+                       form.Domain = base.Domain
+               }
+               if len(form.AppUrl) == 0 {
+                       form.AppUrl = base.AppUrl
+               }
 
-       if ctx.Req.Method == "GET" {
+               auth.AssignForm(form, ctx.Data)
                ctx.HTML(200, "install")
                return
        }
@@ -109,7 +108,12 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
        models.DbCfg.Path = form.DatabasePath
 
        if err := models.NewEngine(); err != nil {
-               ctx.RenderWithErr("Database setting is not correct: "+err.Error(), "install", &form)
+               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)
+               }
                return
        }
 
index 20bd502da2c05e619e912386d086896d74d17c11..1fbc74bc7d6b5b6098c3cc4548e6d28b8e5b2d01 100644 (file)
@@ -20,7 +20,7 @@
             <div class="form-group">
                 <label class="col-md-3 control-label">Host: </label>
                 <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>
 
@@ -28,7 +28,7 @@
                 <label class="col-md-3 control-label">User: </label>
 
                 <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>
 
@@ -36,7 +36,7 @@
                 <label class="col-md-3 control-label">Password: </label>
 
                 <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>
 
@@ -44,7 +44,7 @@
                 <label class="col-md-3 control-label">Database Name: </label>
 
                 <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>
                 </div>
             </div>