diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2022-07-16 20:03:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-16 20:03:10 +0000 |
| commit | 0e72771c25c6bf0dd38b7a9c0332e104df8c15d0 (patch) | |
| tree | 212725eb806590df677b261aa33945756b399e52 | |
| parent | be350388d946003c39fa6bf2cd311c71a33c5fec (diff) | |
| parent | 7ca77d1d8953e3ac6fe8283ed32cdb6cac0706e2 (diff) | |
Merge pull request #214 from arielcostas/cgit-https
cgit: add guide for cloning via HTTPS
| -rw-r--r-- | content/cgit.md | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/content/cgit.md b/content/cgit.md index 70104a9..63bcf80 100644 --- a/content/cgit.md +++ b/content/cgit.md @@ -48,6 +48,16 @@ server { root /usr/share/cgit ; try_files $uri @cgit ; + location ~ /.+/(info/refs|git-upload-pack) { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; + fastcgi_param PATH_INFO $uri; + fastcgi_param GIT_HTTP_EXPORT_ALL 1; + fastcgi_param GIT_PROJECT_ROOT /srv/git; + fastcgi_param HOME /srv/git; + fastcgi_pass unix:/run/fcgiwrap.socket; + } + location @cgit { include fastcgi_params; fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi; @@ -58,7 +68,9 @@ server { } ``` -Then get NGINX to reload your configuration. +Then get NGINX to reload your configuration. This configuration also enables +cloning via HTTPS, so make sure to point the `fastcgi_param GIT_PROJECT_ROOT` +to the directory where you store your repositories. ## Configuring cgit @@ -70,6 +82,7 @@ configure Cgit to our liking, by editing `/etc/cgitrc`. css=/cgit.css logo=/cgit.svg virtual-root=/ +clone-prefix=https://git.example.org # Title and description shown on top of each page root-title=Chad's git server @@ -131,5 +144,4 @@ show the correct value. ## Contribution -- Ariel Costas -- [website](https://costas.dev), - [donations](https://costas.dev/donations/) +- Ariel Costas -- [website](https://costas.dev) |
