[redirects-web] Migrate additional redirects from the proxies



commit ff09c9002a5dbe075721b9b1ab5864ab5c755730
Author: Andrea Veri <averi redhat com>
Date:   Mon Oct 7 12:44:07 2019 +0200

    Migrate additional redirects from the proxies

 app_data/httpd-cfg/bugs.gnome.org.conf             |  6 ++
 app_data/httpd-cfg/git.gnome.org.conf              | 99 ++++++++++++++++++++++
 app_data/httpd-cfg/infrastructure.gnome.org.conf   |  6 ++
 app_data/httpd-cfg/news.gnome.org.conf             |  5 ++
 app_data/httpd-cfg/outreachy.gnome.org.conf        |  7 ++
 app_data/httpd-cfg/src.gnome.org.conf              |  6 ++
 resources/bugs.gnome.org.yaml                      | 17 ++++
 resources/git.gnome.org.yaml                       | 17 ++++
 .../{i18n.gnome.org.conf => i18n.gnome.org.yaml}   |  0
 resources/infrastructure.gnome.org.yaml            | 17 ++++
 ...brary.gnome.org.conf => library.gnome.org.yaml} |  0
 resources/news.gnome.org.yaml                      | 17 ++++
 resources/opw.gnome.org.yaml                       | 17 ++++
 resources/outreachy.gnome.org.yaml                 | 17 ++++
 resources/src.gnome.org.yaml                       | 17 ++++
 15 files changed, 248 insertions(+)
