database configuration only via PG* env variables and MQTT password only via configured env var
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -5,7 +5,6 @@ import "log"
|
||||
import "os"
|
||||
|
||||
type HandlerConfigT struct {
|
||||
DatabaseConnStr string `json:"databaseConnStr"`
|
||||
Attributes map[string]string `json:"attributes"`
|
||||
}
|
||||
|
||||
@ -13,7 +12,8 @@ type ConfigT struct {
|
||||
Mqtt struct {
|
||||
Broker string `json:"broker"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
PasswordEnvVar string `json:"passwordEnvVar"`
|
||||
Password string
|
||||
TlsEnable string `json:"tlsEnable"`
|
||||
} `json:"mqtt"`
|
||||
TopicMappings []struct {
|
||||
@ -36,8 +36,8 @@ func LoadConfiguration() {
|
||||
log.Fatalf("Unable to parse configuration: %s", err)
|
||||
}
|
||||
|
||||
if Config.Mqtt.Password == "ENV" {
|
||||
Config.Mqtt.Password = os.Getenv("MQTT_PASSWORD")
|
||||
if Config.Mqtt.PasswordEnvVar != "" {
|
||||
Config.Mqtt.Password = os.Getenv(Config.Mqtt.PasswordEnvVar)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user