diff --git a/matrix/synapse/README.md b/matrix/synapse/README.md index 90062a9..f51741a 100644 --- a/matrix/synapse/README.md +++ b/matrix/synapse/README.md @@ -13,7 +13,7 @@ documentation](https://element-hq.github.io/synapse/latest/setup/installation.ht ``` apt install -y lsb-release wget apt-transport-https build-essential python3-dev libffi-dev \ python3-pip python3-setuptools sqlite3 \ - libssl-dev virtualenv libjpeg-dev libxslt1-dev libicu-dev git + libssl-dev virtualenv libjpeg-dev libxslt1-dev libicu-dev git python3-jinja2 wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg @@ -489,3 +489,126 @@ notice to, and click "Send Server Notices". If the result is that you're returned to the login screen of Synapse-Admin, there was an error sending the notice. Check the Synapse logs. + + +## Consent template + +You can force your users to accept an agreement before you let them on your +machine, see the [Synapse Documentation](https://element-hq.github.io/synapse/latest/consent_tracking.html#support-in-synapse-for-tracking-agreement-to-server-terms-and-conditions). + +First, make the directory where you want Synapse to search for the document, +we create the directory `consent_policy`: + + +``` +mkdir -p /var/lib/matrix-synapse/consent_policy/en +``` + +You'll have to add the directory `en` under that, as every document is assumed +to be in English. Support for other languages is on the wish list. + +Create a Jinja2 template with the texts you want: the text users have to agree +to before they can use the service, and the text users that have already +agreed will see. Something like this: + +``` + + +
++ You have already accepted the Example End User Policy. +
+ {% else %} +You have agreed to our End User Policy, you can now use our service.
+ +Have fun!
+ + +``` + +We now have the texts ready, time to configure Synapse to use it. + +Create a `form_secret`: + +``` +pwgen -csny 30 1 +``` + +Add this bit to `conf.d/server_notices.yaml`: + +``` +form_secret: "