---
diff --git a/app_data/httpd-cfg/bugs.gnome.org.conf b/app_data/httpd-cfg/bugs.gnome.org.conf
new file mode 100644
index 0000000..923ea4d
--- /dev/null
+++ b/app_data/httpd-cfg/bugs.gnome.org.conf
@@ -0,0 +1,6 @@
+<VirtualHost *:8080>
+    ServerName bugs.gnome.org
+
+    RewriteEngine On
+    RewriteRule ^(.*)$ https://gitlab.gnome.org$1 [R,L]
+</VirtualHost>
diff --git a/app_data/httpd-cfg/git.gnome.org.conf b/app_data/httpd-cfg/git.gnome.org.conf
new file mode 100644
index 0000000..f7c7e7d
--- /dev/null
+++ b/app_data/httpd-cfg/git.gnome.org.conf
@@ -0,0 +1,99 @@
+<VirtualHost *:8080>
+    ServerName git.gnome.org
+
+    RewriteEngine On
+    RewriteCond %{REQUEST_URI} ^/cgit/.*
+    RewriteRule /cgit/(.*) https://git.gnome.org/browse/$1 [R=301,L]
+
+    RewriteCond %{REQUEST_URI} !^/repositories.txt
+    RewriteCond %{REQUEST_URI} !^/repositories.doap
+    RewriteCond %{REQUEST_URI} !^/robots.txt
+    RewriteCond %{REQUEST_URI} !^/browse/.*
+    RewriteCond %{REQUEST_URI} !^/browse$
+    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
+    RewriteCond %{HTTP_USER_AGENT} !^git/.*
+    RewriteCond %{HTTP_USER_AGENT} !^Bittorrent.*
+    RewriteRule /(.*) https://git.gnome.org/browse/$1 [R=301,L]
+
+    # This can be hugely simplified as of Apache 2.4
+    # See http://httpd.apache.org/docs/current/mod/mod_headers.html
+    SetEnvIf Request_URI "^/browse/[^/]+/plain/.*\.flatpak$" ct_flatpak=1
+    SetEnvIf Request_URI "^/browse/[^/]+/plain/.*\.flatpakref$" ct_flatpakref=1
+    SetEnvIf Request_URI "^/browse/[^/]+/plain/.*\.flatpakrepo$" ct_flatpakrepo=1
+
+    Header always set Content-type application/vnd.flatpak "env=ct_flatpak"
+    Header always set Content-type application/vnd.flatpak.ref "env=ct_flatpakref"
+    Header always set Content-type application/vnd.flatpak.repo "env=ct_flatpakrepo"
+
+    <LocationMatch "/browse/[^/]+/plain/.*\.ogv$">
+        Header set Access-Control-Allow-Origin "http://l10n.gnome.org";
+    </LocationMatch>
+
+    # Block Git clients which do not support the efficient git-http-backend method
+    # Supported since Git 1.6.6+
+    SetEnvIf User-Agent "^git/0\." is_bad_agent
+    SetEnvIf User-Agent "^git/1\.[012345]" is_bad_agent
+    SetEnvIf User-Agent "^git/1\.6\.[012345]" is_bad_agent
+    SetEnvIf User-Agent "^Bittorrent" is_bad_agent
+    SetEnvIf User-Agent "^-?$" is_bad_agent
+
+    # Gitlab
+    RedirectMatch 301 ^/repositories\.(doap|txt) https://gitlab.gnome.org/repositories.$1
+    RedirectMatch 301 ^/browse(\/|)$ https://gitlab.gnome.org/GNOME 
+    RedirectMatch 301 ^/browse/archive$ https://gitlab.gnome.org/Archive 
+
+    RewriteCond %{REQUEST_URI}  /browse/archive/(.*)/plain
+    RewriteCond %{QUERY_STRING} h=(.*)
+    RewriteRule /browse/archive/(.*)/plain(.*) https://gitlab.gnome.org/Archive/$1/raw/%1$2? [L]
+
+    RewriteCond %{REQUEST_URI}  /browse/archive/(.*)/tree
+    RewriteCond %{QUERY_STRING} h=(.*)
+    RewriteRule /browse/archive/(.*)/tree(.*) https://gitlab.gnome.org/Archive/$1/tree/%1$2? [L]
+
+    RewriteCond %{REQUEST_URI}  /browse/archive/(.*)/log
+    RewriteCond %{QUERY_STRING} h=(.*)
+    RewriteRule /browse/archive/(.*)/log https://gitlab.gnome.org/Archive/$1/commits/%1? [L]
+
+    RewriteCond %{REQUEST_URI}  /browse/archive/(.*)/commit
+    RewriteCond %{QUERY_STRING} id=(.*)
+    RewriteRule /browse/archive/(.*)/commit https://gitlab.gnome.org/Archive/$1/commit/%1? [L]
+
+    RewriteCond %{REQUEST_URI}  /browse/archive/(.*)/tree
+    RewriteCond %{QUERY_STRING} id=(.*)
+    RewriteRule /browse/archive/(.*)/tree/(.*) https://gitlab.gnome.org/Archive/$1/blob/%1/$2? [L]
+
+    RedirectMatch 301 /browse/archive/(.*)/log https://gitlab.gnome.org/Archive/$1/commits/master
+    RedirectMatch 301 /browse/archive/(.*)/tree(.*) https://gitlab.gnome.org/Archive/$1/tree/master$2
+    RedirectMatch 301 /browse/archive/(.*)/plain(.*) https://gitlab.gnome.org/Archive/$1/raw/master$2
+    RedirectMatch 301 ^/browse/archive/(.*)$ https://gitlab.gnome.org/Archive/$1
+    RedirectMatch 301 /browse/archive/(.*)/(.*)$ https://gitlab.gnome.org/Archive/$1/$2
+
+    RewriteCond %{REQUEST_URI}  /browse/(.*)/plain
+    RewriteCond %{QUERY_STRING} h=(.*)
+    RewriteRule /browse/(.*)/plain(.*) https://gitlab.gnome.org/GNOME/$1/raw/%1$2? [L]
+
+    RewriteCond %{REQUEST_URI}  /browse/(.*)/tree
+    RewriteCond %{QUERY_STRING} h=(.*)
+    RewriteRule /browse/(.*)/tree(.*) https://gitlab.gnome.org/GNOME/$1/tree/%1$2? [L]
+
+    RewriteCond %{REQUEST_URI}  /browse/(.*)/log
+    RewriteCond %{QUERY_STRING} h=(.*)
+    RewriteRule /browse/(.*)/log https://gitlab.gnome.org/GNOME/$1/commits/%1? [L]
+
+    RewriteCond %{REQUEST_URI}  /browse/(.*)/commit
+    RewriteCond %{QUERY_STRING} id=(.*)
+    RewriteRule /browse/(.*)/commit https://gitlab.gnome.org/GNOME/$1/commit/%1? [L]
+
+    RewriteCond %{REQUEST_URI}  /browse/(.*)/tree
+    RewriteCond %{QUERY_STRING} id=(.*)
+    RewriteRule /browse/(.*)/tree/(.*) https://gitlab.gnome.org/GNOME/$1/blob/%1/$2? [L]
+
+    RedirectMatch 301 /browse/(.*)/log https://gitlab.gnome.org/GNOME/$1/commits/master
+    RedirectMatch 301 /browse/(.*)/tree(.*) https://gitlab.gnome.org/GNOME/$1/tree/master$2
+    RedirectMatch 301 /browse/(.*)/plain(.*) https://gitlab.gnome.org/GNOME/$1/raw/master$2
+    RedirectMatch 301 ^/browse/(.*)$ https://gitlab.gnome.org/GNOME/$1
+    RedirectMatch 301 /browse/(.*)/(.*)$ https://gitlab.gnome.org/GNOME/$1/$2
+
+    # Random redirects
+    RedirectPermanent /browse/jhbuild/plain/modulesets/gnome-world-3.14.modules 
https://gitlab.gnome.org/GNOME/jhbuild/raw/master/modulesets/gnome-world.modules 
+</VirtualHost>
diff --git a/app_data/httpd-cfg/infrastructure.gnome.org.conf 
b/app_data/httpd-cfg/infrastructure.gnome.org.conf
new file mode 100644
index 0000000..43b1d85
--- /dev/null
+++ b/app_data/httpd-cfg/infrastructure.gnome.org.conf
@@ -0,0 +1,6 @@
+<VirtualHost *:8080>
+    ServerName infrastructure.gnome.org
+
+    RewriteEngine On
+    RewriteRule ^(.*)$ https://gitlab.gnome.org/Infrastructure/puppet? [R,L]
+</VirtualHost>
diff --git a/app_data/httpd-cfg/news.gnome.org.conf b/app_data/httpd-cfg/news.gnome.org.conf
new file mode 100644
index 0000000..22e93d9
--- /dev/null
+++ b/app_data/httpd-cfg/news.gnome.org.conf
@@ -0,0 +1,5 @@
+<VirtualHost *:8080>
+   ServerName news.gnome.org
+   
+   RedirectPermanent / https://www.gnome.org/news
+</VirtualHost>
diff --git a/app_data/httpd-cfg/outreachy.gnome.org.conf b/app_data/httpd-cfg/outreachy.gnome.org.conf
new file mode 100644
index 0000000..d0b9a52
--- /dev/null
+++ b/app_data/httpd-cfg/outreachy.gnome.org.conf
@@ -0,0 +1,7 @@
+<VirtualHost *:8080>
+   ServerName outreachy.gnome.org
+   ServerAlias opw.gnome.org
+
+   RewriteEngine on
+   RewriteRule (.*) https://outreachy.org/apply [R,L]
+</VirtualHost>
diff --git a/app_data/httpd-cfg/src.gnome.org.conf b/app_data/httpd-cfg/src.gnome.org.conf
new file mode 100644
index 0000000..fff72df
--- /dev/null
+++ b/app_data/httpd-cfg/src.gnome.org.conf
@@ -0,0 +1,6 @@
+<VirtualHost *:8080>
+    ServerName src.gnome.org
+
+    RewriteEngine On
+    RewriteRule ^(.*)$ https://gitlab.gnome.org$1 [R,L]
+</VirtualHost>
diff --git a/resources/bugs.gnome.org.yaml b/resources/bugs.gnome.org.yaml
new file mode 100644
index 0000000..a6001c4
--- /dev/null
+++ b/resources/bugs.gnome.org.yaml
@@ -0,0 +1,17 @@
+apiVersion: route.openshift.io/v1
+kind: Route
+metadata:
+  name: bugs.gnome.org
+  namespace: redirects-web
+spec:
+  host: bugs.gnome.org
+  port:
+    targetPort: 8080-tcp
+  tls:
+    insecureEdgeTerminationPolicy: Redirect
+    termination: edge
+  to:
+    kind: Service
+    name: redirects-web
+    weight: 100
+  wildcardPolicy: None
diff --git a/resources/git.gnome.org.yaml b/resources/git.gnome.org.yaml
new file mode 100644
index 0000000..72711b5
--- /dev/null
+++ b/resources/git.gnome.org.yaml
@@ -0,0 +1,17 @@
+apiVersion: route.openshift.io/v1
+kind: Route
+metadata:
+  name: git.gnome.org
+  namespace: redirects-web
+spec:
+  host: git.gnome.org
+  port:
+    targetPort: 8080-tcp
+  tls:
+    insecureEdgeTerminationPolicy: Redirect
+    termination: edge
+  to:
+    kind: Service
+    name: redirects-web
+    weight: 100
+  wildcardPolicy: None
diff --git a/resources/i18n.gnome.org.conf b/resources/i18n.gnome.org.yaml
similarity index 100%
rename from resources/i18n.gnome.org.conf
rename to resources/i18n.gnome.org.yaml
diff --git a/resources/infrastructure.gnome.org.yaml b/resources/infrastructure.gnome.org.yaml
new file mode 100644
index 0000000..a68ceb4
--- /dev/null
+++ b/resources/infrastructure.gnome.org.yaml
@@ -0,0 +1,17 @@
+apiVersion: route.openshift.io/v1
+kind: Route
+metadata:
+  name: infrastructure.gnome.org
+  namespace: redirects-web
+spec:
+  host: infrastructure.gnome.org
+  port:
+    targetPort: 8080-tcp
+  tls:
+    insecureEdgeTerminationPolicy: Redirect
+    termination: edge
+  to:
+    kind: Service
+    name: redirects-web
+    weight: 100
+  wildcardPolicy: None
diff --git a/resources/library.gnome.org.conf b/resources/library.gnome.org.yaml
similarity index 100%
rename from resources/library.gnome.org.conf
rename to resources/library.gnome.org.yaml
diff --git a/resources/news.gnome.org.yaml b/resources/news.gnome.org.yaml
new file mode 100644
index 0000000..9ecbbd6
--- /dev/null
+++ b/resources/news.gnome.org.yaml
@@ -0,0 +1,17 @@
+apiVersion: route.openshift.io/v1
+kind: Route
+metadata:
+  name: news.gnome.org
+  namespace: redirects-web
+spec:
+  host: news.gnome.org
+  port:
+    targetPort: 8080-tcp
+  tls:
+    insecureEdgeTerminationPolicy: Redirect
+    termination: edge
+  to:
+    kind: Service
+    name: redirects-web
+    weight: 100
+  wildcardPolicy: None
diff --git a/resources/opw.gnome.org.yaml b/resources/opw.gnome.org.yaml
new file mode 100644
index 0000000..ab0b128
--- /dev/null
+++ b/resources/opw.gnome.org.yaml
@@ -0,0 +1,17 @@
+apiVersion: route.openshift.io/v1
+kind: Route
+metadata:
+  name: opw.gnome.org
+  namespace: redirects-web
+spec:
+  host: opw.gnome.org
+  port:
+    targetPort: 8080-tcp
+  tls:
+    insecureEdgeTerminationPolicy: Redirect
+    termination: edge
+  to:
+    kind: Service
+    name: redirects-web
+    weight: 100
+  wildcardPolicy: None
diff --git a/resources/outreachy.gnome.org.yaml b/resources/outreachy.gnome.org.yaml
new file mode 100644
index 0000000..ce15561
--- /dev/null
+++ b/resources/outreachy.gnome.org.yaml
@@ -0,0 +1,17 @@
+apiVersion: route.openshift.io/v1
+kind: Route
+metadata:
+  name: outreachy.gnome.org
+  namespace: redirects-web
+spec:
+  host: outreachy.gnome.org
+  port:
+    targetPort: 8080-tcp
+  tls:
+    insecureEdgeTerminationPolicy: Redirect
+    termination: edge
+  to:
+    kind: Service
+    name: redirects-web
+    weight: 100
+  wildcardPolicy: None
diff --git a/resources/src.gnome.org.yaml b/resources/src.gnome.org.yaml
new file mode 100644
index 0000000..23d969d
--- /dev/null
+++ b/resources/src.gnome.org.yaml
@@ -0,0 +1,17 @@
+apiVersion: route.openshift.io/v1
+kind: Route
+metadata:
+  name: src.gnome.org
+  namespace: redirects-web
+spec:
+  host: src.gnome.org
+  port:
+    targetPort: 8080-tcp
+  tls:
+    insecureEdgeTerminationPolicy: Redirect
+    termination: edge
+  to:
+    kind: Service
+    name: redirects-web
+    weight: 100
+  wildcardPolicy: None


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]