Mentoring session: fixing cgit permission error
This is the second post that is a summary of K. helping me learn more about system admin, IT, the cli, etc.
This time we worked on fixing a permission error on a cgit instance I tried to set up a few months ago. You can see the whole set up process I followed there: https://yctct.com/cgit-instance-set-up, however, at the end of the set up I had a permission error: the user managing cgit could not access the repositories that are hosted on the same VPS.
To see what was going on we first looked at the error log of nginx:
# tail /var/log/nginx/error.log
to find that error again.
Then, we checked the cgit config:
# grep cgit /etc/nginx/sites-available/*
to see if we could learn something from there.
Then, we tried to see which user was running the cgit process:
# ps auwx | grep cgit
No clue in the output.
So we assumed that the user www-data ran the cgit process — I don’t remember why to be honest.
So we changed the group owner of the directory where the repositories live, so that the user running the cgit process can access the repositories:
# chgrp -R www-data /path/to/repositories/
Then, as far as I can remember (we did this a few days ago), we also gave execution access to the group:
# chmod g+x /path/to/repositories/
We also had to do this for the directories of single repositories. I don’t know if we could have done that recursively, probably.
Since then, I added a repository to the directory repositories
, on the VPS, and it looks like I have to modify permissions for the content of that repository to show up on git.yctct.com. I need to look for a way to simply this, so when I add a repository to cgit, it shows up.
personal computing command-line interface (cli) gnu linux trisquel shell literacy wiki mentoring cgit