summaryrefslogtreecommitdiff
path: root/etc/httpd/conf.d/git-http-apcf.conf
diff options
context:
space:
mode:
Diffstat (limited to 'etc/httpd/conf.d/git-http-apcf.conf')
-rw-r--r--etc/httpd/conf.d/git-http-apcf.conf27
1 files changed, 27 insertions, 0 deletions
diff --git a/etc/httpd/conf.d/git-http-apcf.conf b/etc/httpd/conf.d/git-http-apcf.conf
new file mode 100644
index 0000000..d781aea
--- /dev/null
+++ b/etc/httpd/conf.d/git-http-apcf.conf
@@ -0,0 +1,27 @@
+#
+#
+# Git Smart HTTP Support (authenticated read/write)
+# git push, clone, fetch — ALL authenticated
+
+SetEnv GIT_PROJECT_ROOT /srv/git
+SetEnv GIT_HTTP_EXPORT_ALL 1
+
+# Expose all of the endpoints.
+ScriptAliasMatch "^(/.+/(git-upload-pack|git-receive-pack|info/refs))$" \
+ /usr/libexec/git-core/git-http-backend$1
+
+# Globally authenticate for each endpoint.
+<LocationMatch "^/.+/(git-upload-pack|git-receive-pack|info/refs)$">
+ AuthType Basic
+ AuthName "Git Access"
+ AuthUserFile ${GIT_HTTP_AUTH_FILE}
+ Require valid-user
+</LocationMatch>
+
+# info/refs strictly scoped
+<LocationMatch "^/.+/info/refs$">
+ <RequireAny>
+ Require expr %{QUERY_STRING} == "service=git-upload-pack"
+ Require expr %{QUERY_STRING} == "service=git-receive-pack"
+ </RequireAny>
+</LocationMatch>