]> git.ipfire.org Git - ipfire.org.git/commitdiff
fireinfo: Simplify redirection
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 12:46:04 +0000 (12:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2024 12:46:04 +0000 (12:46 +0000)
The redirections didn't work as they incorrectly used the regular
expressions. Since there are so many, it probably is best to simply
redirect everything as is prefixed with /fireinfo and let the service
decide later whether some resource exists.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/__init__.py

index 47806f034122d87348a3ff64f52fde17b35420fe..b4249fac644822fa2e6482f5218b6afdde86f2d8 100644 (file)
@@ -288,36 +288,14 @@ class Application(tornado.web.Application):
                        (r"/news.rss", tornado.web.RedirectHandler, { "url" : "https://blog.ipfire.org/feed.xml" }),
                ])
 
-               # fireinfo.ipfire.org - LEGACY REDIRECTION
+               # fireinfo.ipfire.org
                self.add_handlers(r"fireinfo\.([a-z]+\.dev\.)?ipfire\.org", [
+                       # Handle profiles
                        (r"/fireinfo/send/([a-z0-9]+)", fireinfo.ProfileSendHandler),
 
-                       (r"/", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/" }),
-
-                       # Admin
-                       (r"/admin", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/admin" }),
-
-                       # Vendors
-                       (r"/vendors", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/vendors" }),
-                       (r"/vendors/(pci|usb)/([0-9a-f]{4})", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/vendors/(pci|usb)/([0-9a-f]{4})" }),
-
-                       # Driver
-                       (r"/drivers/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/drivers/(.*)" }),
-
-                       # Show profiles
-                       (r"/profile/random", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/profile/random" }),
-                       (r"/profile/([a-z0-9]{40})", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/profile/([a-z0-9]{40})" }),
-
-                       # Stats
-                       (r"/processors", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/processors" }),
-                       (r"/releases", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/releases" }),
-
-                       # Send profiles
-                       (r"/send/([a-z0-9]+)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/send/([a-z0-9]+)" }),
-
-                       # Serve any static files
-                       (r"/static/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/static/(.*)" }),
-               ] + authentication_handlers)
+                       # Redirect anything else
+                       (r"(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo{0}" }),
+               ])
 
                # i-use.ipfire.org
                self.add_handlers(r"i-use\.([a-z]+\.dev\.)?ipfire\.org", [