HI @balonik,
Thanks for paying attention.
The permission of all directories in /var/www are the same of those below.
ls -l /var/www
drwxrwxr-x 17 gitlab-runner www-data 4096 Jun 8 20:06 example.com
It seems something changes the permissions.
umask of gitlab-runner is 0002, which means that the new files and directories which are created have the right permissions.
@balonik
i found what the problem is, but i am not sure if the fix won’t break s.t. else
So, although user gitlab-runner is member of www-data its primary group is gitlab-runner
So in some cases it changes the group of the directory where copies files.
Now the question is can i change the primary group of gitlab-runner to www-data ???
Hello @bgfr, I encountered a similar issue specifically when trying to copy existing files, such as those within .git. I want to mention that my gitlab-runner user has the same permissions as yours. And also Apache2 server on Ubuntu 22.04.
I was able to resolve the problem by forcefully copying the files using cp -rf into the destination directory. I’m not entirely certain if this approach would be applicable in your case as well.