Added more possible config paths
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
konrad 2019-01-20 16:12:11 +01:00
parent 8362799a93
commit ca6862f6f9
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 11 additions and 1 deletions

View File

@ -17,6 +17,15 @@ first:
child: true
```
## Config file locations
Vikunja will search on various places for a config file:
* Next to the location of the binary
* In the `service.rootpath` location set in a config (remember you can set config arguments via environment variables)
* In `/etc/vikunja`
* In `~/.config/vikunja`
# Default configuration with explanations
This is the same as the `config.yml.sample` file you'll find in the root of vikunja.

View File

@ -84,8 +84,9 @@ func init() {
viper.AutomaticEnv()
// Load the config file
viper.AddConfigPath(exPath)
viper.AddConfigPath(viper.GetString("service.rootpath"))
viper.AddConfigPath("/etc/vikunja/")
viper.AddConfigPath("~/.config/vikunja")
viper.AddConfigPath(".")
viper.SetConfigName("config")
err = viper.ReadInConfig()