Matrix Docker Ansible eploy
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

253 rader
15 KiB

  1. # SPDX-FileCopyrightText: 2022 - 2023 Samuel Meenzen
  2. # SPDX-FileCopyrightText: 2022 - 2024 MDAD project contributors
  3. # SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev
  4. # SPDX-FileCopyrightText: 2023 Nikita Chernyi
  5. # SPDX-FileCopyrightText: 2025 Suguru Hirahara
  6. #
  7. # SPDX-License-Identifier: AGPL-3.0-or-later
  8. ---
  9. # mautrix-discord is a Matrix <-> Discord bridge
  10. # Project source code URL: https://github.com/mautrix/discord
  11. matrix_mautrix_discord_enabled: true
  12. matrix_mautrix_discord_hostname: ""
  13. matrix_mautrix_discord_path_prefix: /
  14. matrix_mautrix_discord_scheme: https
  15. matrix_mautrix_discord_container_image_self_build: false
  16. matrix_mautrix_discord_container_image_self_build_repo: "https://mau.dev/mautrix/discord.git"
  17. matrix_mautrix_discord_container_image_self_build_branch: "{{ 'main' if matrix_mautrix_discord_version == 'latest' else matrix_mautrix_discord_version }}"
  18. # renovate: datasource=docker depName=dock.mau.dev/mautrix/discord
  19. matrix_mautrix_discord_version: v0.7.6
  20. # See: https://mau.dev/mautrix/discord/container_registry
  21. matrix_mautrix_discord_container_image: "{{ matrix_mautrix_discord_container_image_registry_prefix }}mautrix/discord:{{ matrix_mautrix_discord_version }}"
  22. 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 }}"
  23. matrix_mautrix_discord_container_image_registry_prefix_upstream: "{{ matrix_mautrix_discord_container_image_registry_prefix_upstream_default }}"
  24. matrix_mautrix_discord_container_image_registry_prefix_upstream_default: "dock.mau.dev/"
  25. matrix_mautrix_discord_base_path: "{{ matrix_base_data_path }}/mautrix-discord"
  26. matrix_mautrix_discord_config_path: "{{ matrix_mautrix_discord_base_path }}/config"
  27. matrix_mautrix_discord_data_path: "{{ matrix_mautrix_discord_base_path }}/data"
  28. matrix_mautrix_discord_container_src_files_path: "{{ matrix_mautrix_discord_base_path }}/docker-src"
  29. matrix_mautrix_discord_homeserver_address: ""
  30. # Whether asynchronous uploads via MSC2246 should be enabled for media.
  31. # Requires a homeserver that supports MSC2246 (https://github.com/matrix-org/matrix-spec-proposals/pull/2246).
  32. matrix_mautrix_discord_homeserver_async_media: false
  33. matrix_mautrix_discord_homeserver_domain: "{{ matrix_domain }}"
  34. matrix_mautrix_discord_appservice_address: "http://matrix-mautrix-discord:8080"
  35. matrix_mautrix_discord_msc4190_enabled: "{{ matrix_bridges_msc4190_enabled }}"
  36. matrix_mautrix_discord_bridge_command_prefix: "!discord"
  37. # Publicly accessible base URL that Discord can use to reach the bridge, used for avatars in relay mode.
  38. # If not set, avatars will not be bridged. Only the /mautrix-discord/avatar/{server}/{id}/{hash} endpoint is used on this address.
  39. # This should not have a trailing slash, the endpoint above will be appended to the provided address.
  40. 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 '' }}"
  41. # A random key used to sign the avatar URLs. The bridge will only accept requests with a valid signature.
  42. matrix_mautrix_discord_bridge_avatar_proxy_key: ''
  43. # Localpart template of MXIDs for Discord users.
  44. # {{ '{{.}}' }} is replaced with the internal ID of the Discord user.
  45. matrix_mautrix_discord_bridge_username_template: "{% raw %}discord_{{.}}{% endraw %}"
  46. # Displayname template for Discord users. This is also used as the room name in DMs if private_chat_portal_meta is enabled.
  47. matrix_mautrix_discord_bridge_displayname_template: "{% raw %}{{or .GlobalName .Username}}{{if .Bot}} (bot){{end}} (Discord){% endraw %}"
  48. # Displayname template for Discord channels (bridged as rooms, or spaces when type=4).
  49. matrix_mautrix_discord_bridge_channel_name_template: "{% raw %}{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}}{{else}}#{{.Name}}{{end}}{% endraw %}"
  50. # Displayname template for Discord guilds (bridged as spaces).
  51. matrix_mautrix_discord_bridge_guild_name_template: "{% raw %}{{.Name}}{% endraw %}"
  52. matrix_mautrix_discord_bridge_permissions: |
  53. {{
  54. {'*': 'relay', matrix_mautrix_discord_homeserver_domain: 'user'}
  55. | combine({matrix_admin: 'admin'} if matrix_admin else {})
  56. }}
  57. matrix_mautrix_discord_container_network: ''
  58. matrix_mautrix_discord_container_additional_networks: "{{ matrix_mautrix_discord_container_additional_networks_auto + matrix_mautrix_discord_container_additional_networks_custom }}"
  59. matrix_mautrix_discord_container_additional_networks_auto: []
  60. matrix_mautrix_discord_container_additional_networks_custom: []
  61. # matrix_mautrix_discord_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  62. # See `../templates/labels.j2` for details.
  63. #
  64. # To inject your own other container labels, see `matrix_mautrix_discord_container_labels_additional_labels`.
  65. matrix_mautrix_discord_container_labels_traefik_enabled: true
  66. matrix_mautrix_discord_container_labels_traefik_docker_network: "{{ matrix_mautrix_discord_container_network }}"
  67. matrix_mautrix_discord_container_labels_traefik_hostname: "{{ matrix_mautrix_discord_hostname }}"
  68. # The path prefix must either be `/` or not end with a slash (e.g. `/matrix-alertmanager-receiver`).
  69. matrix_mautrix_discord_container_labels_traefik_path_prefix: "{{ matrix_mautrix_discord_path_prefix }}"
  70. matrix_mautrix_discord_container_labels_traefik_entrypoints: web-secure
  71. matrix_mautrix_discord_container_labels_traefik_tls_certResolver: default # noqa var-naming
  72. # Controls whether labels will be added that expose the bridge's avatar proxy (`/mautrix-discord/avatar/{server}/{id}/{hash}`).
  73. # See: matrix_mautrix_discord_bridge_public_address
  74. matrix_mautrix_discord_container_labels_avatar_proxy_enabled: "{{ matrix_mautrix_discord_bridge_public_address != '' }}"
  75. matrix_mautrix_discord_container_labels_avatar_proxy_hostname: "{{ matrix_mautrix_discord_container_labels_traefik_hostname }}"
  76. 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"
  77. 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 }}`)"
  78. matrix_mautrix_discord_container_labels_avatar_proxy_traefik_priority: 0
  79. matrix_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints: "{{ matrix_mautrix_discord_container_labels_traefik_entrypoints }}"
  80. matrix_mautrix_discord_container_labels_avatar_proxy_traefik_tls: "{{ matrix_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints != 'web' }}"
  81. matrix_mautrix_discord_container_labels_avatar_proxy_traefik_tls_certResolver: "{{ matrix_mautrix_discord_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  82. # matrix_mautrix_discord_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  83. # See `../templates/labels.j2` for details.
  84. #
  85. # Example:
  86. # matrix_mautrix_discord_container_labels_additional_labels: |
  87. # my.label=1
  88. # another.label="here"
  89. matrix_mautrix_discord_container_labels_additional_labels: ''
  90. # A list of extra arguments to pass to the container
  91. matrix_mautrix_discord_container_extra_arguments: []
  92. # List of systemd services that matrix-mautrix-discord.service depends on.
  93. 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 }}"
  94. matrix_mautrix_discord_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  95. matrix_mautrix_discord_systemd_required_services_list_auto: []
  96. matrix_mautrix_discord_systemd_required_services_list_custom: []
  97. # List of systemd services that matrix-mautrix-discord.service wants
  98. matrix_mautrix_discord_systemd_wanted_services_list: []
  99. matrix_mautrix_discord_appservice_token: ''
  100. matrix_mautrix_discord_homeserver_token: ''
  101. matrix_mautrix_discord_appservice_bot_username: discordbot
  102. matrix_mautrix_discord_appservice_bot_displayname: Discord bridge bot
  103. matrix_mautrix_discord_appservice_bot_avatar: mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC
  104. matrix_mautrix_discord_provisioning_shared_secret: disable
  105. # Minimum severity of journal log messages.
  106. # Valid values: fatal, error, warn, info, debug, trace
  107. matrix_mautrix_discord_logging_level: 'warn'
  108. # Whether or not created rooms should have federation enabled.
  109. # If false, created portal rooms will never be federated.
  110. matrix_mautrix_discord_federate_rooms: true
  111. # Database-related configuration fields.
  112. #
  113. # To use SQLite, stick to these defaults.
  114. #
  115. # To use Postgres:
  116. # - change the engine (`matrix_mautrix_discord_database_engine: 'postgres'`)
  117. # - adjust your database credentials via the `matrix_mautrix_discord_database_*` variables
  118. matrix_mautrix_discord_database_engine: 'sqlite'
  119. matrix_mautrix_discord_sqlite_database_path_local: "{{ matrix_mautrix_discord_data_path }}/mautrix-discord.db"
  120. matrix_mautrix_discord_sqlite_database_path_in_container: "/data/mautrix-discord.db"
  121. matrix_mautrix_discord_database_username: 'matrix_mautrix_discord'
  122. matrix_mautrix_discord_database_password: 'some-password'
  123. matrix_mautrix_discord_database_hostname: ''
  124. matrix_mautrix_discord_database_port: 5432
  125. matrix_mautrix_discord_database_name: 'matrix_mautrix_discord'
  126. matrix_mautrix_discord_database_sslmode: disable
  127. 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 }}'
  128. matrix_mautrix_discord_appservice_database_type: "{{ {
  129. 'sqlite': 'sqlite3',
  130. 'postgres': 'postgres',
  131. }[matrix_mautrix_discord_database_engine] }}"
  132. matrix_mautrix_discord_appservice_database_uri: "{{ {
  133. 'sqlite': matrix_mautrix_discord_sqlite_database_path_in_container,
  134. 'postgres': matrix_mautrix_discord_database_connection_string,
  135. }[matrix_mautrix_discord_database_engine] }}"
  136. 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) }}"
  137. matrix_mautrix_discord_bridge_login_shared_secret_map_auto: {}
  138. matrix_mautrix_discord_bridge_login_shared_secret_map_custom: {}
  139. # Servers to always allow double puppeting from
  140. 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) }}"
  141. matrix_mautrix_discord_bridge_double_puppet_server_map_default: |-
  142. {{
  143. {}
  144. | combine({
  145. matrix_beeper_linkedin_homeserver_domain: matrix_beeper_linkedin_homeserver_address
  146. })
  147. }}
  148. matrix_mautrix_discord_bridge_double_puppet_server_map_auto: {}
  149. matrix_mautrix_discord_bridge_double_puppet_server_map_custom: {}
  150. # Default mautrix-discord configuration template which covers the generic use case.
  151. # You can customize it by controlling the various variables inside it.
  152. #
  153. # For a more advanced customization, you can extend the default (see `matrix_mautrix_discord_configuration_extension_yaml`)
  154. # or completely replace this variable with your own template.
  155. matrix_mautrix_discord_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  156. matrix_mautrix_discord_configuration_extension_yaml: |
  157. # Your custom YAML configuration goes here.
  158. # This configuration extends the default starting configuration (`matrix_mautrix_discord_configuration_yaml`).
  159. #
  160. # You can override individual variables from the default configuration, or introduce new ones.
  161. #
  162. # If you need something more special, you can take full control by
  163. # completely redefining `matrix_mautrix_discord_configuration_yaml`.
  164. 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 {} }}"
  165. # Holds the final configuration (a combination of the default and its extension).
  166. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_discord_configuration_yaml`.
  167. matrix_mautrix_discord_configuration: "{{ matrix_mautrix_discord_configuration_yaml | from_yaml | combine(matrix_mautrix_discord_configuration_extension, recursive=True) }}"
  168. matrix_mautrix_discord_registration_yaml: |
  169. id: discord
  170. url: {{ matrix_mautrix_discord_appservice_address }}
  171. as_token: "{{ matrix_mautrix_discord_appservice_token }}"
  172. hs_token: "{{ matrix_mautrix_discord_homeserver_token }}"
  173. # See https://github.com/mautrix/signal/issues/43
  174. sender_localpart: _bot_{{ matrix_mautrix_discord_appservice_bot_username }}
  175. rate_limited: false
  176. namespaces:
  177. users:
  178. - regex: '^@discord_[0-9]+:{{ matrix_mautrix_discord_homeserver_domain | regex_escape }}$'
  179. exclusive: true
  180. - exclusive: true
  181. regex: '^@{{ matrix_mautrix_discord_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_discord_homeserver_domain | regex_escape }}$'
  182. de.sorunome.msc2409.push_ephemeral: true
  183. receive_ephemeral: true
  184. io.element.msc4190: {{ matrix_mautrix_discord_msc4190_enabled | to_json }}
  185. matrix_mautrix_discord_registration: "{{ matrix_mautrix_discord_registration_yaml | from_yaml }}"
  186. # Enable End-to-bridge encryption
  187. matrix_mautrix_discord_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
  188. matrix_mautrix_discord_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
  189. matrix_mautrix_discord_bridge_encryption_require: false
  190. matrix_mautrix_discord_bridge_encryption_appservice: false
  191. matrix_mautrix_discord_bridge_encryption_plaintext_mentions: false
  192. matrix_mautrix_discord_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_discord_bridge_encryption_allow }}"
  193. # On Conduit versions before 0.5.0 this option prevented users from joining spaces created by the bridge.
  194. # Setting this to false fixed the issue.
  195. matrix_mautrix_discord_bridge_restricted_rooms: true
  196. # matrix_mautrix_discord_restart_necessary controls whether the service
  197. # will be restarted (when true) or merely started (when false) by the
  198. # systemd service manager role (when conditional restart is enabled).
  199. #
  200. # This value is automatically computed during installation based on whether
  201. # any configuration files, the systemd service file, or the container image changed.
  202. # The default of `false` means "no restart needed" — appropriate when the role's
  203. # installation tasks haven't run (e.g., due to --tags skipping them).
  204. matrix_mautrix_discord_restart_necessary: false