]> git.ipfire.org Git - ipfire.org.git/commitdiff
init.py: moved fireinfo onto main page
authorRico Hoppe <rico.hoppe@ipfire.org>
Sun, 3 Mar 2024 11:12:41 +0000 (11:12 +0000)
committerRico Hoppe <rico.hoppe@ipfire.org>
Sun, 3 Mar 2024 11:12:41 +0000 (11:12 +0000)
src/web/__init__.py

index 52aab69947cb3c1c32129c61b7aeaafbaecfb55f..de561c7ad72d7dace94985ae41f8ec2ae361011d 100644 (file)
@@ -175,6 +175,19 @@ class Application(tornado.web.Application):
                        (r"/donate/error", donate.ErrorHandler),
                        (r"/donate/check-vat-number", donate.CheckVATNumberHandler),
 
+                       # Fireinfo
+                       (r"/fireinfo", fireinfo.IndexHandler),
+                       (r"/fireinfo/admin", fireinfo.AdminIndexHandler),
+                       (r"/fireinfo/vendors", fireinfo.VendorsHandler),
+                       (r"/fireinfo/vendors/(pci|usb)/([0-9a-f]{4})", fireinfo.VendorHandler),
+                       (r"/fireinfo/drivers/(.*)", fireinfo.DriverDetail),
+                       (r"/fireinfo/profile/random", fireinfo.RandomProfileHandler),
+                       (r"/fireinfo/profile/([a-z0-9]{40})", fireinfo.ProfileHandler),
+                       (r"/fireinfo/processors", fireinfo.ProcessorsHandler),
+                       (r"/fireinfo/releases", fireinfo.ReleasesHandler),
+                       (r"/fireinfo/send/([a-z0-9]+)", fireinfo.ProfileSendHandler),
+                       (r"/fireinfo/static/(.*)", tornado.web.StaticFileHandler, { "path" : self.settings.get("static_path") }),
+
                        # Lists
                        (r"/lists", lists.IndexHandler),
 
@@ -184,10 +197,10 @@ class Application(tornado.web.Application):
                        (r"/.well-known/change-password", auth.WellKnownChangePasswordHandler),
 
                        # Projects
-                       (r"/projects/location/?", location.IndexHandler),
-                       (r"/projects/location/download", StaticHandler, { "template" : "location/download.html" }),
-                       (r"/projects/location/how\-to\-use", StaticHandler, { "template" : "location/how-to-use.html" }),
-                       (r"/projects/location/lookup/(.+)", location.LookupHandler),
+                       (r"/location/?", location.IndexHandler),
+                       (r"/location/download", StaticHandler, { "template" : "location/download.html" }),
+                       (r"/location/how\-to\-use", StaticHandler, { "template" : "location/how-to-use.html" }),
+                       (r"/location/lookup/(.+)", location.LookupHandler),
 
                        # Single-Sign-On for Discourse
                        (r"/sso/discourse", auth.SSODiscourse),
@@ -277,33 +290,33 @@ class Application(tornado.web.Application):
                        (r"/news.rss", tornado.web.RedirectHandler, { "url" : "https://blog.ipfire.org/feed.xml" }),
                ])
 
-               # fireinfo.ipfire.org
+               # fireinfo.ipfire.org - LEGACY REDIRECTION
                self.add_handlers(r"fireinfo\.([a-z]+\.dev\.)?ipfire\.org", [
-                       (r"/", fireinfo.IndexHandler),
+                       (r"/", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/" }),
 
                        # Admin
-                       (r"/admin", fireinfo.AdminIndexHandler),
+                       (r"/admin", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/admin" }),
 
                        # Vendors
-                       (r"/vendors", fireinfo.VendorsHandler),
-                       (r"/vendors/(pci|usb)/([0-9a-f]{4})", fireinfo.VendorHandler),
+                       (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/(.*)", fireinfo.DriverDetail),
+                       (r"/drivers/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/drivers/(.*)" }),
 
                        # Show profiles
-                       (r"/profile/random", fireinfo.RandomProfileHandler),
-                       (r"/profile/([a-z0-9]{40})", fireinfo.ProfileHandler),
+                       (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", fireinfo.ProcessorsHandler),
-                       (r"/releases", fireinfo.ReleasesHandler),
+                       (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]+)", fireinfo.ProfileSendHandler),
+                       (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.StaticFileHandler, { "path" : self.settings.get("static_path") }),
+                       (r"/static/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo/static/(.*)" }),
                ] + authentication_handlers)
 
                # i-use.ipfire.org