Make bridge permissions more easily configurable
Not doing {% if matrix_admin %} checks in the YAML also fixes some issues with indentation being incorrect sometimes. This should be backward compatible, except for mautrix-signal's case where `matrix_mautrix_signal_bridge_permissions` previously existed as a string, not a dictionary. `tasks/validate_config.yml` will catch the problem an even provide a quick fix.
This commit is contained in:
@ -103,12 +103,14 @@ matrix_mautrix_signal_relaybot_enabled: false
|
||||
# * - All Matrix users
|
||||
# domain - All users on that homeserver
|
||||
# mxid - Specific user
|
||||
#
|
||||
# This variable used to contain a YAML string, but now needs to contain a hashmap/dictionary.
|
||||
matrix_mautrix_signal_bridge_permissions: |
|
||||
'*': relay
|
||||
'{{ matrix_mautrix_signal_homeserver_domain }}': user
|
||||
{% if matrix_admin %}
|
||||
"{{ matrix_admin }}": admin
|
||||
{% endif %}
|
||||
{{
|
||||
{'*': 'relay'}
|
||||
| combine({matrix_mautrix_signal_homeserver_domain: 'user'})
|
||||
| combine({matrix_admin: 'admin'} if matrix_admin else {})
|
||||
}}
|
||||
|
||||
# Default configuration template which covers the generic use case.
|
||||
# You can customize it by controlling the various variables inside it.
|
||||
|
@ -11,6 +11,15 @@
|
||||
- "matrix_mautrix_signal_homeserver_token"
|
||||
- "matrix_mautrix_signal_appservice_token"
|
||||
|
||||
- name: (Deprecation) Fail if matrix_mautrix_signal_bridge_permissions specified as YAML string, instead of a dictionary
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The `matrix_mautrix_signal_bridge_permissions` variable in your configuration is specified as a YAML string.
|
||||
The playbook now expects a hashmap/dictionary in this variable.
|
||||
Change your configuration like this:
|
||||
matrix_mautrix_signal_bridge_permissions: {{ matrix_mautrix_signal_bridge_permissions | from_yaml | to_json }}
|
||||
when: "matrix_mautrix_signal_bridge_permissions is string"
|
||||
|
||||
- name: (Deprecation) Catch and report renamed Signal variables
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
|
@ -223,8 +223,7 @@ bridge:
|
||||
# * - All Matrix users
|
||||
# domain - All users on that homeserver
|
||||
# mxid - Specific user
|
||||
permissions:
|
||||
{{ matrix_mautrix_signal_bridge_permissions|from_yaml }}
|
||||
permissions: {{ matrix_mautrix_signal_bridge_permissions|to_json }}
|
||||
|
||||
relay:
|
||||
# Whether or not relay mode should be allowed. If allowed, `!signal set-relay` can be used to turn any
|
||||
|
Reference in New Issue
Block a user