matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

matrix_mautrix_signal_bridge_permissions not written to server

Open fcnjd opened this issue 3 years ago • 1 comments

Title mostly tells the problem: When I set the variable in my vars.yml file and re-run the playbook, the corresponding config is not written to the server. The relevant part of the file looks like this (anonymized):

# bridges
# signal
matrix_mautrix_signal_enabled: true
matrix_mautrix_signal_relaybot_enabled: true
# Permissions for using the bridge.
# Permitted values:
#      relay - Allowed to be relayed through the bridge, no access to commands.
#       user - Use the bridge with puppeting.
#      admin - Use and administrate the bridge.
# Permitted keys:
#        * - All Matrix users
#   domain - All users on that homeserver
#     mxid - Specific user
matrix_mautrix_signal_bridge_permissions: |
  '*': relay
  '{{ matrix_mautrix_signal_homeserver_domain }}': user
  '@xxx:matrix.org': user

I think this is probably a bug because I can't explain it differently why the variable is not written in the config. Of course there is a workaround: setting the configuration_extension manually, and so I'd consider it low priority. Anyway, I'd very happy if you could somehow fix that, since it breaks the convention of beeing able to override playbook variables.

fcnjd avatar Feb 25 '22 15:02 fcnjd

I've taken your config and put in in my vars.yml, re-ran the playbook (well, even just this part - ansible-playbook -i inventory/hosts setup.yml --tags=setup-mautrix-signal) and now I can see that the custom permissions have been applied:

# cat /matrix/mautrix-signal/bridge/config.yaml | grep permissions -A 3

    permissions:
        '*': relay
        '@xxx:matrix.org': user
        MY_DOMAIN: user

It seems odd that it doesn't work for you.

You could try adjusting roles/matrix-bridge-mautrix-signal/templates/config.yaml.j2 like this:

     permissions:
-        {{ matrix_mautrix_signal_bridge_permissions|from_yaml }}
+        {{ matrix_mautrix_signal_bridge_permissions|from_yaml|to_yaml }}

.. and see if this helps.

spantaleev avatar Feb 25 '22 16:02 spantaleev

Hey, sorry for not replying for so long. But thank you very much for your help, indeed this solved it. So I can close this now.

fcnjd avatar Sep 19 '23 09:09 fcnjd