Add variables for controlling the native auto-accept-invites Synapse feature

Related to https://github.com/element-hq/synapse/pull/17147
This commit is contained in:
Slavi Pantaleev
2024-06-18 15:40:07 +03:00
parent 9af4b491fa
commit 09d9db5617
4 changed files with 71 additions and 5 deletions

View File

@ -543,6 +543,27 @@ matrix_synapse_auto_join_rooms: []
# automatically if they don't already exist.
matrix_synapse_autocreate_auto_join_rooms: true
# Controls whether room invites will be accepted on behalf of users.
# See: https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#auto-accept-invites
# This should not be used together with the `synapse_auto_accept_invite` module (see `matrix_synapse_ext_synapse_auto_accept_invite_enabled`).
# Also see:
# - `matrix_synapse_auto_accept_invites_only_for_direct_messages`
# - `matrix_synapse_auto_accept_invites_only_from_local_users`
# - `matrix_synapse_auto_accept_invites_worker_to_run_on`
matrix_synapse_auto_accept_invites_enabled: false
# Controls whether auto-invite acceptance should only be done for direct messages.
# Related to: `matrix_synapse_auto_accept_invites_enabled`
matrix_synapse_auto_accept_invites_only_for_direct_messages: false
# Controls whether auto-invite acceptance should only be done when the invitatio nis coming from a local user.
# Related to: `matrix_synapse_auto_accept_invites_enabled`
matrix_synapse_auto_accept_invites_only_from_local_users: false
# When Synapse workers enabled it is possible (but not required) to assign a worker to run the auto-accept-invites feature on (null = main process).
# Related to: `matrix_synapse_auto_accept_invites_enabled`
matrix_synapse_auto_accept_invites_worker_to_run_on: null
# Controls whether password authentication is allowed
# It may be useful when you've configured OAuth, SAML or CAS and want authentication
# to happen only through them
@ -1228,6 +1249,10 @@ matrix_synapse_ext_synapse_s3_storage_provider_update_db_day_count: 0
matrix_synapse_ext_synapse_s3_storage_provider_periodic_migration_schedule: '*-*-* 05:00:00'
# Synapse module to automatically accept room invites.
#
# Since Synapse v1.109.0 (https://github.com/element-hq/synapse/pull/17147),
# this functionality has been merged into Synapse. See `matrix_synapse_auto_accept_invites_enabled`.
#
# See: https://github.com/matrix-org/synapse-auto-accept-invite
# Installing it requires building a customized Docker image for Synapse (see `matrix_synapse_container_image_customizations_enabled`).
# Enabling this will enable customizations and inject the appropriate Dockerfile clauses for installing synapse-auto-accept-invite.

View File

@ -121,3 +121,15 @@
when: "matrix_synapse_container_image_customizations_templates_git_repository_keyscan_enabled | bool and vars[item] == ''"
with_items:
- matrix_synapse_container_image_customizations_templates_git_repository_keyscan_hostname
- name: Fail when auto-accept-invite enabled as a native feature and a module at the same time
ansible.builtin.fail:
msg: >-
Your configuration enables the auto-accept invites feature both as a native Synapse feature (`matrix_synapse_auto_accept_invites_enabled`) and a 3rd party module (`matrix_synapse_ext_synapse_auto_accept_invite_enabled`).
This is unnecessary, since they both do the same and the native feature is built on top of the 3rd party module anyway.
Enabling both at the same time will lead to issues.
We recommend leaving `matrix_synapse_auto_accept_invites_enabled` in your configuration and removing `matrix_synapse_ext_synapse_auto_accept_invite_enabled`.
when:
- matrix_synapse_auto_accept_invites_enabled
- matrix_synapse_ext_synapse_auto_accept_invite_enabled

View File

@ -1550,6 +1550,12 @@ autocreate_auto_join_rooms: {{ matrix_synapse_autocreate_auto_join_rooms|to_json
#
#auto_join_rooms_for_guests: false
auto_accept_invites:
enabled: {{ matrix_synapse_auto_accept_invites_enabled | to_json }}
only_for_direct_messages: {{ matrix_synapse_auto_accept_invites_only_for_direct_messages | to_json }}
only_from_local_users: {{ matrix_synapse_auto_accept_invites_only_from_local_users | to_json }}
worker_to_run_on: {{ matrix_synapse_auto_accept_invites_worker_to_run_on | to_json }}
# Whether to inhibit errors raised when registering a new account if the user ID
# already exists. If turned on, that requests to /register/available will always
# show a user ID as available, and Synapse won't raise an error when starting
@ -1565,7 +1571,7 @@ autocreate_auto_join_rooms: {{ matrix_synapse_autocreate_auto_join_rooms|to_json
# Enable collection and rendering of performance metrics
#
enable_metrics: {{ matrix_synapse_metrics_enabled|to_json }}
enable_metrics: {{ matrix_synapse_metrics_enabled|to_json }}
# Enable sentry integration
# NOTE: While attempts are made to ensure that the logs don't contain