Added more config paths #55

Merged
konrad merged 1 commits from more-config into master 2019-01-20 17:13:21 +00:00
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()