--- /dev/null
+/* CSS-Style IPFire v3 */
+
+/* Reset CSS-defaults */
+*, html, body, p, pre, span {
+ border: none;
+ margin: 0;
+ padding: 0;
+}
+
+/* Set defaults */
+*, html, body, p, span {
+ font-family: verdana, arial, sans-serif;
+ font-size: 14px;
+ color: #333333;
+}
+
+body {
+}
+
+body, .topmenu, .sh-bl, .sh-btn, .sh-br, .sh-ul, .sh-top, .sh-ur, .sh-l, .sh-r {
+ background-color: #8a0400 !important;
+}
+
+.main, .top-bgcolor {
+ /* Main BG-Color */
+ background-color: #F5F5F5;
+}
+
+/* CSS for Top-Menu and Main with shadows */
+.topmenu, .footer {
+ background:url(images/sprite1.png) repeat-x;
+}
+
+.sh-bl, .sh-btn, .sh-br, .sh-ul, .sh-top, .sh-ur {
+ background: url(images/shadow-h.png) no-repeat;
+ height: 30px;
+}
+
+.sh-l, .sh-r {
+ background: url(images/shadow-v.png) repeat-y;
+}
+
+.topmenu, .topmenu-down {
+ background-position: 0 0;
+ color:#fff;
+ width:100%;
+ height:99px;
+ text-align: center;
+}
+
+.wrapper {
+ margin:0 auto;
+ padding-left: 5px;
+ padding-right: 5px;
+ width: 1000px;
+ height: auto;
+}
+
+.sh-ul {
+ background-position: left 0;
+}
+
+.sh-top {
+ margin-right: 30px;
+ background-position: 0px -160px;
+ background-repeat:repeat-x;
+ height: 15px;
+}
+
+.sh-ur {
+ margin-left: 30px;
+ background-position: right -80px;
+}
+
+.top-bgcolor {
+ height: 15px;
+ margin-right: 15px;
+ margin-left: -15px;
+}
+
+.sh-l {
+ background-position: left;
+}
+
+.sh-r {
+ background-position: right;
+ margin-left: 15px;
+}
+
+.main {
+ margin-right: 15px;
+ text-align: left;
+ padding-left: 1em;
+}
+
+.footer, .sh-btn {
+ background-position: -10px -110px;
+ color:#fff;
+ height:36px;
+ text-align: center;
+}
+
+.footer {
+ background-position: -10px -110px;
+ margin-right: 15px !important;
+ margin-right: 30px;
+ margin-left: -15px;
+}
+
+.sh-btn {
+ margin-right: 30px;
+ background-position: 0 bottom !important;
+ background-position: 0 -205px;
+ background-repeat:repeat-x;
+ height: 15px;
+}
+
+.sh-bl {
+ background-position: left -30px;
+ height: 50px;
+}
+
+.sh-br {
+ margin-left: 30px !important;
+ background-position: right -110px;
+ height: 50px;
+}
+
+.header_inner {
+ position: relative;
+ width: 980px;
+ height:102px;
+ margin: 0 auto;
+}
+
+.logo {
+ position: absolute;
+ top: 0;
+ float: left;
+}
+
+.topmenu h1 {
+ float: left;
+ margin-left: 105px;
+ color: #eee;
+ font-size: 1.8em;
+}
+
+.topmenu h2 {
+ float: left;
+ margin-left: 105px;
+ color: #E5CCD0;
+ font-size: 1.0em;
+ vertical-align: bottom;
+}
+
+/* Header Line's */
+.line1 {
+ height: 37px;
+}
+
+.line2 {
+ height: 32px;
+ color: #CCC;
+}
+
+.line3 {
+ height: 31px;
+}
+
+/* Lang */
+.lang {
+ position: absolute;
+ right: 0em;
+ top: 0em;
+}
+
+.lang img {
+ float: left;
+ border: none;
+ margin-right: 0.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0.5em;
+ width: 30px;
+}
+
+/* Menu */
+
+.menu {
+ position: absolute;
+ left: 105px;
+ top: 0em;
+}
+
+.menu li, .menu li a, .menu li a.active, .menu li a:hover {
+ background: url(images/sprite1.png) no-repeat;
+}
+
+.menu ul {
+ list-style: none;
+}
+
+.menu li {
+ font-size:16px;
+ float: left;
+}
+
+.menu li {
+ vertical-align: middle;
+ background-position: 0 -470px;
+}
+
+.menu li a {
+ margin-left: 1px; /*0.5em;*/
+ margin-right: 1px;
+ display: block;
+ padding: 10px 5px 0 8px;
+ height: 26px;
+ background-position: 0 -430px;
+ background-repeat: repeat-x;
+ color: #ddd;
+ font-weight: bolder;
+ vertical-align: middle;
+ font-size: 0.8em;
+ text-decoration: none;
+}
+
+.menu li a.active {
+ background-position: 0 -190px;
+ background-repeat: repeat-x;
+ color: #ddd;
+}
+
+.menu li a:hover {
+ background-position: 0 -190px;
+ background-repeat: repeat-x;
+ color: #fff;
+}
+
+img.symbol {
+ float: left;
+ margin-bottom: 0em;
+ border: 0;
+}
+
+h1, h2, h3, h4 {
+ color: #8a0400;
+}
+
+h1 {
+ font-size: 1.4em;
+}
+
+div.container h1 {
+ font-size: 1.4em;
+ border-bottom: 1px solid #ddd;
+}
+
+div.container h1 .help, div.container h1 .print {
+ margin: 2px;
+ height: 20px;
+ width: 20px;
+ float: right;
+ vertical-align: middle;
+ background-image: url(20x20-ic.png);
+ background-position: -53px -105px;
+}
+
+div.container h1 .print {
+ background-position: -158px -158px;
+}
+
+div.container h2 {
+ font-size: 1.1em;
+ margin-left: 3px;
+}
+
+div.container h3 {
+ font-size: 1em;
+ margin-left: 6px;
+}
+
+div.container h4 {
+ color: #666666;
+ font-size: 1em;
+ margin-left: 6px;
+}
+
+div.container {
+ background-color: #f0f0f0;
+ border:1px solid #ddd;
+ padding: 0.25em;
+ margin-bottom: 15px;
+ margin-right: 1em;
+}
+
+div.container p {
+ font-size: 14px;
+ margin-left: 12px;
+}
+
+div.container fieldset {
+ border: 1px solid #999999;
+ margin-left: 12px;
+ margin-right: 5px;
+ padding: 5px;
+ padding-left: 12px;
+}
+
+div.container fieldset legend {
+ color: #999999;
+}
+
+input {
+ border: none;
+ padding: 1px;
+ overflow: visible;
+}
+
+input[type="text"], input[type="submit"] {
+ border: 1px solid #ccc;
+}
+
+input[type="text"]:hover, input[type="text"]:focus, input[type="submit"]:hover, input[type="submit"]:focus {
+ border: 1px solid #8a0400;
+}
+
+input, label {
+ margin-bottom: 5px;
+ padding: 2px;
+ height: 16px;
+ vertical-align: middle;
+}
+
+.w200px {
+ float: left;
+ width: 200px;
+}
+
+div.container fieldset input[type="submit"] {
+ float: right;
+ margin-left: 5px;
+ padding-left: 22px;
+ font-weight: bold;
+ color: #000;
+ height: 22px;
+}
+
+button {
+ border: 1px outset #ccc;
+ float: right;
+ margin-left: 5px;
+ padding-right: 2px;
+ height: 22px;
+}
+
+button:hover {
+ border: 1px solid #C00;
+}
+
+.bcancel, .byes, .bno {
+ background: url(20-x-ico.png) no-repeat;
+}
+
+.bcancel {
+ background-position: 0 -40px;
+}
+
+.byes {
+ background-position: 0 -20px;
+}
+
+.bno {
+ background-position: 0 -0px;
+}
+
+div.container .linecode, div.container .linecode ol, div.container .linecode ol li {
+ font-family:"Lucida Console", Monaco, monospace;
+ font-size: 14px;
+ line-height: 16px;
+}
+
+div.container .linecode {
+ white-space: pre;
+ border: 1px solid #aaa;
+ background: #fafafa;
+ margin-top: 0.25em;
+ padding: 0.25em 0 0 4em;
+}
+
+div.container .linecode ol {
+ white-space: nowrap;
+ padding-right: 0.25em;
+}
+
+div.container .linecode ol li {
+ white-space: pre;
+}
+
+.lbg1 {
+ background: #FAFAFA;
+}
+
+.lbg2 {
+ background: #EEE;
+}
+
+div.container .tblock {
+ display: block;
+ overflow: auto;
+}
+
+div.container table .iptables {
+ border-collapse: inherit;
+}
+
+div.container .iptables th, div.container .iptables td {
+ padding: 0 5px 0 5px;
+ border: 0px solid #aaa;
+ font-size: 12px;
+ white-space:nowrap;
+}
+
+.lbg3 {
+ background: #CCC;
+}
+
+.c-lo {
+ color: #F0F;
+}
+
+.c-green {
+ color: #0C0;
+}
+
+.c-orange {
+ color: #F90;
+}
+
+.c-red {
+ color: #C00;
+}
+
+.c-blue {
+ color: #33F;
+}
+
+div.container .iptables .drop, div.container .iptables .accept, div.container .iptables .log, div.container .iptables .other {
+ padding-left: 15px;
+}
+
+.drop, .accept, .log, .other {
+ background-image: url(images/icons.png);
+ background-repeat: no-repeat;
+ width: 15px;
+ height: 12px;
+ vertical-align: middle;
+}
+
+.drop {
+ background-position: 0 -0px;
+}
+
+.accept {
+ background-position: 0 -71px;
+}
+
+.log {
+ background-position: 0 -58px;
+}
+
+.other {
+ background-position: 0 -34px;
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8;charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="{{ static_url("templates/template/style.css") }}" />
+ <title>{{ _("IPFire Webconsole") }} - {{ title }}</title>
+ </head>
+
+ <body>
+ <div class="topmenu">
+ <div class="header_inner">
+ <div class="logo">
+ <a href="/">
+ <img src="{{ static_url("templates/template/images/menu_tux.png") }}"
+ class="symbol" alt="IPFire" />
+ </a>
+ </div>
+ <div class="line1">
+ <div class="menu">
+ <ul>
+ <li><a href="#" class="active">Menu Item 1</a></li>
+ <li><a href="#">Menu Item 2</a></li>
+ <li><a href="#">Menu Item 3</a></li>
+ <li><a href="#">Menu Item 4</a></li>
+ </ul>
+ </div>
+ <div class="lang">
+ {{ _("Logged in as:") }} {{ user }}
+ <!-- <a href="#">
+ <img src="{{ static_url("templates/template/images/de.gif") }}"
+ alt="{{ _("German") }}" />
+ </a>
+ <a href="#">
+ <img src="{{ static_url("templates/template/images/en.gif") }}"
+ alt="{{ _("English") }}" />
+ </a> -->
+ <a href="/logout">{{ _("Logout") }}</a>
+ </div>
+ </div>
+ <div class="line2">
+ <h1>{{ _("IPFire Webconsole") }}</h1>
+ </div>
+ <div class="line3">
+ <h2>{{ slogan }}</h2>
+ </div>
+ </div>
+ </div>
+
+ <div class="wrapper">
+ <div class="sh-ul">
+ <div class="sh-ur">
+ <div class="sh-top">
+ </div>
+ <div class="top-bgcolor">
+ </div>
+ </div>
+ </div>
+
+ <div class="sh-l">
+ <div class="sh-r">
+ <div class="main">
+ <!-- The place where containers go -->
+ <br />
+ </div>
+ </div>
+ </div>
+
+ <div class="sh-bl">
+ <div class="sh-br">
+ <div class="footer">
+ {{ footer }}
+ </div>
+ <div class="sh-btn">
+ </div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
--- /dev/null
+#!/usr/bin/python
+
+import os
+import socket
+import time
+
+import tornado.httpserver
+import tornado.ioloop
+import tornado.web
+
+BASEDIR = os.path.dirname(__file__)
+
+settings = {
+ "static_path" : os.path.join(BASEDIR, "static"),
+ "template_path" : os.path.join(BASEDIR, "templates"),
+ "login_url" : "/login",
+ "cookie_secret" : "123456789",
+ "xsrf_cookies" : True,
+}
+
+class BaseHandler(tornado.web.RequestHandler):
+ def get_current_user(self):
+ return self.get_secure_cookie("user")
+
+ def footer(self):
+ return "%s" % socket.gethostname()
+
+
+class MainHandler(BaseHandler):
+ def get(self):
+ if not self.current_user:
+ self.redirect("/login")
+ return
+
+ self.render("template.html", title="Testsite", slogan="Security now!",
+ footer=self.footer(), user=self.current_user)
+
+
+class LoginHandler(BaseHandler):
+ def get(self):
+ self.render("login.html", footer=self.footer())
+
+ def post(self):
+ self.set_secure_cookie("user", self.get_argument("user"))
+ self.redirect("/")
+
+class LogoutHandler(BaseHandler):
+ def get(self):
+ self.clear_cookie("user")
+ self.render("logout.html", footer=self.footer())
+
+
+application = tornado.web.Application([
+ (r"/", MainHandler),
+ (r"/login", LoginHandler),
+ (r"/logout", LogoutHandler),
+], **settings)
+
+if __name__ == "__main__":
+ http_server = tornado.httpserver.HTTPServer(application)
+ http_server.listen(8080)
+ tornado.ioloop.IOLoop.instance().start()