Use apache to serve out http git repos.

Assumes that every project in gerrit has a corresponding repo in
/var/lib/git that can be replicated to. That's probably a one-time offline
creation, followed by an additional step in the adding a project docs.

Change-Id: If9b987717550d5b251366c1408d949c55e64828a
This commit is contained in:
Monty Taylor 2012-07-01 13:41:26 -04:00
parent 6fcec04342
commit 0fbbe34dfc
2 changed files with 21 additions and 6 deletions

View File

@ -3,3 +3,9 @@
[remote "github"]
url = git@github.com:${name}.git
[remote "local"]
url = file:///var/lib/git/${name}.git
replicationDelay = 0
threads = 4
mirror = true

View File

@ -43,13 +43,22 @@
RewriteEngine on
RewriteCond %{HTTP_HOST} !<%= virtual_hostname %>
RewriteRule ^.*$ <%= canonicalweburl %>
RewriteCond %{REQUEST_URI} !^/p/
RewriteRule ^/(.*)$ http://localhost:8081/$1 [P]
ProxyPassReverse / http://localhost:8081/
<Location />
Order allow,deny
Allow from all
ProxyPass http://localhost:8081/ retry=0
</Location>
ProxyPassReverse / http://localhost:8081/
SetEnv GIT_PROJECT_ROOT /var/lib/git/
SetEnv GIT_HTTP_EXPORT_ALL
AliasMatch ^/p/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/lib/git/$1
AliasMatch ^/p/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/lib/git/$1
ScriptAlias /p/ /usr/lib/git-core/git-http-backend/
<Directory /home/gerrit2/review_site/git/>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>