From 63babba31c817607ac1fa43c337738988681cc60 Mon Sep 17 00:00:00 2001 From: xvsun <80697688+xvsun@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:04:46 +0100 Subject: [PATCH] feat: add logger, add synapse workers config --- ...onfiguring-playbook-synapse-auto-accept-invite.md | 12 +++++++++++- roles/custom/matrix-synapse/defaults/main.yml | 2 ++ .../ext/synapse-auto-accept-invite/setup_install.yml | 12 ++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/configuring-playbook-synapse-auto-accept-invite.md b/docs/configuring-playbook-synapse-auto-accept-invite.md index 640e8923e..ccc4b0c33 100644 --- a/docs/configuring-playbook-synapse-auto-accept-invite.md +++ b/docs/configuring-playbook-synapse-auto-accept-invite.md @@ -11,4 +11,14 @@ If you decide that you'd like to let this playbook install it for you, you need matrix_synapse_ext_synapse_auto_accept_invite_enabled: true matrix_synapse_ext_synapse_auto_accept_invite_accept_invites_only_direct_messages: true -``` \ No newline at end of file +``` + +## Synapse worker deployments + +In a [workerized Synapse deployment](https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/c9a842147e09647c355799ca024d65a5de66b099/docs/configuring-playbook-synapse.md#load-balancing-with-workers) it is possible to run this module on a worker to reduce the load on the main process (Default is 'null'). For example add this to your configuration: + +```yaml +matrix_synapse_ext_synapse_auto_accept_invite_worker_to_run_on: 'matrix-synapse-worker-generic-0' +``` + +There might be an [issue with federation](https://github.com/matrix-org/synapse-auto-accept-invite/issues/18). \ No newline at end of file diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index de8451624..3dbf88cc8 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -1226,6 +1226,8 @@ matrix_synapse_ext_synapse_auto_accept_invite_enabled: false matrix_synapse_ext_synapse_auto_accept_invite_version: 1.1.3 # Specifies whether only direct messages (1:1 rooms) will be auto accepted. matrix_synapse_ext_synapse_auto_accept_invite_accept_invites_only_direct_messages: false +# When Synapse workers enabled it is posiible to assign a worker to run this module (null = main process). +matrix_synapse_ext_synapse_auto_accept_invite_worker_to_run_on: null # Specifies whether an external media repository is enabled. # If it is, the Synapse media repo and media-repo workers will be disabled automatically. diff --git a/roles/custom/matrix-synapse/tasks/ext/synapse-auto-accept-invite/setup_install.yml b/roles/custom/matrix-synapse/tasks/ext/synapse-auto-accept-invite/setup_install.yml index fec9ce87e..91dc1cdcf 100644 --- a/roles/custom/matrix-synapse/tasks/ext/synapse-auto-accept-invite/setup_install.yml +++ b/roles/custom/matrix-synapse/tasks/ext/synapse-auto-accept-invite/setup_install.yml @@ -7,7 +7,15 @@ { "module": "synapse_auto_accept_invite.InviteAutoAccepter", "config": { - "accept_invites_only_for_direct_messages": matrix_synapse_ext_synapse_auto_accept_invite_accept_invites_only_direct_messages - } + "accept_invites_only_for_direct_messages": matrix_synapse_ext_synapse_auto_accept_invite_accept_invites_only_direct_messages, + "worker_to_run_on": matrix_synapse_ext_synapse_auto_accept_invite_worker_to_run_on, + }, }] }} + + matrix_synapse_additional_loggers_auto: > + {{ + matrix_synapse_additional_loggers_auto + + + [{'name': 'matrix_auto_accept_invite', 'level': 'INFO'}] + }}