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.
 
 

201 regels
11 KiB

  1. # SPDX-FileCopyrightText: 2023 Johan Swetzén
  2. # SPDX-FileCopyrightText: 2023 Samuel Meenzen
  3. # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev
  4. # SPDX-FileCopyrightText: 2024 Suguru Hirahara
  5. #
  6. # SPDX-License-Identifier: AGPL-3.0-or-later
  7. ---
  8. # mautrix-wsproxy is a Matrix <-> websocket bridge
  9. # See: https://github.com/mautrix/wsproxy
  10. matrix_mautrix_wsproxy_enabled: true
  11. matrix_mautrix_wsproxy_version: latest
  12. # See: https://mau.dev/mautrix/wsproxy/container_registry
  13. matrix_mautrix_wsproxy_container_image: "{{ matrix_mautrix_wsproxy_container_image_registry_prefix }}mautrix/wsproxy:{{ matrix_mautrix_wsproxy_version }}"
  14. matrix_mautrix_wsproxy_container_image_registry_prefix: "{{ matrix_mautrix_wsproxy_container_image_registry_prefix_upstream }}"
  15. matrix_mautrix_wsproxy_container_image_registry_prefix_upstream: "{{ matrix_mautrix_wsproxy_container_image_registry_prefix_upstream_default }}"
  16. matrix_mautrix_wsproxy_container_image_registry_prefix_upstream_default: "dock.mau.dev/"
  17. matrix_mautrix_wsproxy_container_image_force_pull: "{{ matrix_mautrix_wsproxy_container_image.endswith(':latest') }}"
  18. matrix_mautrix_wsproxy_base_path: "{{ matrix_base_data_path }}/wsproxy"
  19. matrix_mautrix_wsproxy_config_path: "{{ matrix_mautrix_wsproxy_base_path }}/config"
  20. matrix_mautrix_wsproxy_homeserver_address: ""
  21. matrix_mautrix_wsproxy_homeserver_domain: "{{ matrix_domain }}"
  22. matrix_mautrix_wsproxy_bind_port: false
  23. matrix_mautrix_wsproxy_port: 29331
  24. matrix_mautrix_wsproxy_appservice_address: "http://matrix-mautrix-wsproxy:{{ matrix_mautrix_wsproxy_port }}"
  25. matrix_mautrix_wsproxy_hostname: ""
  26. # The base container network. It will be auto-created by this role if it doesn't exist already.
  27. matrix_mautrix_wsproxy_container_network: matrix-mautrix-wsproxy
  28. matrix_mautrix_wsproxy_twitter_container_additional_networks: "{{ matrix_mautrix_wsproxy_twitter_container_additional_networks_auto + matrix_mautrix_wsproxy_twitter_container_additional_networks_custom }}"
  29. matrix_mautrix_wsproxy_twitter_container_additional_networks_auto: []
  30. matrix_mautrix_wsproxy_twitter_container_additional_networks_custom: []
  31. # matrix_mautrix_wsproxy_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  32. # See `../templates/labels.j2` for details.
  33. #
  34. # To inject your own other container labels, see `matrix_mautrix_wsproxy_container_labels_additional_labels`.
  35. matrix_mautrix_wsproxy_container_labels_traefik_enabled: true
  36. matrix_mautrix_wsproxy_container_labels_traefik_docker_network: "{{ matrix_mautrix_wsproxy_container_network }}"
  37. matrix_mautrix_wsproxy_container_labels_traefik_hostname: "{{ matrix_mautrix_wsproxy_hostname }}"
  38. # The path prefix must either be `/` or not end with a slash (e.g. `/wsproxy`).
  39. matrix_mautrix_wsproxy_container_labels_traefik_rule: "Host(`{{ matrix_mautrix_wsproxy_container_labels_traefik_hostname }}`)"
  40. matrix_mautrix_wsproxy_container_labels_traefik_priority: 0
  41. matrix_mautrix_wsproxy_container_labels_traefik_entrypoints: web-secure
  42. matrix_mautrix_wsproxy_container_labels_traefik_tls: "{{ matrix_mautrix_wsproxy_container_labels_traefik_entrypoints != 'web' }}"
  43. matrix_mautrix_wsproxy_container_labels_traefik_tls_certResolver: default # noqa var-naming
  44. # Controls which additional headers to attach to all HTTP responses.
  45. # To add your own headers, use `matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_custom`
  46. matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_auto: {}
  47. matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_custom: {}
  48. matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers: "{{ matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_auto | combine(matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers_custom) }}"
  49. # matrix_mautrix_wsproxy_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  50. # See `../templates/labels.j2` for details.
  51. #
  52. # Example:
  53. # matrix_mautrix_wsproxy_container_labels_additional_labels: |
  54. # my.label=1
  55. # another.label="here"
  56. matrix_mautrix_wsproxy_container_labels_additional_labels: ''
  57. # A list of extra arguments to pass to the container
  58. matrix_mautrix_wsproxy_container_extra_arguments: []
  59. # List of systemd services that matrix-mautrix-wsproxy.service depends on.
  60. matrix_mautrix_wsproxy_systemd_required_services_list: "{{ matrix_mautrix_wsproxy_systemd_required_services_list_default + matrix_mautrix_wsproxy_systemd_required_services_list_auto + matrix_mautrix_wsproxy_systemd_required_services_list_custom }}"
  61. matrix_mautrix_wsproxy_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  62. matrix_mautrix_wsproxy_systemd_required_services_list_auto: []
  63. matrix_mautrix_wsproxy_systemd_required_services_list_custom: []
  64. # List of systemd services that matrix-mautrix-wsproxy.service wants
  65. matrix_mautrix_wsproxy_systemd_wanted_services_list: []
  66. matrix_mautrix_androidsms_appservice_token: ''
  67. matrix_mautrix_androidsms_homeserver_token: ''
  68. matrix_mautrix_imessage_appservice_token: ''
  69. matrix_mautrix_imessage_homeserver_token: ''
  70. matrix_mautrix_androidsms_appservice_bot_username: androidsmsbot
  71. matrix_mautrix_imessage_appservice_bot_username: imessagebot
  72. # Default mautrix-wsproxy configuration template which covers the generic use case.
  73. # You can customize it by controlling the various variables inside it.
  74. #
  75. # For a more advanced customization, you can extend the default (see `matrix_mautrix_wsproxy_configuration_extension_yaml`)
  76. # or completely replace this variable with your own template.
  77. matrix_mautrix_wsproxy_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  78. matrix_mautrix_wsproxy_configuration_extension_yaml: |
  79. # Your custom YAML configuration goes here.
  80. # This configuration extends the default starting configuration (`matrix_mautrix_wsproxy_configuration_yaml`).
  81. #
  82. # You can override individual variables from the default configuration, or introduce new ones.
  83. #
  84. # If you need something more special, you can take full control by
  85. # completely redefining `matrix_mautrix_wsproxy_configuration_yaml`.
  86. matrix_mautrix_wsproxy_configuration_extension: "{{ matrix_mautrix_wsproxy_configuration_extension_yaml | from_yaml if matrix_mautrix_wsproxy_configuration_extension_yaml | from_yaml is mapping else {} }}"
  87. # Holds the final configuration (a combination of the default and its extension).
  88. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_wsproxy_configuration_yaml`.
  89. matrix_mautrix_wsproxy_configuration: "{{ matrix_mautrix_wsproxy_configuration_yaml | from_yaml | combine(matrix_mautrix_wsproxy_configuration_extension, recursive=True) }}"
  90. matrix_mautrix_androidsms_registration_yaml: |
  91. id: androidsms
  92. url: {{ matrix_mautrix_wsproxy_appservice_address }}
  93. as_token: "{{ matrix_mautrix_androidsms_appservice_token }}"
  94. hs_token: "{{ matrix_mautrix_androidsms_homeserver_token }}"
  95. sender_localpart: _bot_{{ matrix_mautrix_androidsms_appservice_bot_username }}
  96. rate_limited: false
  97. namespaces:
  98. users:
  99. - regex: '@androidsms_.+:{{ matrix_mautrix_wsproxy_homeserver_domain | regex_escape }}$'
  100. exclusive: true
  101. - exclusive: true
  102. regex: '^@{{ matrix_mautrix_androidsms_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_wsproxy_homeserver_domain | regex_escape }}$'
  103. matrix_mautrix_androidsms_registration: "{{ matrix_mautrix_androidsms_registration_yaml | from_yaml }}"
  104. matrix_mautrix_imessage_registration_yaml: |
  105. id: imessage
  106. url: {{ matrix_mautrix_wsproxy_appservice_address }}
  107. as_token: "{{ matrix_mautrix_imessage_appservice_token }}"
  108. hs_token: "{{ matrix_mautrix_imessage_homeserver_token }}"
  109. sender_localpart: _bot_{{ matrix_mautrix_imessage_appservice_bot_username }}
  110. rate_limited: false
  111. namespaces:
  112. users:
  113. - regex: '@imessage_.+:{{ matrix_mautrix_wsproxy_homeserver_domain | regex_escape }}$'
  114. exclusive: true
  115. - exclusive: true
  116. regex: '^@{{ matrix_mautrix_imessage_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_wsproxy_homeserver_domain | regex_escape }}$'
  117. matrix_mautrix_imessage_registration: "{{ matrix_mautrix_imessage_registration_yaml | from_yaml }}"
  118. # Syncproxy-related configuration fields
  119. # renovate: datasource=docker depName=dock.mau.dev/mautrix/syncproxy
  120. matrix_mautrix_wsproxy_syncproxy_version: latest
  121. # See: https://mau.dev/mautrix/wsproxy/container_registry
  122. matrix_mautrix_wsproxy_syncproxy_container_image: "dock.mau.dev/mautrix/syncproxy:{{ matrix_mautrix_wsproxy_syncproxy_version }}"
  123. matrix_mautrix_wsproxy_syncproxy_container_image_force_pull: "{{ matrix_mautrix_wsproxy_syncproxy_container_image.endswith(':latest') }}"
  124. matrix_mautrix_wsproxy_syncproxy_container_extra_arguments: []
  125. matrix_mautrix_wsproxy_syncproxy_systemd_required_services_list: |-
  126. {{
  127. ([devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [])
  128. +
  129. ['matrix-mautrix-wsproxy.service']
  130. }}
  131. matrix_mautrix_wsproxy_syncproxy_systemd_wanted_services_list: []
  132. matrix_mautrix_wsproxy_syncproxy_homeserver_url: ''
  133. matrix_mautrix_wsproxy_syncproxy_shared_secret: ''
  134. matrix_mautrix_wsproxy_syncproxy_port: 29332
  135. matrix_mautrix_wsproxy_syncproxy_appservice_address: "http://matrix-mautrix-wsproxy-syncproxy:{{ matrix_mautrix_wsproxy_syncproxy_port }}"
  136. # Database-related configuration fields
  137. #
  138. # This bridge supports Postgres and SQLite.
  139. #
  140. matrix_mautrix_wsproxy_syncproxy_database_engine: 'postgres'
  141. matrix_mautrix_wsproxy_syncproxy_database_username: 'matrix_mautrix_wsproxy_syncproxy'
  142. matrix_mautrix_wsproxy_syncproxy_database_password: ''
  143. matrix_mautrix_wsproxy_syncproxy_database_hostname: ''
  144. matrix_mautrix_wsproxy_syncproxy_database_port: 5432
  145. matrix_mautrix_wsproxy_syncproxy_database_name: 'matrix_mautrix_wsproxy_syncproxy'
  146. matrix_mautrix_signal_wsproxy_syncproxy_connection_string: 'postgres://{{ matrix_mautrix_wsproxy_syncproxy_database_username }}:{{ matrix_mautrix_wsproxy_syncproxy_database_password }}@{{ matrix_mautrix_wsproxy_syncproxy_database_hostname }}:{{ matrix_mautrix_wsproxy_syncproxy_database_port }}/{{ matrix_mautrix_wsproxy_syncproxy_database_name }}'
  147. # matrix_mautrix_wsproxy_restart_necessary controls whether the service
  148. # will be restarted (when true) or merely started (when false) by the
  149. # systemd service manager role (when conditional restart is enabled).
  150. #
  151. # This value is automatically computed during installation based on whether
  152. # any configuration files, the systemd service file, or the container image changed.
  153. # The default of `false` means "no restart needed" — appropriate when the role's
  154. # installation tasks haven't run (e.g., due to --tags skipping them).
  155. matrix_mautrix_wsproxy_restart_necessary: false
  156. # matrix_mautrix_wsproxy_syncproxy_restart_necessary controls whether the service
  157. # will be restarted (when true) or merely started (when false) by the
  158. # systemd service manager role (when conditional restart is enabled).
  159. #
  160. # This value is automatically computed during installation based on whether
  161. # any configuration files, the systemd service file, or the container image changed.
  162. # The default of `false` means "no restart needed" — appropriate when the role's
  163. # installation tasks haven't run (e.g., due to --tags skipping them).
  164. matrix_mautrix_wsproxy_syncproxy_restart_necessary: false