diff --git a/config.example.py b/config.example.py index 956ba963..08c53ba7 100644 --- a/config.example.py +++ b/config.example.py @@ -8,10 +8,10 @@ class Config(): # Flask testing TESTING = False # SSO auth enabled - SSO_AUTH = False + SSO_AUTH = True # Authentication is done outside the app, use HTTP header to get the user uuid. # If SSO_AUTH is set to True, this option is ignored and SSO auth is used. - HEADER_AUTH = True + HEADER_AUTH = False # Name of HTTP header containing the UUID of authenticated user. # Only used when HEADER_AUTH is set to True AUTH_HEADER_NAME = 'X-Authenticated-User' diff --git a/flowapp/__init__.py b/flowapp/__init__.py index 536ac51f..95b8afdc 100644 --- a/flowapp/__init__.py +++ b/flowapp/__init__.py @@ -87,13 +87,13 @@ def logout(): def ext_login(): header_name = app.config.get("AUTH_HEADER_NAME", 'X-Authenticated-User') if header_name not in request.headers: - return render_template("errors/401.j2") + return render_template("errors/401.html") uuid = request.headers.get(header_name) if uuid: try: _register_user_to_session(uuid) except AttributeError: - return render_template("errors/401.j2") + return render_template("errors/401.html") return redirect("/") @app.route("/") @@ -136,12 +136,12 @@ def shutdown_session(exception=None): # HTTP error handling @app.errorhandler(404) def not_found(error): - return render_template("errors/404.j2"), 404 + return render_template("errors/404.html"), 404 @app.errorhandler(500) def internal_error(exception): app.logger.error(exception) - return render_template("errors/500.j2"), 500 + return render_template("errors/500.html"), 500 @app.context_processor def utility_processor(): diff --git a/flowapp/instance_config.py b/flowapp/instance_config.py index d2ae8743..548261be 100644 --- a/flowapp/instance_config.py +++ b/flowapp/instance_config.py @@ -99,7 +99,7 @@ class InstanceConfig: DASHBOARD = { "ipv4": { "name": "IPv4", - "macro_file": "macros.j2", + "macro_file": "macros.html", "macro_tbody": "build_ip_tbody", "macro_thead": "build_rules_thead", "table_colspan": 10, @@ -107,7 +107,7 @@ class InstanceConfig: }, "ipv6": { "name": "IPv6", - "macro_file": "macros.j2", + "macro_file": "macros.html", "macro_tbody": "build_ip_tbody", "macro_thead": "build_rules_thead", "table_colspan": 10, @@ -115,7 +115,7 @@ class InstanceConfig: }, "rtbh": { "name": "RTBH", - "macro_file": "macros.j2", + "macro_file": "macros.html", "macro_tbody": "build_rtbh_tbody", "macro_thead": "build_rules_thead", "table_colspan": 5, diff --git a/flowapp/templates/errors/401.j2 b/flowapp/templates/errors/401.html similarity index 83% rename from flowapp/templates/errors/401.j2 rename to flowapp/templates/errors/401.html index 6fea372d..6da05328 100755 --- a/flowapp/templates/errors/401.j2 +++ b/flowapp/templates/errors/401.html @@ -1,4 +1,4 @@ -{% extends 'layouts/default.j2' %} +{% extends 'layouts/default.html' %} {% block content %}
401: Unauthorized
diff --git a/flowapp/templates/errors/404.j2 b/flowapp/templates/errors/404.html similarity index 78% rename from flowapp/templates/errors/404.j2 rename to flowapp/templates/errors/404.html index 0bd068c0..8bccd1d7 100644 --- a/flowapp/templates/errors/404.j2 +++ b/flowapp/templates/errors/404.html @@ -1,4 +1,4 @@ -{% extends 'layouts/default.j2' %} +{% extends 'layouts/default.html' %} {% block content %}There's nothing here!
diff --git a/flowapp/templates/errors/500.j2 b/flowapp/templates/errors/500.html similarity index 76% rename from flowapp/templates/errors/500.j2 rename to flowapp/templates/errors/500.html index ff0a04be..e6aa9ebf 100644 --- a/flowapp/templates/errors/500.j2 +++ b/flowapp/templates/errors/500.html @@ -1,4 +1,4 @@ -{% extends 'layouts/default.j2' %} +{% extends 'layouts/default.html' %} {% block content %}Sorry ;-)
diff --git a/flowapp/templates/forms/api_key.j2 b/flowapp/templates/forms/api_key.html similarity index 88% rename from flowapp/templates/forms/api_key.j2 rename to flowapp/templates/forms/api_key.html index d1128583..9d8901cb 100644 --- a/flowapp/templates/forms/api_key.j2 +++ b/flowapp/templates/forms/api_key.html @@ -1,5 +1,5 @@ -{% extends 'layouts/default.j2' %} -{% from 'forms/macros.j2' import render_field %} +{% extends 'layouts/default.html' %} +{% from 'forms/macros.html' import render_field %} {% block title %}Add New Machine with ApiKey{% endblock %} {% block content %}