]> git.ipfire.org Git - ipfire.org.git/commitdiff
web: Remove custom static handlers
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Jul 2018 17:20:05 +0000 (18:20 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Jul 2018 17:20:05 +0000 (18:20 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/__init__.py

index c424cd65fed5a09eaad59798ccffd907bce251f9..84f4581adcc2506b7df56261a09acae2cff7cfe3 100644 (file)
@@ -77,13 +77,6 @@ class Application(tornado.web.Application):
 
                tornado.web.Application.__init__(self, **settings)
 
-               self.settings["static_path"] = static_path = os.path.join(BASEDIR, "static")
-               static_handlers = [
-                       (r"/static/(.*)", tornado.web.StaticFileHandler, dict(path = static_path)),
-                       (r"/(favicon\.ico)", tornado.web.StaticFileHandler, dict(path = static_path)),
-                       (r"/(robots\.txt)", tornado.web.StaticFileHandler, dict(path = static_path)),
-               ]
-
                authentication_handlers = [
                        (r"/login", LoginHandler),
                        (r"/logout", LogoutHandler),
@@ -111,8 +104,8 @@ class Application(tornado.web.Application):
 
                        # Handle old pages that have moved elsewhere
                        (r"/imprint", tornado.web.RedirectHandler, { "url" : "/legal" }),
-                       (r"/(de|en)/(.*)", LangCompatHandler)
-               ] + static_handlers + [
+                       (r"/(de|en)/(.*)", LangCompatHandler),
+
                        # Always the last rule
                        (r"/(.*)", StaticHandler),
                ])
@@ -128,7 +121,6 @@ class Application(tornado.web.Application):
                        (r"/mirrors", tornado.web.RedirectHandler, { "url" : "https://mirrors.ipfire.org/" }),
                        (r"/source", tornado.web.RedirectHandler, { "url" : "https://source.ipfire.org/" }),
                        (r"/download-splash", DownloadSplashHandler),
-               ] + static_handlers + [
                        (r"/(iso|torrent)/(.*)", DownloadCompatHandler),
                        (r"/(.*)", DownloadFileHandler),
                ])
@@ -137,7 +129,7 @@ class Application(tornado.web.Application):
                self.add_handlers(r"mirrors(\.dev)?\.ipfire\.org", [
                        (r"/", MirrorIndexHandler),
                        (r"/mirror/(.*)", MirrorItemHandler),
-               ] + static_handlers)
+               ])
 
                # planet.ipfire.org
                self.add_handlers(r"planet(\.dev)?\.ipfire\.org", [
@@ -152,7 +144,7 @@ class Application(tornado.web.Application):
                        (r"/rss", RSSPlanetAllHandler),
                        (r"/user/([a-z0-9_-]+)/rss", RSSPlanetUserHandler),
                        (r"/news.rss", tornado.web.RedirectHandler, { "url" : "/rss" }),
-               ] + static_handlers)
+               ])
 
                # fireinfo.ipfire.org
                self.add_handlers(r"fireinfo(\.dev)?\.ipfire\.org", [
@@ -189,7 +181,7 @@ class Application(tornado.web.Application):
                        (r"/stats/virtual", tornado.web.RedirectHandler, { "url" : "/statistics/virtualization" }),
                        (r"/vendor/(pci|usb)/([0-9a-f]{4})", FireinfoDeviceVendorCompatHandler),
                        (r"/model/(pci|usb)/([0-9a-f]{4})/([0-9a-f]{4})", FireinfoDeviceModelCompatHandler),
-               ] + static_handlers)
+               ])
 
                # i-use.ipfire.org
                self.add_handlers(r"i-use(\.dev)?\.ipfire\.org", [
@@ -216,12 +208,12 @@ class Application(tornado.web.Application):
                        (r"/", NopasteCreateHandler),
                        (r"/raw/(.*)", NopasteRawHandler),
                        (r"/view/(.*)", NopasteViewHandler),
-               ] + authentication_handlers + static_handlers)
+               ] + authentication_handlers)
 
                # geoip.ipfire.org
                self.add_handlers(r"geoip(\.dev)?\.ipfire\.org", [
                        (r"/", GeoIPHandler),
-               ] + static_handlers)
+               ])
 
                # talk.ipfire.org
                self.add_handlers(r"talk(\.dev)?\.ipfire\.org", [
@@ -232,12 +224,12 @@ class Application(tornado.web.Application):
                        (r"/phonebook/(\w+)", TalkPhonebookAccountHandler),
                        (r"/phonebook", TalkPhonebookHandler),
                        (r"/profile", TalkProfileHandler),
-               ] + authentication_handlers + static_handlers)
+               ] + authentication_handlers)
 
                # accounts.ipfire.org
                self.add_handlers(r"accounts(\.dev)?\.ipfire\.org", [
                        (r"/avatar/(\w+)\.jpg", AccountsAvatarHandler),
-               ] + static_handlers)
+               ])
 
                # admin.ipfire.org
                self.add_handlers(r"admin(\.dev)?\.ipfire\.org", [
@@ -265,7 +257,7 @@ class Application(tornado.web.Application):
                        (r"/downloads/mirrors", AdminDownloadsMirrorsHandler),
                        # API
                        (r"/api/planet/render", AdminApiPlanetRenderMarkupHandler)
-               ] + authentication_handlers + static_handlers)
+               ] + authentication_handlers)
 
                # ipfire.org
                self.add_handlers(r".*", [