Skip to content

Commit f1c238e

Browse files
committed
Update mautrix-discord config to latest upstream sample and introduce a few new Ansible variables
Provoked by #3900
1 parent 6e3f508 commit f1c238e

File tree

4 files changed

+158
-68
lines changed

4 files changed

+158
-68
lines changed

group_vars/matrix_servers

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,11 @@ matrix_mautrix_discord_systemd_required_services_list_auto: |
11161116
matrix_mautrix_discord_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'maudisc.as.tok', rounds=655555) | to_uuid }}"
11171117

11181118
matrix_mautrix_discord_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
1119-
matrix_mautrix_discord_homeserver_public_address: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}://{{ matrix_server_fqn_matrix }}"
11201119
matrix_mautrix_discord_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'maudisc.hs.tok', rounds=655555) | to_uuid }}"
11211120

1121+
matrix_mautrix_discord_bridge_public_address: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}://{{ matrix_server_fqn_matrix }}"
1122+
matrix_mautrix_discord_bridge_avatar_proxy_key: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'maudisc.avatar', rounds=655555) | to_uuid }}"
1123+
11221124
matrix_mautrix_discord_bridge_login_shared_secret_map_auto: |-
11231125
{{
11241126
({

roles/custom/matrix-bridge-mautrix-discord/defaults/main.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,31 @@ matrix_mautrix_discord_data_path: "{{ matrix_mautrix_discord_base_path }}/data"
2222
matrix_mautrix_discord_docker_src_files_path: "{{ matrix_mautrix_discord_base_path }}/docker-src"
2323

2424
matrix_mautrix_discord_homeserver_address: ""
25-
matrix_mautrix_discord_homeserver_public_address: ''
2625
matrix_mautrix_discord_homeserver_domain: "{{ matrix_domain }}"
2726
matrix_mautrix_discord_appservice_address: "http://matrix-mautrix-discord:8080"
2827

29-
matrix_mautrix_discord_command_prefix: "!discord"
28+
matrix_mautrix_discord_bridge_command_prefix: "!discord"
29+
30+
# Publicly accessible base URL that Discord can use to reach the bridge, used for avatars in relay mode.
31+
# If not set, avatars will not be bridged. Only the /mautrix-discord/avatar/{server}/{id}/{hash} endpoint is used on this address.
32+
# This should not have a trailing slash, the endpoint above will be appended to the provided address.
33+
matrix_mautrix_discord_bridge_public_address: ''
34+
35+
# A random key used to sign the avatar URLs. The bridge will only accept requests with a valid signature.
36+
matrix_mautrix_discord_bridge_avatar_proxy_key: ''
37+
38+
# Localpart template of MXIDs for Discord users.
39+
# {{ '{{.}}' }} is replaced with the internal ID of the Discord user.
40+
matrix_mautrix_discord_bridge_username_template: "{% raw %}discord_{{.}}{% endraw %}"
41+
42+
# Displayname template for Discord users. This is also used as the room name in DMs if private_chat_portal_meta is enabled.
43+
matrix_mautrix_discord_bridge_displayname_template: "{% raw %}{{or .GlobalName .Username}}{{if .Bot}} (bot){{end}}{% endraw %}"
44+
45+
# Displayname template for Discord channels (bridged as rooms, or spaces when type=4).
46+
matrix_mautrix_discord_bridge_channel_name_template: "{% raw %}{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}}{{else}}#{{.Name}}{{end}}{% endraw %}"
47+
48+
# Displayname template for Discord guilds (bridged as spaces).
49+
matrix_mautrix_discord_bridge_guild_name_template: "{% raw %}{{.Name}}{% endraw %}"
3050

3151
matrix_mautrix_discord_bridge_permissions: |
3252
{{
@@ -56,6 +76,8 @@ matrix_mautrix_discord_appservice_token: ''
5676
matrix_mautrix_discord_homeserver_token: ''
5777

5878
matrix_mautrix_discord_appservice_bot_username: discordbot
79+
matrix_mautrix_discord_appservice_bot_displayname: Discord bridge bot
80+
matrix_mautrix_discord_appservice_bot_avatar: mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC
5981

6082
matrix_mautrix_discord_provisioning_shared_secret: disable
6183

@@ -162,6 +184,9 @@ matrix_mautrix_discord_registration: "{{ matrix_mautrix_discord_registration_yam
162184
# Enable End-to-bridge encryption
163185
matrix_mautrix_discord_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
164186
matrix_mautrix_discord_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
187+
matrix_mautrix_discord_bridge_encryption_require: false
188+
matrix_mautrix_discord_bridge_encryption_appservice: false
189+
matrix_mautrix_discord_bridge_encryption_plaintext_mentions: false
165190
matrix_mautrix_discord_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_discord_bridge_encryption_allow }}"
166191

167192
# On Conduit versions before 0.5.0 this option prevented users from joining spaces created by the bridge.

roles/custom/matrix-bridge-mautrix-discord/tasks/validate_config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- {'name': 'matrix_mautrix_discord_appservice_token', when: true}
1010
- {'name': 'matrix_mautrix_discord_homeserver_address', when: true}
1111
- {'name': 'matrix_mautrix_discord_homeserver_token', when: true}
12-
- {'name': 'matrix_mautrix_discord_homeserver_public_address', when: true}
12+
- {'name': 'matrix_mautrix_discord_bridge_public_address', when: true}
1313
- {'name': 'matrix_mautrix_discord_container_network', when: true}
1414
- {'name': 'matrix_mautrix_discord_database_hostname', when: "{{ matrix_mautrix_discord_database_engine == 'postgres' }}"}
1515

@@ -21,3 +21,5 @@
2121
when: "item.old in vars"
2222
with_items:
2323
- {'old': 'matrix_mautrix_discord_login_shared_secret', 'new': '<removed>'}
24+
- {'old': 'matrix_mautrix_discord_homeserver_public_address', 'new': 'matrix_mautrix_discord_bridge_public_address'}
25+
- {'old': 'matrix_mautrix_discord_command_prefix', 'new': 'matrix_mautrix_discord_bridge_command_prefix'}

0 commit comments

Comments
 (0)