From 6cc11eccac3f802a1d539454e9785258065ae534 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Wed, 27 Feb 2019 10:55:08 -0600 Subject: [PATCH] Change sqlite DB path default to data directory (#6198) --- models/models.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/models.go b/models/models.go index b8fe588b5a..faa363e835 100644 --- a/models/models.go +++ b/models/models.go @@ -12,6 +12,7 @@ import ( "net/url" "os" "path" + "path/filepath" "strings" "code.gitea.io/gitea/modules/log" @@ -155,7 +156,7 @@ func LoadConfigs() { DbCfg.Passwd = sec.Key("PASSWD").String() } DbCfg.SSLMode = sec.Key("SSL_MODE").MustString("disable") - DbCfg.Path = sec.Key("PATH").MustString("data/gitea.db") + DbCfg.Path = sec.Key("PATH").MustString(filepath.Join(setting.AppDataPath, "gitea.db")) DbCfg.Timeout = sec.Key("SQLITE_TIMEOUT").MustInt(500) }