From 770dbad2dd03f02b422a35ed8616e03f122757a7 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 27 Jul 2020 12:31:24 -0700 Subject: [PATCH] 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 --- playbooks/roles/gerrit/templates/gerrit.vhost.j2 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/playbooks/roles/gerrit/templates/gerrit.vhost.j2 b/playbooks/roles/gerrit/templates/gerrit.vhost.j2 index d677328fef..817e1f2420 100644 --- a/playbooks/roles/gerrit/templates/gerrit.vhost.j2 +++ b/playbooks/roles/gerrit/templates/gerrit.vhost.j2 @@ -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] Require all granted