Add policy URLs and contact addresses for instances in the relevant places

This commit is contained in:
Matthew Wild
2023-10-25 16:06:07 +01:00
parent 14368c5e9a
commit d6d4bb5afb
19 changed files with 220 additions and 54 deletions

View File

@@ -5,6 +5,11 @@ if [ -n "${SNIKKET_SITE_NAME:-}" ]; then
export SNIKKET_WEB_SITE_NAME="$SNIKKET_SITE_NAME"
fi
export SNIKKET_WEB_TOS_URI="${SNIKKET_TOS_URI}"
export SNIKKET_WEB_PRIVACY_URI="${SNIKKET_PRIVACY_URI}"
export SNIKKET_WEB_ABUSE_EMAIL="${SNIKKET_ABUSE_EMAIL}"
export SNIKKET_WEB_SECURITY_EMAIL="${SNIKKET_SECURITY_EMAIL}"
export SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_INTERFACE="${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_INTERFACE-127.0.0.1}"
export SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT="${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT-5765}"

View File

@@ -170,6 +170,10 @@ class AppConfig:
# tools may also very well override it.
max_avatar_size = environ.var(1024*1024, converter=int)
show_metrics = environ.bool_var(True)
tos_uri = environ.var("")
privacy_uri = environ.var("")
abuse_email = environ.var("")
security_email = environ.var("")
_UPPER_CASE = "".join(map(chr, range(ord("A"), ord("Z")+1)))
@@ -202,6 +206,10 @@ def create_app() -> quart.Quart:
app.config["APPLE_STORE_URL"] = config.apple_store_url
app.config["MAX_AVATAR_SIZE"] = config.max_avatar_size
app.config["SHOW_METRICS"] = config.show_metrics
app.config["TOS_URI"] = config.tos_uri
app.config["PRIVACY_URI"] = config.privacy_uri
app.config["ABUSE_EMAIL"] = config.abuse_email
app.config["SECURITY_EMAIL"] = config.security_email
app.context_processor(proc)
app.register_error_handler(

View File

@@ -173,6 +173,42 @@ async def avatar(from_: str, code: str) -> quart.Response:
return response
@bp.route("/terms")
async def terms() -> Response:
if not current_app.config["TOS_URI"]:
return Response("", 404)
return Response("", status=303, headers={
"Location": current_app.config["TOS_URI"],
})
@bp.route("/privacy")
async def privacy() -> Response:
if not current_app.config["PRIVACY_URI"]:
return Response("", 404)
return Response("", status=303, headers={
"Location": current_app.config["PRIVACY_URI"],
})
# This is linked from the iOS app and about page
@bp.route("/policies/")
async def policies() -> str:
return await render_template(
"policies.html",
)
@bp.route("/.well-known/security.txt")
async def securitytxt() -> Response:
return Response(
await render_template("security.txt"),
mimetype="text/plain;charset=UTF-8",
)
@bp.route("/_health")
async def health() -> Response:
return Response("STATUS OK", content_type="text/plain")

View File

@@ -6,16 +6,20 @@
{% block body %}
<main>
<div class="box el-2">
<h1>{% trans %}About Snikket{% endtrans %}</h1>
<p>{% trans snikket_url="https://snikket.org" %}To learn more about Snikket, visit the <a href="{{ snikket_url}}">Snikket website</a>.{% endtrans %}</p>
<h2>{% trans %}About this Service{% endtrans %}</h2>
<p>{% trans site_name=config["SITE_NAME"] %}This is the Snikket service <em>{{ site_name }}</em>.{% endtrans %}</p>
<p>{% trans site_name=config["SITE_NAME"] %}This is the Snikket service <em>{{ site_name }}</em>, running open-source software from the Snikket project.{% endtrans %}</p>
<p>{% trans snikket_url="https://snikket.org" %}To learn more about Snikket, visit the <a href="{{ snikket_url}}">Snikket website</a>.{% endtrans %}</p>
<p><a href="/policies/">{% trans %}View service policies{% endtrans %}</a>
<h3>{% trans %}Licenses{% endtrans %}</h3>
<p>{% trans agpl_url="https://www.gnu.org/licenses/agpl.html" %}The web portal software is licensed under the terms of the <a href="{{ agpl_url }}">Affero GNU General Public License, version 3.0 or later</a>. The full terms of the license can be reviewed using the aforementioned link.{% endtrans %}</p>
<p>{% trans source_url="https://github.com/snikket-im/snikket-web-portal/" %}The source code of the web portal can be downloaded and viewed in <a href="{{ source_url }}">its GitHub repository</a>.{% endtrans %}</p>
<p>{% trans source_url="https://material.io/resources/icons/", apache20_url="https://www.apache.org/licenses/LICENSE-2.0.txt" %}The icons used in the web portal are <a href="{{ source_url }}">Googles Material Icons</a>, made available by Google under the terms of the <a href="{{ apache20_url }}">Apache 2.0 License</a>.{% endtrans %}</p>
<h3>{% trans %}Trademarks{% endtrans %}</h3>
<p>{% trans trademarks_url="https://snikket.org/about/trademarks/" %}“Snikket” and the parrot logo are trademarks of Snikket Community Interest Company. For more information about the trademarks, visit the <a href="{{ trademarks_url }}">Snikket Trademarks information page</a>.{% endtrans %}
<h3>{% trans %}Software Versions{% endtrans %}</h3>
<pre>Domain: {{ config["SNIKKET_DOMAIN"] }}
Web Portal{% if version %} ({{ version }}){% endif %}
@@ -27,6 +31,7 @@ Web Portal{% if version %} ({{ version }}){% endif %}
{% for name, version in extra_versions.items() %}
{{ name }} ({{ version }}){% endfor %}
{%- endif -%}</pre>
<p>
{%- call standard_button("back", url_for("index"), class="primary") -%}
{% trans %}Back to the main page{% endtrans %}

View File

@@ -17,6 +17,13 @@
{%- else -%}
<p>{% trans site_name=config["SITE_NAME"] %}You have been invited to chat on {{ site_name }} using Snikket, a secure, privacy-friendly chat app.{% endtrans %}</p>
{%- endif -%}
{%- if config["TOS_URI"] and config["PRIVACY_URI"] -%}
<p>
{% trans site_name=config["SITE_NAME"], tos_uri=config["TOS_URI"], privacy_uri=config["PRIVACY_URI"] %}By continuing, you agree to the <a href="{{tos_uri}}">Terms of Service</a> and <a href="{{privacy_uri}}">Privacy Policy</a>.{% endtrans %}
</p>
{%- endif -%}
<h2>{% trans %}Get started{% endtrans %}</h2>
{%- if apple_store_url -%}
<p>{% trans %}Install the Snikket App on your Android or iOS device.{% endtrans %}</p>

View File

@@ -0,0 +1,39 @@
{% extends "base.html" %}
{% from "library.j2" import standard_button %}
{% block head_lead %}
<title>{% trans %}Policies{% endtrans %} - {{ config["SITE_NAME"] }}</title>
{% endblock %}
{% block body %}
<main>
<div class="box el-2">
<h1>{{ config["SITE_NAME"] }}</h1>
<h2>{% trans %}Policies{% endtrans %}</h2>
{% if config["TOS_URI"] or config["PRIVACY_URI"] -%}
<p>{% trans %}Use of this service is subject to the following policies:{% endtrans %}</p>
<ul>
{%- if config["TOS_URI"] %}
<li><a href="{{ config["TOS_URI"] }}">{% trans %}Terms of Service{% endtrans %}</a></li>
{%- endif %}
{%- if config["PRIVACY_URI"] %}
<li><a href="{{ config["PRIVACY_URI"] }}">{% trans %}Privacy Policy{% endtrans %}</a></li>
{%- endif %}
</ul>
{%- else -%}
<p>{% trans %}Please contact the administrator of this instance if you have questions about policies.{% endtrans %}</p>
{% endif -%}
<p>{% trans url="https://snikket.org/app/privacy/" %}Use of the Snikket apps is subject to the <a href="{{url}}">Snikket Apps Privacy Policy</a>.{% endtrans %}</p>
{%- if config["ABUSE_EMAIL"] %}
<p>{% trans email=config["ABUSE_EMAIL"], domain=config["SNIKKET_DOMAIN"] %}To report policy violations or other abuse from this service, please send an email to {{email}}. Specify the domain name of this instance ({{domain}}) and include details of the incident(s).{% endtrans %}</p>
{%- endif %}
<p>
{%- call standard_button("back", url_for("index"), class="primary") -%}
{% trans %}Back to the main page{% endtrans %}
{%- endcall -%}
</p>
</div>
</main>
{% endblock %}

View File

@@ -0,0 +1,16 @@
# {{ config["SNIKKET_DOMAIN"] }} is running open-source software
# from the Snikket project: https://snikket.org/
{% if config["SECURITY_EMAIL"] -%}
# Security issues related to this service should be addressed to the
# following security contact:
Contact: mailto:{{ config["SECURITY_EMAIL"] }}
{% else -%}
# This service does not have a public security contact. You might find
# more information about the service at the following link:
Contact: https://{{ config["SNIKKET_DOMAIN"] }}/policies/
{%- endif %}
# Please report software defects to the project developers, per the
# instructions at the following link:
Contact: https://snikket.org/security/

View File

@@ -8,14 +8,14 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2023-04-01 10:07+0200\n"
"POT-Creation-Date: 2023-10-25 16:15+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"
"Generated-By: Babel 2.13.1\n"
#: snikket_web/admin.py:69 snikket_web/templates/admin_delete_user.html:10
#: snikket_web/templates/admin_edit_circle.html:59
@@ -382,31 +382,37 @@ msgid ""
"Interest Company."
msgstr ""
#: snikket_web/templates/about.html:4 snikket_web/templates/about.html:9
#: snikket_web/templates/about.html:4
msgid "About Snikket"
msgstr ""
#: snikket_web/templates/about.html:9
msgid "About this Service"
msgstr ""
#: snikket_web/templates/about.html:10
#, python-format
msgid ""
"This is the Snikket service <em>%(site_name)s</em>, running open-source "
"software from the Snikket project."
msgstr ""
#: snikket_web/templates/about.html:11
#, python-format
msgid ""
"To learn more about Snikket, visit the <a "
"href=\"%(snikket_url)s\">Snikket website</a>."
msgstr ""
#: snikket_web/templates/about.html:11
msgid "About this Service"
msgstr ""
#: snikket_web/templates/about.html:12
#, python-format
msgid "This is the Snikket service <em>%(site_name)s</em>."
msgstr ""
#: snikket_web/templates/about.html:13
msgid "View service policies"
msgstr ""
#: snikket_web/templates/about.html:15
msgid "Licenses"
msgstr ""
#: snikket_web/templates/about.html:14
#: snikket_web/templates/about.html:16
#, python-format
msgid ""
"The web portal software is licensed under the terms of the <a "
@@ -415,14 +421,14 @@ msgid ""
"aforementioned link."
msgstr ""
#: snikket_web/templates/about.html:15
#: snikket_web/templates/about.html:17
#, python-format
msgid ""
"The source code of the web portal can be downloaded and viewed in <a "
"href=\"%(source_url)s\">its GitHub repository</a>."
msgstr ""
#: snikket_web/templates/about.html:16
#: snikket_web/templates/about.html:18
#, python-format
msgid ""
"The icons used in the web portal are <a href=\"%(source_url)s\">Googles "
@@ -430,11 +436,11 @@ msgid ""
"href=\"%(apache20_url)s\">Apache 2.0 License</a>."
msgstr ""
#: snikket_web/templates/about.html:17
#: snikket_web/templates/about.html:20
msgid "Trademarks"
msgstr ""
#: snikket_web/templates/about.html:18
#: snikket_web/templates/about.html:21
#, python-format
msgid ""
"“Snikket” and the parrot logo are trademarks of Snikket Community "
@@ -442,11 +448,11 @@ msgid ""
" href=\"%(trademarks_url)s\">Snikket Trademarks information page</a>."
msgstr ""
#: snikket_web/templates/about.html:19
#: snikket_web/templates/about.html:23
msgid "Software Versions"
msgstr ""
#: snikket_web/templates/about.html:32
#: snikket_web/templates/about.html:37 snikket_web/templates/policies.html:34
msgid "Back to the main page"
msgstr ""
@@ -1093,20 +1099,20 @@ msgid ""
msgstr ""
#: snikket_web/templates/invite_register.html:14
#: snikket_web/templates/invite_view.html:39
#: snikket_web/templates/invite_view.html:46
msgid "App already installed?"
msgstr ""
#: snikket_web/templates/invite_register.html:16
#: snikket_web/templates/invite_reset_view.html:21
#: snikket_web/templates/invite_view.html:41
#: snikket_web/templates/invite_view.html:84
#: snikket_web/templates/invite_view.html:112
#: snikket_web/templates/invite_view.html:48
#: snikket_web/templates/invite_view.html:91
#: snikket_web/templates/invite_view.html:119
msgid "Open the app"
msgstr ""
#: snikket_web/templates/invite_register.html:18
#: snikket_web/templates/invite_view.html:43
#: snikket_web/templates/invite_view.html:50
msgid "This button works only if you have the app installed already!"
msgstr ""
@@ -1202,7 +1208,7 @@ msgid "You will then be prompted to enter a new password for your account."
msgstr ""
#: snikket_web/templates/invite_reset_view.html:29
#: snikket_web/templates/invite_view.html:45
#: snikket_web/templates/invite_view.html:52
msgid "Alternatives"
msgstr ""
@@ -1288,15 +1294,22 @@ msgid ""
"privacy-friendly chat app."
msgstr ""
#: snikket_web/templates/invite_view.html:20
#: snikket_web/templates/invite_view.html:23
#, python-format
msgid ""
"By continuing, you agree to the <a href=\"%(tos_uri)s\">Terms of "
"Service</a> and <a href=\"%(privacy_uri)s\">Privacy Policy</a>."
msgstr ""
#: snikket_web/templates/invite_view.html:27
msgid "Get started"
msgstr ""
#: snikket_web/templates/invite_view.html:22
#: snikket_web/templates/invite_view.html:29
msgid "Install the Snikket App on your Android or iOS device."
msgstr ""
#: snikket_web/templates/invite_view.html:24
#: snikket_web/templates/invite_view.html:31
#, python-format
msgid ""
"Install the Snikket App on your Android device (<a "
@@ -1304,30 +1317,30 @@ msgid ""
"target=\"_blank\">iOS coming soon!</a>)."
msgstr ""
#: snikket_web/templates/invite_view.html:28
#: snikket_web/templates/invite_view.html:35
msgid "Get it on Google Play"
msgstr ""
#: snikket_web/templates/invite_view.html:30
#: snikket_web/templates/invite_view.html:80
#: snikket_web/templates/invite_view.html:37
#: snikket_web/templates/invite_view.html:87
msgid "Download on the App Store"
msgstr ""
#: snikket_web/templates/invite_view.html:32
#: snikket_web/templates/invite_view.html:39
msgid "Get it on F-Droid"
msgstr ""
#: snikket_web/templates/invite_view.html:35
#: snikket_web/templates/invite_view.html:42
msgid "Send to mobile device"
msgstr ""
#: snikket_web/templates/invite_view.html:38
#: snikket_web/templates/invite_view.html:45
msgid ""
"After installation the app should automatically open and prompt you to "
"create an account. If not, simply click the button below."
msgstr ""
#: snikket_web/templates/invite_view.html:46
#: snikket_web/templates/invite_view.html:53
#, python-format
msgid ""
"You can connect to Snikket using any XMPP-compatible software. If the "
@@ -1335,59 +1348,59 @@ msgid ""
"href=\"%(register_url)s\">register an account manually</a>."
msgstr ""
#: snikket_web/templates/invite_view.html:52
#: snikket_web/templates/invite_view.html:59
msgid "Scan invite code"
msgstr ""
#: snikket_web/templates/invite_view.html:55
#: snikket_web/templates/invite_view.html:62
#: snikket_web/templates/invite_view.html:74
#: snikket_web/templates/invite_view.html:90
#: snikket_web/templates/invite_view.html:102
#: snikket_web/templates/invite_view.html:118
#: snikket_web/templates/invite_view.html:69
#: snikket_web/templates/invite_view.html:81
#: snikket_web/templates/invite_view.html:97
#: snikket_web/templates/invite_view.html:109
#: snikket_web/templates/invite_view.html:125
msgid "Close"
msgstr ""
#: snikket_web/templates/invite_view.html:58
#: snikket_web/templates/invite_view.html:65
msgid ""
"You can transfer this invite to your mobile device by scanning a code "
"with your camera. You can use either a QR scanner app or the Snikket app "
"itself."
msgstr ""
#: snikket_web/templates/invite_view.html:71
#: snikket_web/templates/invite_view.html:78
msgid "Install on iOS"
msgstr ""
#: snikket_web/templates/invite_view.html:77
#: snikket_web/templates/invite_view.html:84
msgid ""
"After downloading Snikket from the App Store, you have to return to this "
"invite link and tap on \"Open the app\" to proceed."
msgstr ""
#: snikket_web/templates/invite_view.html:79
#: snikket_web/templates/invite_view.html:86
msgid "First download Snikket from the App Store using the button below:"
msgstr ""
#: snikket_web/templates/invite_view.html:81
#: snikket_web/templates/invite_view.html:109
#: snikket_web/templates/invite_view.html:88
#: snikket_web/templates/invite_view.html:116
msgid ""
"After the installation is complete, you can return to this page and tap "
"the \"Open the app\" button to continue with the setup:"
msgstr ""
#: snikket_web/templates/invite_view.html:99
#: snikket_web/templates/invite_view.html:108
#: snikket_web/templates/invite_view.html:106
#: snikket_web/templates/invite_view.html:115
msgid "Install via F-Droid"
msgstr ""
#: snikket_web/templates/invite_view.html:105
#: snikket_web/templates/invite_view.html:112
msgid ""
"After installing Snikket via F-Droid, you have to return to this invite "
"link and tap on \"Open the app\" to proceed."
msgstr ""
#: snikket_web/templates/invite_view.html:107
#: snikket_web/templates/invite_view.html:114
msgid "First install Snikket from F-Droid using the button below:"
msgstr ""
@@ -1426,6 +1439,43 @@ msgid ""
"<em>@%(snikket_domain)s</em>. Your password was not sent."
msgstr ""
#: snikket_web/templates/policies.html:4 snikket_web/templates/policies.html:10
msgid "Policies"
msgstr ""
#: snikket_web/templates/policies.html:13
msgid "Use of this service is subject to the following policies:"
msgstr ""
#: snikket_web/templates/policies.html:16
msgid "Terms of Service"
msgstr ""
#: snikket_web/templates/policies.html:19
msgid "Privacy Policy"
msgstr ""
#: snikket_web/templates/policies.html:23
msgid ""
"Please contact the administrator of this instance if you have questions "
"about policies."
msgstr ""
#: snikket_web/templates/policies.html:26
#, python-format
msgid ""
"Use of the Snikket apps is subject to the <a href=\"%(url)s\">Snikket "
"Apps Privacy Policy</a>."
msgstr ""
#: snikket_web/templates/policies.html:29
#, python-format
msgid ""
"To report policy violations or other abuse from this service, please send"
" an email to %(email)s. Specify the domain name of this instance "
"(%(domain)s) and include details of the incident(s)."
msgstr ""
#: snikket_web/templates/unauth.html:16
msgid "Operation successful"
msgstr ""