ihippik / wal-listener

PostgreSQL WAL listener
Apache License 2.0
305 stars 43 forks source link

feat: override config values via environment variables #32

Closed jbergstroem closed 1 month ago

jbergstroem commented 6 months ago

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?

ihippik commented 6 months ago

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.

jbergstroem commented 6 months ago

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.

emidander commented 6 months ago

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

ihippik commented 3 months ago

sorry for the dellay, working on it

ihippik commented 1 month ago

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