From 465df3a9493011ffdf38cf1fc31485330efb5278 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 8 May 2025 10:03:53 +0300 Subject: [PATCH] Add support for synapse-http-antispam and integrate it with Draupnir Supersedes https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4284 --- docs/configuring-playbook-bot-draupnir.md | 14 +++++++ group_vars/matrix_servers | 12 ++++++ .../matrix-bot-draupnir/defaults/main.yml | 33 ++++++++++++++++- .../matrix-bot-draupnir/templates/labels.j2 | 2 +- .../templates/production.yaml.j2 | 14 ++++++- .../systemd/matrix-bot-draupnir.service.j2 | 2 +- roles/custom/matrix-synapse/defaults/main.yml | 32 ++++++++++++++++ .../tasks/ext/setup_install.yml | 13 +++++++ .../synapse-http-antispam/setup_install.yml | 37 +++++++++++++++++++ .../synapse-http-antispam/setup_uninstall.yml | 11 ++++++ .../synapse-http-antispam/validate_config.yml | 21 +++++++++++ 11 files changed, 187 insertions(+), 4 deletions(-) create mode 100644 roles/custom/matrix-synapse/tasks/ext/synapse-http-antispam/setup_install.yml create mode 100644 roles/custom/matrix-synapse/tasks/ext/synapse-http-antispam/setup_uninstall.yml create mode 100644 roles/custom/matrix-synapse/tasks/ext/synapse-http-antispam/validate_config.yml diff --git a/docs/configuring-playbook-bot-draupnir.md b/docs/configuring-playbook-bot-draupnir.md index 623cabe98..de2dfb44b 100644 --- a/docs/configuring-playbook-bot-draupnir.md +++ b/docs/configuring-playbook-bot-draupnir.md @@ -145,6 +145,20 @@ The bot can intercept the report API endpoint of the client-server API, which re matrix_bot_draupnir_config_web_abuseReporting: true ``` +### Enabling synapse-http-antispam support + +Certain protections in Draupnir require the [synapse-http-antispam](https://github.com/maunium/synapse-http-antispam) module and a Synapse homeserver plus homeserver admin status to function. This module can be enabled in the playbook via setting `matrix_bot_draupnir_config_web_synapseHTTPAntispam_enabled` to `true` and making sure that Draupnir admin API access is enabled. + +```yaml +# Enables the integration between Draupnir and synapse-http-antispam module. +matrix_bot_draupnir_config_web_synapseHTTPAntispam_enabled: true + +# Enables draupnir to access Synapse admin APIs. This is required for the module functionality to take full effect. +matrix_bot_draupnir_admin_api_enabled: true +``` + +These protections need to be manually activated and consulting the [enabling protections](#enabling-built-in-protections) guide can be helpful or consulting upstream documentation. +