Further simplify
@@ -42,20 +42,16 @@ config = dict()
def logs():
logs = config.get("logger").logs
return render_template('logs.html.j2',
- title="",
logs=logs,
)
-
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def index(path):
return render_template('index.html.j2',
- title="",
policy=yaml.dump(config.get("policy")),
)
-
def start_server(host, port, policy, accept_proxy_headers=False, logger=None):
if accept_proxy_headers:
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
@@ -63,6 +59,7 @@ def start_server(host, port, policy, accept_proxy_headers=False, logger=None):
config["logger"] = logger
threading.Thread(target=app.run, args=(host, port)).start()
+
class ServerStateLogHandler(logging.Handler):
def __init__(self, max=100):
logging.Handler.__init__(self)
