]> git.ipfire.org Git - ipfire.org.git/commitdiff
web: Allow accessing all websites from development domains
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 3 Mar 2023 10:01:07 +0000 (10:01 +0000)
committerRico Hoppe <rico.hoppe@ipfire.org>
Fri, 3 Mar 2023 10:01:36 +0000 (10:01 +0000)
Signed-off-by: Rico Hoppe <rico.hoppe@ipfire.org>
src/web/__init__.py

index c4075a229fab8de504da8d3845e7230b7a8e5b1d..7319391737d602474e9b97dd769aa0ab7e67da76 100644 (file)
@@ -110,7 +110,7 @@ class Application(tornado.web.Application):
                        (r"/logout", auth.LogoutHandler),
                ]
 
-               self.add_handlers(r"(dev|www)\.ipfire\.rocks", [
+               self.add_handlers(r"(www\.)?(.*)ipfire\.org", [
                        # Entry site that lead the user to index
                        (r"/", IndexHandler),
                        (r"/about", AboutHandler),
@@ -162,7 +162,7 @@ class Application(tornado.web.Application):
                ])
 
                # blog.ipfire.org - LEGACY REDIRECTION
-               self.add_handlers(r"blog\.ipfire\.org", [
+               self.add_handlers(r"blog\.(.*)ipfire\.org", [
                        (r"/", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/blog" }),
                        (r"/authors/(\w+)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/blog/authors/{0}" }),
                        (r"/post/([0-9a-z\-\._]+)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/blog/{0}" }),
@@ -173,20 +173,20 @@ class Application(tornado.web.Application):
                ])
 
                # downloads.ipfire.org
-               self.add_handlers(r"downloads?\.ipfire\.org", [
+               self.add_handlers(r"downloads\.(.*)ipfire\.org", [
                        (r"/", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/download" }),
                        (r"/release/(.*)",  tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/download/{0}" }),
                        (r"/(.*)", download.FileHandler),
                ])
 
                # mirrors.ipfire.org
-               self.add_handlers(r"^mirrors\.ipfire\.org", [
+               self.add_handlers(r"mirrors\.(.*)ipfire\.org", [
                        (r"/", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/download/mirrors" }),
                        (r"/mirrors/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/download/mirrors/{0}" }),
                ])
 
                # planet.ipfire.org
-               self.add_handlers(r"planet\.ipfire\.org", [
+               self.add_handlers(r"planet\.(.*)ipfire\.org", [
                        (r"/", tornado.web.RedirectHandler, { "url" : "https://blog.ipfire.org/" }),
                        (r"/post/([A-Za-z0-9_-]+)", handlers.PlanetPostHandler),
                        (r"/user/([a-z0-9_-]+)", handlers.PlanetUserHandler),
@@ -198,7 +198,7 @@ class Application(tornado.web.Application):
                ])
 
                # fireinfo.ipfire.org
-               self.add_handlers(r"fireinfo\.ipfire\.org", [
+               self.add_handlers(r"fireinfo\.(.*)ipfire\.org", [
                        (r"/", fireinfo.IndexHandler),
 
                        # Admin
@@ -224,14 +224,14 @@ class Application(tornado.web.Application):
                ] + authentication_handlers)
 
                # i-use.ipfire.org
-               self.add_handlers(r"i-use\.ipfire\.org", [
+               self.add_handlers(r"i-use\.(.*)ipfire\.org", [
                        (r"/", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/" }),
                        (r"/profile/([a-f0-9]{40})/([0-9]+).png", iuse.ImageHandler),
                ])
 
                # boot.ipfire.org
                BOOT_STATIC_PATH = os.path.join(self.settings["static_path"], "netboot")
-               self.add_handlers(r"boot(\.dev)?\.ipfire\.org", [
+               self.add_handlers(r"boot\.(.*)ipfire\.org", [
                        (r"/", tornado.web.RedirectHandler, { "url" : "https://wiki.ipfire.org/installation/pxe" }),
 
                        # Configurations
@@ -245,14 +245,14 @@ class Application(tornado.web.Application):
                ])
 
                # nopaste.ipfire.org
-               self.add_handlers(r"nopaste\.ipfire\.org", [
+               self.add_handlers(r"nopaste\.(.*)ipfire\.org", [
                        (r"/", nopaste.CreateHandler),
                        (r"/raw/(.*)", nopaste.RawHandler),
                        (r"/view/(.*)", nopaste.ViewHandler),
                ] + authentication_handlers)
 
                # location.ipfire.org
-               self.add_handlers(r"location\.ipfire\.rocks", [
+               self.add_handlers(r"location\.(.*)ipfire\.org", [
                        (r"/", location.IndexHandler),
                        (r"/download", StaticHandler, { "template" : "../location/download.html" }),
                        (r"/how\-to\-use", StaticHandler, { "template" : "../location/how-to-use.html" }),
@@ -261,17 +261,17 @@ class Application(tornado.web.Application):
                ])
 
                # geoip.ipfire.org
-               self.add_handlers(r"geoip\.ipfire\.org", [
+               self.add_handlers(r"geoip\.(.*)ipfire\.org", [
                        (r"/", tornado.web.RedirectHandler, { "url" : "https://location.ipfire.org/" }),
                ])
 
                # talk.ipfire.org
-               self.add_handlers(r"talk\.ipfire\.org", [
+               self.add_handlers(r"talk\.(.*)ipfire\.org", [
                        (r"/", tornado.web.RedirectHandler, { "url" : "https://people.ipfire.org/" }),
                ])
 
                # people.ipfire.org
-               self.add_handlers(r"people\.ipfire\.(org|rocks)", [
+               self.add_handlers(r"people\.(.*)ipfire\.org", [
                        (r"/", people.IndexHandler),
                        (r"/activate/([a-z_][a-z0-9_-]{0,31})/(\w+)", auth.ActivateHandler),
                        (r"/conferences", people.ConferencesHandler),
@@ -308,7 +308,7 @@ class Application(tornado.web.Application):
                ]  + authentication_handlers)
 
                # wiki.ipfire.org
-               self.add_handlers(r"wiki\.ipfire\.rocks",
+               self.add_handlers(r"wiki\.(.*)ipfire\.org",
                        authentication_handlers + [
 
                        # Actions
@@ -334,7 +334,7 @@ class Application(tornado.web.Application):
                ])
 
                # ipfire.org
-               self.add_handlers(r"ipfire\.org", [
+               self.add_handlers(r"(.*)ipfire\.org", [
                        (r".*", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org" })
                ])