Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

248 lines
14 KiB

  1. # SPDX-FileCopyrightText: 2019 - 2025 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2019 Julian Foad
  3. # SPDX-FileCopyrightText: 2019 Thomas Kuehne
  4. # SPDX-FileCopyrightText: 2021 - 2024 MDAD project contributors
  5. # SPDX-FileCopyrightText: 2021 Sebastian Gumprich
  6. # SPDX-FileCopyrightText: 2022 - 2024 Nikita Chernyi
  7. # SPDX-FileCopyrightText: 2022 Arthur Brugière
  8. # SPDX-FileCopyrightText: 2022 László Várady
  9. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  10. # SPDX-FileCopyrightText: 2022 Petteri Pucilowski
  11. # SPDX-FileCopyrightText: 2023 Adrien le Maire
  12. # SPDX-FileCopyrightText: 2023 James Collier
  13. # SPDX-FileCopyrightText: 2023 Samuel Meenzen
  14. # SPDX-FileCopyrightText: 2023 Shreyas Ajjarapu
  15. # SPDX-FileCopyrightText: 2024 Nikolai Raitsev
  16. # SPDX-FileCopyrightText: 2025 Suguru Hirahara
  17. #
  18. # SPDX-License-Identifier: AGPL-3.0-or-later
  19. ---
  20. # mautrix-whatsapp is a Matrix <-> Whatsapp bridge
  21. # Project source code URL: https://github.com/mautrix/whatsapp
  22. matrix_mautrix_whatsapp_enabled: true
  23. matrix_mautrix_whatsapp_container_image_self_build: false
  24. matrix_mautrix_whatsapp_container_image_self_build_repo: "https://mau.dev/mautrix/whatsapp.git"
  25. matrix_mautrix_whatsapp_container_image_self_build_branch: "{{ 'master' if matrix_mautrix_whatsapp_version == 'latest' else matrix_mautrix_whatsapp_version }}"
  26. # renovate: datasource=docker depName=dock.mau.dev/mautrix/whatsapp
  27. matrix_mautrix_whatsapp_version: v0.12.4
  28. # See: https://mau.dev/mautrix/whatsapp/container_registry
  29. matrix_mautrix_whatsapp_docker_image: "{{ matrix_mautrix_whatsapp_docker_image_registry_prefix }}mautrix/whatsapp:{{ matrix_mautrix_whatsapp_version }}"
  30. matrix_mautrix_whatsapp_docker_image_registry_prefix: "{{ 'localhost/' if matrix_mautrix_whatsapp_container_image_self_build else matrix_mautrix_whatsapp_docker_image_registry_prefix_upstream }}"
  31. matrix_mautrix_whatsapp_docker_image_registry_prefix_upstream: "{{ matrix_mautrix_whatsapp_docker_image_registry_prefix_upstream_default }}"
  32. matrix_mautrix_whatsapp_docker_image_registry_prefix_upstream_default: "dock.mau.dev/"
  33. matrix_mautrix_whatsapp_docker_image_force_pull: "{{ matrix_mautrix_whatsapp_docker_image.endswith(':latest') }}"
  34. matrix_mautrix_whatsapp_base_path: "{{ matrix_base_data_path }}/mautrix-whatsapp"
  35. matrix_mautrix_whatsapp_config_path: "{{ matrix_mautrix_whatsapp_base_path }}/config"
  36. matrix_mautrix_whatsapp_data_path: "{{ matrix_mautrix_whatsapp_base_path }}/data"
  37. matrix_mautrix_whatsapp_docker_src_files_path: "{{ matrix_mautrix_whatsapp_base_path }}/docker-src"
  38. matrix_mautrix_whatsapp_homeserver_address: ""
  39. matrix_mautrix_whatsapp_homeserver_domain: "{{ matrix_domain }}"
  40. # Whether asynchronous uploads via MSC2246 should be enabled for media.
  41. # Requires a homeserver that supports MSC2246 (https://github.com/matrix-org/matrix-spec-proposals/pull/2246).
  42. matrix_mautrix_whatsapp_homeserver_async_media: false
  43. matrix_mautrix_whatsapp_appservice_address: "http://matrix-mautrix-whatsapp:8080"
  44. matrix_mautrix_whatsapp_msc4190_enabled: "{{ matrix_bridges_msc4190_enabled }}"
  45. matrix_mautrix_whatsapp_extev_polls: false
  46. matrix_mautrix_whatsapp_command_prefix: "!wa"
  47. matrix_mautrix_whatsapp_container_network: ""
  48. matrix_mautrix_whatsapp_container_additional_networks: "{{ matrix_mautrix_whatsapp_container_additional_networks_auto + matrix_mautrix_whatsapp_container_additional_networks_custom }}"
  49. matrix_mautrix_whatsapp_container_additional_networks_auto: []
  50. matrix_mautrix_whatsapp_container_additional_networks_custom: []
  51. # matrix_mautrix_whatsapp_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  52. # See `../templates/labels.j2` for details.
  53. #
  54. # To inject your own other container labels, see `matrix_mautrix_whatsapp_container_labels_additional_labels`.
  55. matrix_mautrix_whatsapp_container_labels_traefik_enabled: true
  56. matrix_mautrix_whatsapp_container_labels_traefik_docker_network: "{{ matrix_mautrix_whatsapp_container_network }}"
  57. matrix_mautrix_whatsapp_container_labels_traefik_entrypoints: web-secure
  58. matrix_mautrix_whatsapp_container_labels_traefik_tls_certResolver: default # noqa var-naming
  59. # Controls whether labels will be added that expose mautrix-whatsapp's metrics
  60. matrix_mautrix_whatsapp_container_labels_metrics_enabled: "{{ matrix_mautrix_whatsapp_metrics_enabled and matrix_mautrix_whatsapp_metrics_proxying_enabled }}"
  61. matrix_mautrix_whatsapp_container_labels_metrics_traefik_rule: "Host(`{{ matrix_mautrix_whatsapp_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_mautrix_whatsapp_metrics_proxying_path_prefix }}`)"
  62. matrix_mautrix_whatsapp_container_labels_metrics_traefik_priority: 0
  63. matrix_mautrix_whatsapp_container_labels_metrics_traefik_entrypoints: "{{ matrix_mautrix_whatsapp_container_labels_traefik_entrypoints }}"
  64. matrix_mautrix_whatsapp_container_labels_metrics_traefik_tls: "{{ matrix_mautrix_whatsapp_container_labels_metrics_traefik_entrypoints != 'web' }}"
  65. matrix_mautrix_whatsapp_container_labels_metrics_traefik_tls_certResolver: "{{ matrix_mautrix_whatsapp_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  66. matrix_mautrix_whatsapp_container_labels_metrics_middleware_basic_auth_enabled: false
  67. # See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
  68. matrix_mautrix_whatsapp_container_labels_metrics_middleware_basic_auth_users: ''
  69. # matrix_mautrix_whatsapp_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  70. # See `../templates/labels.j2` for details.
  71. #
  72. # Example:
  73. # matrix_mautrix_whatsapp_container_labels_additional_labels: |
  74. # my.label=1
  75. # another.label="here"
  76. matrix_mautrix_whatsapp_container_labels_additional_labels: ''
  77. # A list of extra arguments to pass to the container
  78. matrix_mautrix_whatsapp_container_extra_arguments: []
  79. # List of systemd services that matrix-mautrix-whatsapp.service depends on.
  80. matrix_mautrix_whatsapp_systemd_required_services_list: "{{ matrix_mautrix_whatsapp_systemd_required_services_list_default + matrix_mautrix_whatsapp_systemd_required_services_list_auto + matrix_mautrix_whatsapp_systemd_required_services_list_custom }}"
  81. matrix_mautrix_whatsapp_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  82. matrix_mautrix_whatsapp_systemd_required_services_list_auto: []
  83. matrix_mautrix_whatsapp_systemd_required_services_list_custom: []
  84. # List of systemd services that matrix-mautrix-whatsapp.service wants
  85. matrix_mautrix_whatsapp_systemd_wanted_services_list: []
  86. matrix_mautrix_whatsapp_appservice_token: ''
  87. matrix_mautrix_whatsapp_homeserver_token: ''
  88. matrix_mautrix_whatsapp_appservice_bot_username: whatsappbot
  89. # Minimum severity of journal log messages.
  90. # Valid values: fatal, error, warn, info, debug, trace
  91. matrix_mautrix_whatsapp_logging_level: 'warn'
  92. # Whether or not created rooms should have federation enabled.
  93. # If false, created portal rooms will never be federated.
  94. matrix_mautrix_whatsapp_federate_rooms: true
  95. # Whether or not metrics endpoint should be enabled.
  96. # Enabling them is usually enough for a local (in-container) Prometheus to consume them.
  97. # If metrics need to be consumed by another (external) Prometheus server, consider exposing them via `matrix_mautrix_whatsapp_metrics_proxying_enabled`.
  98. matrix_mautrix_whatsapp_metrics_enabled: false
  99. # Controls whether metrics should be proxied (exposed) on a public URL
  100. matrix_mautrix_whatsapp_metrics_proxying_enabled: false
  101. matrix_mautrix_whatsapp_metrics_proxying_hostname: ''
  102. matrix_mautrix_whatsapp_metrics_proxying_path_prefix: ''
  103. # Database-related configuration fields.
  104. #
  105. # To use SQLite, stick to these defaults.
  106. #
  107. # To use Postgres:
  108. # - change the engine (`matrix_mautrix_whatsapp_database_engine: 'postgres'`)
  109. # - adjust your database credentials via the `matrix_mautrix_whatsapp_database_*` variables
  110. matrix_mautrix_whatsapp_database_engine: 'sqlite'
  111. matrix_mautrix_whatsapp_sqlite_database_path_local: "{{ matrix_mautrix_whatsapp_data_path }}/mautrix-whatsapp.db"
  112. matrix_mautrix_whatsapp_sqlite_database_path_in_container: "/data/mautrix-whatsapp.db"
  113. matrix_mautrix_whatsapp_database_username: 'matrix_mautrix_whatsapp'
  114. matrix_mautrix_whatsapp_database_password: 'some-password'
  115. matrix_mautrix_whatsapp_database_hostname: ''
  116. matrix_mautrix_whatsapp_database_port: 5432
  117. matrix_mautrix_whatsapp_database_name: 'matrix_mautrix_whatsapp'
  118. matrix_mautrix_whatsapp_database_sslmode: disable
  119. matrix_mautrix_whatsapp_database_connection_string: 'postgresql://{{ matrix_mautrix_whatsapp_database_username }}:{{ matrix_mautrix_whatsapp_database_password }}@{{ matrix_mautrix_whatsapp_database_hostname }}:{{ matrix_mautrix_whatsapp_database_port }}/{{ matrix_mautrix_whatsapp_database_name }}?sslmode={{ matrix_mautrix_whatsapp_database_sslmode }}'
  120. matrix_mautrix_whatsapp_appservice_database_type: "{{
  121. {
  122. 'sqlite': 'sqlite3-fk-wal',
  123. 'postgres':'postgres',
  124. }[matrix_mautrix_whatsapp_database_engine]
  125. }}"
  126. matrix_mautrix_whatsapp_appservice_database_uri: "{{
  127. {
  128. 'sqlite': matrix_mautrix_whatsapp_sqlite_database_path_in_container,
  129. 'postgres': matrix_mautrix_whatsapp_database_connection_string,
  130. }[matrix_mautrix_whatsapp_database_engine]
  131. }}"
  132. matrix_mautrix_whatsapp_double_puppet_secrets: "{{ matrix_mautrix_whatsapp_double_puppet_secrets_auto | combine(matrix_mautrix_whatsapp_double_puppet_secrets_custom) }}"
  133. matrix_mautrix_whatsapp_double_puppet_secrets_auto: {}
  134. matrix_mautrix_whatsapp_double_puppet_secrets_custom: {}
  135. # Displayname template for WhatsApp users.
  136. # {{.PushName}} - nickname set by the WhatsApp user
  137. # {{.BusinessName}} - validated WhatsApp business name
  138. # {{.Phone}} - phone number (international format)
  139. # {{.FullName}} - Name you set in the contacts list
  140. matrix_mautrix_whatsapp_network_displayname_template: '{% raw %}{{or .BusinessName .PushName .Phone}} (WA){% endraw %}'
  141. # Enable End-to-bridge encryption
  142. matrix_mautrix_whatsapp_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
  143. matrix_mautrix_whatsapp_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
  144. matrix_mautrix_whatsapp_bridge_encryption_require: false
  145. matrix_mautrix_whatsapp_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_whatsapp_bridge_encryption_allow }}"
  146. # This pickle key value is backward-compatible with the old bridge.
  147. # See: https://github.com/mautrix/whatsapp/blob/v0.11.0/cmd/mautrix-whatsapp/legacymigrate.go#L44
  148. matrix_mautrix_whatsapp_bridge_encryption_pickle_key: maunium.net/go/mautrix-whatsapp
  149. matrix_mautrix_whatsapp_bridge_personal_filtering_spaces: true
  150. matrix_mautrix_whatsapp_bridge_enable_status_broadcast: true
  151. matrix_mautrix_whatsapp_provisioning_shared_secret: ''
  152. matrix_mautrix_whatsapp_public_media_signing_key: ''
  153. matrix_mautrix_whatsapp_bridge_permissions: |
  154. {{
  155. {'*': 'relay', matrix_mautrix_whatsapp_homeserver_domain: 'user'}
  156. | combine({matrix_admin: 'admin'} if matrix_admin else {})
  157. }}
  158. # Enable bridge relay functionality
  159. matrix_mautrix_whatsapp_bridge_relay_enabled: "{{ matrix_bridges_relay_enabled }}"
  160. # Only allow admins on this home server to set themselves as a relay user
  161. matrix_mautrix_whatsapp_bridge_relay_admin_only: true
  162. # List of user login IDs which anyone can set as a relay, as long as the relay user is in the room.
  163. matrix_mautrix_whatsapp_bridge_relay_default_relays: []
  164. # Controls whether to do backfilling at all.
  165. matrix_mautrix_whatsapp_backfill_enabled: true
  166. # Default mautrix-whatsapp configuration template which covers the generic use case.
  167. # You can customize it by controlling the various variables inside it.
  168. #
  169. # For a more advanced customization, you can extend the default (see `matrix_mautrix_whatsapp_configuration_extension_yaml`)
  170. # or completely replace this variable with your own template.
  171. matrix_mautrix_whatsapp_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  172. matrix_mautrix_whatsapp_configuration_extension_yaml: |
  173. # Your custom YAML configuration goes here.
  174. # This configuration extends the default starting configuration (`matrix_mautrix_whatsapp_configuration_yaml`).
  175. #
  176. # You can override individual variables from the default configuration, or introduce new ones.
  177. #
  178. # If you need something more special, you can take full control by
  179. # completely redefining `matrix_mautrix_whatsapp_configuration_yaml`.
  180. matrix_mautrix_whatsapp_configuration_extension: "{{ matrix_mautrix_whatsapp_configuration_extension_yaml | from_yaml if matrix_mautrix_whatsapp_configuration_extension_yaml | from_yaml is mapping else {} }}"
  181. # Holds the final configuration (a combination of the default and its extension).
  182. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_whatsapp_configuration_yaml`.
  183. matrix_mautrix_whatsapp_configuration: "{{ matrix_mautrix_whatsapp_configuration_yaml | from_yaml | combine(matrix_mautrix_whatsapp_configuration_extension, recursive=True) }}"
  184. matrix_mautrix_whatsapp_registration_yaml: |
  185. id: whatsapp
  186. url: {{ matrix_mautrix_whatsapp_appservice_address }}
  187. as_token: "{{ matrix_mautrix_whatsapp_appservice_token }}"
  188. hs_token: "{{ matrix_mautrix_whatsapp_homeserver_token }}"
  189. # See https://github.com/mautrix/signal/issues/43
  190. sender_localpart: _bot_{{ matrix_mautrix_whatsapp_appservice_bot_username }}
  191. rate_limited: false
  192. namespaces:
  193. users:
  194. - regex: '^@whatsapp_.*:{{ matrix_mautrix_whatsapp_homeserver_domain | regex_escape }}$'
  195. exclusive: true
  196. - exclusive: true
  197. regex: '^@{{ matrix_mautrix_whatsapp_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_whatsapp_homeserver_domain | regex_escape }}$'
  198. de.sorunome.msc2409.push_ephemeral: true
  199. receive_ephemeral: true
  200. io.element.msc4190: {{ matrix_mautrix_whatsapp_msc4190_enabled | to_json }}
  201. matrix_mautrix_whatsapp_registration: "{{ matrix_mautrix_whatsapp_registration_yaml | from_yaml }}"