from .handlers import *
+from . import analytics
from . import auth
from . import blog
from . import boot
# Enable XSRF cookies
"xsrf_cookies" : True,
+ "xsrf_cookie_kwargs" : {
+ "secure" : True,
+ },
# Login
"login_url" : "/login",
# UI Modules
"ui_modules" : {
+ # Analytics
+ "AnalyticsSummary" : analytics.SummaryModule,
+
# Auth
"Password" : auth.PasswordModule,
(r"/logout", auth.LogoutHandler),
]
- self.add_handlers(r"(www\.)?([a-z]+\.dev\.)?ipfire\.org", [
+ self.add_handlers(r"www\.([a-z]+\.dev\.)?ipfire\.org", [
# Entry site that lead the user to index
(r"/", IndexHandler),
+ # Analytics
+ (r"/analytics", analytics.IndexHandler),
+ (r"/analytics/docs", analytics.DocsHandler),
+
# Authentication
(r"/join", auth.JoinHandler),
(r"/login", auth.LoginHandler),
(r"/docs(/[A-Za-z0-9\-_\/]+)?/_files", docs.FilesHandler),
(r"/docs(/[A-Za-z0-9\-_\/]+(?:.*)\.(?:\w+))/_delete", docs.DeleteFileHandler),
(r"/docs(/[A-Za-z0-9\-_\/]+(?:.*)\.(?:\w+))$", docs.FileHandler),
- (r"/docs(/[A-Za-z0-9\-_\/]+)?", docs.PageHandler),
+ (r"/docs(/[A-Za-z0-9\-_\/]*)?", docs.PageHandler),
# Downloads
(r"/downloads", downloads.IndexHandler),
(r"/donate", donate.DonateHandler),
(r"/donate/thank-you", donate.ThankYouHandler),
(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),
# Lists
(r"/lists", lists.IndexHandler),
(r"/password\-reset/([a-z_][a-z0-9_-]{0,31})/(\w+)", auth.PasswordResetHandler),
(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),
+ # Location
+ (r"/location/?", StaticHandler, { "template" : "location/index.html" }),
+ (r"/location/download", tornado.web.RedirectHandler, { "url" : "/location/install" }),
+ (r"/location/how\-to\-use", StaticHandler, { "template" : "location/how-to-use/index.html" }),
+ (r"/location/how\-to\-use/cli", StaticHandler, { "template" : "location/how-to-use/cli.html" }),
+ (r"/location/how\-to\-use/dns", StaticHandler, { "template" : "location/how-to-use/dns.html" }),
+ (r"/location/how\-to\-use/python", StaticHandler, { "template" : "location/how-to-use/python.html" }),
+ (r"/location/install", StaticHandler, { "template" : "location/install.html" }),
+ (r"/location/report\-a\-problem", StaticHandler, { "template" : "location/report-a-problem.html" }),
+ (r"/location/lookup/(.+)", location.LookupHandler),
# Single-Sign-On for Discourse
(r"/sso/discourse", auth.SSODiscourse),
(r"/about", StaticHandler, { "template" : "static/about.html" }),
(r"/legal", StaticHandler, { "template" : "static/legal.html" }),
(r"/help", StaticHandler, { "template" : "static/help.html" }),
+ (r"/partners", StaticHandler, { "template" : "static/partners.html" }),
(r"/sitemap", StaticHandler, { "template" : "static/sitemap.html" }),
# API
(r"/imprint", tornado.web.RedirectHandler, { "url" : "/legal" }),
(r"/news.rss", tornado.web.RedirectHandler, { "url" : "/blog/feed.xml" }),
(r"/news/(.*)", tornado.web.RedirectHandler, { "url" : "/blog/{0}" }),
+ (r"/projects(/.*)", tornado.web.RedirectHandler, { "url" : "{0}" }),
(r"/support", tornado.web.RedirectHandler, { "url" : "/help"}),
(r"/(de|en)/(.*)", tornado.web.RedirectHandler, { "url" : "/{0}"}),
# fireinfo.ipfire.org
self.add_handlers(r"fireinfo\.([a-z]+\.dev\.)?ipfire\.org", [
- (r"/", fireinfo.IndexHandler),
-
- # Admin
- (r"/admin", fireinfo.AdminIndexHandler),
-
- # Vendors
- (r"/vendors", fireinfo.VendorsHandler),
- (r"/vendors/(pci|usb)/([0-9a-f]{4})", fireinfo.VendorHandler),
-
- # Driver
- (r"/drivers/(.*)", fireinfo.DriverDetail),
-
- # Show profiles
- (r"/profile/random", fireinfo.RandomProfileHandler),
- (r"/profile/([a-z0-9]{40})", fireinfo.ProfileHandler),
-
- # Stats
- (r"/processors", fireinfo.ProcessorsHandler),
- (r"/releases", fireinfo.ReleasesHandler),
-
- # Send profiles
+ # Handle profiles
(r"/send/([a-z0-9]+)", fireinfo.ProfileSendHandler),
- # Serve any static files
- (r"/static/(.*)", tornado.web.StaticFileHandler, { "path" : self.settings.get("static_path") }),
- ] + authentication_handlers)
+ # Redirect anything else
+ (r"(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/fireinfo{0}" }),
+ ])
# i-use.ipfire.org
self.add_handlers(r"i-use\.([a-z]+\.dev\.)?ipfire\.org", [
# nopaste.ipfire.org
self.add_handlers(r"nopaste\.([a-z]+\.dev\.)?ipfire\.org", [
(r"/", nopaste.CreateHandler),
+ (r"/upload", nopaste.UploadHandler),
+
+ # View
(r"/raw/(.*)", nopaste.RawHandler),
(r"/view/(.*)", nopaste.ViewHandler),
# location.ipfire.org
self.add_handlers(r"location\.([a-z]+\.dev\.)?ipfire\.org", [
- (r"/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/projects/location/{0}" }),
+ (r"(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/location{0}" }),
])
# geoip.ipfire.org
# wiki.ipfire.org
self.add_handlers(r"wiki\.([a-z]+\.dev\.)?ipfire\.org", [
- (r"/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/docs/{0}" }),
+ (r"(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/docs{0}" }),
])
# ipfire.org
- self.add_handlers(r"(.*)ipfire\.org", [
- (r".*", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org" })
+ self.add_handlers(r"([a-z]+\.dev\.)?ipfire\.org", [
+ (r".*", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/" })
])
logging.info("Successfully initialied application")