diff --git a/.gitignore b/.gitignore index c369c7d..f31e070 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,5 @@ coverage.txt */node_modules/ **/*-packr.go config.yml -gotify.db +data/ images/ \ No newline at end of file diff --git a/README.md b/README.md index 5d17d20..8165971 100644 --- a/README.md +++ b/README.md @@ -55,18 +55,18 @@ server: letsencrypt: enabled: false # if the certificate should be requested from letsencrypt accepttos: false # if you accept the tos from letsencrypt - cache: certs # the directory of the cache from letsencrypt + cache: data/certs # the directory of the cache from letsencrypt hosts: # the hosts for which letsencrypt should request certificates - mydomain.tld - myotherdomain.tld database: # for database see (configure database section) dialect: sqlite3 - connection: gotify.db + connection: data/gotify.db defaultuser: # on database creation, gotify creates an admin user name: admin # the username of the default user pass: admin # the password of the default user passstrength: 10 # the bcrypt password strength (higher = better but also slower) -uploadedimagesdir: images # the directory for storing uploaded images +uploadedimagesdir: data/images # the directory for storing uploaded images ``` ### Environment diff --git a/config/config.go b/config/config.go index 6a02c72..91e4d50 100644 --- a/config/config.go +++ b/config/config.go @@ -20,21 +20,21 @@ type Configuration struct { LetsEncrypt struct { Enabled *bool `default:"false"` AcceptTOS *bool `default:"false"` - Cache string `default:"certs"` + Cache string `default:"data/certs"` Hosts []string } } } Database struct { Dialect string `default:"sqlite3"` - Connection string `default:"gotify.db"` + Connection string `default:"data/gotify.db"` } DefaultUser struct { Name string `default:"admin"` Pass string `default:"admin"` } PassStrength int `default:"10"` - UploadedImagesDir string `default:"images"` + UploadedImagesDir string `default:"data/images"` } // Get returns the configuration extracted from env variables or config file.