-
Notifications
You must be signed in to change notification settings 8000 - Fork 1.3k
Read environment variables from file #771
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
Comments
There is an |
Hi, This is not an appropriate answer, you are not only not answering to @standa4's question, but you are also treating him in a condescending way, like if he was stupid enough as for not reading the documentation that clearly states how to use the I'll exemplify his request with another example I think would be more helpful on depicting the issue... let's say I have a bash script with a conditional that checks some system parameters, and based on that sets one env with a value or a different one that I'll use in my program... it would be really helpful to be able of sourcing that file from the supervisord configuration file. (inb4 just create a bash wrapper that executes your program and call the wrapper from supervisord) Now the actual question was "are you planning to add this feature?" - Can we please get a yes/no answer (I'm guessing it's a "no" based on the date of this issue and the other related issues that were closed too), and, if you feel generous enough, an argument for your decision? Thanks |
The question asked for a single place to define environment variables, citing a desire to not modify multiple config files. Putting the variables in
There are not currently plans to add a separate type of config file just for environment variables. Since this has already been discussed in other issues, please refer to those issues. |
This comment has been minimized.
This comment has been minimized.
I came to this question - thinking that the original poster meant literally from a file ie a |
Agreed. Not being able to read this data from a file is a pretty big missing feature. I have a standard way of defining the env for all my programs, except supervisord. I'd +1 adding functionality for this. |
Same question. |
I've had to work around this by executing a bash script in the command that sources my .env file. |
I don't know how others are treating theirs supervisor's config files (service inis) but I am trying to use them as generic as possible and if some service needs to have env populated with some service specific variables then I want to (need to) source them somehow from envfile. Your answer is to hard-wire env vars inside the service config file?? There are already existing use-cases like this sshd service in the form of systemd unit:
|
Can you please share command detail? |
Is it resolved? |
Explaining a use case for this -- hashicorp's vault drops secrets into files. I'd like to be able to drop some authentication keys as a .env file with root only read permissions and have supervisord pick those up when I restart the service. (I don't want vault messing with the supervisord config files directly.) I think the only workaround is command='/bin/sh -c "source /var/lib/vault/secret.env && run_my_service"' edit: not sure why I said only workaround. Another work around is to make a shell script run_my_service_with_environment that sources the secret env vars. |
Thanks for sharing that workaround. As long as there are no plans on implementing the appreciated variable for service files, this is kind of a consolation. |
Hey, is this feature in pipeline? |
There are many use cases for this, .env files are widely used nowadays, I dont see a reason to not implement it. Also, specifying the vars under |
@balanikaran no, the issue is currently closed, so I guess it's ... not on the radar. Fingers crossed this gets a revival some day! |
another real argument is the "secret" nature of .env files, they often get their content out of an encrpyted file, and just cannot be written directly into a supervisor config file. as @rrauenza indirectly shows in his example. anyway, thanks for listening ;-) |
Moved from #1574
|
Scrolling through this, having similar need(s) |
Hello,
is it possible read the environment variables from file or are you planning to add this feature?
It would be useful in case where I have multiple applications managed by supervisord and these applications share the same env vars. I don't want to edit multiple conf files. These variables can be stored in one file and read from it.
Thank you.
The text was updated successfully, but these errors were encountered: