Browse Source

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
changes/68/651268/2
Jeremy Stanley 1 month ago
parent
commit
addec0df6b
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      modules/openstack_project/files/git-redirect.htaccess

+ 8
- 0
modules/openstack_project/files/git-redirect.htaccess View File

@@ -4,6 +4,14 @@
4 4
 RewriteCond %{QUERY_STRING} "^(.*)h=([^&]+)%2F([^&]+)(.*)$"
5 5
 RewriteRule "^(.*)$" "/$1?%1h=%2/%3%4" [N]
6 6
 
7
+# Map whitelabeled project git sites with repository prefixes
8
+RewriteCond %{HTTP_HOST} ^git\.airshipit\.org$ [NC]
9
+RewriteRule "^(cgit/|)(airship-.*)$" "$1openstack/$2" [L]
10
+RewriteCond %{HTTP_HOST} ^git\.starlingx\.io$ [NC]
11
+RewriteRule "^(cgit/|)(stx-.*)$" "$1openstack/$2" [L]
12
+RewriteCond %{HTTP_HOST} ^git\.zuul-ci\.org$ [NC]
13
+RewriteRule "^(cgit/|)((nodepool|zuul).*)$" "$1openstack-infra/$2" [L]
14
+
7 15
 ###################################
8 16
 # summary
9 17
 #  ignore all args

Loading…
Cancel
Save