]> source.dussan.org Git - gitea.git/commitdiff
fix #660
authorUnknwon <joe2010xtmf@163.com>
Mon, 24 Nov 2014 14:54:08 +0000 (09:54 -0500)
committerUnknwon <joe2010xtmf@163.com>
Mon, 24 Nov 2014 14:54:08 +0000 (09:54 -0500)
cmd/web.go
gogs.go
routers/install.go
templates/.VERSION

index c2017a2850a0f05c2e2ab6ad7528ae1b77d4d05e..3d9d4a7c84d394472469f478605e8b45e9e645c7 100644 (file)
@@ -161,6 +161,7 @@ func runWeb(*cli.Context) {
        // Routers.
        m.Get("/", ignSignIn, routers.Home)
        m.Get("/explore", ignSignIn, routers.Explore)
+       // FIXME: when i'm binding form here???
        m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install)
        m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost)
        m.Group("", func() {
diff --git a/gogs.go b/gogs.go
index 60e53fb4ed2a6fc4929ee2ddd90ece6252d7b335..2cecb58be5b076c04d2c3abfff8ca54d57ce06e2 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
        "github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.5.8.1122 Beta"
+const APP_VER = "0.5.8.1124 Beta"
 
 func init() {
        runtime.GOMAXPROCS(runtime.NumCPU())
index 408ca108f6b2314df96ee809fb1a61f2ff1ee436..df8a05651a68aaa673742ff1649b8c83dd6c3064 100644 (file)
@@ -88,6 +88,7 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
        ctx.Data["Title"] = ctx.Tr("install.install")
        ctx.Data["PageIsInstall"] = true
 
+       // FIXME: when i'm ckeching length here? should they all be 0 no matter when?
        // Get and assign values to install form.
        if len(form.DbHost) == 0 {
                form.DbHost = models.DbCfg.Host
@@ -109,7 +110,15 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
                form.RepoRootPath = setting.RepoRootPath
        }
        if len(form.RunUser) == 0 {
-               form.RunUser = setting.RunUser
+               // Note: it's not normall to use SSH in windows so current user can be first option(not git).
+               if setting.IsWindows && setting.RunUser == "git" {
+                       form.RunUser = os.Getenv("USER")
+                       if len(form.RunUser) == 0 {
+                               form.RunUser = os.Getenv("USERNAME")
+                       }
+               } else {
+                       form.RunUser = setting.RunUser
+               }
        }
        if len(form.Domain) == 0 {
                form.Domain = setting.Domain
index d2d39a12682768e3a1afb332edaadcaaa0ec0792..d4908c46cc0d98e48280d3c31eb2ff2fd6a21dc8 100644 (file)
@@ -1 +1 @@
-0.5.8.1122 Beta
\ No newline at end of file
+0.5.8.1124 Beta
\ No newline at end of file