diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-10-10 16:45:41 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-10-10 16:45:41 +0200 |
commit | 28e2064c86cfb9f35312417192f5b1395b16917c (patch) | |
tree | 6c2846ab180b4d2ad6f4c1153d296c8b5c972ee0 /src/hydrilla/proxy | |
parent | b880bdc779b800ebde810279d1cf5b9e530000de (diff) | |
download | haketilo-hydrilla-28e2064c86cfb9f35312417192f5b1395b16917c.tar.gz haketilo-hydrilla-28e2064c86cfb9f35312417192f5b1395b16917c.zip |
[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
Diffstat (limited to 'src/hydrilla/proxy')
4 files changed, 19 insertions, 11 deletions
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') }} </h4> - <p> - {{ _('web_ui.home.haketilo_is_blah_blah') }} + <p class="has-colored-links"> + {{ _('web_ui.home.html.haketilo_is_blah_blah')|safe }} </p> <div class="horizontal-separator"></div> + {% if request.url.startswith('http://') %} + <h4> + {{ _('web_ui.home.heading.configuring_browser_for_haketilo') }} + </h4> + + <p class="has-colored-links"> + {{ _('web_ui.home.html.to_add_certs_do_xyz')|safe }} + </p> + + <div class="horizontal-separator"></div> + {% endif %} + <h4> {{ _('web_ui.home.heading.options') }} </h4> 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. </ul> {% 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')) }} |