Allow the mautrix whatsapp relaybot to be enabled with a variable (#2381)

* Allow the mautrix whatsapp relaybot to be enable with a variable

This allows a user to enable the relaybot by setting a variable in
`vars.yml` in the same way that the mautrix signal relaybot is
configured.

* Correct default values for mautrix whatsapp relaybot variables

* Add documentation for using the relaybot with mautrix whatsapp

* Adjust variable names to better reflect what they do

* Set default variables properly and use to_json in template
This commit is contained in:
James Collier
2023-01-06 20:09:07 +11:00
committed by GitHub
parent 25b0630bd2
commit 36d8ea281c
3 changed files with 21 additions and 2 deletions

View File

@ -102,6 +102,12 @@ matrix_mautrix_whatsapp_bridge_permissions: |
| combine({matrix_admin: 'admin'} if matrix_admin else {})
}}
# Enable bridge relay functionality
matrix_mautrix_whatsapp_bridge_relay_enabled: false
# Only allow admins on this home server to set themselves as a relay user
matrix_mautrix_whatsapp_bridge_relay_admin_only: true
# Default mautrix-whatsapp configuration template which covers the generic use case.
# You can customize it by controlling the various variables inside it.
#

View File

@ -396,9 +396,9 @@ bridge:
relay:
# Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any
# authenticated user into a relaybot for that chat.
enabled: false
enabled: {{ matrix_mautrix_whatsapp_bridge_relay_enabled | to_json }}
# Should only admins be allowed to set themselves as relay users?
admin_only: true
admin_only: {{ matrix_mautrix_whatsapp_bridge_relay_admin_only | to_json }}
# The formats to use when sending messages to WhatsApp via the relaybot.
message_formats:
m.text: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: {{ '{{ .Message }}' }}"