From 28e2064c86cfb9f35312417192f5b1395b16917c Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Mon, 10 Oct 2022 16:45:41 +0200 Subject: [proxy] when web UI's home page is accessed through plain HTTP, show link to TLS certs page and tell the user to install mitmproxy cert --- src/hydrilla/proxy/web_ui/root.py | 2 +- src/hydrilla/proxy/web_ui/templates/base.html.jinja | 4 ++++ src/hydrilla/proxy/web_ui/templates/index.html.jinja | 16 ++++++++++++++-- .../web_ui/templates/items/item_viewversion.html.jinja | 8 -------- 4 files changed, 19 insertions(+), 11 deletions(-) (limited to 'src/hydrilla/proxy/web_ui') diff --git a/src/hydrilla/proxy/web_ui/root.py b/src/hydrilla/proxy/web_ui/root.py index 3676307..14b44ff 100644 --- a/src/hydrilla/proxy/web_ui/root.py +++ b/src/hydrilla/proxy/web_ui/root.py @@ -167,7 +167,7 @@ def process_request( flask_response = app.test_client().open( path = path, - base_url = 'https://hkt.mitm.it', + base_url = f'{request_info.url.scheme}://hkt.mitm.it', method = request_info.method, query_string = request_info.url.query, headers = [*request_info.headers.items()], diff --git a/src/hydrilla/proxy/web_ui/templates/base.html.jinja b/src/hydrilla/proxy/web_ui/templates/base.html.jinja index 266e448..e4760bf 100644 --- a/src/hydrilla/proxy/web_ui/templates/base.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/base.html.jinja @@ -118,6 +118,10 @@ code in a proprietary work, I am not going to enforce this in court. color: inherit; } + .has-colored-links a { + color: #557b8e; + } + .small-print { font-size: 80%; color: #555; diff --git a/src/hydrilla/proxy/web_ui/templates/index.html.jinja b/src/hydrilla/proxy/web_ui/templates/index.html.jinja index f05cf4a..e42f5e9 100644 --- a/src/hydrilla/proxy/web_ui/templates/index.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/index.html.jinja @@ -37,12 +37,24 @@ code in a proprietary work, I am not going to enforce this in court. {{ _('web_ui.home.heading.about_haketilo') }} -

- {{ _('web_ui.home.haketilo_is_blah_blah') }} +

+ {% if request.url.startswith('http://') %} +

+ {{ _('web_ui.home.heading.configuring_browser_for_haketilo') }} +

+ + + +
+ {% endif %} +

{{ _('web_ui.home.heading.options') }}

diff --git a/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja index 3d1a2cb..4b6cdee 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja @@ -56,14 +56,6 @@ code in a proprietary work, I am not going to enforce this in court. {% endmacro %} -{% block style %} - {{ super() }} - - .has-colored-links a { - color: #557b8e; - } -{% endblock %} - {% block top_errors %} {% if not version_display_info.info.compatible %} {{ error_note(_('web_ui.err.item_not_compatible')) }} -- cgit v1.2.3