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
This commit is contained in:
Jeremy Stanley 2019-04-09 14:57:18 +00:00
parent 713b98298e
commit addec0df6b
1 changed files with 8 additions and 0 deletions

View File

@ -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