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

Fixed bash history folder permissions #308

Merged
merged 3 commits into from
Feb 23, 2021
Merged

Fixed bash history folder permissions #308

merged 3 commits into from
Feb 23, 2021

Conversation

Den4ik
Copy link

@Den4ik Den4ik commented Feb 19, 2021

Related PR #304

I faced with folder permissions that prevent history file creation.
This PR provides fix for bash history folder permissions.

@davidalger I'm not sure that it's best solution, but currently, I don't have any ideas.

davidalger added a commit that referenced this pull request Feb 23, 2021
The value for CHOWN_DIR_LIST has been set in docker-compose config since c64b999; this must be removed in order to allow for overrides such as #308 to work.
@davidalger
Copy link
Collaborator

This is a working solution on Mac OS environments, but doesn't apply to Linux (which will suffer the same issue, since it's due to Docker volumes being created as root:root no matter what).

Side effect (not sure this is a big deal really given these are dev-only containers) is /var is also chown'd since the CHOWN_DIR_LIST loop walks up the path:

$ ls -lhd /var
drwxr-xr-x 1 www-data www-data 4.0K Feb 23 04:37 /var

The only alternate solution I can think of would be a modification to the entrypoint script, but that would also require any one updating Warden to pull latest images (or suffer having bash history stop working between warden shell invocations).

I think the side-effect of using CHOWN_DIR_LIST is fine, so let's add CHOWN_DIR_LIST=${CHOWN_DIR_LIST:-} to the php-fpm.base.yml as well so the exported value will be included on Linux configurations as well.

@Den4ik
Copy link
Author

Den4ik commented Feb 23, 2021

The only alternate solution I can think of would be a modification to the entrypoint script, but that would also require any one updating Warden to pull latest images (or suffer having bash history stop working between warden shell invocations).

Agree. I thought about it, but as you noted it requires to rebuild images and pull the latest from docker hub

@Den4ik
Copy link
Author

Den4ik commented Feb 23, 2021

@davidalger I have moved CHOWN_DIR_LIST into php-fpm.base.yml and mount into /bash_history instead of /var/bash_history
Also, I added WARDEN_CHOWN_DIR_LIST variable that allows defining custom chown list at project .env file

@davidalger davidalger added this to the Warden 0.10.1 milestone Feb 23, 2021
davidalger added a commit that referenced this pull request Feb 23, 2021
@davidalger davidalger merged commit 4c7967e into wardenenv:develop Feb 23, 2021
@Den4ik Den4ik deleted the fixed-history-folder-permissions branch April 21, 2021 07:51
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.

2 participants