From 530dc81a1cb0c82f55dcbdca3b32bae0d1a81846 Mon Sep 17 00:00:00 2001 From: ziprandom Date: Thu, 1 Apr 2021 10:36:56 +0000 Subject: [PATCH] server: additionally read config settings from env make the server app read configuration settings from execution environment to make server deployments more convenient. --- server/services/config/config.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/services/config/config.go b/server/services/config/config.go index 824406bf0..6f4da9822 100644 --- a/server/services/config/config.go +++ b/server/services/config/config.go @@ -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")