Open genofire opened 2 years ago
Previously discussed in #1958, #393.
Oh sorry, have not looked after closed/rejected issues :(
Sad, will you accept MRs with Viper? If somebody else dies it?
The conclusion we've come to in the past is that we might end up doing this in the future, but we probably won't do it now. This increases the configuration surface area considerably and the configuration format isn't completely stable yet anyway, so it's easier for us to deal with one thing for now: the configuration file.
In best, only structure should be used for everything and env-variables names should be generetes (like the yaml
from the same struct
)
The question is, are you willing to merge a PR, if it make nothing change for the way of yaml-file structure and internel config struct
... just the parsing of env variables also.
@neilalexander i started to implement a solution. if i finish it would you merge?
Any suggestion / tips for easier review later?
We intend to officially support k8s/Helm environments in the future. This means we will be heading in the direction of configuration with env vars, but we aren't there yet. The aforementioned concerns remain valid:
This increases the configuration surface area considerably and the configuration format isn't completely stable yet anyway, so it's easier for us to deal with one thing for now: the configuration file.
Especially with our team smaller than before, we cannot devote time to extending the configuration surface area at this time unfortunately.
What do you think about piping a raw yaml config content over something like envsubst in go. @kegsay
thats what the koanf PR hase done ...
Problem:
In a K8s it is really common to run dependencies by other applications like an database operator (zalando's postgres operator). Which generates k8s secrets, for credentials like username and password.
It would be nice to use them directly (instatt of generate configfiles, stored in new k8s secrets with helm or other tooling). Therefore exists the possibility to use envFromSecrets in k8s deployments.
Description/Solution:
So please make it possible to give dendrite configuration parameters with env variables.
Implemented Suggested:
Maybe you like to use the golang library viper and cobra from spf13 for it.