mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 13:49:13 -05:00
Merge branch 'develop' of github.com:gogits/gogs into develop
This commit is contained in:
commit
86abd34eb8
2 changed files with 19 additions and 2 deletions
12
.editorconfig
Normal file
12
.editorconfig
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# http://editorconfig.org
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
|
@ -89,8 +89,13 @@ func getEngine() (*xorm.Engine, error) {
|
||||||
cnnstr := ""
|
cnnstr := ""
|
||||||
switch DbCfg.Type {
|
switch DbCfg.Type {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
cnnstr = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8",
|
if DbCfg.Host[0] == '/' { // looks like a unix socket
|
||||||
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name)
|
cnnstr = fmt.Sprintf("%s:%s@unix(%s)/%s?charset=utf8",
|
||||||
|
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name)
|
||||||
|
} else {
|
||||||
|
cnnstr = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8",
|
||||||
|
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name)
|
||||||
|
}
|
||||||
case "postgres":
|
case "postgres":
|
||||||
var host, port = "127.0.0.1", "5432"
|
var host, port = "127.0.0.1", "5432"
|
||||||
fields := strings.Split(DbCfg.Host, ":")
|
fields := strings.Split(DbCfg.Host, ":")
|
||||||
|
|
Loading…
Reference in a new issue