From 91e39a58f77e3cf1dc071f1a167084de126c08ff Mon Sep 17 00:00:00 2001 From: Pierre 'McFly' Marty Date: Wed, 27 Dec 2023 12:20:34 +0100 Subject: [PATCH] feat: relay mode in signal --- .../defaults/main.yml | 8 +++++++- .../templates/config.yaml.j2 | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml index 26f09119e..6fb1ce056 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-signal/defaults/main.yml @@ -9,7 +9,7 @@ matrix_mautrix_signal_container_image_self_build_repo: "https://mau.dev/mautrix/ matrix_mautrix_signal_container_image_self_build_branch: "{{ 'main' if matrix_mautrix_signal_version == 'latest' else matrix_mautrix_signal_version }}" # renovate: datasource=docker depName=dock.mau.dev/mautrix/signal -matrix_mautrix_signal_version: 8260ba1559fe49b4e19e78bb8a9385aee2b94a8c-amd64 +matrix_mautrix_signal_version: fb18dcebcf611375ef4887041bc3b79008246178-amd64 # See: https://mau.dev/mautrix/signal/container_registry matrix_mautrix_signal_docker_image: "{{ matrix_mautrix_signal_docker_image_name_prefix }}mautrix/signal:{{ matrix_mautrix_signal_version }}" @@ -33,6 +33,12 @@ matrix_mautrix_signal_bridge_permissions: | | combine({matrix_admin: 'admin'} if matrix_admin else {}) }} +# Enable bridge relay functionality +matrix_mautrix_signal_bridge_relay_enabled: "{{ matrix_bridges_relay_enabled }}" + +# Only allow admins on this home server to set themselves as a relay user +matrix_mautrix_signal_bridge_relay_admin_only: true + # A list of extra arguments to pass to the container matrix_mautrix_signal_container_extra_arguments: [] diff --git a/roles/custom/matrix-bridge-mautrix-signal/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-signal/templates/config.yaml.j2 index 00e505342..f05ba4174 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-signal/templates/config.yaml.j2 @@ -250,6 +250,24 @@ bridge: # mxid - Specific user permissions: {{ matrix_mautrix_signal_bridge_permissions|to_json }} + # Settings for relay mode + relay: + # Whether relay mode should be allowed. If allowed, `!signal set-relay` can be used to turn any + # authenticated user into a relaybot for that chat. + enabled: {{ matrix_mautrix_signal_bridge_relay_enabled | to_json }} + # Should only admins be allowed to set themselves as relay users? + admin_only: {{ matrix_mautrix_signal_bridge_relay_admin_only | to_json }} + # The formats to use when sending messages to WhatsApp via the relaybot. + message_formats: + m.text: "{{ '{{ .Sender.Displayname }}' }}: {{ '{{ .Message }}' }}" + m.notice: "{{ '{{ .Sender.Displayname }}' }}:: {{ '{{ .Message }}' }}" + m.emote: "* {{ '{{ .Sender.Displayname }}' }}: {{ '{{ .Message }}' }}" + m.file: "{{ '{{ .Sender.Displayname }}' }}: sent a file" + m.image: "{{ '{{ .Sender.Displayname }}' }}: sent an image" + m.audio: "{{ '{{ .Sender.Displayname }}' }}: sent an audio file" + m.video: "{{ '{{ .Sender.Displayname }}' }}: sent a video" + m.location: "{{ '{{ .Sender.Displayname }}' }}: sent a location" + # Logging config. See https://github.com/tulir/zeroconfig for details. logging: directory: ./logs