diff --git a/config.yml.sample b/config.yml.sample index 5aabc15ad..293939cca 100644 --- a/config.yml.sample +++ b/config.yml.sample @@ -47,7 +47,7 @@ database: # Databse to use database: "vikunja" # When using sqlite, this is the path where to store the data - Path: "./vikunja.db" + path: "./vikunja.db" # Sets the max open connections to the database. Only used when using mysql and postgres. maxopenconnections: 100 # Sets the maximum number of idle connections to the db. @@ -185,11 +185,11 @@ avatar: backgrounds: # Whether to enable backgrounds for lists at all. - enabled: false + enabled: true providers: upload: # Whethere to enable uploaded list backgrounds - enabled: false + enabled: true unsplash: # Whether to enable setting backgrounds from unsplash as list backgrounds enabled: false diff --git a/docs/content/doc/setup/config.md b/docs/content/doc/setup/config.md index 576f7643c..8132798f0 100644 --- a/docs/content/doc/setup/config.md +++ b/docs/content/doc/setup/config.md @@ -90,7 +90,7 @@ database: # Databse to use database: "vikunja" # When using sqlite, this is the path where to store the data - Path: "./vikunja.db" + path: "./vikunja.db" # Sets the max open connections to the database. Only used when using mysql and postgres. maxopenconnections: 100 # Sets the maximum number of idle connections to the db. @@ -228,11 +228,11 @@ avatar: backgrounds: # Whether to enable backgrounds for lists at all. - enabled: false + enabled: true providers: - upload: + upload: # Whethere to enable uploaded list backgrounds - enabled: false + enabled: true unsplash: # Whether to enable setting backgrounds from unsplash as list backgrounds enabled: false diff --git a/go.mod b/go.mod index 3770dc5fe..759824ced 100644 --- a/go.mod +++ b/go.mod @@ -55,7 +55,7 @@ require ( github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/pelletier/go-toml v1.4.0 // indirect github.com/pquerna/otp v1.2.0 - github.com/prometheus/client_golang v1.7.0 + github.com/prometheus/client_golang v1.7.1 github.com/samedi/caldav-go v3.0.0+incompatible github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd @@ -67,7 +67,7 @@ require ( github.com/swaggo/swag v1.6.3 github.com/ulule/limiter/v3 v3.5.0 github.com/urfave/cli v1.22.2 // indirect - golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/lint v0.0.0-20200302205851-738671d3881b golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect golang.org/x/text v0.3.3 // indirect diff --git a/go.sum b/go.sum index 92cd9afc6..e313ce759 100644 --- a/go.sum +++ b/go.sum @@ -477,6 +477,8 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U= github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f h1:BVwpUVJDADN2ufcGik7W992pyps0wZ888b/y9GXcLTU= @@ -635,6 +637,8 @@ golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 h1:vEg9joUBmeBcK9iSJftGNf3coIG4HqZElCPehJsfAYM= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index 3856aef92..9b691ebc6 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -20,6 +20,7 @@ import ( "code.vikunja.io/api/pkg/version" "fmt" "github.com/spf13/cobra" + "runtime" ) func init() { @@ -31,5 +32,6 @@ var versionCmd = &cobra.Command{ Short: "Print the version number of Vikunja", Run: func(cmd *cobra.Command, args []string) { fmt.Printf("Vikunja api version %s\n", version.Version) + fmt.Printf("Built with %s\n", runtime.Version()) }, } diff --git a/pkg/config/config.go b/pkg/config/config.go index 9776cfc12..6df774412 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -253,8 +253,8 @@ func InitDefaultConfig() { AvatarProvider.setDefault("gravatar") AvatarGravaterExpiration.setDefault(3600) // List Backgrounds - BackgroundsEnabled.setDefault(false) - BackgroundsUploadEnabled.setDefault(false) + BackgroundsEnabled.setDefault(true) + BackgroundsUploadEnabled.setDefault(true) BackgroundsUnsplashEnabled.setDefault(false) } diff --git a/pkg/db/db.go b/pkg/db/db.go index 5b85b4253..687e2b2b5 100644 --- a/pkg/db/db.go +++ b/pkg/db/db.go @@ -23,6 +23,7 @@ import ( "fmt" xrc "gitea.com/xorm/xorm-redis-cache" "net/url" + "os" "strconv" "strings" "time" @@ -168,6 +169,13 @@ func initSqliteEngine() (engine *xorm.Engine, err error) { path = "./db.db" } + // Try opening the db file to return a better error message if that does not work + file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0) + if err != nil { + return nil, fmt.Errorf("could not open database file [uid=%d, gid=%d]: %s", os.Getuid(), os.Getgid(), err) + } + _ = file.Close() // We directly close the file because we only want to check if it is writable. It will be reopened lazily later by xorm. + return xorm.NewEngine("sqlite3", path) } diff --git a/pkg/migration/migration.go b/pkg/migration/migration.go index c6970bf8c..6d268f5aa 100644 --- a/pkg/migration/migration.go +++ b/pkg/migration/migration.go @@ -42,7 +42,7 @@ func initMigration(x *xorm.Engine) *xormigrate.Xormigrate { var err error x, err = db.CreateDBEngine() if err != nil { - log.Criticalf("Could not connect to db: %v", err.Error()) + log.Fatalf("Could not connect to db: %v", err.Error()) return nil } } diff --git a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go index 3a5aac700..d4ea301a3 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/histogram.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/histogram.go @@ -607,7 +607,7 @@ func NewConstHistogram( } // MustNewConstHistogram is a version of NewConstHistogram that panics where -// NewConstMetric would have returned an error. +// NewConstHistogram would have returned an error. func MustNewConstHistogram( desc *Desc, count uint64, diff --git a/vendor/modules.txt b/vendor/modules.txt index 1107b17c9..842fc2d47 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -157,7 +157,7 @@ github.com/pmezard/go-difflib/difflib github.com/pquerna/otp github.com/pquerna/otp/hotp github.com/pquerna/otp/totp -# github.com/prometheus/client_golang v1.7.0 +# github.com/prometheus/client_golang v1.7.1 github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal github.com/prometheus/client_golang/prometheus/promauto @@ -236,7 +236,7 @@ github.com/urfave/cli github.com/valyala/bytebufferpool # github.com/valyala/fasttemplate v1.1.0 github.com/valyala/fasttemplate -# golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 +# golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/crypto/acme golang.org/x/crypto/acme/autocert golang.org/x/crypto/bcrypt