Commit 99afe61b authored by qiuqunfeng's avatar qiuqunfeng
Browse files

Add environment variable support for Elasticsearch and Kafka passwords in configuration loading

parent b1f53e07
......@@ -56,5 +56,15 @@ func LoadConfig() *Config {
log.Err(err).Msg("Failed to parse config file")
return nil
}
esPassword := os.Getenv("ELASTIC_PASSWORD")
if esPassword != "" {
config.ElasticsearchConfig.Password = esPassword
}
kafkaPassword := os.Getenv("KAFKA_PASSWORD")
if kafkaPassword != "" {
config.KafkaConfig.Password = kafkaPassword
}
return &config
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment