Merge pull request #227 from ziprandom/read_config_settings_from_env

server: additionally read config settings from env
This commit is contained in:
Jesús Espino 2021-04-06 12:04:52 +02:00 committed by GitHub
commit 5e292ad77b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,8 @@ func ReadConfigFile() (*Configuration, error) {
viper.SetConfigName("config") // name of config file (without extension)
viper.SetConfigType("json") // REQUIRED if the config file does not have the extension in the name
viper.AddConfigPath(".") // optionally look for config in the working directory
viper.SetEnvPrefix("focalboard")
viper.AutomaticEnv() // read config values from env like FOCALBOARD_SERVERROOT=...
viper.SetDefault("ServerRoot", DefaultServerRoot)
viper.SetDefault("Port", DefaultPort)
viper.SetDefault("DBType", "sqlite3")