From a4422469230af422bbcd1d5059f927ea1d1410b4 Mon Sep 17 00:00:00 2001 From: Rico Hoppe Date: Sun, 3 Mar 2024 11:12:41 +0000 Subject: [PATCH] init.py: moved fireinfo onto main page --- src/web/__init__.py | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/src/web/__init__.py b/src/web/__init__.py index 52aab699..de561c7a 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -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 -- 2.47.2