aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/policies/info_pages_templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/proxy/policies/info_pages_templates')
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/info_base.html.jinja89
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/js_error_blocked_info.html.jinja22
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/js_fallback_allowed_info.html.jinja14
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/js_fallback_blocked_info.html.jinja14
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/js_rule_allowed_info.html.jinja14
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/js_rule_blocked_info.html.jinja14
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/js_rule_info.html.jinja37
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/payload_info.html.jinja48
-rw-r--r--src/hydrilla/proxy/policies/info_pages_templates/special_page_info.html.jinja17
9 files changed, 269 insertions, 0 deletions
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/info_base.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/info_base.html.jinja
new file mode 100644
index 0000000..0785039
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/info_base.html.jinja
@@ -0,0 +1,89 @@
+{#
+SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+
+Proxy info page with information about other page - base template.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+
+Dual licensed under
+* GNU General Public License v3.0 or later and
+* Creative Commons Attribution Share Alike 4.0 International.
+
+You can choose to use either of these licenses or both.
+
+
+I, Wojtek Kosior, thereby promise not to sue for violation of this
+file's licenses. Although I request that you do not make use of this
+code in a proprietary work, I am not going to enforce this in court.
+#}
+{% extends "base.html.jinja" %}
+
+{% block style %}
+ {{ super() }}
+
+ #main {
+ padding: 0 10px;
+ }
+{% endblock %}
+
+{% block head %}
+ {{ super() }}
+
+ <title>{{ _('info.base.title') }}</title>
+{% endblock head %}
+
+{% block main %}
+ <h3>
+ {{ _('info.base.heading.page_info') }}
+ </h3>
+
+ {{ label(_('info.base.page_url_label')) }}
+
+ <p>
+ {{ url }}
+ </p>
+
+ <div class="horizontal-separator"></div>
+
+ {{ label(_('info.base.page_policy_label')) }}
+
+ <p class="has-colored-links">
+ {% block site_policy required %}{% endblock %}
+ </p>
+
+ {% block main_rest %}
+ {% endblock %}
+
+ {% block options %}
+ <div class="horizontal-separator"></div>
+
+ {{ label(_('info.base.more_config_options_label')) }}
+
+ {% set site_pattern = url_patterns.pattern_for_domain(url)|urlencode %}
+ {% set page_pattern = url_patterns.normalize_pattern(url)|urlencode %}
+
+ {%
+ for pattern, hkt_url_fmt, but_text in [
+ (site_pattern, 'https://hkt.mitm.it/rules/viewbypattern?pattern={}',
+ _('info.base.this_site_script_blocking_button')),
+
+ (site_pattern, 'https://hkt.mitm.it/import?pattern={}',
+ _('info.base.this_site_payload_button')),
+
+ (page_pattern, 'https://hkt.mitm.it/rules/viewbypattern?pattern={}',
+ _('info.base.this_page_script_blocking_button')),
+
+ (page_pattern, 'https://hkt.mitm.it/import?pattern={}',
+ _('info.base.this_page_payload_button'))
+ ]
+ %}
+ {% set hkt_url = hkt_url_fmt.format(pattern) %}
+ {% set classes = "green-button block-with-bottom-margin" %}
+ <a class="{{classes}}" href="{{ hkt_url }}" target="_blank">
+ {{ but_text }}
+ </a>
+ {% endfor %}
+ {% endblock options %}
+{% endblock main %}
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/js_error_blocked_info.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/js_error_blocked_info.html.jinja
new file mode 100644
index 0000000..c76d42b
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/js_error_blocked_info.html.jinja
@@ -0,0 +1,22 @@
+{#
+SPDX-License-Identifier: CC0-1.0
+
+Proxy info page with information about page with JS blocked after an error.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+#}
+{% extends "info_base.html.jinja" %}
+
+{% block site_policy %}
+ {{ _('info.js_error_blocked.html')|safe }}
+{% endblock %}
+
+{% block main_rest %}
+ {% if settings.advanced_user %}
+ {{ label(_('info.js_error_blocked.stacktrace')) }}
+
+ {{ verbatim(traceback) }}
+ {% endif %}
+{% endblock %}
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/js_fallback_allowed_info.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/js_fallback_allowed_info.html.jinja
new file mode 100644
index 0000000..71f3151
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/js_fallback_allowed_info.html.jinja
@@ -0,0 +1,14 @@
+{#
+SPDX-License-Identifier: CC0-1.0
+
+Proxy info page with information about page with JS allowed by default policy.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+#}
+{% extends "info_base.html.jinja" %}
+
+{% block site_policy %}
+ {{ _('info.js_fallback_allowed') }}
+{% endblock %}
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/js_fallback_blocked_info.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/js_fallback_blocked_info.html.jinja
new file mode 100644
index 0000000..3e8719a
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/js_fallback_blocked_info.html.jinja
@@ -0,0 +1,14 @@
+{#
+SPDX-License-Identifier: CC0-1.0
+
+Proxy info page with information about page with JS blocked by default policy.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+#}
+{% extends "info_base.html.jinja" %}
+
+{% block site_policy %}
+ {{ _('info.js_fallback_blocked') }}
+{% endblock %}
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/js_rule_allowed_info.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/js_rule_allowed_info.html.jinja
new file mode 100644
index 0000000..fe74602
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/js_rule_allowed_info.html.jinja
@@ -0,0 +1,14 @@
+{#
+SPDX-License-Identifier: CC0-1.0
+
+Proxy info page with information about page with JS allowed by a rule.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+#}
+{% extends "js_rule_info.html.jinja" %}
+
+{% block site_policy %}
+ {{ format_html_with_rule_url(_('info.js_allowed.html.rule{url}_is_used')) }}
+{% endblock %}
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/js_rule_blocked_info.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/js_rule_blocked_info.html.jinja
new file mode 100644
index 0000000..e84d371
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/js_rule_blocked_info.html.jinja
@@ -0,0 +1,14 @@
+{#
+SPDX-License-Identifier: CC0-1.0
+
+Proxy info page with information about page with JS blocked by a rule.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+#}
+{% extends "js_rule_info.html.jinja" %}
+
+{% block site_policy %}
+ {{ format_html_with_rule_url(_('info.js_blocked.html.rule{url}_is_used')) }}
+{% endblock %}
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/js_rule_info.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/js_rule_info.html.jinja
new file mode 100644
index 0000000..b808827
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/js_rule_info.html.jinja
@@ -0,0 +1,37 @@
+{#
+SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+
+Proxy info page with information about page with JS blocked or allowed by a
+rule - template for firther extending.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+
+Dual licensed under
+* GNU General Public License v3.0 or later and
+* Creative Commons Attribution Share Alike 4.0 International.
+
+You can choose to use either of these licenses or both.
+
+
+I, Wojtek Kosior, thereby promise not to sue for violation of this
+file's licenses. Although I request that you do not make use of this
+code in a proprietary work, I am not going to enforce this in court.
+#}
+{% extends "info_base.html.jinja" %}
+
+{% macro format_html_with_rule_url(msg_fmt) %}
+ {% set url_fmt = 'https://hkt.mitm.it/rules/viewbypattern?pattern={pattern}' %}
+ {{ msg_fmt.format(url=url_fmt.format(pattern=pattern)|e)|safe }}
+{% endmacro %}
+
+{% block main_rest %}
+ <div class="horizontal-separator"></div>
+
+ {{ label(_('info.rule.matched_pattern_label')) }}
+
+ <p>
+ {{ pattern }}
+ </p>
+{% endblock %}
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/payload_info.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/payload_info.html.jinja
new file mode 100644
index 0000000..a71ca25
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/payload_info.html.jinja
@@ -0,0 +1,48 @@
+{#
+SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+
+Proxy info page with information about page with payload.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+
+Dual licensed under
+* GNU General Public License v3.0 or later and
+* Creative Commons Attribution Share Alike 4.0 International.
+
+You can choose to use either of these licenses or both.
+
+
+I, Wojtek Kosior, thereby promise not to sue for violation of this
+file's licenses. Although I request that you do not make use of this
+code in a proprietary work, I am not going to enforce this in court.
+#}
+{% extends "info_base.html.jinja" %}
+
+{% macro format_html_with_package_identifier_and_url(msg_fmt) %}
+ {% set package_identifier = payload_data.mapping_identifier|e %}
+ {% set url_fmt = 'https://hkt.mitm.it/package/viewbypayload/{payload_id}/{package_identifier}' %}
+ {%
+ set url = url_fmt.format(
+ payload_id = payload_data.ref.id,
+ package_identifier = package_identifier
+ )
+ %}
+ {{ msg_fmt.format(identifier=package_identifier, url=url|e)|safe }}
+{% endmacro %}
+
+{% block site_policy %}
+ {% set fmt = _('info.payload.html.package_{identifier}{url}_is_used') %}
+ {{ format_html_with_package_identifier_and_url(fmt) }}
+{% endblock %}
+
+{% block main_rest %}
+ <div class="horizontal-separator"></div>
+
+ {{ label(_('info.payload.matched_pattern_label')) }}
+
+ <p>
+ {{ payload_data.pattern }}
+ </p>
+{% endblock %}
diff --git a/src/hydrilla/proxy/policies/info_pages_templates/special_page_info.html.jinja b/src/hydrilla/proxy/policies/info_pages_templates/special_page_info.html.jinja
new file mode 100644
index 0000000..2f7a9d3
--- /dev/null
+++ b/src/hydrilla/proxy/policies/info_pages_templates/special_page_info.html.jinja
@@ -0,0 +1,17 @@
+{#
+SPDX-License-Identifier: CC0-1.0
+
+Proxy info page with information about page handled by special policy.
+
+This file is part of Hydrilla&Haketilo.
+
+Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
+#}
+{% extends "info_base.html.jinja" %}
+
+{% block site_policy %}
+ {{ _('info.special_page') }}
+{% endblock %}
+
+{% block options %}
+{% endblock %}