commit 59d3128711c0222092135e93ca788d388aacd573 parent 759f11dc50b2f3694051dd71d0ae6f0bc81a62ae Author: Kévin Le Gouguec <kevin.legouguec@gmail.com> Date: Tue, 19 Jan 2021 00:37:04 +0100 Dump notes on how to setup cgit Diffstat:
| A | guides/cloud/git.org | | | 41 | +++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 41 insertions(+), 0 deletions(-)
diff --git a/guides/cloud/git.org b/guides/cloud/git.org @@ -0,0 +1,41 @@ +Necessary configurations for running cgit behind nginx on Debian. +* nginx +In =/etc/nginx/sites-available/git.domain.tld=: +#+begin_src +server { + listen 80; + listen [::]:80; + + server_name git.domain.tld; + + root /usr/share/cgit; + try_files $uri @cgit; + + location @cgit { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; + fastcgi_param PATH_INFO $uri; + fastcgi_param QUERY_STRING $args; + fastcgi_param HTTP_HOST $server_name; + fastcgi_pass unix:/run/fcgiwrap.socket; + } +} +#+end_src +* cgit +In =/etc/cgitrc=: +#+begin_src conf +css=/cgit.css +logo=/cgit.png +virtual-root=/ + +scan-path=/srv/git +#+end_src +* git +#+begin_src sh +$ echo $(which git-shell) >> /etc/shells +$ chsh git -s $(which git-shell) +$ mkdir /srv/git +$ chown git:www-data /srv/git +# Each time a repository is added: +$ git -C /srv/git/$repo config core.sharedRepository 0640 +#+end_src