spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.78k stars 1.03k forks source link

Signal bridge encryption not working after changing to double puppet appservice #3493

Closed ddogfoodd closed 1 month ago

ddogfoodd commented 1 month ago

Describe the bug After enabling the double puppet appservice, encryption for the signal bot seems broken. I am opening this issue so that we can collect details, as some people reported this problem in the playbooks and mautrix signal bridge matrix rooms. If you have any details please add them as comments below so we can figure this out.

To Reproduce My vars.yml file looks like this (Mautrix Signal related):

# Double Puppet Appservice for newer bridge implementations
matrix_appservice_double_puppet_enabled: true
# Shared Secret Auth - the old way of double puppeting for bridges
matrix_synapse_ext_password_provider_shared_secret_auth_enabled: true
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: 'XXXX'

matrix_mautrix_signal_enabled: true
matrix_mautrix_signal_configuration_extension_yaml: |
  bridge:
    encryption:
      allow: true
      default: true
      # set to false when not using Beeper (see: https://docs.mau.fi/bridges/general/troubleshooting.html#the-bridge-cant-decrypt-my-messages)
      appservice: false

Expected behavior I thought adding the line matrix_appservice_double_puppet_enabled: true would do all the work and make the bridge use the double puppet appservice while keep it using encryption.

Matrix Server:

Additional context

ddogfoodd commented 1 month ago

It seems the encryption config of the signal bridge is just outdated.

ddogfoodd commented 1 month ago

New way to do it:

# Double Puppet Appservice for newer bridge implementations
matrix_appservice_double_puppet_enabled: true
# Shared Secret Auth - the old way of double puppeting for bridges
matrix_synapse_ext_password_provider_shared_secret_auth_enabled: true
matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: 'XXXX'

matrix_mautrix_signal_enabled: true
matrix_mautrix_signal_configuration_extension_yaml: |
  bridge:
    ...
  encryption:
      allow: true
      default: true
      # set to false when not using Beeper (see: https://docs.mau.fi/bridges/general/troubleshooting.html#the-bridge-cant-decrypt-my-messages)
      appservice: false

The indentation level of encryption has changed.

spantaleev commented 1 month ago

Good catch! Indeed, the encryption configuration has moved. encryption was previously nested under bridge, but not anymore.

Adjusting the encryption settings using the existing dedicated Ansible variables (matrix_mautrix_signal_bridge_encryption_allow, etc.) would have been your friend and done the right thing. Using matrix_mautrix_signal_configuration_extension_yaml instead of dedicated variables is prone to such issues - the playbook can neither check your configuration (except for YAML syntax validity), nor can it tell you when you're using incorrect configuration keys.

Due to this, the variables (matrix_mautrix_signal_bridge_encryption_allow, etc.) also need to be renamed for consistency (with the old ones being deprecated), but this hasn't been done yet.