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

Create storage directories as 777 #118

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

Create storage directories as 777 #118

wants to merge 1 commit into from

Conversation

georgeboot
Copy link
Contributor

@georgeboot georgeboot commented May 5, 2023

Create storage dirs with 777 permissions, so that php-fpm can access the directory (it runs as user nobody).

Fixes #117

@mattrenner
Copy link

Could be my specific use-case or environment, but might be worth noting that I ran into this problem as well but the above didn't work due to the default umask of the root user, which drops the applied permission back down to 0755.

Clearing the umask temporarily with umask(0) (and then putting it back) resolves this for me.

I'm not going to pretend I already knew this and didn't spend a morning smacking my head into the wall! https://stackoverflow.com/a/3997671

@mnapoli
Copy link
Member

mnapoli commented May 9, 2023

@mattrenner whole TIL about umask, thanks for sharing.

I'm 👍 to merge this, I don't think it hurts anything (PHP should have access to write this directory, and there shouldn't be any other user, so I don't see a security issue), but maybe we should change off and on the umask too then?

@FRoepstorf
Copy link

Stumbled upon the same issue, only locally though:
Just changing the permissions to 0777 did not work, changing and resetting the umask did the trick!

@deleugpn
Copy link
Member

deleugpn commented Jul 2, 2023

The way I handle this sort of issue is to configure my local container to run with the nobody user, which matches the FPM configration that Bref ships. With docker compose it's as easy as setting your container with user: nobody.

@mnapoli
Copy link
Member

mnapoli commented Jul 2, 2023

@deleugpn do you see a way for us to fix this for all users? Would it make sense to change the user in Docker images for example, or could that mess things up? I haven't taken the time to dig into this.

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.

storage directory creation causes permission issues with bref/php-82-fpm-dev:2
6 participants