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:
Slavi Pantaleev
2022-07-25 15:55:16 +03:00
parent b2f47fcfcd
commit ac72879bf5
21 changed files with 94 additions and 65 deletions

View File

@ -29,6 +29,12 @@ matrix_beeper_linkedin_bridge_presence: true
matrix_beeper_linkedin_command_prefix: "!li"
matrix_beeper_linkedin_bridge_permissions: |
{{
{matrix_beeper_linkedin_homeserver_domain: 'user'}
| combine({matrix_admin: 'admin'} if matrix_admin else {})
}}
# A list of extra arguments to pass to the container
matrix_beeper_linkedin_container_extra_arguments: []

View File

@ -56,7 +56,7 @@ appservice:
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
# to leave display name/avatar as-is.
displayname: LinkedIn bridge bot
avatar: mxc://sumnerevans.com/XMtwdeUBnxYvWNFFrfeTSHqB
avatar: mxc://sumnerevans.com/XMtwdeUBnxYvWNFFrfeTSHqB
# Whether or not to receive ephemeral events via appservice transactions.
# Requires MSC2409 support (i.e. Synapse 1.22+).
@ -236,11 +236,7 @@ bridge:
# * - All Matrix users
# domain - All users on that homeserver
# mxid - Specific user
permissions:
"{{ matrix_beeper_linkedin_homeserver_domain }}": user
{% if matrix_admin %}
"{{ matrix_admin }}": admin
{% endif %}
permissions: {{ matrix_beeper_linkedin_bridge_permissions|to_json }}