From addec0df6b70b73cb754864318fe0913820843f2 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 9 Apr 2019 14:57:18 +0000 Subject: [PATCH] Add rewrites for whitelabeled legacy git sites The Ariship, StarlingX and Zuul git sites "hide" the namespaces of their repositories, so need additional rewriting to readd them when redirecting to the OpenDev Gitea service. In an effort to avoid rewrite loops, pattern match them on specific repository name prefixes so they won't match the namespaces being inserted. Change-Id: I0a19393147eca5d75b286dfb8bda5665f31a2a2b Task: #29705 --- modules/openstack_project/files/git-redirect.htaccess | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/openstack_project/files/git-redirect.htaccess b/modules/openstack_project/files/git-redirect.htaccess index a72f6b5ca8..0384d02cbb 100644 --- a/modules/openstack_project/files/git-redirect.htaccess +++ b/modules/openstack_project/files/git-redirect.htaccess @@ -4,6 +4,14 @@ RewriteCond %{QUERY_STRING} "^(.*)h=([^&]+)%2F([^&]+)(.*)$" RewriteRule "^(.*)$" "/$1?%1h=%2/%3%4" [N] +# Map whitelabeled project git sites with repository prefixes +RewriteCond %{HTTP_HOST} ^git\.airshipit\.org$ [NC] +RewriteRule "^(cgit/|)(airship-.*)$" "$1openstack/$2" [L] +RewriteCond %{HTTP_HOST} ^git\.starlingx\.io$ [NC] +RewriteRule "^(cgit/|)(stx-.*)$" "$1openstack/$2" [L] +RewriteCond %{HTTP_HOST} ^git\.zuul-ci\.org$ [NC] +RewriteRule "^(cgit/|)((nodepool|zuul).*)$" "$1openstack-infra/$2" [L] + ################################### # summary # ignore all args