git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: git@vger.kernel.org
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	Philippe Blain <levraiphilippeblain@gmail.com>
Subject: [PATCH] Docs: web server must setenv GIT_PROTOCOL for v2
Date: Sat,  4 Sep 2021 11:17:21 -0400	[thread overview]
Message-ID: <20210904151721.445117-1-konstantin@linuxfoundation.org> (raw)

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/
Reported-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
---
 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


             reply	other threads:[~2021-09-04 15:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04 15:17 Konstantin Ryabitsev [this message]
2021-09-04 15:55 ` [PATCH] Docs: web server must setenv GIT_PROTOCOL for v2 Jeff King
2021-09-07 20:57   ` Junio C Hamano
2021-09-07 21:11   ` Konstantin Ryabitsev
2021-09-08 10:48     ` Jeff King
2021-09-08 10:57       ` Jeff King
2021-09-08 16:50         ` Eric Wong
2021-09-09 17:28         ` Junio C Hamano
2021-09-09 17:35           ` Junio C Hamano
2021-09-10 11:39             ` Jeff King
2021-09-10 14:02               ` Jeff King
2021-09-10 14:04                 ` [PATCH 1/5] t5551: test v2-to-v0 http protocol fallback Jeff King
2021-09-10 14:05                 ` [PATCH 2/5] http-backend: handle HTTP_GIT_PROTOCOL CGI variable Jeff King
2021-09-10 14:09                 ` [PATCH 3/5] docs/http-backend: mention v2 protocol Jeff King
2021-09-10 14:09                 ` [PATCH 4/5] docs/git: discuss server-side config for GIT_PROTOCOL Jeff King
2021-09-10 14:10                 ` [PATCH 5/5] docs/protocol-v2: point readers transport config discussion Jeff King
2021-09-10 22:08                 ` [PATCH] Docs: web server must setenv GIT_PROTOCOL for v2 Junio C Hamano
2021-09-09 17:50         ` Philippe Blain
2021-09-10  5:39           ` Junio C Hamano
2021-09-10 11:40             ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210904151721.445117-1-konstantin@linuxfoundation.org \
    --to=konstantin@linuxfoundation.org \
    --cc=git@vger.kernel.org \
    --cc=levraiphilippeblain@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).