From ef54ed93c91db420f22cab63f2d293adbef92b3a Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 15 Aug 2013 01:29:03 +0000 Subject: [PATCH] Serve repos via git+https outside of cgit * modules/cgit/templates/git.vhost.erb: Add Apache aliases to the git-http-backend CGI and static git files where possible. This makes git clone, pull and fetch HTTPS URLs more consistent with their git protocol counterparts. * modules/openstack_project/files/git/cgitrc: Adjust the displayed HTTPS clone URL in the WebUI to match. Change-Id: Ibb4fd41191f33b615ed36f78e1951555a1c0dad1 --- modules/cgit/templates/git.vhost.erb | 7 +++++++ modules/openstack_project/files/git/cgitrc | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/cgit/templates/git.vhost.erb b/modules/cgit/templates/git.vhost.erb index 9cb587199f..d17f16a3b0 100644 --- a/modules/cgit/templates/git.vhost.erb +++ b/modules/cgit/templates/git.vhost.erb @@ -21,6 +21,13 @@ RewriteEngine On RewriteRule ^/$ /cgit [R] + SetEnv GIT_PROJECT_ROOT /var/lib/git/ + SetEnv GIT_HTTP_EXPORT_ALL + + AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/lib/git/$1 + AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/lib/git/$1 + ScriptAlias / /usr/libexec/git-core/git-http-backend/ + ErrorLog /var/log/httpd/git-error.log LogLevel warn diff --git a/modules/openstack_project/files/git/cgitrc b/modules/openstack_project/files/git/cgitrc index 937c7121cd..15e68a490d 100644 --- a/modules/openstack_project/files/git/cgitrc +++ b/modules/openstack_project/files/git/cgitrc @@ -6,7 +6,7 @@ cache-size=0 # Specify some default clone prefixes -clone-prefix=git://git.openstack.org https://git.openstack.org/cgit +clone-prefix=git://git.openstack.org https://git.openstack.org # Specify the css url css=/cgit-data/cgit.css