Open georgeboot opened 1 year ago
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
@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?
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!
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
.
@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.
Create storage dirs with 777 permissions, so that php-fpm can access the directory (it runs as user nobody).
Fixes #117