-
Notifications
You must be signed in to change notification settings - Fork 57
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
[IMP] Expand env vars in config #8
Conversation
lasley
commented
Jan 21, 2017
- Add optional environment variable expansion for the config file
* Add optional environment variable expansion for the config file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lacks proper docs in README.
Oops I knew I was forgetting something! Documentation updated |
2 similar comments
Coverage drop is due to more lines being added in the ReadMe it seems. I submitted #9 for that. |
@lasley IMO Variable expansion should be the default. A plus should be to keep a parameter to disable the expansion. |
@lmignon Making it the default sounds good to me - not being a core contributor to this repo, I was trying to make the change as silently as possible for the proposal. @sbidoul Yeah there could be some security implications here, as with most things using environment vars. An example of a harmful act that could be performed with this is the using a Travis Secret env var in a test & dumping it to console. This would require a merge to master though, because the Travis secures are not exposed to forks. I'm sure some other dangerous things could be thought of as well, but that's the main one I watch out for in PRs with systems that include env expansion. As with most security holes, the tradeoff is usability. In my specific instance, these env vars enhance usability of this application quite a bit in the context of Docker. |
I prefer to keep the explicit activation of the substitution mode. |
@@ -89,6 +89,16 @@ def get_parser(): | |||
type=_log_level_string_to_int, | |||
nargs='?', | |||
help='Set the logging output level. {0}'.format(_LOG_LEVEL_STRINGS)) | |||
|
|||
main_parser.add_argument( | |||
'-e', '--expand-env', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @pedrobaeza in Tecnativa@50467a3#commitcomment-20682952:
this is an incorrect use of parse arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct use is:
main_parser.add_argument(
'-e', '--expand-env',
dest='expand_env',
action='store_true',
help='Expand environment variables in configuration file',
)