-
Notifications
You must be signed in to change notification settings - Fork 5
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
Set config values with environment variables #64
Comments
This branch can be tested with staging.tfrei.links-tech.org, which currently runs the envs branch. to do: think of test cases. I already tested if the env vars are set in config.py. One possible case would be whether twitter works if you supply consumer_key & consumer_secret via .env file. Where is the web/host variable even used inside the container? not sure. The contact variable is impossible to test because I think the container can't send mail atm. |
|
contact seems to work too, but sending mails doesn't work yet. |
Is your feature request related to a problem? Please describe.
The docker container in https://github.com/ticketfrei/docker-ticketfrei/ needs the option to set config values by environment variables. This would diminish the need for one of the shared volumes, and concentrate configuration in one docker-compose file.
It would be nice to keep the config.toml in the architecture though, if someone needs it - but override the values when environment variables are set.
Describe the solution you'd like
config.py should first check if there is a config file. If there is no config file, it should check if environment variables are set. If they are "", the default values from config.toml.example should be used. Else the environment variables should be used for the config values.
They don't need to be updated during runtime.
Describe alternatives you've considered
Additional context
Problem: If you want to set one of the values to "" by using an environment variable, the value would be overriden by the default value. This should not be a problem with our current config settings though.
The text was updated successfully, but these errors were encountered: