diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-10 23:03:17 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-10 23:03:17 -0400 |
commit | 6ce9d800d014f5d440271e628c538ce823bbe263 (patch) | |
tree | 5a34f667120bccf8e95a52dddf8ea49fcb8288f6 /models/models.go | |
parent | 52837e3d36658cd58076ee0b9d9d99800b5ade88 (diff) | |
download | gitea-6ce9d800d014f5d440271e628c538ce823bbe263.tar.gz gitea-6ce9d800d014f5d440271e628c538ce823bbe263.zip |
Add custom.ini
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/models/models.go b/models/models.go index 7dfc0aaf0a..0566824759 100644 --- a/models/models.go +++ b/models/models.go @@ -7,7 +7,6 @@ package models import ( "fmt" "os" - "os/user" _ "github.com/go-sql-driver/mysql" "github.com/lunny/xorm" @@ -47,16 +46,7 @@ func setEngine() { dbUser := base.Cfg.MustValue("database", "USER") dbPwd := base.Cfg.MustValue("database", "PASSWD") - uname, err := user.Current() - if err != nil { - fmt.Printf("models.init -> fail to get user: %s\n", err) - os.Exit(2) - } - - if uname.Username == "jiahuachen" { - dbPwd = base.Cfg.MustValue("database", "PASSWD_jiahua") - } - + var err error switch dbType { case "mysql": orm, err = xorm.NewEngine("mysql", fmt.Sprintf("%v:%v@%v/%v?charset=utf8", @@ -83,9 +73,6 @@ func setEngine() { //log.Trace("Initialized database -> %s", dbName) RepoRootPath = base.Cfg.MustValue("repository", "ROOT") - if uname.Username == "jiahuachen" { - RepoRootPath = base.Cfg.MustValue("repository", "ROOT_jiahuachen") - } } func init() { |