tokarchuk/v1.17
Unknwon 10 years ago
parent 5b32cdd960
commit 5b96e3fcc7
  1. 1
      cmd/web.go
  2. 2
      gogs.go
  3. 9
      routers/install.go
  4. 2
      templates/.VERSION

@ -161,6 +161,7 @@ func runWeb(*cli.Context) {
// Routers. // Routers.
m.Get("/", ignSignIn, routers.Home) m.Get("/", ignSignIn, routers.Home)
m.Get("/explore", ignSignIn, routers.Explore) m.Get("/explore", ignSignIn, routers.Explore)
// FIXME: when i'm binding form here???
m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install) m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install)
m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost) m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost)
m.Group("", func() { m.Group("", func() {

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.5.8.1122 Beta" const APP_VER = "0.5.8.1124 Beta"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

@ -88,6 +88,7 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
ctx.Data["Title"] = ctx.Tr("install.install") ctx.Data["Title"] = ctx.Tr("install.install")
ctx.Data["PageIsInstall"] = true 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. // Get and assign values to install form.
if len(form.DbHost) == 0 { if len(form.DbHost) == 0 {
form.DbHost = models.DbCfg.Host form.DbHost = models.DbCfg.Host
@ -109,8 +110,16 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
form.RepoRootPath = setting.RepoRootPath form.RepoRootPath = setting.RepoRootPath
} }
if len(form.RunUser) == 0 { if len(form.RunUser) == 0 {
// 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 form.RunUser = setting.RunUser
} }
}
if len(form.Domain) == 0 { if len(form.Domain) == 0 {
form.Domain = setting.Domain form.Domain = setting.Domain
} }

@ -1 +1 @@
0.5.8.1122 Beta 0.5.8.1124 Beta
Loading…
Cancel
Save