summaryrefslogtreecommitdiff
path: root/roles/git/files/git.conf
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2024-01-21 18:14:36 +0000
committerDmitry Ilvokhin <d@ilvokhin.com>2024-01-21 18:14:36 +0000
commite2ee37f71a5059578605c77bdd0d8bad71049c5a (patch)
tree4ce810536fc512a71114e8c3ebaaa5a29e1074be /roles/git/files/git.conf
parent2822b40326df4c24042b879a64389ce5e594fa5b (diff)
downloadinfra-e2ee37f71a5059578605c77bdd0d8bad71049c5a.tar.gz
infra-e2ee37f71a5059578605c77bdd0d8bad71049c5a.tar.bz2
infra-e2ee37f71a5059578605c77bdd0d8bad71049c5a.zip
Add role for git server
The Git server role should support: * git ssh protocol, * git protocol, * git smart http protocol. Support for cgit will come as a separate role.
Diffstat (limited to 'roles/git/files/git.conf')
-rw-r--r--roles/git/files/git.conf16
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/git/files/git.conf b/roles/git/files/git.conf
new file mode 100644
index 0000000..1434cda
--- /dev/null
+++ b/roles/git/files/git.conf
@@ -0,0 +1,16 @@
+# Source: https://gist.github.com/kierdwyn/3745400e6a184f621b92
+
+location ~ /.+/(info/refs|git-upload-pack|git-receive-pack) {
+ # Set chunks to unlimited, as the body's can be huge.
+ client_max_body_size 0;
+
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
+ fastcgi_param GIT_HTTP_EXPORT_ALL "";
+ fastcgi_param GIT_PROJECT_ROOT /srv/git;
+ fastcgi_param PATH_INFO $uri;
+ # Forward REMOTE_USER as we want to know when we are authenticated.
+ fastcgi_param REMOTE_USER $remote_user;
+
+ fastcgi_pass unix:/run/fcgiwrap.sock;
+}