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.
 
 

217 lines
12 KiB

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