summaryrefslogtreecommitdiff
path: root/roles/git-http-backend/templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/git-http-backend/templates')
-rw-r--r--roles/git-http-backend/templates/git-http-backend.conf22
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 }};
+}