import ipfire
import ipfire.countries
+from .. import util
from .handlers import *
# UI Methods
"ui_methods" : {
+ "format_asn" : self.format_asn,
"format_country_name" : self.format_country_name,
"format_language_name" : self.format_language_name,
"format_month_name" : self.format_month_name,
])
# blog.ipfire.org
- self.add_handlers(r"blog(\.dev)?\.ipfire\.org", [
+ self.add_handlers(r"blog\.ipfire\.org", [
(r"/", blog.IndexHandler),
(r"/authors/(\w+)", blog.AuthorHandler),
(r"/compose", blog.ComposeHandler),
] + authentication_handlers)
# downloads.ipfire.org
- self.add_handlers(r"downloads?(\.dev)?\.ipfire\.org", [
+ self.add_handlers(r"downloads?\.ipfire\.org", [
(r"/", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/" }),
(r"/release/(.*)", download.ReleaseRedirectHandler),
(r"/(.*)", download.FileHandler),
])
# mirrors.ipfire.org
- self.add_handlers(r"mirrors(\.dev)?\.ipfire\.org", [
+ self.add_handlers(r"^mirrors\.ipfire\.org", [
(r"/", mirrors.IndexHandler),
(r"/mirrors/(.*)", mirrors.MirrorHandler),
])
# planet.ipfire.org
- self.add_handlers(r"planet(\.dev)?\.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),
])
# fireinfo.ipfire.org
- self.add_handlers(r"fireinfo(\.dev)?\.ipfire\.org", [
+ self.add_handlers(r"fireinfo\.ipfire\.org", [
(r"/", fireinfo.IndexHandler),
# Admin
] + authentication_handlers)
# i-use.ipfire.org
- self.add_handlers(r"i-use(\.dev)?\.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),
])
])
# nopaste.ipfire.org
- self.add_handlers(r"nopaste(\.dev)?\.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(\.dev)?\.ipfire\.org", [
+ self.add_handlers(r"location\.ipfire\.org", [
(r"/", location.IndexHandler),
(r"/how\-to\-use", StaticHandler, { "template" : "../location/how-to-use.html" }),
(r"/lookup/(.+)/blacklists", location.BlacklistsHandler),
])
# geoip.ipfire.org
- self.add_handlers(r"geoip(\.dev)?\.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(\.dev)?\.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(\.dev)?\.ipfire\.org", [
+ 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),
] + authentication_handlers)
# wiki.ipfire.org
- self.add_handlers(r"wiki(\.dev)?\.ipfire\.org",
+ self.add_handlers(r"wiki\.ipfire\.org",
authentication_handlers + [
# Actions
logging.info("Successfully initialied application")
+ def format_asn(self, handler, asn):
+ return util.format_asn(asn)
+
def format_country_name(self, handler, country_code):
return ipfire.countries.get_name(country_code)