mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-07-16 19:53:53 +03:00
Rename matrix_mautrix_discord_* variables to matrix_bridge_mautrix_discord_*
Part of adopting a uniform naming policy for bridge variables, where the variable prefix matches the role directory name. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ See [this section](configuring-playbook-bridge-mautrix-bridges.md#set-up-double-
|
||||
To enable the bridge, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
|
||||
|
||||
```yaml
|
||||
matrix_mautrix_discord_enabled: true
|
||||
matrix_bridge_mautrix_discord_enabled: true
|
||||
```
|
||||
|
||||
### Extending the configuration
|
||||
@@ -96,7 +96,7 @@ The default logging level for this component is `warn`. If you want to increase
|
||||
|
||||
```yaml
|
||||
# Valid values: fatal, error, warn, info, debug, trace
|
||||
matrix_mautrix_discord_logging_level: 'debug'
|
||||
matrix_bridge_mautrix_discord_logging_level: 'debug'
|
||||
```
|
||||
|
||||
### Command requires room admin rights when user is creator
|
||||
|
||||
+36
-36
@@ -114,7 +114,7 @@ matrix_homeserver_container_extra_arguments_auto: |
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_rustpush_bridge_config_path + '/registration.yaml,dst=/matrix-rustpush-bridge-registration.yaml,ro'] if matrix_rustpush_bridge_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mautrix_discord_config_path + '/registration.yaml,dst=/matrix-mautrix-discord-registration.yaml,ro'] if matrix_mautrix_discord_enabled else [])
|
||||
(['--mount type=bind,src=' + matrix_bridge_mautrix_discord_config_path + '/registration.yaml,dst=/matrix-mautrix-discord-registration.yaml,ro'] if matrix_bridge_mautrix_discord_enabled else [])
|
||||
+
|
||||
(['--mount type=bind,src=' + matrix_mautrix_slack_config_path + '/registration.yaml,dst=/matrix-mautrix-slack-registration.yaml,ro'] if matrix_mautrix_slack_enabled else [])
|
||||
+
|
||||
@@ -173,7 +173,7 @@ matrix_homeserver_app_service_config_files_auto: |
|
||||
+
|
||||
(['/matrix-rustpush-bridge-registration.yaml'] if matrix_rustpush_bridge_enabled else [])
|
||||
+
|
||||
(['/matrix-mautrix-discord-registration.yaml'] if matrix_mautrix_discord_enabled else [])
|
||||
(['/matrix-mautrix-discord-registration.yaml'] if matrix_bridge_mautrix_discord_enabled else [])
|
||||
+
|
||||
(['/matrix-mautrix-slack-registration.yaml'] if matrix_mautrix_slack_enabled else [])
|
||||
+
|
||||
@@ -429,9 +429,9 @@ devture_systemd_service_manager_services_list_auto: |
|
||||
([{
|
||||
'name': 'matrix-mautrix-discord.service',
|
||||
'priority': 2000,
|
||||
'restart_necessary': (matrix_mautrix_discord_restart_necessary | bool),
|
||||
'restart_necessary': (matrix_bridge_mautrix_discord_restart_necessary | bool),
|
||||
'groups': ['matrix', 'bridges', 'mautrix-discord'],
|
||||
}] if matrix_mautrix_discord_enabled else [])
|
||||
}] if matrix_bridge_mautrix_discord_enabled else [])
|
||||
+
|
||||
([{
|
||||
'name': 'matrix-mautrix-slack.service',
|
||||
@@ -1499,66 +1499,66 @@ matrix_rustpush_bridge_database_password: "{{ (matrix_homeserver_generic_secret_
|
||||
######################################################################
|
||||
|
||||
# We don't enable bridges by default.
|
||||
matrix_mautrix_discord_enabled: false
|
||||
matrix_bridge_mautrix_discord_enabled: false
|
||||
|
||||
matrix_mautrix_discord_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_mautrix_discord_container_image_registry_prefix_upstream_default }}"
|
||||
matrix_bridge_mautrix_discord_container_image_registry_prefix_upstream: "{{ matrix_container_global_registry_prefix_override if matrix_container_global_registry_prefix_override else matrix_bridge_mautrix_discord_container_image_registry_prefix_upstream_default }}"
|
||||
|
||||
matrix_mautrix_discord_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"
|
||||
matrix_bridge_mautrix_discord_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"
|
||||
|
||||
matrix_mautrix_discord_container_network: "{{ matrix_addons_container_network }}"
|
||||
matrix_bridge_mautrix_discord_container_network: "{{ matrix_addons_container_network }}"
|
||||
|
||||
matrix_mautrix_discord_container_additional_networks_auto: |-
|
||||
matrix_bridge_mautrix_discord_container_additional_networks_auto: |-
|
||||
{{
|
||||
(
|
||||
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
|
||||
+
|
||||
([postgres_container_network] if postgres_enabled and matrix_mautrix_discord_database_hostname == postgres_connection_hostname else [])
|
||||
([postgres_container_network] if postgres_enabled and matrix_bridge_mautrix_discord_database_hostname == postgres_connection_hostname else [])
|
||||
+
|
||||
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and matrix_mautrix_discord_container_labels_traefik_enabled) else [])
|
||||
([matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_playbook_reverse_proxyable_services_additional_network and matrix_bridge_mautrix_discord_container_labels_traefik_enabled) else [])
|
||||
) | unique
|
||||
}}
|
||||
|
||||
matrix_mautrix_discord_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
|
||||
matrix_mautrix_discord_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
|
||||
matrix_mautrix_discord_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
|
||||
matrix_mautrix_discord_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
|
||||
|
||||
matrix_mautrix_discord_systemd_required_services_list_auto: |
|
||||
matrix_bridge_mautrix_discord_systemd_required_services_list_auto: |
|
||||
{{
|
||||
matrix_addons_homeserver_systemd_services_list
|
||||
+
|
||||
([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_mautrix_discord_database_hostname == postgres_connection_hostname) else [])
|
||||
([postgres_identifier ~ '.service'] if (postgres_enabled and matrix_bridge_mautrix_discord_database_hostname == postgres_connection_hostname) else [])
|
||||
}}
|
||||
|
||||
matrix_mautrix_discord_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':maudisc.as.tok') | hash('sha512') | to_uuid }}"
|
||||
matrix_bridge_mautrix_discord_appservice_token: "{{ (matrix_homeserver_generic_secret_key + ':maudisc.as.tok') | hash('sha512') | to_uuid }}"
|
||||
|
||||
matrix_mautrix_discord_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
|
||||
matrix_mautrix_discord_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':maudisc.hs.tok') | hash('sha512') | to_uuid }}"
|
||||
matrix_bridge_mautrix_discord_homeserver_address: "{{ matrix_addons_homeserver_client_api_url }}"
|
||||
matrix_bridge_mautrix_discord_homeserver_token: "{{ (matrix_homeserver_generic_secret_key + ':maudisc.hs.tok') | hash('sha512') | to_uuid }}"
|
||||
|
||||
matrix_mautrix_discord_homeserver_async_media: "{{ matrix_homeserver_implementation in ['synapse'] }}"
|
||||
matrix_bridge_mautrix_discord_homeserver_async_media: "{{ matrix_homeserver_implementation in ['synapse'] }}"
|
||||
|
||||
matrix_mautrix_discord_bridge_avatar_proxy_key: "{{ (matrix_homeserver_generic_secret_key + ':maudisc.avatar') | hash('sha512') | to_uuid }}"
|
||||
matrix_bridge_mautrix_discord_bridge_avatar_proxy_key: "{{ (matrix_homeserver_generic_secret_key + ':maudisc.avatar') | hash('sha512') | to_uuid }}"
|
||||
|
||||
matrix_mautrix_discord_hostname: "{{ matrix_server_fqn_matrix }}"
|
||||
matrix_mautrix_discord_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}"
|
||||
matrix_bridge_mautrix_discord_hostname: "{{ matrix_server_fqn_matrix }}"
|
||||
matrix_bridge_mautrix_discord_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}"
|
||||
|
||||
matrix_mautrix_discord_bridge_login_shared_secret_map_auto: |-
|
||||
matrix_bridge_mautrix_discord_bridge_login_shared_secret_map_auto: |-
|
||||
{{
|
||||
({
|
||||
matrix_mautrix_discord_homeserver_domain: ("as_token:" + matrix_appservice_double_puppet_registration_as_token)
|
||||
matrix_bridge_mautrix_discord_homeserver_domain: ("as_token:" + matrix_appservice_double_puppet_registration_as_token)
|
||||
})
|
||||
if matrix_appservice_double_puppet_enabled
|
||||
else (
|
||||
{matrix_mautrix_discord_homeserver_domain: matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret}
|
||||
{matrix_bridge_mautrix_discord_homeserver_domain: matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret}
|
||||
if matrix_synapse_ext_password_provider_shared_secret_auth_enabled
|
||||
else {}
|
||||
)
|
||||
}}
|
||||
|
||||
# Postgres is the default, except if not using internal Postgres server
|
||||
matrix_mautrix_discord_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
|
||||
matrix_mautrix_discord_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
|
||||
matrix_mautrix_discord_database_password: "{{ (matrix_homeserver_generic_secret_key + ':maudiscord.db') | hash('sha512') | to_uuid }}"
|
||||
matrix_bridge_mautrix_discord_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
|
||||
matrix_bridge_mautrix_discord_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
|
||||
matrix_bridge_mautrix_discord_database_password: "{{ (matrix_homeserver_generic_secret_key + ':maudiscord.db') | hash('sha512') | to_uuid }}"
|
||||
|
||||
######################################################################
|
||||
#
|
||||
@@ -4243,10 +4243,10 @@ postgres_managed_databases_auto: |
|
||||
}] if (matrix_mautrix_whatsapp_enabled and matrix_mautrix_whatsapp_database_engine == 'postgres' and matrix_mautrix_whatsapp_database_hostname == postgres_connection_hostname) else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_mautrix_discord_database_name,
|
||||
'username': matrix_mautrix_discord_database_username,
|
||||
'password': matrix_mautrix_discord_database_password,
|
||||
}] if (matrix_mautrix_discord_enabled and matrix_mautrix_discord_database_engine == 'postgres' and matrix_mautrix_discord_database_hostname == postgres_connection_hostname) else [])
|
||||
'name': matrix_bridge_mautrix_discord_database_name,
|
||||
'username': matrix_bridge_mautrix_discord_database_username,
|
||||
'password': matrix_bridge_mautrix_discord_database_password,
|
||||
}] if (matrix_bridge_mautrix_discord_enabled and matrix_bridge_mautrix_discord_database_engine == 'postgres' and matrix_bridge_mautrix_discord_database_hostname == postgres_connection_hostname) else [])
|
||||
+
|
||||
([{
|
||||
'name': matrix_mautrix_slack_database_name,
|
||||
@@ -5131,9 +5131,9 @@ matrix_ketesa_config_asManagedUsers_auto: |
|
||||
] if matrix_rustpush_bridge_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@'+(matrix_mautrix_discord_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$',
|
||||
'^@'+(matrix_bridge_mautrix_discord_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$',
|
||||
'^@discord_[0-9]+:'+(matrix_domain | regex_escape)+'$',
|
||||
] if matrix_mautrix_discord_enabled else [])
|
||||
] if matrix_bridge_mautrix_discord_enabled else [])
|
||||
+
|
||||
([
|
||||
'^@'+(matrix_mautrix_gmessages_appservice_bot_username | default('') | regex_escape)+':'+(matrix_domain | regex_escape)+'$',
|
||||
|
||||
@@ -10,238 +10,238 @@
|
||||
# mautrix-discord is a Matrix <-> Discord bridge
|
||||
# Project source code URL: https://github.com/mautrix/discord
|
||||
|
||||
matrix_mautrix_discord_enabled: true
|
||||
matrix_bridge_mautrix_discord_enabled: true
|
||||
|
||||
matrix_mautrix_discord_hostname: ""
|
||||
matrix_mautrix_discord_path_prefix: /
|
||||
matrix_mautrix_discord_scheme: https
|
||||
matrix_bridge_mautrix_discord_hostname: ""
|
||||
matrix_bridge_mautrix_discord_path_prefix: /
|
||||
matrix_bridge_mautrix_discord_scheme: https
|
||||
|
||||
matrix_mautrix_discord_container_image_self_build: false
|
||||
matrix_mautrix_discord_container_image_self_build_repo: "https://mau.dev/mautrix/discord.git"
|
||||
matrix_mautrix_discord_container_image_self_build_branch: "{{ 'main' if matrix_mautrix_discord_version == 'latest' else matrix_mautrix_discord_version }}"
|
||||
matrix_bridge_mautrix_discord_container_image_self_build: false
|
||||
matrix_bridge_mautrix_discord_container_image_self_build_repo: "https://mau.dev/mautrix/discord.git"
|
||||
matrix_bridge_mautrix_discord_container_image_self_build_branch: "{{ 'main' if matrix_bridge_mautrix_discord_version == 'latest' else matrix_bridge_mautrix_discord_version }}"
|
||||
|
||||
# renovate: datasource=docker depName=dock.mau.dev/mautrix/discord
|
||||
matrix_mautrix_discord_version: v0.7.6
|
||||
matrix_bridge_mautrix_discord_version: v0.7.6
|
||||
|
||||
# See: https://mau.dev/mautrix/discord/container_registry
|
||||
matrix_mautrix_discord_container_image: "{{ matrix_mautrix_discord_container_image_registry_prefix }}mautrix/discord:{{ matrix_mautrix_discord_version }}"
|
||||
matrix_mautrix_discord_container_image_registry_prefix: "{{ 'localhost/' if matrix_mautrix_discord_container_image_self_build else matrix_mautrix_discord_container_image_registry_prefix_upstream }}"
|
||||
matrix_mautrix_discord_container_image_registry_prefix_upstream: "{{ matrix_mautrix_discord_container_image_registry_prefix_upstream_default }}"
|
||||
matrix_mautrix_discord_container_image_registry_prefix_upstream_default: "dock.mau.dev/"
|
||||
matrix_bridge_mautrix_discord_container_image: "{{ matrix_bridge_mautrix_discord_container_image_registry_prefix }}mautrix/discord:{{ matrix_bridge_mautrix_discord_version }}"
|
||||
matrix_bridge_mautrix_discord_container_image_registry_prefix: "{{ 'localhost/' if matrix_bridge_mautrix_discord_container_image_self_build else matrix_bridge_mautrix_discord_container_image_registry_prefix_upstream }}"
|
||||
matrix_bridge_mautrix_discord_container_image_registry_prefix_upstream: "{{ matrix_bridge_mautrix_discord_container_image_registry_prefix_upstream_default }}"
|
||||
matrix_bridge_mautrix_discord_container_image_registry_prefix_upstream_default: "dock.mau.dev/"
|
||||
|
||||
matrix_mautrix_discord_base_path: "{{ matrix_base_data_path }}/mautrix-discord"
|
||||
matrix_mautrix_discord_config_path: "{{ matrix_mautrix_discord_base_path }}/config"
|
||||
matrix_mautrix_discord_data_path: "{{ matrix_mautrix_discord_base_path }}/data"
|
||||
matrix_mautrix_discord_container_src_files_path: "{{ matrix_mautrix_discord_base_path }}/docker-src"
|
||||
matrix_bridge_mautrix_discord_base_path: "{{ matrix_base_data_path }}/mautrix-discord"
|
||||
matrix_bridge_mautrix_discord_config_path: "{{ matrix_bridge_mautrix_discord_base_path }}/config"
|
||||
matrix_bridge_mautrix_discord_data_path: "{{ matrix_bridge_mautrix_discord_base_path }}/data"
|
||||
matrix_bridge_mautrix_discord_container_src_files_path: "{{ matrix_bridge_mautrix_discord_base_path }}/docker-src"
|
||||
|
||||
matrix_mautrix_discord_homeserver_address: ""
|
||||
matrix_bridge_mautrix_discord_homeserver_address: ""
|
||||
# Whether asynchronous uploads via MSC2246 should be enabled for media.
|
||||
# Requires a homeserver that supports MSC2246 (https://github.com/matrix-org/matrix-spec-proposals/pull/2246).
|
||||
matrix_mautrix_discord_homeserver_async_media: false
|
||||
matrix_mautrix_discord_homeserver_domain: "{{ matrix_domain }}"
|
||||
matrix_mautrix_discord_appservice_address: "http://matrix-mautrix-discord:8080"
|
||||
matrix_bridge_mautrix_discord_homeserver_async_media: false
|
||||
matrix_bridge_mautrix_discord_homeserver_domain: "{{ matrix_domain }}"
|
||||
matrix_bridge_mautrix_discord_appservice_address: "http://matrix-mautrix-discord:8080"
|
||||
|
||||
matrix_mautrix_discord_msc4190_enabled: "{{ matrix_bridges_msc4190_enabled }}"
|
||||
matrix_bridge_mautrix_discord_msc4190_enabled: "{{ matrix_bridges_msc4190_enabled }}"
|
||||
|
||||
matrix_mautrix_discord_bridge_command_prefix: "!discord"
|
||||
matrix_bridge_mautrix_discord_bridge_command_prefix: "!discord"
|
||||
|
||||
# Publicly accessible base URL that Discord can use to reach the bridge, used for avatars in relay mode.
|
||||
# If not set, avatars will not be bridged. Only the /mautrix-discord/avatar/{server}/{id}/{hash} endpoint is used on this address.
|
||||
# This should not have a trailing slash, the endpoint above will be appended to the provided address.
|
||||
matrix_mautrix_discord_bridge_public_address: "{{ (matrix_mautrix_discord_scheme + '://' + matrix_mautrix_discord_hostname + (matrix_mautrix_discord_path_prefix if matrix_mautrix_discord_path_prefix != '/' else '')) if matrix_mautrix_discord_hostname else '' }}"
|
||||
matrix_bridge_mautrix_discord_bridge_public_address: "{{ (matrix_bridge_mautrix_discord_scheme + '://' + matrix_bridge_mautrix_discord_hostname + (matrix_bridge_mautrix_discord_path_prefix if matrix_bridge_mautrix_discord_path_prefix != '/' else '')) if matrix_bridge_mautrix_discord_hostname else '' }}"
|
||||
|
||||
# A random key used to sign the avatar URLs. The bridge will only accept requests with a valid signature.
|
||||
matrix_mautrix_discord_bridge_avatar_proxy_key: ''
|
||||
matrix_bridge_mautrix_discord_bridge_avatar_proxy_key: ''
|
||||
|
||||
# Localpart template of MXIDs for Discord users.
|
||||
# {{ '{{.}}' }} is replaced with the internal ID of the Discord user.
|
||||
matrix_mautrix_discord_bridge_username_template: "{% raw %}discord_{{.}}{% endraw %}"
|
||||
matrix_bridge_mautrix_discord_bridge_username_template: "{% raw %}discord_{{.}}{% endraw %}"
|
||||
|
||||
# Displayname template for Discord users. This is also used as the room name in DMs if private_chat_portal_meta is enabled.
|
||||
matrix_mautrix_discord_bridge_displayname_template: "{% raw %}{{or .GlobalName .Username}}{{if .Bot}} (bot){{end}} (Discord){% endraw %}"
|
||||
matrix_bridge_mautrix_discord_bridge_displayname_template: "{% raw %}{{or .GlobalName .Username}}{{if .Bot}} (bot){{end}} (Discord){% endraw %}"
|
||||
|
||||
# Displayname template for Discord channels (bridged as rooms, or spaces when type=4).
|
||||
matrix_mautrix_discord_bridge_channel_name_template: "{% raw %}{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}}{{else}}#{{.Name}}{{end}}{% endraw %}"
|
||||
matrix_bridge_mautrix_discord_bridge_channel_name_template: "{% raw %}{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}}{{else}}#{{.Name}}{{end}}{% endraw %}"
|
||||
|
||||
# Displayname template for Discord guilds (bridged as spaces).
|
||||
matrix_mautrix_discord_bridge_guild_name_template: "{% raw %}{{.Name}}{% endraw %}"
|
||||
matrix_bridge_mautrix_discord_bridge_guild_name_template: "{% raw %}{{.Name}}{% endraw %}"
|
||||
|
||||
matrix_mautrix_discord_bridge_permissions: |
|
||||
matrix_bridge_mautrix_discord_bridge_permissions: |
|
||||
{{
|
||||
{'*': 'relay', matrix_mautrix_discord_homeserver_domain: 'user'}
|
||||
{'*': 'relay', matrix_bridge_mautrix_discord_homeserver_domain: 'user'}
|
||||
| combine({matrix_admin: 'admin'} if matrix_admin else {})
|
||||
}}
|
||||
|
||||
matrix_mautrix_discord_container_network: ''
|
||||
matrix_bridge_mautrix_discord_container_network: ''
|
||||
|
||||
matrix_mautrix_discord_container_additional_networks: "{{ matrix_mautrix_discord_container_additional_networks_auto + matrix_mautrix_discord_container_additional_networks_custom }}"
|
||||
matrix_mautrix_discord_container_additional_networks_auto: []
|
||||
matrix_mautrix_discord_container_additional_networks_custom: []
|
||||
matrix_bridge_mautrix_discord_container_additional_networks: "{{ matrix_bridge_mautrix_discord_container_additional_networks_auto + matrix_bridge_mautrix_discord_container_additional_networks_custom }}"
|
||||
matrix_bridge_mautrix_discord_container_additional_networks_auto: []
|
||||
matrix_bridge_mautrix_discord_container_additional_networks_custom: []
|
||||
|
||||
# matrix_mautrix_discord_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
|
||||
# matrix_bridge_mautrix_discord_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
|
||||
# See `../templates/labels.j2` for details.
|
||||
#
|
||||
# To inject your own other container labels, see `matrix_mautrix_discord_container_labels_additional_labels`.
|
||||
matrix_mautrix_discord_container_labels_traefik_enabled: true
|
||||
matrix_mautrix_discord_container_labels_traefik_docker_network: "{{ matrix_mautrix_discord_container_network }}"
|
||||
matrix_mautrix_discord_container_labels_traefik_hostname: "{{ matrix_mautrix_discord_hostname }}"
|
||||
# To inject your own other container labels, see `matrix_bridge_mautrix_discord_container_labels_additional_labels`.
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_enabled: true
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_docker_network: "{{ matrix_bridge_mautrix_discord_container_network }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_hostname: "{{ matrix_bridge_mautrix_discord_hostname }}"
|
||||
# The path prefix must either be `/` or not end with a slash (e.g. `/matrix-alertmanager-receiver`).
|
||||
matrix_mautrix_discord_container_labels_traefik_path_prefix: "{{ matrix_mautrix_discord_path_prefix }}"
|
||||
matrix_mautrix_discord_container_labels_traefik_entrypoints: web-secure
|
||||
matrix_mautrix_discord_container_labels_traefik_tls_certResolver: default # noqa var-naming
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_path_prefix: "{{ matrix_bridge_mautrix_discord_path_prefix }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_entrypoints: web-secure
|
||||
matrix_bridge_mautrix_discord_container_labels_traefik_tls_certResolver: default # noqa var-naming
|
||||
|
||||
# Controls whether labels will be added that expose the bridge's avatar proxy (`/mautrix-discord/avatar/{server}/{id}/{hash}`).
|
||||
# See: matrix_mautrix_discord_bridge_public_address
|
||||
matrix_mautrix_discord_container_labels_avatar_proxy_enabled: "{{ matrix_mautrix_discord_bridge_public_address != '' }}"
|
||||
matrix_mautrix_discord_container_labels_avatar_proxy_hostname: "{{ matrix_mautrix_discord_container_labels_traefik_hostname }}"
|
||||
matrix_mautrix_discord_container_labels_avatar_proxy_path_prefix: "{{ matrix_mautrix_discord_container_labels_traefik_path_prefix if matrix_mautrix_discord_container_labels_traefik_path_prefix == '/' else (matrix_mautrix_discord_container_labels_traefik_path_prefix + '/') }}mautrix-discord/avatar"
|
||||
matrix_mautrix_discord_container_labels_avatar_proxy_traefik_rule: "Host(`{{ matrix_mautrix_discord_container_labels_traefik_hostname }}`) && PathPrefix(`{{ matrix_mautrix_discord_container_labels_avatar_proxy_path_prefix }}`)"
|
||||
matrix_mautrix_discord_container_labels_avatar_proxy_traefik_priority: 0
|
||||
matrix_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints: "{{ matrix_mautrix_discord_container_labels_traefik_entrypoints }}"
|
||||
matrix_mautrix_discord_container_labels_avatar_proxy_traefik_tls: "{{ matrix_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints != 'web' }}"
|
||||
matrix_mautrix_discord_container_labels_avatar_proxy_traefik_tls_certResolver: "{{ matrix_mautrix_discord_container_labels_traefik_tls_certResolver }}" # noqa var-naming
|
||||
# See: matrix_bridge_mautrix_discord_bridge_public_address
|
||||
matrix_bridge_mautrix_discord_container_labels_avatar_proxy_enabled: "{{ matrix_bridge_mautrix_discord_bridge_public_address != '' }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_avatar_proxy_hostname: "{{ matrix_bridge_mautrix_discord_container_labels_traefik_hostname }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_avatar_proxy_path_prefix: "{{ matrix_bridge_mautrix_discord_container_labels_traefik_path_prefix if matrix_bridge_mautrix_discord_container_labels_traefik_path_prefix == '/' else (matrix_bridge_mautrix_discord_container_labels_traefik_path_prefix + '/') }}mautrix-discord/avatar"
|
||||
matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_rule: "Host(`{{ matrix_bridge_mautrix_discord_container_labels_traefik_hostname }}`) && PathPrefix(`{{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_path_prefix }}`)"
|
||||
matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_priority: 0
|
||||
matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints: "{{ matrix_bridge_mautrix_discord_container_labels_traefik_entrypoints }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_tls: "{{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints != 'web' }}"
|
||||
matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_tls_certResolver: "{{ matrix_bridge_mautrix_discord_container_labels_traefik_tls_certResolver }}" # noqa var-naming
|
||||
|
||||
# matrix_mautrix_discord_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
|
||||
# matrix_bridge_mautrix_discord_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
|
||||
# See `../templates/labels.j2` for details.
|
||||
#
|
||||
# Example:
|
||||
# matrix_mautrix_discord_container_labels_additional_labels: |
|
||||
# matrix_bridge_mautrix_discord_container_labels_additional_labels: |
|
||||
# my.label=1
|
||||
# another.label="here"
|
||||
matrix_mautrix_discord_container_labels_additional_labels: ''
|
||||
matrix_bridge_mautrix_discord_container_labels_additional_labels: ''
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_mautrix_discord_container_extra_arguments: []
|
||||
matrix_bridge_mautrix_discord_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-mautrix-discord.service depends on.
|
||||
matrix_mautrix_discord_systemd_required_services_list: "{{ matrix_mautrix_discord_systemd_required_services_list_default + matrix_mautrix_discord_systemd_required_services_list_auto + matrix_mautrix_discord_systemd_required_services_list_custom }}"
|
||||
matrix_mautrix_discord_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_mautrix_discord_systemd_required_services_list_auto: []
|
||||
matrix_mautrix_discord_systemd_required_services_list_custom: []
|
||||
matrix_bridge_mautrix_discord_systemd_required_services_list: "{{ matrix_bridge_mautrix_discord_systemd_required_services_list_default + matrix_bridge_mautrix_discord_systemd_required_services_list_auto + matrix_bridge_mautrix_discord_systemd_required_services_list_custom }}"
|
||||
matrix_bridge_mautrix_discord_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
|
||||
matrix_bridge_mautrix_discord_systemd_required_services_list_auto: []
|
||||
matrix_bridge_mautrix_discord_systemd_required_services_list_custom: []
|
||||
|
||||
# List of systemd services that matrix-mautrix-discord.service wants
|
||||
matrix_mautrix_discord_systemd_wanted_services_list: []
|
||||
matrix_bridge_mautrix_discord_systemd_wanted_services_list: []
|
||||
|
||||
matrix_mautrix_discord_appservice_token: ''
|
||||
matrix_mautrix_discord_homeserver_token: ''
|
||||
matrix_bridge_mautrix_discord_appservice_token: ''
|
||||
matrix_bridge_mautrix_discord_homeserver_token: ''
|
||||
|
||||
matrix_mautrix_discord_appservice_bot_username: discordbot
|
||||
matrix_mautrix_discord_appservice_bot_displayname: Discord bridge bot
|
||||
matrix_mautrix_discord_appservice_bot_avatar: mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC
|
||||
matrix_bridge_mautrix_discord_appservice_bot_username: discordbot
|
||||
matrix_bridge_mautrix_discord_appservice_bot_displayname: Discord bridge bot
|
||||
matrix_bridge_mautrix_discord_appservice_bot_avatar: mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC
|
||||
|
||||
matrix_mautrix_discord_provisioning_shared_secret: disable
|
||||
matrix_bridge_mautrix_discord_provisioning_shared_secret: disable
|
||||
|
||||
# Minimum severity of journal log messages.
|
||||
# Valid values: fatal, error, warn, info, debug, trace
|
||||
matrix_mautrix_discord_logging_level: 'warn'
|
||||
matrix_bridge_mautrix_discord_logging_level: 'warn'
|
||||
|
||||
# Whether or not created rooms should have federation enabled.
|
||||
# If false, created portal rooms will never be federated.
|
||||
matrix_mautrix_discord_federate_rooms: true
|
||||
matrix_bridge_mautrix_discord_federate_rooms: true
|
||||
|
||||
# Database-related configuration fields.
|
||||
#
|
||||
# To use SQLite, stick to these defaults.
|
||||
#
|
||||
# To use Postgres:
|
||||
# - change the engine (`matrix_mautrix_discord_database_engine: 'postgres'`)
|
||||
# - adjust your database credentials via the `matrix_mautrix_discord_database_*` variables
|
||||
matrix_mautrix_discord_database_engine: 'sqlite'
|
||||
# - change the engine (`matrix_bridge_mautrix_discord_database_engine: 'postgres'`)
|
||||
# - adjust your database credentials via the `matrix_bridge_mautrix_discord_database_*` variables
|
||||
matrix_bridge_mautrix_discord_database_engine: 'sqlite'
|
||||
|
||||
matrix_mautrix_discord_sqlite_database_path_local: "{{ matrix_mautrix_discord_data_path }}/mautrix-discord.db"
|
||||
matrix_mautrix_discord_sqlite_database_path_in_container: "/data/mautrix-discord.db"
|
||||
matrix_bridge_mautrix_discord_sqlite_database_path_local: "{{ matrix_bridge_mautrix_discord_data_path }}/mautrix-discord.db"
|
||||
matrix_bridge_mautrix_discord_sqlite_database_path_in_container: "/data/mautrix-discord.db"
|
||||
|
||||
matrix_mautrix_discord_database_username: 'matrix_mautrix_discord'
|
||||
matrix_mautrix_discord_database_password: 'some-password'
|
||||
matrix_mautrix_discord_database_hostname: ''
|
||||
matrix_mautrix_discord_database_port: 5432
|
||||
matrix_mautrix_discord_database_name: 'matrix_mautrix_discord'
|
||||
matrix_mautrix_discord_database_sslmode: disable
|
||||
matrix_bridge_mautrix_discord_database_username: 'matrix_mautrix_discord'
|
||||
matrix_bridge_mautrix_discord_database_password: 'some-password'
|
||||
matrix_bridge_mautrix_discord_database_hostname: ''
|
||||
matrix_bridge_mautrix_discord_database_port: 5432
|
||||
matrix_bridge_mautrix_discord_database_name: 'matrix_mautrix_discord'
|
||||
matrix_bridge_mautrix_discord_database_sslmode: disable
|
||||
|
||||
matrix_mautrix_discord_database_connection_string: 'postgresql://{{ matrix_mautrix_discord_database_username }}:{{ matrix_mautrix_discord_database_password }}@{{ matrix_mautrix_discord_database_hostname }}:{{ matrix_mautrix_discord_database_port }}/{{ matrix_mautrix_discord_database_name }}?sslmode={{ matrix_mautrix_discord_database_sslmode }}'
|
||||
matrix_bridge_mautrix_discord_database_connection_string: 'postgresql://{{ matrix_bridge_mautrix_discord_database_username }}:{{ matrix_bridge_mautrix_discord_database_password }}@{{ matrix_bridge_mautrix_discord_database_hostname }}:{{ matrix_bridge_mautrix_discord_database_port }}/{{ matrix_bridge_mautrix_discord_database_name }}?sslmode={{ matrix_bridge_mautrix_discord_database_sslmode }}'
|
||||
|
||||
matrix_mautrix_discord_appservice_database_type: "{{ {
|
||||
matrix_bridge_mautrix_discord_appservice_database_type: "{{ {
|
||||
'sqlite': 'sqlite3',
|
||||
'postgres': 'postgres',
|
||||
}[matrix_mautrix_discord_database_engine] }}"
|
||||
}[matrix_bridge_mautrix_discord_database_engine] }}"
|
||||
|
||||
matrix_mautrix_discord_appservice_database_uri: "{{ {
|
||||
'sqlite': matrix_mautrix_discord_sqlite_database_path_in_container,
|
||||
'postgres': matrix_mautrix_discord_database_connection_string,
|
||||
}[matrix_mautrix_discord_database_engine] }}"
|
||||
matrix_bridge_mautrix_discord_appservice_database_uri: "{{ {
|
||||
'sqlite': matrix_bridge_mautrix_discord_sqlite_database_path_in_container,
|
||||
'postgres': matrix_bridge_mautrix_discord_database_connection_string,
|
||||
}[matrix_bridge_mautrix_discord_database_engine] }}"
|
||||
|
||||
matrix_mautrix_discord_bridge_login_shared_secret_map: "{{ matrix_mautrix_discord_bridge_login_shared_secret_map_auto | combine(matrix_mautrix_discord_bridge_login_shared_secret_map_custom) }}"
|
||||
matrix_mautrix_discord_bridge_login_shared_secret_map_auto: {}
|
||||
matrix_mautrix_discord_bridge_login_shared_secret_map_custom: {}
|
||||
matrix_bridge_mautrix_discord_bridge_login_shared_secret_map: "{{ matrix_bridge_mautrix_discord_bridge_login_shared_secret_map_auto | combine(matrix_bridge_mautrix_discord_bridge_login_shared_secret_map_custom) }}"
|
||||
matrix_bridge_mautrix_discord_bridge_login_shared_secret_map_auto: {}
|
||||
matrix_bridge_mautrix_discord_bridge_login_shared_secret_map_custom: {}
|
||||
|
||||
|
||||
# Servers to always allow double puppeting from
|
||||
matrix_mautrix_discord_bridge_double_puppet_server_map: "{{ matrix_mautrix_discord_bridge_double_puppet_server_map_default | combine(matrix_mautrix_discord_bridge_double_puppet_server_map_auto) | combine(matrix_mautrix_discord_bridge_double_puppet_server_map_custom) }}"
|
||||
matrix_mautrix_discord_bridge_double_puppet_server_map_default: |-
|
||||
matrix_bridge_mautrix_discord_bridge_double_puppet_server_map: "{{ matrix_bridge_mautrix_discord_bridge_double_puppet_server_map_default | combine(matrix_bridge_mautrix_discord_bridge_double_puppet_server_map_auto) | combine(matrix_bridge_mautrix_discord_bridge_double_puppet_server_map_custom) }}"
|
||||
matrix_bridge_mautrix_discord_bridge_double_puppet_server_map_default: |-
|
||||
{{
|
||||
{}
|
||||
| combine({
|
||||
matrix_bridge_beeper_linkedin_homeserver_domain: matrix_bridge_beeper_linkedin_homeserver_address
|
||||
})
|
||||
}}
|
||||
matrix_mautrix_discord_bridge_double_puppet_server_map_auto: {}
|
||||
matrix_mautrix_discord_bridge_double_puppet_server_map_custom: {}
|
||||
matrix_bridge_mautrix_discord_bridge_double_puppet_server_map_auto: {}
|
||||
matrix_bridge_mautrix_discord_bridge_double_puppet_server_map_custom: {}
|
||||
|
||||
# Default mautrix-discord configuration template which covers the generic use case.
|
||||
# You can customize it by controlling the various variables inside it.
|
||||
#
|
||||
# For a more advanced customization, you can extend the default (see `matrix_mautrix_discord_configuration_extension_yaml`)
|
||||
# For a more advanced customization, you can extend the default (see `matrix_bridge_mautrix_discord_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_mautrix_discord_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
matrix_bridge_mautrix_discord_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_mautrix_discord_configuration_extension_yaml: |
|
||||
matrix_bridge_mautrix_discord_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_mautrix_discord_configuration_yaml`).
|
||||
# This configuration extends the default starting configuration (`matrix_bridge_mautrix_discord_configuration_yaml`).
|
||||
#
|
||||
# You can override individual variables from the default configuration, or introduce new ones.
|
||||
#
|
||||
# If you need something more special, you can take full control by
|
||||
# completely redefining `matrix_mautrix_discord_configuration_yaml`.
|
||||
# completely redefining `matrix_bridge_mautrix_discord_configuration_yaml`.
|
||||
|
||||
matrix_mautrix_discord_configuration_extension: "{{ matrix_mautrix_discord_configuration_extension_yaml | from_yaml if matrix_mautrix_discord_configuration_extension_yaml | from_yaml is mapping else {} }}"
|
||||
matrix_bridge_mautrix_discord_configuration_extension: "{{ matrix_bridge_mautrix_discord_configuration_extension_yaml | from_yaml if matrix_bridge_mautrix_discord_configuration_extension_yaml | from_yaml is mapping else {} }}"
|
||||
|
||||
# Holds the final configuration (a combination of the default and its extension).
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_mautrix_discord_configuration_yaml`.
|
||||
matrix_mautrix_discord_configuration: "{{ matrix_mautrix_discord_configuration_yaml | from_yaml | combine(matrix_mautrix_discord_configuration_extension, recursive=True) }}"
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_bridge_mautrix_discord_configuration_yaml`.
|
||||
matrix_bridge_mautrix_discord_configuration: "{{ matrix_bridge_mautrix_discord_configuration_yaml | from_yaml | combine(matrix_bridge_mautrix_discord_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_mautrix_discord_registration_yaml: |
|
||||
matrix_bridge_mautrix_discord_registration_yaml: |
|
||||
id: discord
|
||||
url: {{ matrix_mautrix_discord_appservice_address }}
|
||||
as_token: "{{ matrix_mautrix_discord_appservice_token }}"
|
||||
hs_token: "{{ matrix_mautrix_discord_homeserver_token }}"
|
||||
url: {{ matrix_bridge_mautrix_discord_appservice_address }}
|
||||
as_token: "{{ matrix_bridge_mautrix_discord_appservice_token }}"
|
||||
hs_token: "{{ matrix_bridge_mautrix_discord_homeserver_token }}"
|
||||
# See https://github.com/mautrix/signal/issues/43
|
||||
sender_localpart: _bot_{{ matrix_mautrix_discord_appservice_bot_username }}
|
||||
sender_localpart: _bot_{{ matrix_bridge_mautrix_discord_appservice_bot_username }}
|
||||
rate_limited: false
|
||||
namespaces:
|
||||
users:
|
||||
- regex: '^@discord_[0-9]+:{{ matrix_mautrix_discord_homeserver_domain | regex_escape }}$'
|
||||
- regex: '^@discord_[0-9]+:{{ matrix_bridge_mautrix_discord_homeserver_domain | regex_escape }}$'
|
||||
exclusive: true
|
||||
- exclusive: true
|
||||
regex: '^@{{ matrix_mautrix_discord_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_discord_homeserver_domain | regex_escape }}$'
|
||||
regex: '^@{{ matrix_bridge_mautrix_discord_appservice_bot_username | regex_escape }}:{{ matrix_bridge_mautrix_discord_homeserver_domain | regex_escape }}$'
|
||||
de.sorunome.msc2409.push_ephemeral: true
|
||||
receive_ephemeral: true
|
||||
io.element.msc4190: {{ matrix_mautrix_discord_msc4190_enabled | to_json }}
|
||||
io.element.msc4190: {{ matrix_bridge_mautrix_discord_msc4190_enabled | to_json }}
|
||||
|
||||
matrix_mautrix_discord_registration: "{{ matrix_mautrix_discord_registration_yaml | from_yaml }}"
|
||||
matrix_bridge_mautrix_discord_registration: "{{ matrix_bridge_mautrix_discord_registration_yaml | from_yaml }}"
|
||||
|
||||
# Enable End-to-bridge encryption
|
||||
matrix_mautrix_discord_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
|
||||
matrix_mautrix_discord_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
|
||||
matrix_mautrix_discord_bridge_encryption_require: false
|
||||
matrix_mautrix_discord_bridge_encryption_appservice: false
|
||||
matrix_mautrix_discord_bridge_encryption_plaintext_mentions: false
|
||||
matrix_mautrix_discord_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_discord_bridge_encryption_allow }}"
|
||||
matrix_bridge_mautrix_discord_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
|
||||
matrix_bridge_mautrix_discord_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
|
||||
matrix_bridge_mautrix_discord_bridge_encryption_require: false
|
||||
matrix_bridge_mautrix_discord_bridge_encryption_appservice: false
|
||||
matrix_bridge_mautrix_discord_bridge_encryption_plaintext_mentions: false
|
||||
matrix_bridge_mautrix_discord_bridge_encryption_key_sharing_allow: "{{ matrix_bridge_mautrix_discord_bridge_encryption_allow }}"
|
||||
|
||||
# On Conduit versions before 0.5.0 this option prevented users from joining spaces created by the bridge.
|
||||
# Setting this to false fixed the issue.
|
||||
matrix_mautrix_discord_bridge_restricted_rooms: true
|
||||
matrix_bridge_mautrix_discord_bridge_restricted_rooms: true
|
||||
|
||||
# matrix_mautrix_discord_restart_necessary controls whether the service
|
||||
# matrix_bridge_mautrix_discord_restart_necessary controls whether the service
|
||||
# will be restarted (when true) or merely started (when false) by the
|
||||
# systemd service manager role (when conditional restart is enabled).
|
||||
#
|
||||
@@ -249,4 +249,4 @@ matrix_mautrix_discord_bridge_restricted_rooms: true
|
||||
# any configuration files, the systemd service file, or the container image changed.
|
||||
# The default of `false` means "no restart needed" — appropriate when the role's
|
||||
# installation tasks haven't run (e.g., due to --tags skipping them).
|
||||
matrix_mautrix_discord_restart_necessary: false
|
||||
matrix_bridge_mautrix_discord_restart_necessary: false
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
- install-all
|
||||
- install-mautrix-discord
|
||||
block:
|
||||
- when: matrix_mautrix_discord_enabled | bool
|
||||
- when: matrix_bridge_mautrix_discord_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_mautrix_discord_enabled | bool
|
||||
- when: matrix_bridge_mautrix_discord_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- setup-mautrix-discord
|
||||
block:
|
||||
- when: not matrix_mautrix_discord_enabled | bool
|
||||
- when: not matrix_bridge_mautrix_discord_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
|
||||
@@ -8,32 +8,32 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mautrix_discord_migration_requires_restart: false
|
||||
matrix_bridge_mautrix_discord_migration_requires_restart: false
|
||||
|
||||
- when: "matrix_mautrix_discord_database_engine == 'postgres'"
|
||||
- when: "matrix_bridge_mautrix_discord_database_engine == 'postgres'"
|
||||
block:
|
||||
- name: Check if an SQLite database already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mautrix_discord_sqlite_database_path_local }}"
|
||||
register: matrix_mautrix_discord_sqlite_database_path_local_stat_result
|
||||
path: "{{ matrix_bridge_mautrix_discord_sqlite_database_path_local }}"
|
||||
register: matrix_bridge_mautrix_discord_sqlite_database_path_local_stat_result
|
||||
|
||||
- when: "matrix_mautrix_discord_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
- when: "matrix_bridge_mautrix_discord_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
postgres_db_migration_request:
|
||||
src: "{{ matrix_mautrix_discord_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_mautrix_discord_database_connection_string }}"
|
||||
src: "{{ matrix_bridge_mautrix_discord_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_bridge_mautrix_discord_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
engine_variable_name: 'matrix_mautrix_discord_database_engine'
|
||||
engine_variable_name: 'matrix_bridge_mautrix_discord_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-mautrix-discord.service']
|
||||
pgloader_options: ['--with "quote identifiers"']
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mautrix_discord_migration_requires_restart: true
|
||||
matrix_bridge_mautrix_discord_migration_requires_restart: true
|
||||
|
||||
- name: Ensure Mautrix Discord paths exists
|
||||
ansible.builtin.file:
|
||||
@@ -43,77 +43,77 @@
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_mautrix_discord_base_path }}", when: true}
|
||||
- {path: "{{ matrix_mautrix_discord_config_path }}", when: true}
|
||||
- {path: "{{ matrix_mautrix_discord_data_path }}", when: true}
|
||||
- {path: "{{ matrix_mautrix_discord_container_src_files_path }}", when: "{{ matrix_mautrix_discord_container_image_self_build }}"}
|
||||
- {path: "{{ matrix_bridge_mautrix_discord_base_path }}", when: true}
|
||||
- {path: "{{ matrix_bridge_mautrix_discord_config_path }}", when: true}
|
||||
- {path: "{{ matrix_bridge_mautrix_discord_data_path }}", when: true}
|
||||
- {path: "{{ matrix_bridge_mautrix_discord_container_src_files_path }}", when: "{{ matrix_bridge_mautrix_discord_container_image_self_build }}"}
|
||||
when: item.when | bool
|
||||
|
||||
- name: Ensure Mautrix Discord image is pulled
|
||||
community.docker.docker_image_pull:
|
||||
name: "{{ matrix_mautrix_discord_container_image }}"
|
||||
name: "{{ matrix_bridge_mautrix_discord_container_image }}"
|
||||
pull: always
|
||||
when: not matrix_mautrix_discord_container_image_self_build
|
||||
register: matrix_mautrix_discord_container_image_pull_result
|
||||
when: not matrix_bridge_mautrix_discord_container_image_self_build
|
||||
register: matrix_bridge_mautrix_discord_container_image_pull_result
|
||||
retries: "{{ devture_playbook_help_container_retries_count }}"
|
||||
delay: "{{ devture_playbook_help_container_retries_delay }}"
|
||||
until: matrix_mautrix_discord_container_image_pull_result is not failed
|
||||
until: matrix_bridge_mautrix_discord_container_image_pull_result is not failed
|
||||
|
||||
- name: Ensure Mautrix discord repository is present on self-build
|
||||
ansible.builtin.git:
|
||||
repo: "{{ matrix_mautrix_discord_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_mautrix_discord_container_src_files_path }}"
|
||||
version: "{{ matrix_mautrix_discord_container_image_self_build_branch }}"
|
||||
repo: "{{ matrix_bridge_mautrix_discord_container_image_self_build_repo }}"
|
||||
dest: "{{ matrix_bridge_mautrix_discord_container_src_files_path }}"
|
||||
version: "{{ matrix_bridge_mautrix_discord_container_image_self_build_branch }}"
|
||||
force: "yes"
|
||||
become: true
|
||||
become_user: "{{ matrix_user_name }}"
|
||||
register: matrix_mautrix_discord_git_pull_results
|
||||
when: "matrix_mautrix_discord_container_image_self_build | bool"
|
||||
register: matrix_bridge_mautrix_discord_git_pull_results
|
||||
when: "matrix_bridge_mautrix_discord_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure Mautrix discord Docker image is built
|
||||
community.docker.docker_image_build:
|
||||
name: "{{ matrix_mautrix_discord_container_image }}"
|
||||
name: "{{ matrix_bridge_mautrix_discord_container_image }}"
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_mautrix_discord_container_src_files_path }}"
|
||||
path: "{{ matrix_bridge_mautrix_discord_container_src_files_path }}"
|
||||
pull: true
|
||||
rebuild: "{{ 'always' if matrix_mautrix_discord_git_pull_results.changed | bool else 'never' }}"
|
||||
when: "matrix_mautrix_discord_container_image_self_build | bool"
|
||||
register: matrix_mautrix_discord_container_image_build_result
|
||||
rebuild: "{{ 'always' if matrix_bridge_mautrix_discord_git_pull_results.changed | bool else 'never' }}"
|
||||
when: "matrix_bridge_mautrix_discord_container_image_self_build | bool"
|
||||
register: matrix_bridge_mautrix_discord_container_image_build_result
|
||||
|
||||
- name: Ensure mautrix-discord config.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mautrix_discord_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mautrix_discord_config_path }}/config.yaml"
|
||||
content: "{{ matrix_bridge_mautrix_discord_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_bridge_mautrix_discord_config_path }}/config.yaml"
|
||||
mode: '0644'
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
register: matrix_mautrix_discord_config_result
|
||||
register: matrix_bridge_mautrix_discord_config_result
|
||||
|
||||
- name: Ensure mautrix-discord registration.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mautrix_discord_registration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mautrix_discord_config_path }}/registration.yaml"
|
||||
content: "{{ matrix_bridge_mautrix_discord_registration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_bridge_mautrix_discord_config_path }}/registration.yaml"
|
||||
mode: '0644'
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
register: matrix_mautrix_discord_registration_result
|
||||
register: matrix_bridge_mautrix_discord_registration_result
|
||||
|
||||
- name: Ensure mautrix-discord support files installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/{{ item }}.j2"
|
||||
dest: "{{ matrix_mautrix_discord_base_path }}/{{ item }}"
|
||||
dest: "{{ matrix_bridge_mautrix_discord_base_path }}/{{ item }}"
|
||||
mode: '0640'
|
||||
owner: "{{ matrix_user_name }}"
|
||||
group: "{{ matrix_group_name }}"
|
||||
with_items:
|
||||
- labels
|
||||
register: matrix_mautrix_discord_support_files_result
|
||||
register: matrix_bridge_mautrix_discord_support_files_result
|
||||
|
||||
- name: Ensure mautrix-discord container network is created
|
||||
when: matrix_mautrix_discord_container_network != 'host'
|
||||
when: matrix_bridge_mautrix_discord_container_network != 'host'
|
||||
community.general.docker_network:
|
||||
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
|
||||
name: "{{ matrix_mautrix_discord_container_network }}"
|
||||
name: "{{ matrix_bridge_mautrix_discord_container_network }}"
|
||||
driver: bridge
|
||||
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
|
||||
|
||||
@@ -122,19 +122,19 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mautrix-discord.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-discord.service"
|
||||
mode: '0644'
|
||||
register: matrix_mautrix_discord_systemd_service_result
|
||||
register: matrix_bridge_mautrix_discord_systemd_service_result
|
||||
|
||||
- name: Determine whether matrix-mautrix-discord needs a restart
|
||||
ansible.builtin.set_fact:
|
||||
matrix_mautrix_discord_restart_necessary: >-
|
||||
matrix_bridge_mautrix_discord_restart_necessary: >-
|
||||
{{
|
||||
matrix_mautrix_discord_migration_requires_restart | default(false)
|
||||
or matrix_mautrix_discord_config_result.changed | default(false)
|
||||
or matrix_mautrix_discord_registration_result.changed | default(false)
|
||||
or matrix_mautrix_discord_support_files_result.changed | default(false)
|
||||
or matrix_mautrix_discord_systemd_service_result.changed | default(false)
|
||||
or matrix_mautrix_discord_container_image_pull_result.changed | default(false)
|
||||
or matrix_mautrix_discord_container_image_build_result.changed | default(false)
|
||||
matrix_bridge_mautrix_discord_migration_requires_restart | default(false)
|
||||
or matrix_bridge_mautrix_discord_config_result.changed | default(false)
|
||||
or matrix_bridge_mautrix_discord_registration_result.changed | default(false)
|
||||
or matrix_bridge_mautrix_discord_support_files_result.changed | default(false)
|
||||
or matrix_bridge_mautrix_discord_systemd_service_result.changed | default(false)
|
||||
or matrix_bridge_mautrix_discord_container_image_pull_result.changed | default(false)
|
||||
or matrix_bridge_mautrix_discord_container_image_build_result.changed | default(false)
|
||||
}}
|
||||
|
||||
- name: Ensure matrix-mautrix-discord.service restarted, if necessary
|
||||
@@ -142,4 +142,4 @@
|
||||
name: "matrix-mautrix-discord.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_mautrix_discord_migration_requires_restart | bool"
|
||||
when: "matrix_bridge_mautrix_discord_migration_requires_restart | bool"
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
- name: Check existence of matrix-mautrix-discord service
|
||||
ansible.builtin.stat:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-discord.service"
|
||||
register: matrix_mautrix_discord_service_stat
|
||||
register: matrix_bridge_mautrix_discord_service_stat
|
||||
|
||||
- when: matrix_mautrix_discord_service_stat.stat.exists | bool
|
||||
- when: matrix_bridge_mautrix_discord_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-mautrix-discord is stopped
|
||||
ansible.builtin.service:
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
|
||||
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
|
||||
with_items:
|
||||
- {'old': 'matrix_mautrix_discord_login_shared_secret', 'new': '<removed>'}
|
||||
- {'old': 'matrix_mautrix_discord_homeserver_public_address', 'new': 'matrix_mautrix_discord_bridge_public_address'}
|
||||
- {'old': 'matrix_mautrix_discord_command_prefix', 'new': 'matrix_mautrix_discord_bridge_command_prefix'}
|
||||
- {'old': 'matrix_mautrix_discord_docker_image_name_prefix', 'new': 'matrix_mautrix_discord_container_image_registry_prefix'}
|
||||
- {'old': 'matrix_mautrix_discord_docker_image', 'new': 'matrix_mautrix_discord_container_image'}
|
||||
- {'old': 'matrix_mautrix_discord_docker_image_force_pull', 'new': 'matrix_mautrix_discord_container_image_force_pull'}
|
||||
- {'old': 'matrix_mautrix_discord_docker_image_registry_prefix', 'new': 'matrix_mautrix_discord_container_image_registry_prefix'}
|
||||
- {'old': 'matrix_mautrix_discord_docker_image_registry_prefix_upstream', 'new': 'matrix_mautrix_discord_container_image_registry_prefix_upstream'}
|
||||
- {'old': 'matrix_mautrix_discord_docker_image_registry_prefix_upstream_default', 'new': 'matrix_mautrix_discord_container_image_registry_prefix_upstream_default'}
|
||||
- {'old': 'matrix_mautrix_discord_docker_src_files_path', 'new': 'matrix_mautrix_discord_container_src_files_path'}
|
||||
- {'old': 'matrix_mautrix_discord_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_login_shared_secret', 'new': '<removed>'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_homeserver_public_address', 'new': 'matrix_bridge_mautrix_discord_bridge_public_address'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_command_prefix', 'new': 'matrix_bridge_mautrix_discord_bridge_command_prefix'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_docker_image_name_prefix', 'new': 'matrix_bridge_mautrix_discord_container_image_registry_prefix'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_docker_image', 'new': 'matrix_bridge_mautrix_discord_container_image'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_docker_image_force_pull', 'new': 'matrix_bridge_mautrix_discord_container_image_force_pull'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_docker_image_registry_prefix', 'new': 'matrix_bridge_mautrix_discord_container_image_registry_prefix'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_docker_image_registry_prefix_upstream', 'new': 'matrix_bridge_mautrix_discord_container_image_registry_prefix_upstream'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_docker_image_registry_prefix_upstream_default', 'new': 'matrix_bridge_mautrix_discord_container_image_registry_prefix_upstream_default'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_docker_src_files_path', 'new': 'matrix_bridge_mautrix_discord_container_src_files_path'}
|
||||
- {'old': 'matrix_bridge_mautrix_discord_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
|
||||
|
||||
- name: Fail if required mautrix-discord settings not defined
|
||||
ansible.builtin.fail:
|
||||
@@ -31,11 +31,11 @@
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
|
||||
with_items:
|
||||
- {'name': 'matrix_mautrix_discord_appservice_token', when: true}
|
||||
- {'name': 'matrix_mautrix_discord_homeserver_address', when: true}
|
||||
- {'name': 'matrix_mautrix_discord_homeserver_token', when: true}
|
||||
- {'name': 'matrix_mautrix_discord_bridge_public_address', when: true}
|
||||
- {'name': 'matrix_mautrix_discord_container_network', when: true}
|
||||
- {'name': 'matrix_mautrix_discord_database_hostname', when: "{{ matrix_mautrix_discord_database_engine == 'postgres' }}"}
|
||||
- {'name': 'matrix_mautrix_discord_container_labels_avatar_proxy_hostname', when: "{{ matrix_mautrix_discord_container_labels_avatar_proxy_enabled }}"}
|
||||
- {'name': 'matrix_mautrix_discord_container_labels_avatar_proxy_path_prefix', when: "{{ matrix_mautrix_discord_container_labels_avatar_proxy_enabled }}"}
|
||||
- {'name': 'matrix_bridge_mautrix_discord_appservice_token', when: true}
|
||||
- {'name': 'matrix_bridge_mautrix_discord_homeserver_address', when: true}
|
||||
- {'name': 'matrix_bridge_mautrix_discord_homeserver_token', when: true}
|
||||
- {'name': 'matrix_bridge_mautrix_discord_bridge_public_address', when: true}
|
||||
- {'name': 'matrix_bridge_mautrix_discord_container_network', when: true}
|
||||
- {'name': 'matrix_bridge_mautrix_discord_database_hostname', when: "{{ matrix_bridge_mautrix_discord_database_engine == 'postgres' }}"}
|
||||
- {'name': 'matrix_bridge_mautrix_discord_container_labels_avatar_proxy_hostname', when: "{{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_enabled }}"}
|
||||
- {'name': 'matrix_bridge_mautrix_discord_container_labels_avatar_proxy_path_prefix', when: "{{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_enabled }}"}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# Homeserver details.
|
||||
homeserver:
|
||||
# The address that this appservice can use to connect to the homeserver.
|
||||
address: {{ matrix_mautrix_discord_homeserver_address | to_json }}
|
||||
address: {{ matrix_bridge_mautrix_discord_homeserver_address | to_json }}
|
||||
# The domain of the homeserver (also known as server_name, used for MXIDs, etc).
|
||||
domain: {{ matrix_mautrix_discord_homeserver_domain | to_json }}
|
||||
domain: {{ matrix_bridge_mautrix_discord_homeserver_domain | to_json }}
|
||||
|
||||
# What software is the homeserver running?
|
||||
# Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here.
|
||||
@@ -16,7 +16,7 @@ homeserver:
|
||||
# Endpoint for reporting per-message status.
|
||||
message_send_checkpoint_endpoint: null
|
||||
# Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246?
|
||||
async_media: {{ matrix_mautrix_discord_homeserver_async_media | to_json }}
|
||||
async_media: {{ matrix_bridge_mautrix_discord_homeserver_async_media | to_json }}
|
||||
|
||||
# Should the bridge use a websocket for connecting to the homeserver?
|
||||
# The server side is currently not documented anywhere and is only implemented by mautrix-wsproxy,
|
||||
@@ -29,7 +29,7 @@ homeserver:
|
||||
# Changing these values requires regeneration of the registration.
|
||||
appservice:
|
||||
# The address that the homeserver can use to connect to this appservice.
|
||||
address: {{ matrix_mautrix_discord_appservice_address | to_json }}
|
||||
address: {{ matrix_bridge_mautrix_discord_appservice_address | to_json }}
|
||||
|
||||
# The hostname and port where this appservice should listen.
|
||||
hostname: 0.0.0.0
|
||||
@@ -38,13 +38,13 @@ appservice:
|
||||
# Database config.
|
||||
database:
|
||||
# The database type. "sqlite3-fk-wal" and "postgres" are supported.
|
||||
type: {{ matrix_mautrix_discord_appservice_database_type | to_json }}
|
||||
type: {{ matrix_bridge_mautrix_discord_appservice_database_type | to_json }}
|
||||
# The database URI.
|
||||
# SQLite: A raw file path is supported, but `file:<path>?_txlock=immediate` is recommended.
|
||||
# https://github.com/mattn/go-sqlite3#connection-string
|
||||
# Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
|
||||
# To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql
|
||||
uri: {{ matrix_mautrix_discord_appservice_database_uri | to_json }}
|
||||
uri: {{ matrix_bridge_mautrix_discord_appservice_database_uri | to_json }}
|
||||
# Maximum number of connections. Mostly relevant for Postgres.
|
||||
max_open_conns: 20
|
||||
max_idle_conns: 2
|
||||
@@ -58,11 +58,11 @@ appservice:
|
||||
# Appservice bot details.
|
||||
bot:
|
||||
# Username of the appservice bot.
|
||||
username: {{ matrix_mautrix_discord_appservice_bot_username | to_json }}
|
||||
username: {{ matrix_bridge_mautrix_discord_appservice_bot_username | to_json }}
|
||||
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
|
||||
# to leave display name/avatar as-is.
|
||||
displayname: {{ matrix_mautrix_discord_appservice_bot_displayname | to_json(ensure_ascii=False) }}
|
||||
avatar: {{ matrix_mautrix_discord_appservice_bot_avatar | to_json }}
|
||||
displayname: {{ matrix_bridge_mautrix_discord_appservice_bot_displayname | to_json(ensure_ascii=False) }}
|
||||
avatar: {{ matrix_bridge_mautrix_discord_appservice_bot_avatar | to_json }}
|
||||
|
||||
# Whether or not to receive ephemeral events via appservice transactions.
|
||||
# Requires MSC2409 support (i.e. Synapse 1.22+).
|
||||
@@ -74,14 +74,14 @@ appservice:
|
||||
async_transactions: false
|
||||
|
||||
# Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
|
||||
as_token: {{ matrix_mautrix_discord_appservice_token | to_json }}
|
||||
hs_token: {{ matrix_mautrix_discord_homeserver_token | to_json }}
|
||||
as_token: {{ matrix_bridge_mautrix_discord_appservice_token | to_json }}
|
||||
hs_token: {{ matrix_bridge_mautrix_discord_homeserver_token | to_json }}
|
||||
|
||||
# Bridge config
|
||||
bridge:
|
||||
# Localpart template of MXIDs for Discord users.
|
||||
# {% raw %}{{.}}{% endraw %} is replaced with the internal ID of the Discord user.
|
||||
username_template: {{ matrix_mautrix_discord_bridge_username_template | to_json }}
|
||||
username_template: {{ matrix_bridge_mautrix_discord_bridge_username_template | to_json }}
|
||||
# Displayname template for Discord users. This is also used as the room name in DMs if private_chat_portal_meta is enabled.
|
||||
# Available variables:
|
||||
# .ID - Internal user ID
|
||||
@@ -92,7 +92,7 @@ bridge:
|
||||
# .System - Whether the user is an official system user
|
||||
# .Webhook - Whether the user is a webhook and is not an application
|
||||
# .Application - Whether the user is an application
|
||||
displayname_template: {{ matrix_mautrix_discord_bridge_displayname_template | to_json }}
|
||||
displayname_template: {{ matrix_bridge_mautrix_discord_bridge_displayname_template | to_json }}
|
||||
# Displayname template for Discord channels (bridged as rooms, or spaces when type=4).
|
||||
# Available variables:
|
||||
# .Name - Channel name, or user displayname (pre-formatted with displayname_template) in DMs.
|
||||
@@ -100,11 +100,11 @@ bridge:
|
||||
# .GuildName - Guild name.
|
||||
# .NSFW - Whether the channel is marked as NSFW.
|
||||
# .Type - Channel type (see values at https://github.com/bwmarrin/discordgo/blob/v0.25.0/structs.go#L251-L267)
|
||||
channel_name_template: {{ matrix_mautrix_discord_bridge_channel_name_template | to_json }}
|
||||
channel_name_template: {{ matrix_bridge_mautrix_discord_bridge_channel_name_template | to_json }}
|
||||
# Displayname template for Discord guilds (bridged as spaces).
|
||||
# Available variables:
|
||||
# .Name - Guild name
|
||||
guild_name_template: {{ matrix_mautrix_discord_bridge_guild_name_template | to_json }}
|
||||
guild_name_template: {{ matrix_bridge_mautrix_discord_bridge_guild_name_template | to_json }}
|
||||
# Whether to explicitly set the avatar and room name for private chat portal rooms.
|
||||
# If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms.
|
||||
# If set to `always`, all DM rooms will have explicit names and avatars set.
|
||||
@@ -114,9 +114,9 @@ bridge:
|
||||
# Publicly accessible base URL that Discord can use to reach the bridge, used for avatars in relay mode.
|
||||
# If not set, avatars will not be bridged. Only the /mautrix-discord/avatar/{server}/{id}/{hash} endpoint is used on this address.
|
||||
# This should not have a trailing slash, the endpoint above will be appended to the provided address.
|
||||
public_address: {{ matrix_mautrix_discord_bridge_public_address | to_json }}
|
||||
public_address: {{ matrix_bridge_mautrix_discord_bridge_public_address | to_json }}
|
||||
# A random key used to sign the avatar URLs. The bridge will only accept requests with a valid signature.
|
||||
avatar_proxy_key: {{ matrix_mautrix_discord_bridge_avatar_proxy_key | to_json }}
|
||||
avatar_proxy_key: {{ matrix_bridge_mautrix_discord_bridge_avatar_proxy_key | to_json }}
|
||||
|
||||
portal_message_buffer: 128
|
||||
|
||||
@@ -131,7 +131,7 @@ bridge:
|
||||
message_error_notices: true
|
||||
# Should the bridge use space-restricted join rules instead of invite-only for guild rooms?
|
||||
# This can avoid unnecessary invite events in guild rooms when members are synced in.
|
||||
restricted_rooms: {{ matrix_mautrix_discord_bridge_restricted_rooms | to_json }}
|
||||
restricted_rooms: {{ matrix_bridge_mautrix_discord_bridge_restricted_rooms | to_json }}
|
||||
# Should the bridge automatically join the user to threads on Discord when the thread is opened on Matrix?
|
||||
# This only works with clients that support thread read receipts (MSC3771 added in Matrix v1.4).
|
||||
autojoin_thread_on_open: true
|
||||
@@ -159,7 +159,7 @@ bridge:
|
||||
delete_guild_on_leave: true
|
||||
# Whether or not created rooms should have federation enabled.
|
||||
# If false, created portal rooms will never be federated.
|
||||
federate_rooms: {{ matrix_mautrix_discord_federate_rooms | to_json }}
|
||||
federate_rooms: {{ matrix_bridge_mautrix_discord_federate_rooms | to_json }}
|
||||
# Prefix messages from webhooks with the profile info? This can be used along with a custom displayname_template
|
||||
# to better handle webhooks that change their name all the time (like ones used by bridges).
|
||||
prefix_webhook_messages: false
|
||||
@@ -207,7 +207,7 @@ bridge:
|
||||
height: 320
|
||||
fps: 25 # only for webm, webp and gif (2, 5, 10, 20 or 25 recommended)
|
||||
# Servers to always allow double puppeting from
|
||||
double_puppet_server_map: {{ matrix_mautrix_discord_bridge_double_puppet_server_map | to_json }}
|
||||
double_puppet_server_map: {{ matrix_bridge_mautrix_discord_bridge_double_puppet_server_map | to_json }}
|
||||
# Allow using double puppeting from any server with a valid client .well-known file.
|
||||
double_puppet_allow_discovery: false
|
||||
# Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
|
||||
@@ -215,10 +215,10 @@ bridge:
|
||||
# If set, double puppeting will be enabled automatically for local users
|
||||
# instead of users having to find an access token and run `login-matrix`
|
||||
# manually.
|
||||
login_shared_secret_map: {{ matrix_mautrix_discord_bridge_login_shared_secret_map | to_json }}
|
||||
login_shared_secret_map: {{ matrix_bridge_mautrix_discord_bridge_login_shared_secret_map | to_json }}
|
||||
|
||||
# The prefix for commands. Only required in non-management rooms.
|
||||
command_prefix: {{ matrix_mautrix_discord_bridge_command_prefix | to_json }}
|
||||
command_prefix: {{ matrix_bridge_mautrix_discord_bridge_command_prefix | to_json }}
|
||||
# Messages sent upon joining a management room.
|
||||
# Markdown is supported. The defaults are listed below.
|
||||
management_room_text:
|
||||
@@ -260,24 +260,24 @@ bridge:
|
||||
# See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
|
||||
encryption:
|
||||
# Allow encryption, work in group chat rooms with e2ee enabled
|
||||
allow: {{ matrix_mautrix_discord_bridge_encryption_allow | to_json }}
|
||||
allow: {{ matrix_bridge_mautrix_discord_bridge_encryption_allow | to_json }}
|
||||
# Default to encryption, force-enable encryption in all portals the bridge creates
|
||||
# This will cause the bridge bot to be in private chats for the encryption to work properly.
|
||||
default: {{ matrix_mautrix_discord_bridge_encryption_default | to_json }}
|
||||
default: {{ matrix_bridge_mautrix_discord_bridge_encryption_default | to_json }}
|
||||
# Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data.
|
||||
appservice: {{ matrix_mautrix_discord_bridge_encryption_appservice | to_json}}
|
||||
appservice: {{ matrix_bridge_mautrix_discord_bridge_encryption_appservice | to_json}}
|
||||
# Require encryption, drop any unencrypted messages.
|
||||
require: {{ matrix_mautrix_discord_bridge_encryption_require | to_json }}
|
||||
require: {{ matrix_bridge_mautrix_discord_bridge_encryption_require | to_json }}
|
||||
# Whether to use MSC4190 instead of appservice login to create the bridge bot device.
|
||||
# Requires the homeserver to support MSC4190 and the device masquerading parts of MSC3202.
|
||||
# Only relevant when using end-to-bridge encryption, required when using encryption with next-gen auth (MSC3861).
|
||||
# Changing this option requires updating the appservice registration file.
|
||||
msc4190: {{ matrix_mautrix_discord_msc4190_enabled | to_json }}
|
||||
msc4190: {{ matrix_bridge_mautrix_discord_msc4190_enabled | to_json }}
|
||||
# Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
|
||||
# You must use a client that supports requesting keys from other users to use this feature.
|
||||
allow_key_sharing: {{ matrix_mautrix_discord_bridge_encryption_key_sharing_allow | to_json }}
|
||||
allow_key_sharing: {{ matrix_bridge_mautrix_discord_bridge_encryption_key_sharing_allow | to_json }}
|
||||
# Should users mentions be in the event wire content to enable the server to send push notifications?
|
||||
plaintext_mentions: {{ matrix_mautrix_discord_bridge_encryption_plaintext_mentions | to_json }}
|
||||
plaintext_mentions: {{ matrix_bridge_mautrix_discord_bridge_encryption_plaintext_mentions | to_json }}
|
||||
# Options for deleting megolm sessions from the bridge.
|
||||
delete_keys:
|
||||
# Beeper-specific: delete outbound sessions when hungryserv confirms
|
||||
@@ -344,7 +344,7 @@ bridge:
|
||||
prefix: /_matrix/provision
|
||||
# Shared secret for authentication. If set to "generate", a random secret will be generated,
|
||||
# or if set to "disable", the provisioning API will be disabled.
|
||||
shared_secret: {{ matrix_mautrix_discord_provisioning_shared_secret | to_json }}
|
||||
shared_secret: {{ matrix_bridge_mautrix_discord_provisioning_shared_secret | to_json }}
|
||||
# Enable debug API at /debug with provisioning authentication.
|
||||
debug_endpoints: false
|
||||
|
||||
@@ -357,11 +357,11 @@ bridge:
|
||||
# * - All Matrix users
|
||||
# domain - All users on that homeserver
|
||||
# mxid - Specific user
|
||||
permissions: {{ matrix_mautrix_discord_bridge_permissions|to_json }}
|
||||
permissions: {{ matrix_bridge_mautrix_discord_bridge_permissions|to_json }}
|
||||
|
||||
# Logging config. See https://github.com/tulir/zeroconfig for details.
|
||||
logging:
|
||||
min_level: {{ matrix_mautrix_discord_logging_level | to_json }}
|
||||
min_level: {{ matrix_bridge_mautrix_discord_logging_level | to_json }}
|
||||
writers:
|
||||
- type: stdout
|
||||
format: pretty-colored
|
||||
|
||||
@@ -4,16 +4,16 @@ SPDX-FileCopyrightText: 2024 Slavi Pantaleev
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#}
|
||||
|
||||
{% if matrix_mautrix_discord_container_labels_traefik_enabled %}
|
||||
{% if matrix_bridge_mautrix_discord_container_labels_traefik_enabled %}
|
||||
traefik.enable=true
|
||||
|
||||
{% if matrix_mautrix_discord_container_labels_traefik_docker_network %}
|
||||
traefik.docker.network={{ matrix_mautrix_discord_container_labels_traefik_docker_network }}
|
||||
{% if matrix_bridge_mautrix_discord_container_labels_traefik_docker_network %}
|
||||
traefik.docker.network={{ matrix_bridge_mautrix_discord_container_labels_traefik_docker_network }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.services.matrix-mautrix-discord.loadbalancer.server.port=8080
|
||||
|
||||
{% if matrix_mautrix_discord_container_labels_avatar_proxy_enabled %}
|
||||
{% if matrix_bridge_mautrix_discord_container_labels_avatar_proxy_enabled %}
|
||||
############################################################
|
||||
# #
|
||||
# Avatar proxy #
|
||||
@@ -22,21 +22,21 @@ traefik.http.services.matrix-mautrix-discord.loadbalancer.server.port=8080
|
||||
|
||||
{% set middlewares = [] %}
|
||||
|
||||
{% if matrix_mautrix_discord_container_labels_traefik_path_prefix != '/' %}
|
||||
traefik.http.middlewares.matrix-mautrix-discord-slashless-redirect.redirectregex.regex=({{ matrix_mautrix_discord_container_labels_traefik_path_prefix | quote }})$
|
||||
{% if matrix_bridge_mautrix_discord_container_labels_traefik_path_prefix != '/' %}
|
||||
traefik.http.middlewares.matrix-mautrix-discord-slashless-redirect.redirectregex.regex=({{ matrix_bridge_mautrix_discord_container_labels_traefik_path_prefix | quote }})$
|
||||
traefik.http.middlewares.matrix-mautrix-discord-slashless-redirect.redirectregex.replacement=${1}/
|
||||
{% set middlewares = middlewares + ['matrix-mautrix-discord-slashless-redirect'] %}
|
||||
{% endif %}
|
||||
|
||||
{% if matrix_mautrix_discord_container_labels_traefik_path_prefix != '/' %}
|
||||
traefik.http.middlewares.matrix-mautrix-discord-strip-prefix.stripprefix.prefixes={{ matrix_mautrix_discord_container_labels_traefik_path_prefix }}
|
||||
{% if matrix_bridge_mautrix_discord_container_labels_traefik_path_prefix != '/' %}
|
||||
traefik.http.middlewares.matrix-mautrix-discord-strip-prefix.stripprefix.prefixes={{ matrix_bridge_mautrix_discord_container_labels_traefik_path_prefix }}
|
||||
{% set middlewares = middlewares + ['matrix-mautrix-discord-strip-prefix'] %}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.rule={{ matrix_mautrix_discord_container_labels_avatar_proxy_traefik_rule }}
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.rule={{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_rule }}
|
||||
|
||||
{% if matrix_mautrix_discord_container_labels_avatar_proxy_traefik_priority | int > 0 %}
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.priority={{ matrix_mautrix_discord_container_labels_avatar_proxy_traefik_priority }}
|
||||
{% if matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_priority | int > 0 %}
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.priority={{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_priority }}
|
||||
{% endif %}
|
||||
|
||||
{% if middlewares | length > 0 %}
|
||||
@@ -44,11 +44,11 @@ traefik.http.routers.matrix-mautrix-discord-avatar-proxy.middlewares={{ middlewa
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.service=matrix-mautrix-discord
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.entrypoints={{ matrix_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints }}
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.entrypoints={{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints }}
|
||||
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.tls={{ matrix_mautrix_discord_container_labels_avatar_proxy_traefik_tls | to_json }}
|
||||
{% if matrix_mautrix_discord_container_labels_avatar_proxy_traefik_tls %}
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.tls.certResolver={{ matrix_mautrix_discord_container_labels_avatar_proxy_traefik_tls_certResolver }}
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.tls={{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_tls | to_json }}
|
||||
{% if matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_tls %}
|
||||
traefik.http.routers.matrix-mautrix-discord-avatar-proxy.tls.certResolver={{ matrix_bridge_mautrix_discord_container_labels_avatar_proxy_traefik_tls_certResolver }}
|
||||
{% endif %}
|
||||
|
||||
############################################################
|
||||
@@ -61,4 +61,4 @@ traefik.http.routers.matrix-mautrix-discord-avatar-proxy.tls.certResolver={{ mat
|
||||
|
||||
{% endif %}
|
||||
|
||||
{{ matrix_mautrix_discord_container_labels_additional_labels }}
|
||||
{{ matrix_bridge_mautrix_discord_container_labels_additional_labels }}
|
||||
|
||||
+10
-10
@@ -1,11 +1,11 @@
|
||||
#jinja2: lstrip_blocks: True
|
||||
[Unit]
|
||||
Description=Matrix Mautrix Discord bridge
|
||||
{% for service in matrix_mautrix_discord_systemd_required_services_list %}
|
||||
{% for service in matrix_bridge_mautrix_discord_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_mautrix_discord_systemd_wanted_services_list %}
|
||||
{% for service in matrix_bridge_mautrix_discord_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
@@ -22,19 +22,19 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_mautrix_discord_container_network }} \
|
||||
--label-file={{ matrix_mautrix_discord_base_path }}/labels \
|
||||
--mount type=bind,src={{ matrix_mautrix_discord_config_path }},dst=/config,ro \
|
||||
--mount type=bind,src={{ matrix_mautrix_discord_data_path }},dst=/data \
|
||||
--network={{ matrix_bridge_mautrix_discord_container_network }} \
|
||||
--label-file={{ matrix_bridge_mautrix_discord_base_path }}/labels \
|
||||
--mount type=bind,src={{ matrix_bridge_mautrix_discord_config_path }},dst=/config,ro \
|
||||
--mount type=bind,src={{ matrix_bridge_mautrix_discord_data_path }},dst=/data \
|
||||
--workdir=/data \
|
||||
{% for arg in matrix_mautrix_discord_container_extra_arguments %}
|
||||
{% for arg in matrix_bridge_mautrix_discord_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_mautrix_discord_container_image }} \
|
||||
{{ matrix_bridge_mautrix_discord_container_image }} \
|
||||
/usr/bin/mautrix-discord -c /config/config.yaml -r /config/registration.yaml --no-update
|
||||
|
||||
{% if matrix_mautrix_discord_container_network != 'host' %}
|
||||
{% for network in matrix_mautrix_discord_container_additional_networks %}
|
||||
{% if matrix_bridge_mautrix_discord_container_network != 'host' %}
|
||||
{% for network in matrix_bridge_mautrix_discord_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-discord
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user