I have a website up and running with nginx, and I have some content in my website that I want to manage with git so that others can collaborate.
Let us say that have a user named alice and that the root of the website is located somewhere within alice's home directory, as in /home/alice/website/index.html
Let us also assume that I have set up a git server via gitolite for access-control, the usage of which requires setting up a dummy user that we will call git. There are good reasons for this user being a separate one from alice.
I want alice's website to be able to show the content of some git repository web_repo.git, the origin of which is to be found in /home/git/web_repo.git, as the documentation for gitolite requires.
My first idea is to run a post-receive hook in the repository to sync it with some subdirectory of /home/alice/website, but that demands user git copying files into other user's (alice) home directory, which ends up in file permissions error.
There are certain constraints in my build that require the website to be hosted within alice's home directory, and I can't think of a secure and elegant solution to this problem.
I have just started managing this small server and I would kindly appreciate any insights.