Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use environment variables in config #21

Closed
Malanius opened this issue Apr 11, 2023 · 2 comments · Fixed by #22
Closed

Unable to use environment variables in config #21

Malanius opened this issue Apr 11, 2023 · 2 comments · Fixed by #22

Comments

@Malanius
Copy link
Contributor

Malanius commented Apr 11, 2023

Hello, I'd like to have the possibility to reference environment variables inside the configuration file. For now, it doesn't seem to work or I didn't figure out how to do that.

For example, I have bloom packed inside a docker container along with the backend and I'd like to reuse the same image on different environments and be able to configure the Redis host as each environment has its own cluster with REDIST_HOST env var.
The rest of the backend configuration is done through environment variables (following the 12fa principles) and it would be great to have the same possibility in bloom as well.

For now, I can work around this by replacing some placeholder value in the config using entry point script, but that doesn't feel as clean and it's quite rare to find something that doesn't support configuration from env vars nowadays 🙂

PS: I might be able to hack on this, but never done something in Rust before so I would need some pointers on how to deal with this.

@valeriansaliou
Copy link
Owner

Hello! Someone has already done a PR for Sonic, another Rust project of mine: valeriansaliou/sonic#148

I'm accepting any PR on this if you're willing to work on it :) Note that I may have refactored the env var reader code in Sonic, so you may look at the env var parsing code from the master branch instead of the original PR I provided here.

@Malanius
Copy link
Contributor Author

Thanks, that will be helpful! I'll take a look at how it's done in sonic and if it is something I could reimplement for bloom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants