summaryrefslogtreecommitdiffstatshomepage
path: root/cgitrc
diff options
context:
space:
mode:
authorWolfgang Müller2021-05-28 16:03:01 +0200
committerWolfgang Müller2021-05-28 16:03:01 +0200
commit2d8f83a3072970a51c45d2f72724696781ef6de8 (patch)
treed86368112ae3b3743b8c9b55a2161d9c2aa7dbfa /cgitrc
parent69a9085b7b833c5c8a445784b479518cb391baae (diff)
downloadcgit-git-http-backend.tar.gz
Support Git over HTTP by proxying git-http-backend(1)git-http-backend
cgit lacks an easy way to support the "smart" HTTP protocol out of the box. A patch [1] has been proposed in the past, but was never merged. A few years later there was a short discussion at [2] which did not go anywhere. The majority of users who want to support the "smart" HTTP protocol right now seem to conditionally point their web server to git-http-backend(1) directly. This relies on proper path-matching and regular expression support in the web server as seen in the EXMAPLES section of git-http-backend(1). As proposed in [3], it is possible to have cgit interface with the necessary functionality in Git directly, but that would require more work. It does not seem that this is something forthcoming in cgit. Instead, for now, use a modified version of the patch suggested in [1], which simply executes git-http-backend(1) when needed. This removes the need for any additional plumbing in the web server. Notable changes to the original patch: * Remove automatic handling of GIT_PROJECT_ROOT in favour of having the user set the variable correctly themselves. This reduces complexity. * Use the correct function to generate error pages. The original patch used html_status(), which does not exist anymore. * In cmd.c, adjust the struct entries to fit. Sadly we cannot use the def_cmd() macro directly, as the endpoints "git-upload-pack" and "git-receive-pack" contain dashes. [1] https://lists.zx2c4.com/pipermail/cgit/2014-December/002312.html [2] https://lists.zx2c4.com/pipermail/cgit/2016-February/002907.html [3] https://lists.zx2c4.com/pipermail/cgit/2016-February/002926.html
Diffstat (limited to '')
-rw-r--r--cgitrc.5.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 33a6a8c..820cfa6 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -234,6 +234,11 @@ header::
The content of the file specified with this option will be included
verbatim at the top of all pages. Default value: none.
+http-backend-path::
+ Path to the git-http-backend binary. Setting this allows the git clone to
+ fetch/push via Git over HTTP. You'll also need to set enable-http-clone
+ for this to work. See git-http-backend(1). Default value: none.
+
include::
Name of a configfile to include before the rest of the current config-
file is parsed. Default value: none. See also: "MACRO EXPANSION".
@@ -824,6 +829,9 @@ enable-index-owner=1
# Allow http transport git clone
enable-http-clone=1
+# Use git-http-backend to serve Git over HTTP
+http-backend-path=/usr/lib/git-core/git-http-backend
+
# Show extra links for each repository on the index page
enable-index-links=1