wal-listener icon indicating copy to clipboard operation
wal-listener copied to clipboard

feat: override config values via environment variables

Open jbergstroem opened this issue 1 year ago • 3 comments

It would be great to be able to override/set config values through environment variables. I believe viper supports this out of the box; combining viper.SetEnvPrefix() and viper.AutomaticEnv() could be a good start?

jbergstroem avatar Apr 24 '24 12:04 jbergstroem

agreed, mb viper would not be a bad choice for initializing the config. I have a rather complex config structure so I didn’t use environment variables yet.

ihippik avatar Apr 28 '24 09:04 ihippik

agreed, mb viper would not be a bad choice for initializing the config. I have a rather complex config structure so I didn’t use environment variables yet.

It could be useful to have config mounted for all your environments, but override things like dsn/password/host between them.

jbergstroem avatar Apr 30 '24 10:04 jbergstroem

I would like this as well! For our Kubernetes setup it makes sense to override secrets (like Postgres password) using environement variables.

emidander avatar May 03 '24 06:05 emidander

sorry for the dellay, working on it

ihippik avatar Jul 19 '24 11:07 ihippik

https://github.com/ihippik/wal-listener/pull/45

ihippik avatar Sep 19 '24 15:09 ihippik