diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-24 09:54:08 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-24 09:54:08 -0500 |
commit | 5b96e3fcc7132bf853bf82a06203d53978811015 (patch) | |
tree | 47d650ed16552f8145e8113ad41faf486da11f81 /routers/install.go | |
parent | 5b32cdd96086b31b1ab3a71684241d8752dfc621 (diff) | |
download | gitea-5b96e3fcc7132bf853bf82a06203d53978811015.tar.gz gitea-5b96e3fcc7132bf853bf82a06203d53978811015.zip |
fix #660
Diffstat (limited to 'routers/install.go')
-rw-r--r-- | routers/install.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/routers/install.go b/routers/install.go index 408ca108f6..df8a05651a 100644 --- a/routers/install.go +++ b/routers/install.go @@ -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 |