changes
This commit is contained in:
@@ -14,7 +14,7 @@ type ConfigT struct {
|
||||
Mqtt struct {
|
||||
Broker string `json:"broker"`
|
||||
Username string `json:"username"`
|
||||
Password string
|
||||
Password string `json:"password"`
|
||||
TlsEnable string `json:"tlsEnable"`
|
||||
} `json:"mqtt"`
|
||||
IncludeTopics []string `json:"includeTopics"`
|
||||
@@ -37,5 +37,8 @@ func LoadConfiguration() {
|
||||
log.Fatalf("Unable to parse configuration: %s", err)
|
||||
}
|
||||
|
||||
Config.Mqtt.Password = os.Getenv("MQTT_PASSWORD")
|
||||
// Load password from environment variable only if not set in config
|
||||
if Config.Mqtt.Password == "" {
|
||||
Config.Mqtt.Password = os.Getenv("MQTT_PASSWORD")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user