-
Notifications
You must be signed in to change notification settings - Fork 862
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
Environment variable values? #255
Comments
I would hope that erb or other tool would be a better fit for templating. |
Those do work, but then you have the interaction of template syntax and toml syntax; can the toml editor support be made to work with that? |
Seems like this is something that should be done on a post-push build step, meaning after you push it'll trigger a script that would inject the env vars into the doc. Heroku does similar steps like this when building the database.yml for a Rails project. |
Environment variable injection would be cool, but I think it falls outside the scope of TOML's goal of minimalism. TOML implementations could offer this as an option, or applications could provide it as well, both of which seem more appropriate than baking this behavior into the spec. Thanks for the thoughts! |
Before: meta_dir = "/home/user/.../go-apt-cacher/meta" cache_dir = "/home/user/.../go-apt-cacher/cache" After: meta_dir = "${HOME}/.../go-apt-cacher/meta" cache_dir = "${HOME}/.../go-apt-cacher/cache" In TOML spec, environment variable is not defined yet and it won't be added[1], but it is useful that environment variable is support in go-apt-cacher layer. [1] toml-lang/toml#255
In many hosting environments (Heroku and Docker come to mind), certain important application values such as DB host/port are provided via environment variables. Is there any recommended way to integrate this with a TOML config file?
Of course, I can establish a convention that certain properties in the config contain names of env variables instead of the actual values, but then I have to do type conversion/validation myself (such as for an integer value) instead of the TOML library doing it for me.
I think my ideal scenario would be the ability to do something like this:
where the environment variables get substituted into the file before parsing and its expected that
INTEGER_ENV_VAR
will contain something that would be valid to have there without quotes, etc etc.The text was updated successfully, but these errors were encountered: