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

[Feature Request] Automatically load config values for specific keys from files #1022

Open
kolaente opened this issue Nov 11, 2020 · 4 comments

Comments

@kolaente
Copy link

kolaente commented Nov 11, 2020

It would be great if viper had the ability to automatically load config values for specific keys from files, by adding a _FILE suffix to the env variable or config variable name.

For example, if I have a config variable which I can configure with the EXAMPLE env variable I would like to populate that config value from the file at /path/to/file if I set the variable EXAMPLE_FILE=/path/to/file. This would enable support for docker secrets out of the box.

Maybe a feature for v2?

@github-actions
Copy link

👋 Thanks for reporting!

A maintainer will take a look at your issue shortly. 👀

In the meantime: We are working on Viper v2 and we would love to hear your thoughts about what you like or don't like about Viper, so we can improve or fix those issues.

⏰ If you have a couple minutes, please take some time and share your thoughts: https://forms.gle/R6faU74qPRPAzchZ9

📣 If you've already given us your feedback, you can still help by spreading the news,
either by sharing the above link or telling people about this on Twitter:

https://twitter.com/sagikazarmark/status/1306904078967074816

Thank you! ❤️

@kolaente
Copy link
Author

Looks like there's even a pr from 2015 about this: #94

@sagikazarmark
Copy link
Collaborator

V2 will change a lot of aspects of config loading, so this might be easier to implement, but I don't think it's high on the priority list.

You'll probably be able to implement it for yourself if/when #1046 lands, but I'm not sure this is something we want to maintain in the core.

@kolaente
Copy link
Author

@sagikazarmark I see, thanks for the explanation.

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

No branches or pull requests

2 participants