feat!(config): store sqlite file relative to rootpath (#934)
Moderately breaking change since in most cases the root path was already set next to the binary.
This commit is contained in:
parent
eac6c98bf1
commit
0145a8ba50
|
|
@ -366,7 +366,7 @@ func InitDefaultConfig() {
|
|||
DatabaseUser.setDefault("vikunja")
|
||||
DatabasePassword.setDefault("")
|
||||
DatabaseDatabase.setDefault("vikunja")
|
||||
DatabasePath.setDefault("./vikunja.db")
|
||||
DatabasePath.setDefault(filepath.Join(ServiceRootpath.GetString(), "vikunja.db"))
|
||||
DatabaseMaxOpenConnections.setDefault(100)
|
||||
DatabaseMaxIdleConnections.setDefault(50)
|
||||
DatabaseMaxConnectionLifetime.setDefault(10000)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import (
|
|||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -178,8 +179,9 @@ func initPostgresEngine() (engine *xorm.Engine, err error) {
|
|||
|
||||
func initSqliteEngine() (engine *xorm.Engine, err error) {
|
||||
path := config.DatabasePath.GetString()
|
||||
if path == "" {
|
||||
path = "./db.db"
|
||||
|
||||
if path != "memory" && !filepath.IsAbs(path) {
|
||||
path = filepath.Join(config.ServiceRootpath.GetString(), path)
|
||||
}
|
||||
|
||||
if path == "memory" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue