updated config
parent
7be40e0154
commit
839857807e
|
@ -41,11 +41,9 @@ func LoadConfig() {
|
|||
fmt.Println("Load env from system")
|
||||
}
|
||||
|
||||
Cfg = Config{
|
||||
config := Config{
|
||||
Debug: os.Getenv("DEBUG") == "true",
|
||||
ColorizedOutput: os.Getenv("COLORIZED_OUTPUT") == "true",
|
||||
Host: os.Getenv("HOST"),
|
||||
Port: os.Getenv("PORT"),
|
||||
LogManagerServerUrl: os.Getenv("LOG_MANAGER_SERVER_URL"),
|
||||
Telegram: Telegram{
|
||||
Debug: os.Getenv("TELEGRAM_DEBUG") == "true",
|
||||
|
@ -59,4 +57,15 @@ func LoadConfig() {
|
|||
DatabaseName: os.Getenv("MARIADB_DATABASE_NAME"),
|
||||
},
|
||||
}
|
||||
|
||||
// load default values if not in docker
|
||||
if os.Getenv("DOCKER") == "" {
|
||||
config.Host = os.Getenv("HOST")
|
||||
config.Port = os.Getenv("PORT")
|
||||
} else { // load from docker env
|
||||
config.Host = "0.0.0.0"
|
||||
config.Port = "3000"
|
||||
}
|
||||
|
||||
Cfg = config
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue