Deny Gerrit /p/ requests

Gerrit is repurposing the /p/ path for project dashboard under
polygerrit. We use this path for Git mirrors. To resolve this let's
disable the /p/ path now then when it is used for project dashboards
users won't be as confused.

This has the added benefit of reducing the number of mirrors we need to
manage which makes managing branches in the mirrors simpler.

Change-Id: I9ebca2049a4a0707ecfbaecd92e42ebc1e6c3f87
This commit is contained in:
Clark Boylan 2020-07-27 12:31:24 -07:00
parent 5fa69476c4
commit 770dbad2dd

View File

@ -66,9 +66,7 @@
SetEnv GIT_PROJECT_ROOT /opt/lib/git
SetEnv GIT_HTTP_EXPORT_ALL
AliasMatch ^/p/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /opt/lib/git/$1
AliasMatch ^/p/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /opt/lib/git/$1
ScriptAlias /p/ /usr/lib/git-core/git-http-backend/
RewriteRule "^/p/.*" "-" [F,L]
<Directory /home/gerrit2/review_site/git/>
Require all granted