[FLI-907] config: add ability to specify env vars #2844
Labels
enhancement
Created by Linear-GitHub Sync
go
good first issue
help wanted
Halp
md
Not too big, not too small
Problem
Currently, Flipt supports configuration via YAML or ENV vars (https://www.flipt.io/docs/configuration/overview). Environment variables override config files. Env var keys that Flipt supports comes directly from the keys of the YAML config.
What we don't currently allow is specifying env vars in the conf file format.
Why this could be a problem is the env var keys become exceptionally long depending on how deeply nested the corresponding YAML config is. Example:
authentication.methods.oidc.providers.github.client_id
in YAML becomesFLIPT_AUTHENTICATION_METHODS_OIDC_PROVIDERS_GITHUB_CLIENT_ID
as an env var.Ideal Solution
It would be nice if we could provide a 'shortcut' for specifying configuration in YAML that would allow users to specify env var keys that we should look in for the correct value.
Ie:
"${env:FLIPT_GITHUB_CLIENT_ID}"
This would allow users to swap in whatever env var keys they want and we could look for those values at startup, failing fast if we cant find the env var value.
Search
Additional Context
Since we use Viper for config parsing, I think we could use some of the tactics described in this blog post: https://sagikazarmark.hu/blog/decoding-custom-formats-with-viper/ to decode a value that follows with the above format
${env:value}
FLI-907
The text was updated successfully, but these errors were encountered: