diff options
| author | Joe Carstairs <me@joeac.net> | 2026-08-26 10:27:32 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-08-26 10:27:32 +0100 |
| commit | 690f218cbdf89327408ea75f2d21fde257a29411 (patch) | |
| tree | c0d695883f761afe8f1b0f0c90bdf73309cc1e5a /roles/git-http-backend/templates/git-http-backend.conf | |
| parent | 9ec180130f0085340f3a6f2828b2f49d558a2548 (diff) | |
refactor git into cgit, git-daemon and git-http-backend
Diffstat (limited to 'roles/git-http-backend/templates/git-http-backend.conf')
| -rw-r--r-- | roles/git-http-backend/templates/git-http-backend.conf | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/roles/git-http-backend/templates/git-http-backend.conf b/roles/git-http-backend/templates/git-http-backend.conf new file mode 100644 index 0000000..26e012b --- /dev/null +++ b/roles/git-http-backend/templates/git-http-backend.conf @@ -0,0 +1,22 @@ +location ~ /(.+)/(HEAD|info/refs|objects|git-upload-pack|git-receive-pack) { + if (-f /srv/git/$1/{{ git_export_ok_file }}) { + set $auth_basic "private-write repository"; + } + if (!-f /srv/git/$1/{{ git_export_ok_file }}) { + set $auth_basic "private repository"; + } + if ($arg_service != git-receive-pack) { + set $auth_basic off; + } + auth_basic $auth_basic; + auth_basic_user_file .htpasswd; + + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend; + fastcgi_param PATH_INFO $uri; + fastcgi_param GIT_PROJECT_ROOT /srv/git; + fastcgi_param GIT_HTTP_EXPORT_ALL 1; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param HOME /srv/git; + fastcgi_pass unix:{{ fcgiwrap_socket }}; +} |
