From 59d3128711c0222092135e93ca788d388aacd573 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Tue, 19 Jan 2021 00:37:04 +0100 Subject: Dump notes on how to setup cgit --- guides/cloud/git.org | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 guides/cloud/git.org (limited to 'guides/cloud') diff --git a/guides/cloud/git.org b/guides/cloud/git.org new file mode 100644 index 0000000..109f306 --- /dev/null +++ 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 -- cgit v1.2.3