From cb05b8325cdd85dda9bbebf61d8993da34d80e70 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 28 Mar 2014 08:39:35 -0400 Subject: Update config option --- conf/app.ini | 2 -- 1 file changed, 2 deletions(-) (limited to 'conf') diff --git a/conf/app.ini b/conf/app.ini index d988b4acbc..a3c749be01 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -33,8 +33,6 @@ PATH = data/gogs.db [security] INSTALL_LOCK = false -; Use HTTPS to clone repository, otherwise use HTTP. -ENABLE_HTTPS_CLONE = false ; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!! SECRET_KEY = !#@FDEWREWR&*( ; Auto-login remember days -- cgit v1.2.3 From a55941ff833155cba88dbcc957b15c0ddcf07cb4 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 28 Mar 2014 17:34:07 -0400 Subject: Add auto-detect home directory --- conf/app.ini | 2 +- modules/base/conf.go | 9 +++++++-- routers/repo/issue.go | 12 ++++++------ templates/install.tmpl | 2 +- templates/issue/view.tmpl | 18 ++++++++++-------- 5 files changed, 25 insertions(+), 18 deletions(-) (limited to 'conf') diff --git a/conf/app.ini b/conf/app.ini index a3c749be01..05c7745fc4 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -7,7 +7,7 @@ RUN_USER = git RUN_MODE = dev [repository] -ROOT = /Users/%(RUN_USER)s/git/gogs-repositories +ROOT = LANG_IGNS = Google Go|C|C++|Python|Ruby|C Sharp LICENSES = Apache v2 License|GPL v2|MIT License|Affero GPL|Artistic License 2.0|BSD (3-Clause) License diff --git a/modules/base/conf.go b/modules/base/conf.go index b3a987e646..fd77cfd3ce 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -291,9 +291,14 @@ func NewConfigContext() { PictureService = Cfg.MustValue("picture", "SERVICE") // Determine and create root git reposiroty path. - RepoRootPath = Cfg.MustValue("repository", "ROOT") + homeDir, err := com.HomeDir() + if err != nil { + fmt.Printf("Fail to get home directory): %v\n", err) + os.Exit(2) + } + RepoRootPath = Cfg.MustValue("repository", "ROOT", filepath.Join(homeDir, "git/gogs-repositories")) if err = os.MkdirAll(RepoRootPath, os.ModePerm); err != nil { - fmt.Printf("models.init(fail to create RepoRootPath(%s)): %v\n", RepoRootPath, err) + fmt.Printf("Fail to create RepoRootPath(%s): %v\n", RepoRootPath, err) os.Exit(2) } } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index c3d1a0d960..6ac8a53579 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -231,6 +231,12 @@ func Comment(ctx *middleware.Context, params martini.Params) { return } + content := ctx.Query("content") + if len(content) == 0 { + ctx.Redirect(fmt.Sprintf("/%s/%s/issues/%d", ctx.User.Name, ctx.Repo.Repository.Name, index)) + return + } + issue, err := models.GetIssueByIndex(ctx.Repo.Repository.Id, int64(index)) if err != nil { if err == models.ErrIssueNotExist { @@ -241,12 +247,6 @@ func Comment(ctx *middleware.Context, params martini.Params) { return } - content := ctx.Query("content") - if len(content) == 0 { - ctx.Handle(404, "issue.Comment", err) - return - } - switch params["action"] { case "new": if err = models.CreateComment(ctx.User.Id, issue.Id, 0, 0, content); err != nil { diff --git a/templates/install.tmpl b/templates/install.tmpl index be5a69186d..872982a0ad 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -133,7 +133,7 @@
- +    -    + {{if .Issue.IsClosed}} + + {{else}} + + {{end}}  
-- cgit v1.2.3 From d01820c125669367b7a585d767d5f11e73a701c2 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Sat, 29 Mar 2014 13:40:22 +0800 Subject: conf support mysql port --- conf/app.ini | 2 +- models/models.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'conf') diff --git a/conf/app.ini b/conf/app.ini index 05c7745fc4..abc27c39c4 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -20,7 +20,7 @@ HTTP_PORT = 3000 [database] ; Either "mysql", "postgres" or "sqlite3"(binary release only), it's your choice DB_TYPE = mysql -HOST = +HOST = 127.0.0.1:3306 NAME = gogs USER = root PASSWD = diff --git a/models/models.go b/models/models.go index 04a361c595..bafa1747e8 100644 --- a/models/models.go +++ b/models/models.go @@ -38,7 +38,7 @@ func SetEngine() { var err error switch DbCfg.Type { case "mysql": - orm, err = xorm.NewEngine("mysql", fmt.Sprintf("%s:%s@%s/%s?charset=utf8", + orm, err = xorm.NewEngine("mysql", fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8", DbCfg.User, DbCfg.Pwd, DbCfg.Host, DbCfg.Name)) case "postgres": orm, err = xorm.NewEngine("postgres", fmt.Sprintf("user=%s password=%s dbname=%s sslmode=%s", -- cgit v1.2.3