Thread (7 messages) 7 messages, 4 authors, 2021-09-09

[PATCH] Docs: web server must setenv GIT_PROTOCOL for v2

STALE1853d

From: Konstantin Ryabitsev <hidden>
Date: 2021-09-04 15:18:00
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

For the server-side to properly respond to v2 protocol requests, the
webserver must set the GIT_PROTOCOL environment variable to the value of
the Git-Protocol: request header.

Link: https://lore.kernel.org/git/YTNtVJy6sCfQ7T3L@coredump.intra.peff.net/ (local)
Reported-by: Philippe Blain <redacted>
Signed-off-by: Konstantin Ryabitsev <redacted>
---
 Documentation/technical/protocol-v2.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff --git a/Documentation/technical/protocol-v2.txt b/Documentation/technical/protocol-v2.txt
index 1040d85319..7a0e97cc8d 100644
--- a/Documentation/technical/protocol-v2.txt
+++ b/Documentation/technical/protocol-v2.txt
@@ -81,6 +81,21 @@ A v2 server would reply:
 Subsequent requests are then made directly to the service
 `$GIT_URL/git-upload-pack`. (This works the same for git-receive-pack).
 
+The web server handling the requests must properly set the GIT_PROTOCOL
+environment variable when it finds `Git-Protocol` in the request headers.
+
+Apache example:
+
+   SetEnvIf Git-Protocol ".*" GIT_PROTOCOL=$0
+
+Nginx + uwsgi example:
+
+   uwsgi_param GIT_PROTOCOL $http_git_protocol;
+
+Nginx + fastcgi example:
+
+   fastcgi_param GIT_PROTOCOL $http_git_protocol;
+
 Capability Advertisement
 ------------------------
 
base-commit: e0a2f5cbc585657e757385ad918f167f519cfb96
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help