I use a central HUB which does an auto deploy to a productive web server if there are changes in the main branch. Now the setup runs in file permission problems.
If I do a push I want to preserve the group owner inherited by the root dictionary. At the same time I want to have the following permissions:
- there is only one user: 'deploy_git'
- files should belong to the group 'www-data'
- file permissions should be set to 750 for dictionaries and to 640 for all other files.
A post-receive is already created which does the auto deploy. It is working like intended. But I can't manage to save the group owner for the dictionaries. u+s does not preserve the group owner and g+s is not working because the group has no write access to dictionaries.
I did already recharges for two days without a solution. :-(
This is where POSIX ACLs come in:
The
setfacl
manpage will tell you exactly what's going on, but essentially the first command just sets an ACL for thewww-data
group to be able to read all files, and read+execute all directories, under/some/directory
. The second command sets the "defaults" for new files and directories under/some/directory
, so that any files created later will correctly inherit the ACL, too.