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

Preserve environment variables from the parent environment #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pre
Copy link

@pre pre commented Oct 9, 2017

It is useful to set runtime configuration with environment variables in Docker. Butterfly by default discards any environment variables set by the parent environment.

This PR copies env = os.environ and keeps them by passing --preserve-environment to /bin/su.

I did not test any other configurations than the one provided by --unsecure. This PR will probably break other configurations as-is. I am running Butterfly as a non-root user in Docker, without the ability to change the user. Access control is provided by a Nginx reverse proxy in the front.

It is useful to set runtime configuration with environment variables
in Docker. Butterfly by default discards any environment
variables set by the parent environment.
@paradoxxxzero
Copy link
Owner

Err maybe a cli flag like --preserve-environment would be better to avoid breaking the current login functionality. And using the if branch just above instead of overriding the env var would be cleaner.

@CPapadim
Copy link

CPapadim commented Dec 9, 2018

Any thoughts on adding this functionality?

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

Successfully merging this pull request may close these issues.

3 participants