Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

2208 satır
148 KiB

  1. ---
  2. # Synapse is a Matrix homeserver
  3. # Project source code URL: https://github.com/element-hq/synapse
  4. matrix_synapse_enabled: true
  5. # Specifies which Github organization and repository name Synapse lives at.
  6. #
  7. # This influences:
  8. # - the Github Container Image registry that container images are pulled from (see `matrix_synapse_container_image_name`)
  9. # - the git repository to code is pulled from when self-building is used (see `matrix_synapse_container_image_self_build_repo`)
  10. # - potentially other roles which need to reference the Synapse git repository
  11. #
  12. # A popular alternative value may be: `matrix-org/synapse`.
  13. # However, do note that the last Synapse version available there is v1.98.0.
  14. matrix_synapse_github_org_and_repo: element-hq/synapse
  15. # renovate: datasource=docker depName=ghcr.io/element-hq/synapse
  16. matrix_synapse_version: v1.149.1
  17. matrix_synapse_username: ''
  18. matrix_synapse_uid: ''
  19. matrix_synapse_gid: ''
  20. matrix_synapse_container_image_self_build: false
  21. matrix_synapse_container_image_self_build_repo: "https://github.com/{{ matrix_synapse_github_org_and_repo }}.git"
  22. # matrix_synapse_container_image_customizations_enabled controls whether a customized Synapse image will be built.
  23. #
  24. # We toggle this variable to `true` when certain features which require a custom build are enabled.
  25. # Feel free to toggle this to `true` yourself and specify build steps in `matrix_synapse_container_image_customizations_dockerfile_body_custom`.
  26. #
  27. # See:
  28. # - `roles/custom/matrix-synapse/templates/synapse/customizations/Dockerfile.j2`
  29. # - `matrix_synapse_container_image_customizations_dockerfile_body_custom`
  30. # - `matrix_synapse_container_image_customized`
  31. # - `matrix_synapse_container_image_final`
  32. matrix_synapse_container_image_customizations_enabled: |-
  33. {{
  34. matrix_synapse_container_image_customizations_s3_storage_provider_installation_enabled
  35. or
  36. matrix_synapse_container_image_customizations_templates_enabled
  37. }}
  38. # Controls whether custom build steps will be added to the Dockerfile for installing s3-storage-provider.
  39. # The version that will be installed is specified in `matrix_synapse_ext_synapse_s3_storage_provider_version`.
  40. matrix_synapse_container_image_customizations_s3_storage_provider_installation_enabled: "{{ matrix_synapse_ext_synapse_s3_storage_provider_enabled }}"
  41. # Controls whether custom build steps will be added to the Dockerfile for customizing the email templates used by Synapse.
  42. #
  43. # Example usage:
  44. #
  45. # ```yaml
  46. # matrix_synapse_container_image_customizations_templates_enabled: true
  47. # # The templates are expected to be in a `templates/` subdirectory in
  48. # matrix_synapse_container_image_customizations_templates_in_container_template_files_relative_path: templates/
  49. # matrix_synapse_container_image_customizations_templates_git_repository_url: git@github.com:organization/repository.git
  50. # matrix_synapse_container_image_customizations_templates_git_repository_branch: main
  51. # matrix_synapse_container_image_customizations_templates_git_repository_keyscan_enabled: true
  52. # matrix_synapse_container_image_customizations_templates_git_repository_keyscan_hostname: github.com
  53. # ```
  54. #
  55. # See: https://github.com/element-hq/synapse/blob/develop/docs/templates.md
  56. matrix_synapse_container_image_customizations_templates_enabled: false
  57. matrix_synapse_container_image_customizations_templates_in_container_base_path: /custom-templates
  58. matrix_synapse_container_image_customizations_templates_in_container_template_files_relative_path: ''
  59. matrix_synapse_container_image_customizations_templates_in_container_full_path: "{{ matrix_synapse_container_image_customizations_templates_in_container_base_path }}/{{ matrix_synapse_container_image_customizations_templates_in_container_template_files_relative_path }}"
  60. matrix_synapse_container_image_customizations_templates_git_repository_url: ''
  61. matrix_synapse_container_image_customizations_templates_git_repository_branch: main
  62. matrix_synapse_container_image_customizations_templates_git_repository_keyscan_enabled: false
  63. matrix_synapse_container_image_customizations_templates_git_repository_keyscan_hostname: ''
  64. # matrix_synapse_container_image_customizations_dockerfile_body contains your custom Dockerfile steps
  65. # for building your customized Synapse image based on the original (upstream) image (`matrix_synapse_container_image`).
  66. # A `FROM …` clause is included automatically so you don't have to.
  67. #
  68. # For this to take effect, you need to enable customizations (`matrix_synapse_container_image_customizations_enabled: true`).
  69. #
  70. # Example:
  71. # matrix_synapse_container_image_customizations_dockerfile_body_custom: |
  72. # RUN echo 'This is a custom step for building the customized Docker image for Synapse.'
  73. # RUN echo 'You can override matrix_synapse_container_image_customizations_dockerfile_body_custom to add your own steps.'
  74. # RUN echo 'You do NOT need to include a FROM clause yourself.'
  75. matrix_synapse_container_image_customizations_dockerfile_body_custom: ''
  76. matrix_synapse_container_image: "{{ matrix_synapse_container_image_registry_prefix }}{{ matrix_synapse_container_image_name }}:{{ matrix_synapse_container_image_tag }}"
  77. matrix_synapse_container_image_name: "{{ matrix_synapse_github_org_and_repo }}"
  78. matrix_synapse_container_image_tag: "{{ matrix_synapse_version }}"
  79. matrix_synapse_container_image_force_pull: "{{ matrix_synapse_container_image.endswith(':latest') }}"
  80. matrix_synapse_container_image_registry_prefix: "{{ 'localhost/' if matrix_synapse_container_image_self_build else matrix_synapse_container_image_registry_prefix_upstream }}"
  81. matrix_synapse_container_image_registry_prefix_upstream: "{{ matrix_synapse_container_image_registry_prefix_upstream_default }}"
  82. matrix_synapse_container_image_registry_prefix_upstream_default: "ghcr.io/"
  83. # matrix_synapse_container_image_customized is the name of the locally built Synapse image
  84. # which adds various customizations on top of the original (upstream) Synapse image.
  85. # This image will be based on the upstream `matrix_synapse_container_image` image, only if `matrix_synapse_container_image_customizations_enabled: true`.
  86. matrix_synapse_container_image_customized: "localhost/matrixdotorg/synapse:{{ matrix_synapse_container_image_tag }}-customized"
  87. # Controls whether the customized image (`matrix_synapse_container_image_customized`) is to be force-built without layer caching enabled.
  88. # This is useful if you've enabled customizations (e.g. `matrix_synapse_container_image_customizations_templates_enabled`),
  89. # which clone some branch of some repository, and you'd like for each Ansible run to pull new revisions from that branch.
  90. matrix_synapse_container_image_customized_build_nocache: false
  91. # Controls whether the customized image (`matrix_synapse_container_image_customized`) is to be built, even if it already exists.
  92. # Related to: matrix_synapse_container_image_customized_build_nocache
  93. matrix_synapse_container_image_customized_force_source: "{{ matrix_synapse_container_image_customized_build_nocache }}"
  94. # matrix_synapse_container_image_final holds the name of the Synapse image to run depending on whether or not customizations are enabled.
  95. matrix_synapse_container_image_final: "{{ matrix_synapse_container_image_customized if matrix_synapse_container_image_customizations_enabled else matrix_synapse_container_image }} "
  96. matrix_synapse_base_path: "{{ matrix_base_data_path }}/synapse"
  97. matrix_synapse_container_src_files_path: "{{ matrix_synapse_base_path }}/docker-src"
  98. matrix_synapse_customized_container_src_files_path: "{{ matrix_synapse_base_path }}/customized-docker-src"
  99. matrix_synapse_config_dir_path: "{{ matrix_synapse_base_path }}/config"
  100. matrix_synapse_storage_path: "{{ matrix_synapse_base_path }}/storage"
  101. matrix_synapse_media_store_path: "{{ matrix_synapse_storage_path }}/media-store"
  102. matrix_synapse_bin_path: "{{ matrix_synapse_base_path }}/bin"
  103. matrix_synapse_ext_path: "{{ matrix_synapse_base_path }}/ext"
  104. matrix_synapse_ext_s3_storage_provider_base_path: "{{ matrix_synapse_base_path }}/ext/s3-storage-provider"
  105. matrix_synapse_ext_s3_storage_provider_bin_path: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/bin"
  106. matrix_synapse_ext_s3_storage_provider_data_path: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/data"
  107. # extra arguments to pass to s3-storage-provider script when starting Synapse container
  108. matrix_synapse_ext_s3_storage_provider_container_arguments: []
  109. # matrix_synapse_s3_storage_provider_restart_necessary controls whether the
  110. # s3-storage-provider migrate timer will be restarted (when true) or merely
  111. # started (when false) by the systemd service manager role (when conditional
  112. # restart is enabled).
  113. #
  114. # This value is automatically computed during installation based on whether
  115. # any configuration files or the systemd service/timer files changed.
  116. # The default of `false` means "no restart needed" — appropriate when the role's
  117. # installation tasks haven't run (e.g., due to --tags skipping them).
  118. matrix_synapse_s3_storage_provider_restart_necessary: false
  119. matrix_synapse_container_client_api_port: 8008
  120. # Controls the `x_forwarded` setting for the "Insecure HTTP listener (Client API)".
  121. # We default this to `true`, because such insecure HTTP listeners are most likely behind a reverse-proxy (that handles TLS).
  122. matrix_synapse_container_client_api_x_forwarded: true
  123. matrix_synapse_container_federation_api_tls_port: 8448
  124. # Controls the `x_forwarded` setting for the "TLS-enabled federation listener".
  125. # We default this to `false`, because TLS-enabled listeners are likely to be exposed directly (instead of being behind a reverse-proxy).
  126. matrix_synapse_container_federation_api_tls_x_forwarded: false
  127. matrix_synapse_container_federation_api_plain_port: 8048
  128. # Controls the `x_forwarded` setting for the "Insecure federation listener".
  129. # We default this to `true`, because such insecure HTTP listeners are most likely behind a reverse-proxy (that handles TLS).
  130. matrix_synapse_container_federation_api_plain_x_forwarded: true
  131. # The base container network. It will be auto-created by this role if it doesn't exist already.
  132. matrix_synapse_container_network: ''
  133. # A list of additional container networks that the container would be connected to.
  134. # The role does not create these networks, so make sure they already exist.
  135. # Use this to expose this container to another reverse proxy, which runs in a different container network.
  136. matrix_synapse_container_additional_networks: "{{ matrix_synapse_container_additional_networks_auto + matrix_synapse_container_additional_networks_custom }}"
  137. matrix_synapse_container_additional_networks_auto: []
  138. matrix_synapse_container_additional_networks_custom: []
  139. # Controls whether the matrix-synapse container exposes the Client/Server API port (tcp/{{ matrix_synapse_container_client_api_port }} in the container).
  140. #
  141. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8008"), or empty string to not expose.
  142. matrix_synapse_container_client_api_host_bind_port: ''
  143. # Controls whether the matrix-synapse container exposes the plain (unencrypted) Server/Server (Federation) API port (tcp/8048 in the container).
  144. #
  145. # Takes effect only if federation is enabled (matrix_synapse_federation_enabled).
  146. #
  147. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8048"), or empty string to not expose.
  148. matrix_synapse_container_federation_api_plain_host_bind_port: ''
  149. # Controls whether the matrix-synapse container exposes the tls (encrypted) Server/Server (Federation) API port (tcp/8448 in the container).
  150. #
  151. # Takes effect only if federation is enabled (matrix_synapse_federation_enabled)
  152. # and TLS support is enabled (matrix_synapse_tls_federation_listener_enabled).
  153. #
  154. # Takes an "<ip>:<port>" or "<port>" value (e.g. "8448"), or empty string to not expose.
  155. matrix_synapse_container_federation_api_tls_host_bind_port: ''
  156. # Controls whether the matrix-synapse container exposes the metrics port (tcp/9100 in the container).
  157. #
  158. # Takes effect only if metrics are enabled (matrix_synapse_metrics_enabled).
  159. #
  160. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9100"), or empty string to not expose.
  161. matrix_synapse_container_metrics_api_host_bind_port: ''
  162. # Controls whether the matrix-synapse container exposes the manhole port (tcp/9000 in the container).
  163. #
  164. # Takes effect only if the manhole is enabled (matrix_synapse_manhole_enabled).
  165. #
  166. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9100"), or empty string to not expose.
  167. matrix_synapse_container_manhole_api_host_bind_port: ''
  168. # matrix_synapse_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the main Synapse worker.
  169. # See `../templates/labels.j2` for details.
  170. #
  171. # To inject your own other container labels, see `matrix_synapse_container_labels_additional_labels`.
  172. matrix_synapse_container_labels_traefik_enabled: true
  173. matrix_synapse_container_labels_traefik_docker_network: "{{ matrix_synapse_container_network }}"
  174. matrix_synapse_container_labels_traefik_entrypoints: web-secure
  175. matrix_synapse_container_labels_traefik_tls_certResolver: default # noqa var-naming
  176. matrix_synapse_container_labels_traefik_hostname: ''
  177. # Controls whether a compression middleware will be injected into the middlewares list.
  178. # This compression middleware is supposed to be defined elsewhere (using labels or a File provider, etc.) and is merely referenced by this router.
  179. matrix_synapse_container_labels_traefik_compression_middleware_enabled: false
  180. matrix_synapse_container_labels_traefik_compression_middleware_name: ""
  181. # Controls whether Matrix-related labels will be added.
  182. #
  183. # When set to false, variables like the following take no effect:
  184. # - `matrix_synapse_container_labels_public_client_api_enabled`
  185. # - `matrix_synapse_container_labels_public_client_synapse_client_api_enabled`
  186. # - `matrix_synapse_container_labels_public_client_synapse_admin_api_enabled`
  187. # - `matrix_synapse_container_labels_public_federation_api_enabled`
  188. #
  189. # When workers are enabled, we do not capture these requests, because we can't route them appropriately.
  190. matrix_synapse_container_labels_matrix_related_labels_enabled: "{{ not matrix_synapse_workers_enabled }}"
  191. # Controls whether labels will be added for handling the root (/) path on a public Traefik entrypoint.
  192. matrix_synapse_container_labels_public_client_root_enabled: true
  193. matrix_synapse_container_labels_public_client_root_traefik_hostname: "{{ matrix_synapse_container_labels_traefik_hostname }}"
  194. matrix_synapse_container_labels_public_client_root_traefik_rule: "Host(`{{ matrix_synapse_container_labels_public_client_root_traefik_hostname }}`) && Path(`/`)"
  195. matrix_synapse_container_labels_public_client_root_traefik_priority: 0
  196. matrix_synapse_container_labels_public_client_root_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}"
  197. matrix_synapse_container_labels_public_client_root_traefik_tls: "{{ matrix_synapse_container_labels_public_client_root_traefik_entrypoints != 'web' }}"
  198. matrix_synapse_container_labels_public_client_root_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  199. matrix_synapse_container_labels_public_client_root_redirection_enabled: false
  200. matrix_synapse_container_labels_public_client_root_redirection_url: ""
  201. # Controls whether labels will be added that expose the Client-Server API on a public Traefik entrypoint.
  202. # Regardless of whether this is enabled, it may or may not take effect due to the value of other variables.
  203. # See `matrix_synapse_container_labels_traefik_enabled` or `matrix_synapse_container_labels_matrix_related_labels_enabled`
  204. matrix_synapse_container_labels_public_client_api_enabled: true
  205. matrix_synapse_container_labels_public_client_api_traefik_hostname: "{{ matrix_synapse_container_labels_traefik_hostname }}"
  206. matrix_synapse_container_labels_public_client_api_traefik_path_prefix: /_matrix
  207. matrix_synapse_container_labels_public_client_api_traefik_rule: "Host(`{{ matrix_synapse_container_labels_public_client_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_container_labels_public_client_api_traefik_path_prefix }}`)"
  208. matrix_synapse_container_labels_public_client_api_traefik_priority: 0
  209. matrix_synapse_container_labels_public_client_api_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}"
  210. matrix_synapse_container_labels_public_client_api_traefik_tls: "{{ matrix_synapse_container_labels_public_client_api_traefik_entrypoints != 'web' }}"
  211. matrix_synapse_container_labels_public_client_api_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  212. # Controls whether labels will be added that expose the Client-Server API on the internal Traefik entrypoint.
  213. # This is similar to `matrix_synapse_container_labels_public_client_api_enabled`, but the entrypoint and intent is different.
  214. # Regardless of whether this is enabled, it may or may not take effect due to the value of other variables.
  215. # See `matrix_synapse_container_labels_traefik_enabled` or `matrix_synapse_container_labels_matrix_related_labels_enabled`
  216. matrix_synapse_container_labels_internal_client_api_enabled: false
  217. matrix_synapse_container_labels_internal_client_api_traefik_path_prefix: "{{ matrix_synapse_container_labels_public_client_api_traefik_path_prefix }}"
  218. matrix_synapse_container_labels_internal_client_api_traefik_rule: "PathPrefix(`{{ matrix_synapse_container_labels_internal_client_api_traefik_path_prefix }}`)"
  219. matrix_synapse_container_labels_internal_client_api_traefik_priority: "{{ matrix_synapse_container_labels_public_client_api_traefik_priority }}"
  220. matrix_synapse_container_labels_internal_client_api_traefik_entrypoints: ""
  221. # Controls whether labels will be added that expose the /_synapse/client paths
  222. # When workers are enabled, we do not capture these requests, because they may be load-balanaced to some specific worker.
  223. # Regardless of whether this is enabled, it may or may not take effect due to the value of other variables.
  224. # See `matrix_synapse_container_labels_traefik_enabled` or `matrix_synapse_container_labels_matrix_related_labels_enabled`
  225. matrix_synapse_container_labels_public_client_synapse_client_api_enabled: true
  226. matrix_synapse_container_labels_public_client_synapse_client_api_traefik_hostname: "{{ matrix_synapse_container_labels_traefik_hostname }}"
  227. matrix_synapse_container_labels_public_client_synapse_client_api_traefik_path_prefix: /_synapse/client
  228. matrix_synapse_container_labels_public_client_synapse_client_api_traefik_rule: "Host(`{{ matrix_synapse_container_labels_public_client_synapse_client_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_container_labels_public_client_synapse_client_api_traefik_path_prefix }}`)"
  229. matrix_synapse_container_labels_public_client_synapse_client_api_traefik_priority: 0
  230. matrix_synapse_container_labels_public_client_synapse_client_api_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}"
  231. matrix_synapse_container_labels_public_client_synapse_client_api_traefik_tls: "{{ matrix_synapse_container_labels_public_client_synapse_client_api_traefik_entrypoints != 'web' }}"
  232. matrix_synapse_container_labels_public_client_synapse_client_api_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  233. # Controls whether labels will be added that expose the /_synapse/admin paths
  234. # Following these recommendations (https://github.com/element-hq/synapse/blob/master/docs/reverse_proxy.md), by default, we don't.
  235. # Regardless of whether this is enabled, it may or may not take effect due to the value of other variables.
  236. # See `matrix_synapse_container_labels_traefik_enabled` or `matrix_synapse_container_labels_matrix_related_labels_enabled`
  237. matrix_synapse_container_labels_public_client_synapse_admin_api_enabled: false
  238. matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_hostname: "{{ matrix_synapse_container_labels_traefik_hostname }}"
  239. matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_path_prefix: /_synapse/admin
  240. matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_rule: "Host(`{{ matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_path_prefix }}`)"
  241. matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_priority: 0
  242. matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}"
  243. matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_tls: "{{ matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_entrypoints != 'web' }}"
  244. matrix_synapse_container_labels_public_client_synapse_admin_api_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  245. # Controls whether labels will be added that expose the /_synapse/admin paths on the internal Traefik entrypoint.
  246. # Following these recommendations (https://github.com/element-hq/synapse/blob/master/docs/reverse_proxy.md), by default, we don't.
  247. # Regardless of whether this is enabled, it may or may not take effect due to the value of other variables.
  248. matrix_synapse_container_labels_internal_client_synapse_admin_api_enabled: false
  249. matrix_synapse_container_labels_internal_client_synapse_admin_api_traefik_path_prefix: /_synapse/admin
  250. matrix_synapse_container_labels_internal_client_synapse_admin_api_traefik_rule: "PathPrefix(`{{ matrix_synapse_container_labels_internal_client_synapse_admin_api_traefik_path_prefix }}`)"
  251. matrix_synapse_container_labels_internal_client_synapse_admin_api_traefik_priority: 0
  252. matrix_synapse_container_labels_internal_client_synapse_admin_api_traefik_entrypoints: ""
  253. # Controls whether labels will be added that expose the Server-Server API (Federation API).
  254. # Regardless of whether this is enabled, it may or may not take effect due to the value of other variables.
  255. # See `matrix_synapse_container_labels_traefik_enabled` or `matrix_synapse_container_labels_matrix_related_labels_enabled`
  256. matrix_synapse_container_labels_public_federation_api_enabled: "{{ matrix_synapse_federation_port_enabled }}"
  257. matrix_synapse_container_labels_public_federation_api_traefik_hostname: "{{ matrix_synapse_container_labels_traefik_hostname }}"
  258. matrix_synapse_container_labels_public_federation_api_traefik_path_prefix: /_matrix
  259. matrix_synapse_container_labels_public_federation_api_traefik_rule: "Host(`{{ matrix_synapse_container_labels_public_federation_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_container_labels_public_federation_api_traefik_path_prefix }}`)"
  260. matrix_synapse_container_labels_public_federation_api_traefik_priority: 0
  261. matrix_synapse_container_labels_public_federation_api_traefik_entrypoints: ''
  262. # TLS is force-enabled here, because the spec (https://spec.matrix.org/v1.9/server-server-api/#tls) says that the federation API must use HTTPS.
  263. matrix_synapse_container_labels_public_federation_api_traefik_tls: true
  264. matrix_synapse_container_labels_public_federation_api_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  265. # Controls whether labels will be added that expose metrics (see `matrix_synapse_metrics_proxying_enabled`) for the main Synapse process
  266. matrix_synapse_container_labels_public_metrics_enabled: "{{ matrix_synapse_metrics_enabled and matrix_synapse_metrics_proxying_enabled }}"
  267. matrix_synapse_container_labels_public_metrics_traefik_path: "{{ matrix_synapse_metrics_proxying_path_prefix }}/main-process"
  268. matrix_synapse_container_labels_public_metrics_traefik_rule: "Host(`{{ matrix_synapse_metrics_proxying_hostname }}`) && Path(`{{ matrix_synapse_container_labels_public_metrics_traefik_path }}`)"
  269. matrix_synapse_container_labels_public_metrics_traefik_priority: 0
  270. matrix_synapse_container_labels_public_metrics_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}"
  271. matrix_synapse_container_labels_public_metrics_traefik_tls: "{{ matrix_synapse_container_labels_public_metrics_traefik_entrypoints != 'web' }}"
  272. matrix_synapse_container_labels_public_metrics_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  273. matrix_synapse_container_labels_public_metrics_middleware_basic_auth_enabled: false
  274. # See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
  275. matrix_synapse_container_labels_public_metrics_middleware_basic_auth_users: ''
  276. # matrix_synapse_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  277. # See `../templates/labels.j2` for details.
  278. #
  279. # Example:
  280. # matrix_synapse_container_labels_additional_labels: |
  281. # my.label=1
  282. # another.label="here"
  283. matrix_synapse_container_labels_additional_labels: ''
  284. # Specifies how often the container health check will run.
  285. #
  286. # The Synapse container image ships with a default HEALTHCHECK (curl to /health)
  287. # with an interval of 15s, timeout of 5s, and start period of 5s.
  288. #
  289. # For Traefik-based setups, it's important that the interval is short,
  290. # because the interval value also specifies the "initial wait time".
  291. # This is a Docker (moby) bug: https://github.com/moby/moby/issues/33410
  292. # Without a successful healthcheck, Traefik will not register the service for reverse-proxying.
  293. # A shorter interval also lets our systemd ExecStartPost health check
  294. # (see matrix_synapse_systemd_healthcheck_enabled) detect readiness faster at startup.
  295. #
  296. # For non-Traefik setups, we use the default healthcheck interval (15s) to decrease overhead.
  297. matrix_synapse_container_health_interval_seconds: "{{ 5 if matrix_synapse_container_labels_traefik_enabled else 15 }}"
  298. matrix_synapse_container_health_interval: "{{ matrix_synapse_container_health_interval_seconds }}s"
  299. # A list of extra arguments to pass to the container
  300. # Also see `matrix_synapse_container_arguments`
  301. matrix_synapse_container_extra_arguments: []
  302. # matrix_synapse_container_extra_arguments_auto is a list of extra arguments to pass to the container.
  303. # This list is managed by the playbook. You're not meant to override this variable.
  304. # If you'd like to inject your own arguments, see `matrix_synapse_container_extra_arguments`.
  305. matrix_synapse_container_extra_arguments_auto: []
  306. # matrix_synapse_container_arguments holds the final list of extra arguments to pass to the container.
  307. # You're not meant to override this variable.
  308. # If you'd like to inject your own arguments, see `matrix_synapse_container_extra_arguments`.
  309. matrix_synapse_container_arguments: "{{ matrix_synapse_container_extra_arguments + matrix_synapse_container_extra_arguments_auto }}"
  310. # matrix_synapse_container_master_extra_arguments contains arguments specific to the master process whereas
  311. # matrix_synapse_container_arguments contains arguments the apply to all Synapse containers (master and worker).
  312. matrix_synapse_container_master_extra_arguments: []
  313. # List of systemd services that matrix-synapse.service depends on
  314. matrix_synapse_systemd_required_services_list: "{{ matrix_synapse_systemd_required_services_list_default + matrix_synapse_systemd_required_services_list_auto + matrix_synapse_systemd_required_services_list_custom }}"
  315. matrix_synapse_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  316. matrix_synapse_systemd_required_services_list_auto: []
  317. matrix_synapse_systemd_required_services_list_custom: []
  318. # List of systemd services that matrix-synapse.service wants
  319. matrix_synapse_systemd_wanted_services_list: "{{ matrix_synapse_systemd_wanted_services_list_default + matrix_synapse_systemd_wanted_services_list_auto + matrix_synapse_systemd_wanted_services_list_custom }}"
  320. matrix_synapse_systemd_wanted_services_list_default: []
  321. matrix_synapse_systemd_wanted_services_list_auto: []
  322. matrix_synapse_systemd_wanted_services_list_custom: []
  323. # List of systemd services that matrix-goofys.service depends on
  324. matrix_synapse_goofys_systemd_required_services_list: "{{ matrix_synapse_goofys_systemd_required_services_list_default + matrix_synapse_goofys_systemd_required_services_list_auto + matrix_synapse_goofys_systemd_required_services_list_custom }}"
  325. matrix_synapse_goofys_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  326. matrix_synapse_goofys_systemd_required_services_list_auto: []
  327. matrix_synapse_goofys_systemd_required_services_list_custom: []
  328. # Controls the post-start health check in the systemd service.
  329. # When enabled, ExecStartPost polls Docker's container health status via `docker inspect`,
  330. # keeping the service in "activating (start-post)" state until Synapse is ready.
  331. # Services with After=matrix-synapse.service will properly wait.
  332. # This relies on the container image's built-in HEALTHCHECK (curl to /health),
  333. # with the interval controlled by matrix_synapse_container_health_interval.
  334. matrix_synapse_systemd_healthcheck_enabled: true
  335. matrix_synapse_systemd_healthcheck_max_retries: 180
  336. matrix_synapse_systemd_healthcheck_interval_seconds: 1
  337. # The command used for the health check in ExecStartPost.
  338. # Polls `docker inspect` for the container's health status until it reports "healthy".
  339. matrix_synapse_systemd_healthcheck_command: >-
  340. {{ devture_systemd_docker_base_host_command_sh }} -c
  341. 'for i in $(seq 1 {{ matrix_synapse_systemd_healthcheck_max_retries }}); do
  342. echo "[Attempt $i/{{ matrix_synapse_systemd_healthcheck_max_retries }}] Synapse systemd health check: checking container health status..";
  343. status=$( {{ devture_systemd_docker_base_host_command_docker }} inspect --format={{ '"{{' }}.State.Health.Status{{ '}}"' }} matrix-synapse 2>/dev/null);
  344. if [ "$status" = "healthy" ]; then echo "[Attempt $i/{{ matrix_synapse_systemd_healthcheck_max_retries }}] Synapse systemd health check: passed" && exit 0; fi;
  345. echo "[Attempt $i/{{ matrix_synapse_systemd_healthcheck_max_retries }}] Synapse systemd health check: not ready yet (status: $status), retrying in {{ matrix_synapse_systemd_healthcheck_interval_seconds }}s..";
  346. sleep {{ matrix_synapse_systemd_healthcheck_interval_seconds }};
  347. done; echo "[Attempt $i/{{ matrix_synapse_systemd_healthcheck_max_retries }}] Synapse systemd health check: failed after {{ matrix_synapse_systemd_healthcheck_max_retries }} attempts"; exit 1'
  348. # Controls how long to sleep for after the systemd health check passes.
  349. # Even after Synapse is healthy, the reverse proxy (e.g. Traefik) needs time to discover
  350. # the container and register its routes. Traefik waits `providers.providersThrottleDuration`
  351. # (see https://doc.traefik.io/traefik/v3.3/providers/overview/#providersprovidersthrottleduration)
  352. # before applying new configuration from Docker events.
  353. # Without this delay, services depending on Synapse may encounter 404 errors
  354. # when connecting through the reverse proxy.
  355. # This value is meant to be wired to the Traefik throttle duration by the playbook's group vars.
  356. matrix_synapse_systemd_service_post_start_delay_seconds: 0
  357. matrix_synapse_in_container_python_packages_path: "/usr/local/lib/python3.13/site-packages"
  358. # Specifies which template files to use when configuring Synapse.
  359. # If you'd like to have your own different configuration, feel free to copy and paste
  360. # the original files into your inventory (e.g. in `inventory/host_vars/matrix.example.com/`)
  361. # and then change the specific host's `vars.yml` file like this:
  362. # matrix_synapse_template_synapse_homeserver: "{{ playbook_dir }}/inventory/host_vars/matrix.example.com/homeserver.yaml.j2"
  363. matrix_synapse_template_synapse_homeserver: "{{ role_path }}/templates/synapse/homeserver.yaml.j2"
  364. matrix_synapse_template_synapse_log: "{{ role_path }}/templates/synapse/synapse.log.config.j2"
  365. matrix_synapse_public_baseurl: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}://{{ matrix_server_fqn_matrix }}/"
  366. matrix_synapse_macaroon_secret_key: ""
  367. matrix_synapse_registration_shared_secret: "{{ matrix_synapse_macaroon_secret_key }}"
  368. matrix_synapse_allow_guest_access: false
  369. matrix_synapse_form_secret: "{{ matrix_synapse_macaroon_secret_key }}"
  370. # Controls how to reach server admin, used in ResouceLimitError
  371. matrix_synapse_admin_contact: ~
  372. matrix_synapse_max_upload_size_mb: 50
  373. # Controls whether local media should be removed under certain conditions, typically for the purpose of saving space.
  374. # should be empty to disable
  375. matrix_synapse_media_retention_local_media_lifetime:
  376. # Controls whether remote media cache (media that is downloaded from other homeservers)
  377. # should be removed under certain conditions, typically for the purpose of saving space.
  378. # should be empty to disable
  379. matrix_synapse_media_retention_remote_media_lifetime:
  380. # Controls the list of additional oembed providers to be added to the homeserver.
  381. matrix_synapse_oembed_additional_providers: []
  382. # Controls message retention policies
  383. matrix_synapse_retention_enabled: false
  384. # "A single var to control them all" - applied to all retention period vars, applied only if a value is set, e.g. : "1d", "1w", "1m", "1y"
  385. matrix_synapse_retention_period: ""
  386. # The default min lifetime, applied only if a value is set, e.g. : "1d", "1w", "1m", "1y"
  387. matrix_synapse_retention_default_policy_min_lifetime: "{{ matrix_synapse_retention_period }}"
  388. # The default max lifetime, applied only if a value is set, e.g. : "1d", "1w", "1m", "1y"
  389. matrix_synapse_retention_default_policy_max_lifetime: "{{ matrix_synapse_retention_period }}"
  390. # The allowed min lifetime, applied only if a value is set, e.g. : "1d", "1w", "1m", "1y"
  391. matrix_synapse_retention_allowed_lifetime_min: "{{ matrix_synapse_retention_period }}"
  392. # The allowed max lifetime, applied only if a value is set, e.g. : "1d", "1w", "1m", "1y"
  393. matrix_synapse_retention_allowed_lifetime_max: "{{ matrix_synapse_retention_period }}"
  394. # The list of the purge jobs, structure (all fields are optional, example below contains all available variants):
  395. # - longest_max_lifetime: "1d"
  396. # shortest_max_lifetime: "1d"
  397. # interval: "12h"
  398. # - longest_max_lifetime: "1d"
  399. # - shortest_max_lifetime: "1d"
  400. # - interval: "12h"
  401. matrix_synapse_retention_purge_jobs: []
  402. # The tmpfs at /tmp needs to be large enough to handle multiple concurrent file uploads.
  403. matrix_synapse_tmp_directory_size_mb: "{{ matrix_synapse_max_upload_size_mb * 50 }}"
  404. # Log levels
  405. # Possible options are defined here https://docs.python.org/3/library/logging.html#logging-levels
  406. # warning: setting log level to DEBUG will make synapse log sensitive information such
  407. # as access tokens.
  408. #
  409. # Increasing verbosity may lead to an excessive amount of log messages being generated,
  410. # some of which may get dropped by systemd-journald on certain distributions (like CentOS 7).
  411. # You can work around it by adding `RateLimitInterval=0` and `RateLimitBurst=0` under `[Storage]` in
  412. # `/etc/systemd/journald.conf` and restarting the logging service (`systemctl restart systemd-journald`).
  413. matrix_synapse_log_level: "WARNING"
  414. matrix_synapse_storage_sql_log_level: "WARNING"
  415. matrix_synapse_root_log_level: "WARNING"
  416. # Rate limits
  417. matrix_synapse_rc_message:
  418. per_second: 0.5
  419. burst_count: 30
  420. matrix_synapse_rc_registration:
  421. per_second: 0.17
  422. burst_count: 3
  423. matrix_synapse_rc_login:
  424. address:
  425. per_second: 0.17
  426. burst_count: 3
  427. account:
  428. per_second: 0.17
  429. burst_count: 3
  430. failed_attempts:
  431. per_second: 0.17
  432. burst_count: 3
  433. matrix_synapse_rc_admin_redaction:
  434. per_second: 1
  435. burst_count: 50
  436. matrix_synapse_rc_joins:
  437. local:
  438. per_second: 0.1
  439. burst_count: 10
  440. remote:
  441. per_second: 0.01
  442. burst_count: 10
  443. matrix_synapse_rc_invites:
  444. per_room:
  445. per_second: 0.3
  446. burst_count: 10
  447. per_user:
  448. per_second: 0.003
  449. burst_count: 5
  450. per_issuer:
  451. per_second: 0.3
  452. burst_count: 10
  453. matrix_synapse_rc_federation:
  454. window_size: 1000
  455. sleep_limit: 10
  456. sleep_delay: 500
  457. reject_limit: 50
  458. concurrent: 3
  459. matrix_synapse_federation_rr_transactions_per_room_per_second: 50
  460. # Controls the rate limit for delayed event management.
  461. #
  462. # This is only applied if `matrix_synapse_experimental_features_msc4140_enabled` is set to `true`.
  463. matrix_synapse_rc_delayed_event_mgmt:
  464. per_second: 1
  465. burst_count: 20
  466. # Controls the templates directory setting.
  467. #
  468. # See:
  469. # - `matrix_synapse_container_image_customizations_templates_enabled`
  470. # - https://github.com/element-hq/synapse/blob/develop/docs/templates.md
  471. matrix_synapse_templates_custom_template_directory: "{{ matrix_synapse_container_image_customizations_templates_in_container_full_path if matrix_synapse_container_image_customizations_templates_enabled else '' }}"
  472. # Controls whether the TLS federation listener is enabled (tcp/8448).
  473. # Only makes sense if federation is enabled (`matrix_synapse_federation_enabled`).
  474. # Note that federation may potentially be enabled as non-TLS on `matrix_synapse_container_federation_api_plain_port` as well.
  475. # If you're serving Synapse behind an HTTPS-capable reverse-proxy,
  476. # you can disable the TLS listener (`matrix_synapse_tls_federation_listener_enabled: false`).
  477. matrix_synapse_tls_federation_listener_enabled: true
  478. matrix_synapse_tls_certificate_path: "/data/{{ matrix_server_fqn_matrix }}.tls.crt"
  479. matrix_synapse_tls_private_key_path: "/data/{{ matrix_server_fqn_matrix }}.tls.key"
  480. # Resource names used by the insecure HTTP listener. Here only the Client API
  481. # is defined, see the homeserver config for a full list of valid resource
  482. # names.
  483. matrix_synapse_http_listener_resource_names: ["client"]
  484. # Resources served on Synapse's federation port.
  485. # When disabling federation, we may wish to serve the `openid` resource here,
  486. # so that services like Matrix User Verification Service can work.
  487. matrix_synapse_federation_listener_resource_names: "{{ ['federation'] if matrix_synapse_federation_enabled else (['openid'] if matrix_synapse_federation_port_openid_resource_required else []) }}"
  488. # Enable this to allow Synapse to report utilization statistics about your server to matrix.org
  489. # (things like number of users, number of messages sent, uptime, load, etc.)
  490. matrix_synapse_report_stats: false
  491. # The endpoint to report homeserver usage statistics to.
  492. matrix_synapse_report_stats_endpoint: "https://matrix.org/report-usage-stats/push"
  493. # Controls whether the Matrix server will track presence status (online, offline, unavailable) for users.
  494. # If users participate in large rooms with many other servers,
  495. # disabling this will decrease server load significantly.
  496. matrix_synapse_presence_enabled: true
  497. # Controls whether remote room complexity checks are enabled when joining rooms.
  498. # When enabled, Synapse checks a room's complexity before joining a remote room.
  499. # Complexity is measured as `current_state_events / 500` and can prevent
  500. # users from joining very large/active rooms on constrained servers.
  501. matrix_synapse_limit_remote_rooms_enabled: false
  502. # Maximum complexity allowed before join is blocked.
  503. matrix_synapse_limit_remote_rooms_complexity: 1.0
  504. # Error message returned when a user attempts to join a too-complex room.
  505. matrix_synapse_limit_remote_rooms_complexity_error: "Your homeserver is unable to join rooms this large or complex. Please speak to your server administrator, or upgrade your instance to join this room."
  506. # Allow server admins to join rooms even when they exceed the complexity limit.
  507. matrix_synapse_limit_remote_rooms_admins_can_join: false
  508. # Controls whether accessing the server's public rooms directory can be done without authentication.
  509. # For private servers, you most likely wish to require authentication,
  510. # unless you know what list of rooms you're publishing to the world and explicitly want to do it.
  511. matrix_synapse_allow_public_rooms_without_auth: false
  512. # Controls whether remote servers can fetch this server's public rooms directory via federation.
  513. # The upstream default is `false`, but we try to make Matrix federation more useful.
  514. #
  515. # For private servers, you may wish to forbid it to align yourself with upstream defaults.
  516. # However, disabling federation completely (see `matrix_synapse_federation_enabled`) is a better way to make your server private,
  517. # instead of relying on security-by-obscurity — federating with others, having your public rooms joinable by anyone,
  518. # but hiding them and thinking you've secured them.
  519. matrix_synapse_allow_public_rooms_over_federation: true
  520. # Whether to require authentication to retrieve profile data (avatars,
  521. # display names) of other users through the client API. Defaults to
  522. # 'false'. Note that profile data is also available via the federation
  523. # API, so this setting is of limited value if federation is enabled on
  524. # the server.
  525. matrix_synapse_require_auth_for_profile_requests: false
  526. # Set to true to require a user to share a room with another user in order
  527. # to retrieve their profile information. Only checked on Client-Server
  528. # requests. Profile requests from other servers should be checked by the
  529. # requesting server. Defaults to 'false'.
  530. matrix_synapse_limit_profile_requests_to_users_who_share_rooms: false
  531. # Set to false to prevent a user's profile data from being retrieved and
  532. # displayed in a room until they have joined it. By default, a user's
  533. # profile data is included in an invite event, regardless of the values
  534. # of the above two settings, and whether or not the users share a server.
  535. # Defaults to 'true'.
  536. matrix_synapse_include_profile_data_on_invite: true
  537. # User search behaviour
  538. matrix_synapse_user_directory_search_all_users: false
  539. matrix_synapse_user_directory_prefer_local_users: false
  540. matrix_synapse_user_directory_exclude_remote_users: false
  541. # Controls whether people with access to the homeserver can register by themselves.
  542. matrix_synapse_enable_registration: false
  543. # Controls whether people with access to the homeserver can register by themselves without verification (email/msisdn/token)
  544. matrix_synapse_enable_registration_without_verification: false
  545. # reCAPTCHA API for validating registration attempts
  546. matrix_synapse_enable_registration_captcha: false
  547. matrix_synapse_recaptcha_public_key: ''
  548. matrix_synapse_recaptcha_private_key: ''
  549. # Requires an MSC3231 token for registration. Note that `matrix_synapse_enable_registration` must be set to `true`.
  550. # Tokens can be created via the API or through synapse-admin.
  551. # Disabling this option will not delete any tokens previously generated.
  552. matrix_synapse_registration_requires_token: false
  553. # A list of 3PID types which users must supply when registering (possible values: email, msisdn).
  554. matrix_synapse_registrations_require_3pid: []
  555. # Explicitly disable asking for MSISDNs from the registration
  556. # flow (overrides matrix_synapse_registrations_require_3pid if MSISDNs are set as required)
  557. matrix_synapse_disable_msisdn_registration: false
  558. # A list of patterns 3pids must match in order to permit registration, e.g.:
  559. # - medium: email
  560. # pattern: '.*@example\.com'
  561. # - medium: msisdn
  562. # pattern: '\+44'
  563. matrix_synapse_allowed_local_3pids: []
  564. # The server to use for phone number threepid validation. When empty, validation cannot happen, as Synapse doesn't support it.
  565. # To make it work, this should be pointed to an identity server.
  566. matrix_synapse_account_threepid_delegates_msisdn: ''
  567. # Users who register on this homeserver will automatically be joined to these rooms.
  568. # Rooms are to be specified using addresses (e.g. `#address:example.com`)
  569. # If any auto-join rooms are invite-only, you need to define `matrix_synapse_auto_join_mxid_localpart`.
  570. matrix_synapse_auto_join_rooms: []
  571. # Controls whether auto-join rooms (`matrix_synapse_auto_join_rooms`) are to be created
  572. # automatically if they don't already exist.
  573. matrix_synapse_autocreate_auto_join_rooms: true
  574. # The local part of the user ID which is used to create auto-join rooms if `matrix_synapse_autocreate_auto_join_rooms` is true.
  575. # Defaults to the initial user account that registers.
  576. # The user ID is also used to invite new users to any auto-join rooms which are set to invite-only.
  577. matrix_synapse_auto_join_mxid_localpart: ''
  578. # Controls whether room invites will be accepted on behalf of users.
  579. # See: https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html#auto-accept-invites
  580. # Also see:
  581. # - `matrix_synapse_auto_accept_invites_only_for_direct_messages`
  582. # - `matrix_synapse_auto_accept_invites_only_from_local_users`
  583. # - `matrix_synapse_auto_accept_invites_worker_to_run_on`
  584. matrix_synapse_auto_accept_invites_enabled: false
  585. # Controls whether auto-invite acceptance should only be done for direct messages.
  586. # Related to: `matrix_synapse_auto_accept_invites_enabled`
  587. matrix_synapse_auto_accept_invites_only_for_direct_messages: false
  588. # Controls whether auto-invite acceptance should only be done when the invitatio nis coming from a local user.
  589. # Related to: `matrix_synapse_auto_accept_invites_enabled`
  590. matrix_synapse_auto_accept_invites_only_from_local_users: false
  591. # When Synapse workers enabled it is possible (but not required) to assign a worker to run the auto-accept-invites feature on (null = main process).
  592. # Related to: `matrix_synapse_auto_accept_invites_enabled`
  593. matrix_synapse_auto_accept_invites_worker_to_run_on: null
  594. # Controls whether password authentication is allowed
  595. # It may be useful when you've configured OAuth, SAML or CAS and want authentication
  596. # to happen only through them
  597. matrix_synapse_password_config_enabled: true
  598. # Controls password-peppering for Synapse. Not to be changed after initial setup.
  599. matrix_synapse_password_config_pepper: ""
  600. # Controls if Synapse allows people to authenticate against its local database.
  601. # It may be useful to disable this if you've configured additional password providers
  602. # and only wish authentication to happen through them.
  603. matrix_synapse_password_config_localdb_enabled: true
  604. # Controls the number of events that Synapse caches in memory.
  605. matrix_synapse_event_cache_size: "100K"
  606. # Controls cache sizes for Synapse.
  607. # Raise this to increase cache sizes or lower it to potentially lower memory use.
  608. # To learn more, see:
  609. # - https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#caching
  610. # - https://github.com/matrix-org/synapse/issues/3939
  611. # Defaults for timings of caches is from https://tcpipuk.github.io/synapse/deployment/synapse.html
  612. # The idea with the timings used is that you get to evict soon but also you keep stuff around for a long time when its not forced out.
  613. # Long cache lifetimes together with the low minimum TTL allows autotune to be the primary eviction method assuming size of cache is hit before we hit other caps.
  614. matrix_synapse_caches_global_factor: 10
  615. matrix_synapse_caches_expire_caches: true
  616. matrix_synapse_caches_cache_entry_ttl: "1080m"
  617. matrix_synapse_caches_sync_response_cache_duration: "2m"
  618. # Controls how much memory this role thinks is available for cache-size-related calculations.
  619. # By default, all of the server's memory is taken into account, but you can adjust this.
  620. # You can also go for directly adjusting cache-sizes (matrix_synapse_cache_autotuning_max_cache_memory_usage, matrix_synapse_cache_autotuning_target_cache_memory_usage) instead of adjusting this.
  621. matrix_synapse_cache_size_calculations_memtotal_bytes: "{{ (ansible_facts['memtotal_mb'] * 1024 * 1024) | int }}"
  622. # Controls the cap to use for matrix_synapse_cache_autotuning_max_cache_memory_usage.
  623. matrix_synapse_cache_size_calculations_max_cache_memory_usage_cap_bytes: "{{ (2 * 1024 * 1024 * 1024) }}" # 2GB
  624. # Controls the cap to use for matrix_synapse_cache_autotuning_target_cache_memory_usage.
  625. matrix_synapse_cache_size_calculations_target_cache_memory_usage_cap_bytes: "{{ (1 * 1024 * 1024 * 1024) }}" # 1GB
  626. matrix_synapse_cache_autotuning_min_cache_ttl: "30s"
  627. matrix_synapse_cache_autotuning_max_cache_memory_usage: |-
  628. {{
  629. [
  630. (((matrix_synapse_cache_size_calculations_memtotal_bytes | int) / 8) | int),
  631. (matrix_synapse_cache_size_calculations_max_cache_memory_usage_cap_bytes | int),
  632. ] | min
  633. }}
  634. matrix_synapse_cache_autotuning_target_cache_memory_usage: |-
  635. {{
  636. [
  637. (((matrix_synapse_cache_size_calculations_memtotal_bytes | int) / 16) | int),
  638. (matrix_synapse_cache_size_calculations_target_cache_memory_usage_cap_bytes | int),
  639. ] | min
  640. }}
  641. # Controls whether Synapse will federate at all.
  642. # Disable this to completely isolate your server from the rest of the Matrix network.
  643. #
  644. # Disabling this still keeps the federation port exposed, because it may be used for other services (`openid`).
  645. #
  646. # Also see:
  647. # - `matrix_synapse_tls_federation_listener_enabled` if you wish to keep federation enabled,
  648. # but want to stop the TLS listener (port 8448).
  649. # - `matrix_synapse_federation_port_enabled` to avoid exposing the federation ports
  650. matrix_synapse_federation_enabled: true
  651. # Controls whether the federation ports are used at all.
  652. # One may wish to disable federation (`matrix_synapse_federation_enabled: true`),
  653. # but still run other resources (like `openid`) on the federation port
  654. # by enabling them in `matrix_synapse_federation_listener_resource_names`.
  655. matrix_synapse_federation_port_enabled: "{{ matrix_synapse_federation_enabled or matrix_synapse_federation_port_openid_resource_required }}"
  656. # Controls whether an `openid` listener is to be enabled. Useful when disabling federation,
  657. # but needing the `openid` APIs for Dimension.
  658. matrix_synapse_federation_port_openid_resource_required: false
  659. # A list of domain names that are allowed to federate with the given Synapse server.
  660. # An empty list value (`[]`) will also effectively stop federation, but if that's the desired
  661. # result, it's better to accomplish it by changing `matrix_synapse_federation_enabled`.
  662. matrix_synapse_federation_domain_whitelist: ~
  663. # Enable/disable OpenID Connect
  664. matrix_synapse_oidc_enabled: false
  665. # List of OpenID Connect providers, ref: https://matrix-org.github.io/synapse/latest/openid.html#sample-configs
  666. matrix_synapse_oidc_providers: []
  667. # A list of additional "volumes" to mount in the container.
  668. # This list gets populated dynamically based on Synapse extensions that have been enabled.
  669. # Contains definition objects like this: `{"src": "/outside", "dst": "/inside", "options": "ro"}
  670. # Note: internally, this uses the `--mount` flag for mounting the specified volumes.
  671. matrix_synapse_container_additional_volumes: []
  672. # Controls whether cas_config is enabled
  673. matrix_synapse_cas_config_enabled: false
  674. # A list of additional loggers to register in synapse.log.config.
  675. # This list gets populated dynamically based on Synapse extensions that have been enabled.
  676. # Contains definition objects like this: `{"name": "..", "level": "DEBUG"}
  677. matrix_synapse_additional_loggers: "{{ matrix_synapse_additional_loggers_auto + matrix_synapse_additional_loggers_custom }}"
  678. matrix_synapse_additional_loggers_auto:
  679. # By default, we're disabling some useless (and even toxic) spammy WARNING-level logs.
  680. # Related to:
  681. # - https://github.com/matrix-org/synapse/issues/16208
  682. # - https://github.com/matrix-org/synapse/issues/16101
  683. # - https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/2853
  684. - name: synapse.http.matrixfederationclient
  685. level: CRITICAL
  686. - name: synapse.federation.sender.per_destination_queue
  687. level: CRITICAL
  688. - name: synapse.handlers.device
  689. level: CRITICAL
  690. - name: synapse.replication.tcp.handler
  691. level: CRITICAL
  692. matrix_synapse_additional_loggers_custom: []
  693. # A list of appservice config files (in-container filesystem paths).
  694. # This list gets populated dynamically based on Synapse extensions that have been enabled.
  695. # You may wish to use this together with `matrix_synapse_container_additional_volumes` or `matrix_synapse_container_extra_arguments`.
  696. # Also see `matrix_synapse_app_service_config_files_final`
  697. matrix_synapse_app_service_config_files: []
  698. # matrix_synapse_app_service_config_files_auto is a list of appservice config files.
  699. # This list is managed by the playbook. You're not meant to override this variable.
  700. # If you'd like to inject your own arguments, see `matrix_synapse_app_service_config_files`.
  701. matrix_synapse_app_service_config_files_auto: []
  702. # matrix_synapse_app_service_config_files_final holds the final list of config files to pass to the container.
  703. # You're not meant to override this variable.
  704. # If you'd like to inject your own arguments, see `matrix_synapse_app_service_config_files`.
  705. matrix_synapse_app_service_config_files_final: "{{ matrix_synapse_app_service_config_files + matrix_synapse_app_service_config_files_auto }}"
  706. # This is set dynamically during execution depending on whether
  707. # any password providers have been enabled or not.
  708. matrix_synapse_password_providers_enabled: false
  709. # Whether clients can request to include message content in push notifications
  710. # sent through third party servers. Setting this to false requires mobile clients
  711. # to load message content directly from the homeserver.
  712. matrix_synapse_push_include_content: true
  713. # If url previews should be generated. This will cause a request from Synapse to URLs shared by users.
  714. # Also see `matrix_synapse_url_preview_ip_range_blacklist`.
  715. matrix_synapse_url_preview_enabled: true
  716. # List of IP address CIDR ranges that the URL preview spider is denied from accessing.
  717. # Note: The value is ignored when an HTTP proxy is in use
  718. # See the comment about this setting in `templates/synapse/homeserver.yaml.j2` for more details.
  719. matrix_synapse_url_preview_ip_range_blacklist:
  720. - '127.0.0.0/8'
  721. - '10.0.0.0/8'
  722. - '172.16.0.0/12'
  723. - '192.168.0.0/16'
  724. - '100.64.0.0/10'
  725. - '192.0.0.0/24'
  726. - '169.254.0.0/16'
  727. - '192.88.99.0/24'
  728. - '198.18.0.0/15'
  729. - '192.0.2.0/24'
  730. - '198.51.100.0/24'
  731. - '203.0.113.0/24'
  732. - '224.0.0.0/4'
  733. - '::1/128'
  734. - 'fe80::/10'
  735. - 'fc00::/7'
  736. - '2001:db8::/32'
  737. - 'ff00::/8'
  738. - 'fec0::/10'
  739. # List of IP address CIDR ranges that the URL preview spider is allowed to access even if they are specified in `matrix_synapse_url_preview_ip_range_blacklist`.
  740. matrix_synapse_url_preview_ip_range_whitelist: []
  741. # List of URL matches that the URL preview spider is denied from accessing.
  742. # See https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#url_preview_url_blacklist
  743. # for more details.
  744. matrix_synapse_url_preview_url_blacklist: []
  745. # A list of values for the Accept-Language HTTP header used when downloading webpages during URL preview generation
  746. matrix_url_preview_accept_language: ['en-US', 'en']
  747. # Enable exposure of metrics to Prometheus
  748. # See https://github.com/element-hq/synapse/blob/master/docs/metrics-howto.md
  749. matrix_synapse_metrics_enabled: false
  750. matrix_synapse_metrics_port: 9100
  751. # matrix_synapse_grafana_dashboard_urls contains a list of URLs with Grafana dashboard definitions.
  752. # If the Grafana role is enabled, these dashboards will be downloaded.
  753. matrix_synapse_grafana_dashboard_urls:
  754. - https://raw.githubusercontent.com/element-hq/synapse/master/contrib/grafana/synapse.json
  755. # Controls whether Synapse metrics should be proxied (exposed) on:
  756. # - `matrix.example.com/metrics/synapse/main-process` for the main process
  757. # - `matrix.example.com/metrics/synapse/worker/{type}-{id}` for each worker process
  758. matrix_synapse_metrics_proxying_enabled: false
  759. matrix_synapse_metrics_proxying_hostname: ''
  760. matrix_synapse_metrics_proxying_path_prefix: /metrics/synapse
  761. # Enable the Synapse manhole
  762. # See https://github.com/element-hq/synapse/blob/master/docs/manhole.md
  763. matrix_synapse_manhole_enabled: false
  764. # Enable support for Synapse workers
  765. matrix_synapse_workers_enabled: false
  766. # Controls the `x_forwarded` setting for the main `http` listener for Synapse workers.
  767. # We default this to `true`, because such insecure HTTP listeners are most likely behind a reverse-proxy (that handles TLS).
  768. matrix_synapse_worker_listeners_http_main_x_forwarded: true
  769. # Specifies worker configuration that should be used when workers are enabled.
  770. #
  771. # The possible values (as seen in `matrix_synapse_workers_presets`) are:
  772. # - "little-federation-helper" - a very minimal worker configuration to improve federation performance
  773. # - "one-of-each" - one worker of each supported type + a generic worker
  774. # - "specialized-workers" - one worker of each supported type + specialized workers
  775. #
  776. # You can override `matrix_synapse_workers_presets` to define your own presets, which is ill-advised, because it's fragile.
  777. # To use a more custom configuration, start with one of these presets as a base and configure `matrix_synapse_workers_*_count` variables manually, to suit your liking.
  778. matrix_synapse_workers_preset: one-of-each
  779. matrix_synapse_workers_presets:
  780. little-federation-helper:
  781. room_workers_count: 0
  782. sync_workers_count: 0
  783. client_reader_workers_count: 0
  784. federation_reader_workers_count: 0
  785. generic_workers_count: 0
  786. pusher_workers_count: 0
  787. federation_sender_workers_count: 1
  788. media_repository_workers_count: 0
  789. appservice_workers_count: 0
  790. user_dir_workers_count: 0
  791. background_workers_count: 0
  792. stream_writer_events_stream_workers_count: 0
  793. stream_writer_typing_stream_workers_count: 0
  794. stream_writer_to_device_stream_workers_count: 0
  795. stream_writer_account_data_stream_workers_count: 0
  796. stream_writer_receipts_stream_workers_count: 0
  797. stream_writer_presence_stream_workers_count: 0
  798. stream_writer_push_rules_stream_workers_count: 0
  799. stream_writer_device_lists_stream_workers_count: 0
  800. # Keep disabled by default: MSC4306/4308 thread subscriptions are unstable
  801. # and disabled in upstream Synapse unless explicitly opted in.
  802. stream_writer_thread_subscriptions_stream_workers_count: 0
  803. one-of-each:
  804. room_workers_count: 0
  805. sync_workers_count: 0
  806. client_reader_workers_count: 0
  807. federation_reader_workers_count: 0
  808. generic_workers_count: 1
  809. pusher_workers_count: 1
  810. federation_sender_workers_count: 1
  811. media_repository_workers_count: 1
  812. appservice_workers_count: 1
  813. user_dir_workers_count: 1
  814. background_workers_count: 1
  815. stream_writer_events_stream_workers_count: 1
  816. stream_writer_typing_stream_workers_count: 1
  817. stream_writer_to_device_stream_workers_count: 1
  818. stream_writer_account_data_stream_workers_count: 1
  819. stream_writer_receipts_stream_workers_count: 1
  820. stream_writer_presence_stream_workers_count: 1
  821. stream_writer_push_rules_stream_workers_count: 1
  822. stream_writer_device_lists_stream_workers_count: 1
  823. # Keep disabled by default: MSC4306/4308 thread subscriptions are unstable
  824. # and disabled in upstream Synapse unless explicitly opted in.
  825. stream_writer_thread_subscriptions_stream_workers_count: 0
  826. specialized-workers:
  827. room_workers_count: 1
  828. sync_workers_count: 1
  829. client_reader_workers_count: 1
  830. federation_reader_workers_count: 1
  831. generic_workers_count: 0
  832. pusher_workers_count: 1
  833. federation_sender_workers_count: 1
  834. media_repository_workers_count: 1
  835. appservice_workers_count: 1
  836. user_dir_workers_count: 1
  837. background_workers_count: 1
  838. stream_writer_events_stream_workers_count: 1
  839. stream_writer_typing_stream_workers_count: 1
  840. stream_writer_to_device_stream_workers_count: 1
  841. stream_writer_account_data_stream_workers_count: 1
  842. stream_writer_receipts_stream_workers_count: 1
  843. stream_writer_presence_stream_workers_count: 1
  844. stream_writer_push_rules_stream_workers_count: 1
  845. stream_writer_device_lists_stream_workers_count: 1
  846. # Keep disabled by default: MSC4306/4308 thread subscriptions are unstable
  847. # and disabled in upstream Synapse unless explicitly opted in.
  848. stream_writer_thread_subscriptions_stream_workers_count: 0
  849. # Controls whether the matrix-synapse container exposes the various worker ports
  850. # (see `port` and `metrics_port` in `matrix_synapse_workers_enabled_list`) outside of the container.
  851. #
  852. # Takes an "<ip>" value (e.g. "127.0.0.1", "0.0.0.0", etc), or empty string to not expose.
  853. # It takes "*" to signify "bind on all interfaces" ("0.0.0.0" is IPv4-only).
  854. matrix_synapse_workers_container_host_bind_address: ''
  855. # matrix_synapse_worker_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to Synapse worker containers.
  856. # See `../templates/worker-labels.j2` for details.
  857. #
  858. # To inject your own other container labels, see `matrix_synapse_worker_container_labels_additional_labels`.
  859. matrix_synapse_worker_container_labels_traefik_enabled: true
  860. matrix_synapse_worker_container_labels_traefik_docker_network: "{{ matrix_synapse_container_labels_traefik_docker_network }}"
  861. matrix_synapse_worker_container_labels_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}"
  862. matrix_synapse_worker_container_labels_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  863. matrix_synapse_worker_container_labels_traefik_hostname: "{{ matrix_synapse_container_labels_traefik_hostname }}"
  864. # Controls whether labels will be added that expose metrics (see `matrix_synapse_metrics_proxying_enabled`)
  865. matrix_synapse_worker_container_labels_public_metrics_enabled: "{{ matrix_synapse_metrics_enabled and matrix_synapse_metrics_proxying_enabled }}"
  866. # The `__WORKER_ID__` placeholder will be replaced with the actual worker ID during label-file generation (see `../templates/worker-labels.j2`).
  867. matrix_synapse_worker_container_labels_public_metrics_traefik_path: "{{ matrix_synapse_metrics_proxying_path_prefix }}/worker/__WORKER_ID__"
  868. matrix_synapse_worker_container_labels_public_metrics_traefik_rule: "Host(`{{ matrix_synapse_metrics_proxying_hostname }}`) && Path(`{{ matrix_synapse_worker_container_labels_public_metrics_traefik_path }}`)"
  869. matrix_synapse_worker_container_labels_public_metrics_traefik_priority: 0
  870. matrix_synapse_worker_container_labels_public_metrics_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}"
  871. matrix_synapse_worker_container_labels_public_metrics_traefik_tls: "{{ matrix_synapse_container_labels_public_metrics_traefik_entrypoints != 'web' }}"
  872. matrix_synapse_worker_container_labels_public_metrics_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  873. matrix_synapse_worker_container_labels_public_metrics_middleware_basic_auth_enabled: "{{ matrix_synapse_container_labels_public_metrics_middleware_basic_auth_enabled }}"
  874. # See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
  875. matrix_synapse_worker_container_labels_public_metrics_middleware_basic_auth_users: "{{ matrix_synapse_container_labels_public_metrics_middleware_basic_auth_users }}"
  876. # matrix_synapse_worker_container_labels_additional_labels contains a multiline string with additional labels to add to the label files for Synapse worker containers.
  877. # See `../templates/labels.j2` for details.
  878. #
  879. # Example:
  880. # matrix_synapse_worker_container_labels_additional_labels: |
  881. # my.label=1
  882. # another.label="here"
  883. matrix_synapse_worker_container_labels_additional_labels: ''
  884. # Room workers
  885. matrix_synapse_workers_room_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['room_workers_count'] }}"
  886. matrix_synapse_workers_room_workers_port_range_start: 28111
  887. matrix_synapse_workers_room_workers_metrics_range_start: 29111
  888. matrix_synapse_workers_room_workers_container_arguments: []
  889. # Sync workers
  890. matrix_synapse_workers_sync_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['sync_workers_count'] }}"
  891. matrix_synapse_workers_sync_workers_port_range_start: 28211
  892. matrix_synapse_workers_sync_workers_metrics_range_start: 29211
  893. matrix_synapse_workers_sync_workers_container_arguments: []
  894. # Client reader workers
  895. matrix_synapse_workers_client_reader_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['client_reader_workers_count'] }}"
  896. matrix_synapse_workers_client_reader_workers_port_range_start: 28311
  897. matrix_synapse_workers_client_reader_workers_metrics_range_start: 29311
  898. matrix_synapse_workers_client_reader_workers_container_arguments: []
  899. # Federation reader workers
  900. matrix_synapse_workers_federation_reader_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['federation_reader_workers_count'] }}"
  901. matrix_synapse_workers_federation_reader_workers_port_range_start: 28411
  902. matrix_synapse_workers_federation_reader_workers_metrics_range_start: 29411
  903. matrix_synapse_workers_federation_reader_workers_container_arguments: []
  904. # Generic workers
  905. matrix_synapse_workers_generic_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['generic_workers_count'] }}"
  906. matrix_synapse_workers_generic_workers_port_range_start: 18111
  907. matrix_synapse_workers_generic_workers_metrics_range_start: 19111
  908. matrix_synapse_workers_generic_workers_container_arguments: []
  909. # matrix_synapse_workers_stream_writer_events_stream_workers_count controls how many stream writers that handle the `events` stream to spawn.
  910. # More than 1 worker is also supported of this type.
  911. matrix_synapse_workers_stream_writer_events_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_events_stream_workers_count'] }}"
  912. # matrix_synapse_workers_stream_writer_typing_stream_workers_count controls how many stream writers that handle the `typing` stream to spawn.
  913. # The count of these workers can only be 0 or 1.
  914. matrix_synapse_workers_stream_writer_typing_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_typing_stream_workers_count'] }}"
  915. # matrix_synapse_workers_stream_writer_to_device_stream_workers_count controls how many stream writers that handle the `to_device` stream to spawn.
  916. # The count of these workers can only be 0 or 1.
  917. matrix_synapse_workers_stream_writer_to_device_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_to_device_stream_workers_count'] }}"
  918. # matrix_synapse_workers_stream_writer_account_data_stream_workers_count controls how many stream writers that handle the `account_data` stream to spawn.
  919. # The count of these workers can only be 0 or 1.
  920. matrix_synapse_workers_stream_writer_account_data_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_account_data_stream_workers_count'] }}"
  921. # matrix_synapse_workers_stream_writer_receipts_stream_workers_count controls how many stream writers that handle the `receipts` stream to spawn.
  922. # The count of these workers can only be 0 or 1.
  923. matrix_synapse_workers_stream_writer_receipts_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_receipts_stream_workers_count'] }}"
  924. # matrix_synapse_workers_stream_writer_presence_stream_workers_count controls how many stream writers that handle the `presence` stream to spawn.
  925. # The count of these workers can only be 0 or 1.
  926. matrix_synapse_workers_stream_writer_presence_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_presence_stream_workers_count'] }}"
  927. # matrix_synapse_workers_stream_writer_push_rules_stream_workers_count controls how many stream writers that handle the `push_rules` stream to spawn.
  928. # The count of these workers can only be 0 or 1.
  929. matrix_synapse_workers_stream_writer_push_rules_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_push_rules_stream_workers_count'] }}"
  930. # matrix_synapse_workers_stream_writer_device_lists_stream_workers_count controls how many stream writers that handle the `device_lists` stream to spawn.
  931. # More than 1 worker is also supported of this type.
  932. matrix_synapse_workers_stream_writer_device_lists_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_device_lists_stream_workers_count'] }}"
  933. # matrix_synapse_workers_stream_writer_thread_subscriptions_stream_workers_count controls how many stream writers that handle the `thread_subscriptions` stream to spawn.
  934. # More than 1 worker is also supported of this type.
  935. matrix_synapse_workers_stream_writer_thread_subscriptions_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_thread_subscriptions_stream_workers_count'] }}"
  936. # A list of stream writer workers to enable. This list is built automatically based on other variables.
  937. # You're encouraged to enable/disable stream writer workers by setting `matrix_synapse_workers_stream_writer_*_stream_workers_count` variables, instead of adjusting this list manually.
  938. matrix_synapse_workers_stream_writers: |
  939. {{
  940. []
  941. +
  942. ([{'stream': 'events'}] * matrix_synapse_workers_stream_writer_events_stream_workers_count | int)
  943. +
  944. ([{'stream': 'typing'}] * matrix_synapse_workers_stream_writer_typing_stream_workers_count | int)
  945. +
  946. ([{'stream': 'to_device'}] * matrix_synapse_workers_stream_writer_to_device_stream_workers_count | int)
  947. +
  948. ([{'stream': 'account_data'}] * matrix_synapse_workers_stream_writer_account_data_stream_workers_count | int)
  949. +
  950. ([{'stream': 'receipts'}] * matrix_synapse_workers_stream_writer_receipts_stream_workers_count | int)
  951. +
  952. ([{'stream': 'presence'}] * matrix_synapse_workers_stream_writer_presence_stream_workers_count | int)
  953. +
  954. ([{'stream': 'push_rules'}] * matrix_synapse_workers_stream_writer_push_rules_stream_workers_count | int)
  955. +
  956. ([{'stream': 'device_lists'}] * matrix_synapse_workers_stream_writer_device_lists_stream_workers_count | int)
  957. +
  958. ([{'stream': 'thread_subscriptions'}] * matrix_synapse_workers_stream_writer_thread_subscriptions_stream_workers_count | int)
  959. }}
  960. matrix_synapse_workers_stream_writers_container_arguments: []
  961. # matrix_synapse_stream_writers populates the `stream_writers` Synapse configuration used when Synapse workers are in use (`matrix_synapse_workers_enabled`).
  962. # What you see below is an initial default value which will be adjusted at runtime based on the value of `matrix_synapse_workers_stream_writers`.
  963. # Adjusting this value manually is generally not necessary.
  964. #
  965. # It's tempting to initialize this like this:
  966. # matrix_synapse_stream_writers:
  967. # - typing: []
  968. # - events: []
  969. # - to_device: []
  970. # - account_data: []
  971. # - receipts: []
  972. # - presence: []
  973. # .. but Synapse does not like empty lists (see https://github.com/matrix-org/synapse/issues/13804)
  974. matrix_synapse_stream_writers: {}
  975. # `matrix_synapse_workers_stream_writer_workers_` variables control the port numbers of various stream writer workers
  976. # defined in `matrix_synapse_workers_stream_writers`.
  977. # It should be noted that not all of the background worker types will need to expose HTTP services, etc.
  978. matrix_synapse_workers_stream_writer_workers_http_port_range_start: 20011
  979. matrix_synapse_workers_stream_writer_workers_replication_port_range_start: 25011
  980. matrix_synapse_workers_stream_writer_workers_metrics_range_start: 19211
  981. # matrix_synapse_workers_pusher_workers_count controls the number of pusher workers (workers who push out notifications) to spawn.
  982. # See https://matrix-org.github.io/synapse/latest/workers.html#synapseapppusher
  983. matrix_synapse_workers_pusher_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['pusher_workers_count'] }}"
  984. matrix_synapse_workers_pusher_workers_metrics_range_start: 19200
  985. matrix_synapse_workers_pusher_workers_container_arguments: []
  986. # matrix_synapse_federation_pusher_instances populates the `pusher_instances` Synapse configuration used when Synapse workers are in use (`matrix_synapse_workers_enabled`).
  987. # What you see below is an initial default value which will be adjusted at runtime based on the value of `matrix_synapse_workers_pusher_workers_count` or `matrix_synapse_workers_enabled_list`.
  988. # Adjusting this value manually is generally not necessary.
  989. matrix_synapse_federation_pusher_instances: []
  990. # matrix_synapse_workers_federation_sender_workers_count controls the number of federation sender workers to spawn.
  991. # See https://matrix-org.github.io/synapse/latest/workers.html#synapseappfederation_sender
  992. matrix_synapse_workers_federation_sender_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['federation_sender_workers_count'] }}"
  993. matrix_synapse_workers_federation_sender_workers_metrics_range_start: 19400
  994. matrix_synapse_workers_federation_sender_workers_container_arguments: []
  995. # matrix_synapse_federation_sender_instances populates the `federation_sender_instances` Synapse configuration used when Synapse workers are in use (`matrix_synapse_workers_enabled`).
  996. # What you see below is an initial default value which will be adjusted at runtime based on the value of `matrix_synapse_workers_federation_sender_workers_count` or `matrix_synapse_workers_enabled_list`.
  997. # Adjusting this value manually is generally not necessary.
  998. matrix_synapse_federation_sender_instances: []
  999. matrix_synapse_workers_media_repository_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['media_repository_workers_count'] if not matrix_synapse_ext_media_repo_enabled else 0 }}"
  1000. matrix_synapse_workers_media_repository_workers_port_range_start: 18551
  1001. matrix_synapse_workers_media_repository_workers_metrics_range_start: 19551
  1002. matrix_synapse_workers_media_repository_workers_container_arguments: []
  1003. # matrix_synapse_enable_media_repo controls if the main Synapse process should serve media repository endpoints or if it should be left to media_repository workers (see `matrix_synapse_workers_media_repository_workers_count`).
  1004. # This is enabled if workers are disabled, or if they are enabled, but there are no media repository workers.
  1005. # Adjusting this value manually is generally not necessary.
  1006. matrix_synapse_enable_media_repo: "{{ not matrix_synapse_ext_media_repo_enabled and (not matrix_synapse_workers_enabled or (matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'media_repository') | list | length == 0)) }}"
  1007. # matrix_synapse_enable_local_media_storage controls whether the local on-disk media storage provider is enabled in Synapse.
  1008. # When disabled, media is stored only in configured `media_storage_providers` and temporary files are used for processing (no local caching).
  1009. # Warning: If this option is set to false and no `media_storage_providers` are configured, all media requests will return 404 errors as there will be no storage backend available.
  1010. matrix_synapse_enable_local_media_storage: true
  1011. # matrix_synapse_enable_authenticated_media controls if authenticated media is enabled.
  1012. # If enabled all "old" media remains accessible over the legacy endpoints but new media is blocked.
  1013. # while this option is enabled all media access and downloads have to be done via authenticated endpoints.
  1014. matrix_synapse_enable_authenticated_media: true
  1015. # matrix_synapse_media_instance_running_background_jobs populates the `media_instance_running_background_jobs` Synapse configuration used when Synapse workers are in use (`matrix_synapse_workers_enabled`).
  1016. # `media_instance_running_background_jobs` is meant to point to a single media-repository worker, which is dedicated to running background tasks that maintain the media repository.
  1017. # Multiple `media_repository` workers may be enabled. We always pick the first one as the background tasks worker.
  1018. matrix_synapse_media_instance_running_background_jobs: "{{ (matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'media_repository') | list)[0].name if (matrix_synapse_workers_enabled and matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'media_repository') | list | length > 0) else '' }}"
  1019. # matrix_synapse_workers_appservice_workers_count can only be 0 or 1. More instances are not supported.
  1020. # appservice workers were deprecated since Synapse v1.59 (see: https://github.com/element-hq/synapse/blob/v1.59.0/docs/upgrade.md#deprecation-of-the-synapseappappservice-and-synapseappuser_dir-worker-application-types).
  1021. # Our implementation uses generic worker services and assigns them to perform appservice work using the `notify_appservices_from_worker` Synapse option.
  1022. matrix_synapse_workers_appservice_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['appservice_workers_count'] }}"
  1023. matrix_synapse_workers_appservice_workers_metrics_range_start: 19300
  1024. matrix_synapse_workers_appservice_workers_container_arguments: []
  1025. # matrix_synapse_notify_appservices_from_worker populates the `notify_appservices_from_worker` Synapse configuration used when Synapse workers are in use (`matrix_synapse_workers_enabled`).
  1026. # `notify_appservices_from_worker` is meant to point to a worker, which is dedicated to sending output traffic to Application Services.
  1027. matrix_synapse_notify_appservices_from_worker: "{{ (matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'appservice') | list)[0].name if (matrix_synapse_workers_enabled and matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'appservice') | list | length > 0) else '' }}"
  1028. # matrix_synapse_workers_user_dir_workers_count can only be 0 or 1. More instances are not supported.
  1029. # user_dir workers were deprecated since Synapse v1.59 (see: https://github.com/element-hq/synapse/blob/v1.59.0/docs/upgrade.md#deprecation-of-the-synapseappappservice-and-synapseappuser_dir-worker-application-types).
  1030. # Our implementation uses generic worker services and assigns them to perform appservice work using the `update_user_directory_from_worker` Synapse option.
  1031. matrix_synapse_workers_user_dir_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['user_dir_workers_count'] }}"
  1032. matrix_synapse_workers_user_dir_workers_port_range_start: 18661
  1033. matrix_synapse_workers_user_dir_workers_metrics_range_start: 19661
  1034. matrix_synapse_workers_user_dir_workers_container_arguments: []
  1035. # matrix_synapse_update_user_directory_from_worker populates the `update_user_directory_from_worker` Synapse configuration used when Synapse workers are in use (`matrix_synapse_workers_enabled`).
  1036. # `update_user_directory_from_worker` is meant to point to a worker, which is dedicated to updating the user directory and servicing some user directory URL endpoints (`matrix_synapse_workers_user_dir_worker_client_server_endpoints`).
  1037. matrix_synapse_update_user_directory_from_worker: "{{ (matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'user_dir') | list)[0].name if (matrix_synapse_workers_enabled and matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'user_dir') | list | length > 0) else '' }}"
  1038. # matrix_synapse_workers_background_workers_count can only be 0 or 1. More instances are not supported.
  1039. # Our implementation uses a generic worker and assigns Synapse to perform background work on this worker using the `run_background_tasks_on` Synapse option.
  1040. matrix_synapse_workers_background_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['background_workers_count'] }}"
  1041. matrix_synapse_workers_background_workers_metrics_range_start: 19700
  1042. matrix_synapse_workers_background_workers_container_arguments: []
  1043. # matrix_synapse_run_background_tasks_on populates the `run_background_tasks_on` Synapse configuration used when Synapse workers are in use (`matrix_synapse_workers_enabled`).
  1044. # `run_background_tasks_on` is meant to point to a worker, which is dedicated to processing background tasks.
  1045. matrix_synapse_run_background_tasks_on: "{{ (matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'background') | list)[0].name if (matrix_synapse_workers_enabled and matrix_synapse_workers_enabled_list | selectattr('type', 'equalto', 'background') | list | length > 0) else '' }}"
  1046. # Default list of workers to spawn.
  1047. #
  1048. # Unless you populate this manually, this list is dynamically generated
  1049. # based on other variables above:
  1050. # - `matrix_synapse_workers_*_workers_count`
  1051. # - `matrix_synapse_workers_*_workers_port_range_start`
  1052. # - `matrix_synapse_workers_*_workers_port_metrics_range_start`
  1053. #
  1054. # We advise that you use those variables and let this list be populated dynamically.
  1055. # Doing that is simpler and also protects you from shooting yourself in the foot,
  1056. # as certain workers can only be spawned just once.
  1057. #
  1058. # Each worker instance in the list defines the following fields:
  1059. # - `id` - a string that uniquely identifies the worker
  1060. # - `name` - a string that will be used as the container and systemd service name
  1061. # - `type` - the type of worker (`generic_worker`, `stream_writer`, `pusher`, etc.)
  1062. # - `app` - the Synapse app (https://matrix-org.github.io/synapse/latest/workers.html#available-worker-applications) that powers this worker (`generic_worker`, `federation_sender`, etc.).
  1063. # The `app` usually matches the `type`, but not always. For example, `type = stream_writer` workers are served by the `generic_worker` type.
  1064. # - `port` - an HTTP port where the worker listens for requests (can be `0` for workers that don't do HTTP request processing)
  1065. # - `metrics_port` - an HTTP port where the worker exports Prometheus metrics
  1066. # - `replication_port` - an HTTP port where the worker serves `replication` endpoints (used by stream writers, etc.)
  1067. # - `webserving` - tells whether this type of worker serves web (client or federation) requests, so that it can be injected as a dependency to the reverse-proxy
  1068. #
  1069. # Example of what this needs to look like, if you're defining it manually:
  1070. # matrix_synapse_workers_enabled_list:
  1071. # - { 'id': 'generic-worker-0', 'name': 'matrix-synapse-worker-generic-0', 'type': 'generic_worker', 'app': 'generic_worker', 'port': 18111, 'metrics_port': 19111, 'webserving': true }
  1072. # - { 'id': 'generic-worker-1', 'name': 'matrix-synapse-worker-generic-1', 'type': 'generic_worker', 'app': 'generic_worker', 'port': 18112, 'metrics_port': 19112, 'webserving': true }
  1073. # - { 'id': 'generic-worker-2', 'name': 'matrix-synapse-worker-generic-2', 'type': 'generic_worker', 'app': 'generic_worker', 'port': 18113, 'metrics_port': 19113, 'webserving': true }
  1074. # - { 'id': 'generic-worker-3', 'name': 'matrix-synapse-worker-generic-3', 'type': 'generic_worker', 'app': 'generic_worker', 'port': 18114, 'metrics_port': 19114, 'webserving': true }
  1075. # - { 'id': 'generic-worker-4', 'name': 'matrix-synapse-worker-generic-4', 'type': 'generic_worker', 'app': 'generic_worker', 'port': 18115, 'metrics_port': 19115, 'webserving': true }
  1076. # - { 'id': 'generic-worker-5', 'name': 'matrix-synapse-worker-generic-5', 'type': 'generic_worker', 'app': 'generic_worker', 'port': 18116, 'metrics_port': 19116, 'webserving': true }
  1077. # - { 'id': 'stream-writer-0-events', 'name': 'matrix-synapse-worker-stream-writer-0-events', 'type': 'stream_writer', 'app': 'generic_worker', 'stream_writer_stream': 'events', 'port': 0, 'replication_port': 25011, metrics_port: 19111, 'webserving': false }
  1078. # - { 'id': 'stream-writer-1-typing', 'name': 'matrix-synapse-worker-stream-writer-1-typing', 'type': 'stream_writer', 'app': 'generic_worker', 'stream_writer_stream': 'typing', 'port': 20012, 'replication_port': 25012, metrics_port: 19112, 'webserving': true }
  1079. # - { 'id': 'pusher-0', 'name': 'matrix-synapse-worker-pusher-0', 'type': 'pusher', 'app': 'pusher', 'port': 0, 'metrics_port': 19200, 'webserving': false }
  1080. # - { 'id': 'appservice-0', 'name': 'matrix-synapse-worker-appservice-0', 'type': 'appservice', 'port': 0, 'metrics_port': 19300, 'webserving': false }
  1081. # - { 'id': 'federation-sender-0', 'name': 'matrix-synapse-worker-federation-sender-0', 'type': 'federation_sender', 'port': 0, 'metrics_port': 19400, 'webserving': false }
  1082. # - { 'id': 'media-repository-0', 'name': 'matrix-synapse-worker-media-repository-0', 'type': 'media_repository', 'port': 18551, 'metrics_port': 19551, 'webserving': true }
  1083. matrix_synapse_workers_enabled_list: []
  1084. # matrix_synapse_instance_map holds the instance map used for mapping worker names (for the main process and certain generic workers only!) to where they live (host, port which handles replication traffic).
  1085. # This map starts off being populated with the Synapse main (master) process,
  1086. # but will be populated with workers automatically during runtime, based on `matrix_synapse_workers_enabled_list`.
  1087. matrix_synapse_instance_map: |
  1088. {{
  1089. {
  1090. 'main': {
  1091. 'host': 'matrix-synapse',
  1092. 'port': matrix_synapse_replication_http_port,
  1093. },
  1094. } if matrix_synapse_workers_enabled else {}
  1095. }}
  1096. # Redis information
  1097. matrix_synapse_redis_enabled: false
  1098. matrix_synapse_redis_password: ""
  1099. matrix_synapse_redis_dbid: 0
  1100. matrix_synapse_redis_use_tls: false
  1101. # Connection option 1: TCP
  1102. matrix_synapse_redis_host: ""
  1103. matrix_synapse_redis_port: 6379
  1104. # Connection option 2: Unix socket (takes precedence over TCP if `matrix_synapse_redis_path` is set)
  1105. # disabled by default
  1106. matrix_synapse_redis_path_enabled: false
  1107. # the path to the redis socket's parent dir (/tmp, not /tmp/redis.sock file) inside the container, Synapse default's is "/tmp/redis.sock"
  1108. matrix_synapse_redis_path: "/tmp"
  1109. # the filename of the redis socket, inside the container, Synapse default's is "redis.sock"
  1110. matrix_synapse_redis_path_socket: "/redis.sock"
  1111. # the path to the redis socket on the host, e.g., "/matrix/valkey/run" (parent dir, not the socket file itself).
  1112. matrix_synapse_redis_path_host: ""
  1113. # Controls whether Synapse starts a replication listener necessary for workers.
  1114. #
  1115. # If Redis is available, we prefer to use that, instead of talking over Synapse's custom replication protocol.
  1116. #
  1117. # matrix_synapse_replication_listener_enabled: "{{ matrix_synapse_workers_enabled and matrix_synapse_redis_enabled }}"
  1118. # We force-enable this listener for now until we debug why communication via Redis fails.
  1119. matrix_synapse_replication_listener_enabled: true
  1120. # Port used for communication between main synapse process and workers.
  1121. # Only gets used if `matrix_synapse_replication_listener_enabled: true`
  1122. matrix_synapse_replication_http_port: 9093
  1123. # Send ERROR logs to sentry.io for easier tracking
  1124. # To set this up: go to sentry.io, create a python project, and set
  1125. # matrix_synapse_sentry_dsn to the URL it gives you.
  1126. # See https://github.com/matrix-org/synapse/issues/4632 for important privacy concerns
  1127. matrix_synapse_sentry_dsn: ""
  1128. # Postgres database information
  1129. matrix_synapse_database_txn_limit: 0
  1130. #
  1131. # Use this hostname for TCP-based Postgres connections.
  1132. # When `matrix_synapse_database_socket_enabled` is true, this is ignored and
  1133. # `matrix_synapse_database_socket_path` is used instead.
  1134. matrix_synapse_database_host: ''
  1135. matrix_synapse_database_port: 5432
  1136. matrix_synapse_database_cp_min: 5
  1137. matrix_synapse_database_cp_max: 10
  1138. matrix_synapse_database_user: "synapse"
  1139. matrix_synapse_database_password: ""
  1140. matrix_synapse_database_database: "synapse"
  1141. # Connection option 2: Unix socket (takes precedence over TCP if enabled)
  1142. # disabled by default
  1143. matrix_synapse_database_socket_enabled: false
  1144. # the path to the postgres socket's parent dir inside the container (not the socket file itself).
  1145. matrix_synapse_database_socket_path: "/tmp/postgres"
  1146. # the path to the postgres socket on the host, e.g., "/matrix/postgres/run" (parent dir, not the socket file itself).
  1147. matrix_synapse_database_socket_path_host: ""
  1148. matrix_synapse_turn_uris: []
  1149. matrix_synapse_turn_shared_secret: ""
  1150. matrix_synapse_turn_username: ""
  1151. matrix_synapse_turn_password: ""
  1152. matrix_synapse_turn_allow_guests: false
  1153. matrix_synapse_email_enabled: false
  1154. matrix_synapse_email_smtp_host: ""
  1155. matrix_synapse_email_smtp_port: 587
  1156. matrix_synapse_email_smtp_user: ""
  1157. matrix_synapse_email_smtp_pass: ""
  1158. matrix_synapse_email_smtp_require_transport_security: false
  1159. matrix_synapse_email_notif_from: "Matrix <matrix@{{ matrix_domain }}>"
  1160. matrix_synapse_email_app_name: Matrix
  1161. matrix_synapse_email_enable_notifs: true
  1162. matrix_synapse_email_notif_for_new_users: true
  1163. matrix_synapse_email_client_base_url: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}://{{ matrix_server_fqn_element }}"
  1164. matrix_synapse_email_invite_client_location: "https://app.element.io"
  1165. # Controls whether to enable the "send typing, presence and receipts to appservices" experimental feature.
  1166. #
  1167. # See:
  1168. # - https://github.com/matrix-org/matrix-spec-proposals/pull/2409
  1169. # - https://matrix-org.github.io/matrix-hookshot/latest/advanced/encryption.html#running-with-synapse
  1170. matrix_synapse_experimental_features_msc2409_to_device_messages_enabled: false
  1171. # Controls whether to enable the "transaction extensions" for encrypted appservices experimental feature.
  1172. #
  1173. # See:
  1174. # - https://github.com/matrix-org/matrix-spec-proposals/pull/3202
  1175. # - https://matrix-org.github.io/matrix-hookshot/latest/advanced/encryption.html#running-with-synapse
  1176. matrix_synapse_experimental_features_msc3202_transaction_extensions_enabled: false
  1177. ################################################################################
  1178. #
  1179. # Next-generation auth for Matrix, based on OAuth 2.0/OIDC
  1180. #
  1181. ################################################################################
  1182. # Controls whether to enable "Matrix Authentication Service" integration ("Next-generation auth for Matrix, based on OAuth 2.0/OIDC").
  1183. # See:
  1184. # - https://github.com/element-hq/matrix-authentication-service
  1185. # - https://matrix.org/blog/2023/09/better-auth/
  1186. # - https://github.com/matrix-org/matrix-spec-proposals/pull/3861
  1187. matrix_synapse_matrix_authentication_service_enabled: false
  1188. # Specifies the base URL where the Matrix Authentication Service is running.
  1189. matrix_synapse_matrix_authentication_service_endpoint: ""
  1190. # Specifies the shared secret used to authenticate Matrix Authentication Service requests.
  1191. # Must be the same as `matrix.secret` in the Matrix Authentication Service configuration.
  1192. # See https://element-hq.github.io/matrix-authentication-service/reference/configuration.html#matrix
  1193. matrix_synapse_matrix_authentication_service_secret: ""
  1194. # Controls whether to enable the "QR code login" experimental feature.
  1195. # Enabling this requires that Matrix Authentication Service integration (see `matrix_synapse_matrix_authentication_service_enabled`) is also enabled.
  1196. matrix_synapse_experimental_features_msc4108_enabled: false
  1197. ################################################################################
  1198. #
  1199. # /Next-generation auth for Matrix, based on OAuth 2.0/OIDC
  1200. #
  1201. ################################################################################
  1202. # Controls whether to enable the "room summary API" experimental feature.
  1203. # See https://github.com/matrix-org/matrix-spec-proposals/pull/3266
  1204. # Despite being experimental, this feature is mandatory for the next-generation Element X clients, which is why it is enabled by default:
  1205. # https://github.com/element-hq/element-x-ios/issues/3713#issuecomment-2620958291
  1206. # If you're worried about the privacy implications of this unauthenticated API, see:
  1207. # https://github.com/deepbluev7/matrix-doc/blob/room-summaries/proposals/3266-room-summary.md#client-server-api
  1208. # Set this to false if you still want to disable to API for some reason. Note that doing so breaks Element X compatibility though.
  1209. matrix_synapse_experimental_features_msc3266_enabled: true
  1210. # Controls whether to enable the "Delayed Events" experimental feature.
  1211. # Delayed events are required for proper call (Element Call) participation signalling.
  1212. # If disabled it is very likely that you end up with stuck calls in Matrix rooms.
  1213. #
  1214. # Related to:
  1215. # - `matrix_synapse_max_event_delay_duration`
  1216. # - `matrix_synapse_rc_delayed_event_mgmt`
  1217. #
  1218. # See https://github.com/matrix-org/matrix-spec-proposals/pull/4140
  1219. matrix_synapse_experimental_features_msc4140_enabled: false
  1220. # Controls the maximum allowed duration by which sent events can be delayed, as per MSC4140.
  1221. #
  1222. # See `matrix_synapse_experimental_features_msc4140_enabled`.
  1223. matrix_synapse_max_event_delay_duration: 24h
  1224. # Controls whether to enable the MSC4222 experimental feature (adding `state_after` to sync v2).
  1225. #
  1226. # Allow clients to opt-in to a change of the sync v2 API that allows them to correctly track the state of the room.
  1227. # This is required by Element Call to track room state reliably.
  1228. #
  1229. # See https://github.com/matrix-org/matrix-spec-proposals/pull/4222
  1230. matrix_synapse_experimental_features_msc4222_enabled: false
  1231. # Controls whether to enable the MSC4306 experimental feature ("thread subscriptions").
  1232. #
  1233. # In current Synapse, this also enables the MSC4308 thread-subscriptions extension
  1234. # to Sliding Sync under the same upstream feature flag.
  1235. #
  1236. # See:
  1237. # - https://github.com/matrix-org/matrix-spec-proposals/pull/4306
  1238. # - https://github.com/matrix-org/matrix-spec-proposals/pull/4308
  1239. matrix_synapse_experimental_features_msc4306_enabled: false
  1240. # Controls whether to enable the MSC4354 experimental feature (sticky events).
  1241. #
  1242. # This is implemented since Synapse v1.148.0 and can be used by element-call v0.17.0+
  1243. #
  1244. # See https://github.com/matrix-org/matrix-spec-proposals/pull/4354
  1245. matrix_synapse_experimental_features_msc4354_enabled: false
  1246. # Enable this to activate the REST auth password provider module.
  1247. # See: https://github.com/ma1uta/matrix-synapse-rest-password-provider
  1248. matrix_synapse_ext_password_provider_rest_auth_enabled: false
  1249. matrix_synapse_ext_password_provider_rest_auth_download_url: "https://raw.githubusercontent.com/ma1uta/matrix-synapse-rest-password-provider/ed377fb70513c2e51b42055eb364195af1ccaf33/rest_auth_provider.py"
  1250. matrix_synapse_ext_password_provider_rest_auth_endpoint: ""
  1251. matrix_synapse_ext_password_provider_rest_auth_registration_enforce_lowercase: false
  1252. matrix_synapse_ext_password_provider_rest_auth_registration_profile_name_autofill: true
  1253. matrix_synapse_ext_password_provider_rest_auth_login_profile_name_autofill: false
  1254. # Enable this to activate the Shared Secret Auth password provider module.
  1255. # See: https://github.com/devture/matrix-synapse-shared-secret-auth
  1256. matrix_synapse_ext_password_provider_shared_secret_auth_enabled: false
  1257. matrix_synapse_ext_password_provider_shared_secret_auth_download_url: "https://raw.githubusercontent.com/devture/matrix-synapse-shared-secret-auth/2.0.3/shared_secret_authenticator.py"
  1258. matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret: ""
  1259. matrix_synapse_ext_password_provider_shared_secret_auth_m_login_password_support_enabled: true
  1260. matrix_synapse_ext_password_provider_shared_secret_auth_com_devture_shared_secret_auth_support_enabled: true
  1261. matrix_synapse_ext_password_provider_shared_secret_config: "{{ matrix_synapse_ext_password_provider_shared_secret_config_yaml | from_yaml }}"
  1262. matrix_synapse_ext_password_provider_shared_secret_config_yaml: |
  1263. shared_secret: {{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret | string | to_json }}
  1264. m_login_password_support_enabled: {{ matrix_synapse_ext_password_provider_shared_secret_auth_m_login_password_support_enabled | to_json }}
  1265. com_devture_shared_secret_auth_support_enabled: {{ matrix_synapse_ext_password_provider_shared_secret_auth_com_devture_shared_secret_auth_support_enabled | to_json }}
  1266. # Enable this to activate LDAP password provider
  1267. matrix_synapse_ext_password_provider_ldap_enabled: false
  1268. matrix_synapse_ext_password_provider_ldap_uri: "ldap://ldap.example.com:389"
  1269. matrix_synapse_ext_password_provider_ldap_start_tls: true
  1270. matrix_synapse_ext_password_provider_ldap_mode: "search"
  1271. matrix_synapse_ext_password_provider_ldap_base: ""
  1272. matrix_synapse_ext_password_provider_ldap_attributes_uid: "uid"
  1273. matrix_synapse_ext_password_provider_ldap_attributes_mail: "mail"
  1274. matrix_synapse_ext_password_provider_ldap_attributes_name: "cn"
  1275. matrix_synapse_ext_password_provider_ldap_bind_dn: ""
  1276. matrix_synapse_ext_password_provider_ldap_bind_password: ""
  1277. matrix_synapse_ext_password_provider_ldap_filter: ""
  1278. matrix_synapse_ext_password_provider_ldap_active_directory: false
  1279. matrix_synapse_ext_password_provider_ldap_default_domain: ""
  1280. matrix_synapse_ext_password_provider_ldap_tls_options_validate: true
  1281. matrix_synapse_ext_password_provider_ldap_tls_options_ca_certs_file: ""
  1282. # Enable this to activate the Synapse Antispam spam-checker module.
  1283. # See: https://github.com/t2bot/synapse-simple-antispam
  1284. matrix_synapse_ext_spam_checker_synapse_simple_antispam_enabled: false
  1285. matrix_synapse_ext_spam_checker_synapse_simple_antispam_git_repository_url: "https://github.com/t2bot/synapse-simple-antispam"
  1286. matrix_synapse_ext_spam_checker_synapse_simple_antispam_git_version: "5ab711971e3a4541a7a40310ff85e17f8262cc05"
  1287. matrix_synapse_ext_spam_checker_synapse_simple_antispam_config_blocked_homeservers: []
  1288. # Enable this to activate the Mjolnir Antispam spam-checker module.
  1289. # See: https://github.com/matrix-org/mjolnir#synapse-module
  1290. matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled: false
  1291. matrix_synapse_ext_spam_checker_mjolnir_antispam_git_repository_url: "https://github.com/matrix-org/mjolnir"
  1292. # renovate: datasource=docker depName=matrixdotorg/mjolnir
  1293. matrix_synapse_ext_spam_checker_mjolnir_antispam_git_version: "v1.12.1"
  1294. matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_invites: true
  1295. # Flag messages sent by servers/users in the ban lists as spam. Currently
  1296. # this means that spammy messages will appear as empty to users. Default
  1297. # false.
  1298. matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_messages: false
  1299. # Remove users from the user directory search by filtering Matrix IDs and
  1300. # display names by the entries in the user ban list. Default false.
  1301. matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_usernames: false
  1302. # The room IDs of the ban lists to honour. Unlike other parts of Mjolnir,
  1303. # this list cannot be room aliases or permalinks. This server is expected
  1304. # to already be joined to the room - Mjolnir will not automatically join
  1305. # these rooms.
  1306. # ["!qporfwt:example.com"]
  1307. matrix_synapse_ext_spam_checker_mjolnir_antispam_config_ban_lists: []
  1308. # A dictionary with various fields controlling max length.
  1309. # See https://github.com/matrix-org/mjolnir/blob/main/docs/synapse_module.md for details.
  1310. matrix_synapse_ext_spam_checker_mjolnir_antispam_config_message_max_length: {}
  1311. # Actual configuration passed to the mjolnir-antispam Synapse module
  1312. matrix_synapse_ext_spam_checker_mjolnir_antispam_config:
  1313. block_invites: "{{ matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_invites }}"
  1314. block_messages: "{{ matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_messages }}"
  1315. block_usernames: "{{ matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_usernames }}"
  1316. ban_lists: "{{ matrix_synapse_ext_spam_checker_mjolnir_antispam_config_ban_lists }}"
  1317. message_max_length: "{{ matrix_synapse_ext_spam_checker_mjolnir_antispam_config_message_max_length }}"
  1318. # Enable this to activate the synapse-http-antispam module.
  1319. # See: github.com/maunium/synapse-http-antispam
  1320. matrix_synapse_ext_synapse_http_antispam_enabled: false
  1321. matrix_synapse_ext_synapse_http_antispam_git_repository_url: "https://github.com/maunium/synapse-http-antispam"
  1322. # renovate: datasource=github-releases depName=maunium/synapse-http-antispam
  1323. matrix_synapse_ext_synapse_http_antispam_git_version: "v0.5.0"
  1324. # Where Synapse can locate the consumer of the antispam API. Currently
  1325. # Draupnir is the only consumer of this API that is playbook supported.
  1326. # But https://github.com/maunium/meowlnir also supports the API.
  1327. matrix_synapse_ext_synapse_http_antispam_config_base_url: ''
  1328. # This is a shared secret that is established between the consumer and the
  1329. # homeserver a lot like how AS authentication is done. This is fully managed
  1330. # the same way AS authentication is by the playbook.
  1331. matrix_synapse_ext_synapse_http_antispam_config_authorization: ''
  1332. # This controls if the module will ping the consumer or not for ease of troubleshooting. This defaults
  1333. # to enabled to help assure users that the connection is working.
  1334. # Due to that its only a single log line per worker per startup this default is deemed acceptable.
  1335. matrix_synapse_ext_synapse_http_antispam_config_do_ping: true
  1336. # This controls what callbacks are activated. This list is fully dependent on what consumer is in play.
  1337. # And what capabilities said consumer should or shouldn't have. There are also performance implications
  1338. # to these choices.
  1339. matrix_synapse_ext_synapse_http_antispam_config_enabled_callbacks: []
  1340. # Controls if a loss of connectivity to the consumer results in fail open or closed.
  1341. # As in if failure results in events getting flagged automatically as spam or not.
  1342. matrix_synapse_ext_synapse_http_antispam_config_fail_open: {}
  1343. # Controls if the checking is blocking or not. This allows the homeserver to skip waiting for a consumer response.
  1344. matrix_synapse_ext_synapse_http_antispam_config_async: {}
  1345. # Actual configuration passed to the synapse-http-antispam module
  1346. matrix_synapse_ext_synapse_http_antispam_config: "{{ matrix_synapse_ext_synapse_http_antispam_config_yaml | from_yaml }}"
  1347. matrix_synapse_ext_synapse_http_antispam_config_yaml: |
  1348. base_url: {{ matrix_synapse_ext_synapse_http_antispam_config_base_url | to_json }}
  1349. authorization: {{ matrix_synapse_ext_synapse_http_antispam_config_authorization | to_json }}
  1350. do_ping: {{ matrix_synapse_ext_synapse_http_antispam_config_do_ping | to_json }}
  1351. enabled_callbacks: {{ matrix_synapse_ext_synapse_http_antispam_config_enabled_callbacks | to_json }}
  1352. fail_open: {{ matrix_synapse_ext_synapse_http_antispam_config_fail_open | to_json }}
  1353. async: {{ matrix_synapse_ext_synapse_http_antispam_config_async | to_json }}
  1354. # Enable this to activate the E2EE disabling Synapse module.
  1355. # See: https://github.com/digitalentity/matrix_encryption_disabler
  1356. matrix_synapse_ext_encryption_disabler_enabled: false
  1357. matrix_synapse_ext_encryption_disabler_download_url: "https://raw.githubusercontent.com/digitalentity/matrix_encryption_disabler/cdc37a07441acb7c2a3288bcb29b376658d5e766/matrix_e2ee_filter.py"
  1358. # A list of server domain names for which to deny encryption if the event sender's domain matches the domain in the list.
  1359. # By default, with the configuration below, we prevent all homeserver users from initiating encryption in ANY room.
  1360. matrix_synapse_ext_encryption_disabler_deny_encryption_for_users_of: ["{{ matrix_domain }}"]
  1361. # A list of server domain names for which to deny encryption if the destination room ID's domain matches the domain in the list.
  1362. # By default, with the configuration below, we prevent locally-created encryption events by ANY user encrypt rooms on the homeserver.
  1363. # Note: foreign users with enough room privileges will still be able to send an encryption event to your rooms and encrypt them.
  1364. matrix_synapse_ext_encryption_disabler_deny_encryption_for_rooms_of: ["{{ matrix_domain }}"]
  1365. # Specifies whether the power levels event (setting) provided during room creation should be patched.
  1366. # This makes it impossible for anybody (locally or over federation) from enabling room encryption
  1367. # for the lifetime of rooms created while this setting is enabled (irreversible).
  1368. # Enabling this may have incompatibility consequences with servers / clients.
  1369. # Familiarize yourself with the caveats upstream: https://github.com/digitalentity/matrix_encryption_disabler
  1370. matrix_synapse_ext_encryption_disabler_patch_power_levels: false
  1371. matrix_synapse_ext_encryption_config: "{{ matrix_synapse_ext_encryption_config_yaml | from_yaml }}"
  1372. matrix_synapse_ext_encryption_config_yaml: |
  1373. deny_encryption_for_users_of: {{ matrix_synapse_ext_encryption_disabler_deny_encryption_for_users_of | to_json }}
  1374. deny_encryption_for_rooms_of: {{ matrix_synapse_ext_encryption_disabler_deny_encryption_for_rooms_of | to_json }}
  1375. patch_power_levels: {{ matrix_synapse_ext_encryption_disabler_patch_power_levels | to_json }}
  1376. # matrix_synapse_ext_synapse_s3_storage_provider_enabled controls whether to enable https://github.com/matrix-org/synapse-s3-storage-provider
  1377. # Installing it requires building a customized Docker image for Synapse (see `matrix_synapse_container_image_customizations_enabled`).
  1378. # Enabling this will enable customizations and inject the appropriate Dockerfile clauses for installing synapse-s3-storage-provider.
  1379. matrix_synapse_ext_synapse_s3_storage_provider_enabled: false
  1380. # renovate: datasource=github-releases depName=matrix-org/synapse-s3-storage-provider
  1381. matrix_synapse_ext_synapse_s3_storage_provider_version: 1.6.0
  1382. # Controls whether media from this (local) server is stored in s3-storage-provider
  1383. matrix_synapse_ext_synapse_s3_storage_provider_store_local: true
  1384. # Controls whether media from remote servers is stored in s3-storage-provider
  1385. matrix_synapse_ext_synapse_s3_storage_provider_store_remote: true
  1386. # Controls whether files are stored to S3 at the same time they are stored on the local filesystem.
  1387. # For slightly improved reliability, consider setting this to `true`.
  1388. # Even with asynchronous uploading to S3 (`false` value), data loss shouldn't be possible,
  1389. # because the local filesystem is a reliable data store anyway.
  1390. matrix_synapse_ext_synapse_s3_storage_provider_store_synchronous: false
  1391. matrix_synapse_ext_synapse_s3_storage_provider_config_bucket: ''
  1392. # Prefix for all media in bucket, can't be changed once media has been uploaded.
  1393. # Useful if sharing the bucket between Synapses
  1394. # Example value: prefix/to/files/in/bucket
  1395. matrix_synapse_ext_synapse_s3_storage_provider_config_prefix: ''
  1396. matrix_synapse_ext_synapse_s3_storage_provider_config_region_name: ''
  1397. matrix_synapse_ext_synapse_s3_storage_provider_config_endpoint_url: ''
  1398. matrix_synapse_ext_synapse_s3_storage_provider_config_access_key_id: ''
  1399. matrix_synapse_ext_synapse_s3_storage_provider_config_secret_access_key: ''
  1400. # Enable this to use EC2 instance profile metadata to grab IAM credentials instead of passing credentials directly
  1401. # via matrix_synapse_ext_synapse_s3_storage_provider_config_access_key_id and matrix_synapse_ext_synapse_s3_storage_provider_config_secret_access_key
  1402. matrix_synapse_ext_synapse_s3_storage_provider_config_ec2_instance_profile: false
  1403. matrix_synapse_ext_synapse_s3_storage_provider_config_sse_customer_enabled: false
  1404. matrix_synapse_ext_synapse_s3_storage_provider_config_sse_customer_key: ''
  1405. matrix_synapse_ext_synapse_s3_storage_provider_config_sse_customer_algo: 'AES256'
  1406. matrix_synapse_ext_synapse_s3_storage_provider_config_storage_class: STANDARD
  1407. matrix_synapse_ext_synapse_s3_storage_provider_config_threadpool_size: 40
  1408. # matrix_synapse_ext_synapse_s3_storage_provider_update_db_day_count is a day value (number) for the `s3_media_upload update-db` command.
  1409. # It specifies how old files need to have been inactive to be eligible for migration from the local filesystem to the S3 data store.
  1410. # By default, we use `0` which says "all files are eligible for migration".
  1411. matrix_synapse_ext_synapse_s3_storage_provider_update_db_day_count: 0
  1412. # Specifies how often periodic migration (`matrix-synapse-s3-storage-provider-migrate.timer`) will run.
  1413. # This is a systemd timer OnCalendar definition. Learn more here: https://man.archlinux.org/man/systemd.time.7#CALENDAR_EVENTS
  1414. matrix_synapse_ext_synapse_s3_storage_provider_periodic_migration_schedule: '*-*-* 05:00:00'
  1415. # List of systemd services that matrix-synapse-s3-storage-provider-migrate.service requires.
  1416. # We only depend on matrix-synapse.service here, because its own dependencies (Postgres, Docker, etc.)
  1417. # are transitively resolved by systemd.
  1418. matrix_synapse_ext_synapse_s3_storage_provider_migrate_systemd_required_services_list: ['matrix-synapse.service']
  1419. # List of systemd services that matrix-synapse-s3-storage-provider-migrate.service wants
  1420. matrix_synapse_ext_synapse_s3_storage_provider_migrate_systemd_wanted_services_list: []
  1421. # Specifies whether an external media repository is enabled.
  1422. # If it is, the Synapse media repo and media-repo workers will be disabled automatically.
  1423. matrix_synapse_ext_media_repo_enabled: false
  1424. matrix_s3_media_store_enabled: false
  1425. matrix_s3_media_store_custom_endpoint_enabled: false
  1426. matrix_s3_goofys_container_image: "{{ matrix_s3_goofys_container_image_registry_prefix }}ewoutp/goofys:latest"
  1427. matrix_s3_goofys_container_image_registry_prefix: "{{ matrix_s3_goofys_container_image_registry_prefix_upstream }}"
  1428. matrix_s3_goofys_container_image_registry_prefix_upstream: "{{ matrix_s3_goofys_container_image_registry_prefix_upstream_default }}"
  1429. matrix_s3_goofys_container_image_registry_prefix_upstream_default: "docker.io/"
  1430. matrix_s3_goofys_container_image_force_pull: "{{ matrix_s3_goofys_container_image.endswith(':latest') }}"
  1431. matrix_s3_media_store_custom_endpoint: "your-custom-endpoint"
  1432. matrix_s3_media_store_bucket_name: "your-bucket-name"
  1433. matrix_s3_media_store_aws_access_key: "your-aws-access-key"
  1434. matrix_s3_media_store_aws_secret_key: "your-aws-secret-key"
  1435. matrix_s3_media_store_region: "eu-central-1"
  1436. matrix_s3_media_store_path: "{{ matrix_synapse_media_store_path }}"
  1437. # matrix_goofys_restart_necessary controls whether the Goofys service
  1438. # will be restarted (when true) or merely started (when false) by the
  1439. # systemd service manager role (when conditional restart is enabled).
  1440. #
  1441. # This value is automatically computed during installation based on whether
  1442. # any configuration files, the systemd service file, or the container image changed.
  1443. # The default of `false` means "no restart needed" — appropriate when the role's
  1444. # installation tasks haven't run (e.g., due to --tags skipping them).
  1445. matrix_goofys_restart_necessary: false
  1446. # Controls whether the self-check feature should validate SSL certificates.
  1447. matrix_synapse_self_check_validate_certificates: true
  1448. # Controls whether server notices are enabled.
  1449. matrix_synapse_server_notices_enabled: false
  1450. # The localpart of the user that will send server notices, this user will be created if it doesn't exist.
  1451. matrix_synapse_server_notices_system_mxid_localpart: "notices"
  1452. # The display name of the user that will send server notices.
  1453. matrix_synapse_server_notices_system_mxid_display_name: "Server Notices"
  1454. # Optional avatar URL for the user that will send server notices, example: mxc://example.com/abc123
  1455. matrix_synapse_server_notices_system_mxid_avatar_url: ~
  1456. # The name of the room where server notices will be sent, this room will be created if it doesn't exist.
  1457. matrix_synapse_server_notices_room_name: "Server Notices"
  1458. # Optional avatar URL for the server notices room, example: mxc://example.com/abc123
  1459. matrix_synapse_server_notices_room_avatar_url: ~
  1460. # Optional topic for the server notices room.
  1461. matrix_synapse_server_notices_room_topic: ~
  1462. # If true, users will be automatically joined to the server notices room instead of being invited.
  1463. matrix_synapse_server_notices_auto_join: false
  1464. # Controls whether searching the public room list is enabled.
  1465. matrix_synapse_enable_room_list_search: true
  1466. # Controls who's allowed to create aliases on this server.
  1467. matrix_synapse_alias_creation_rules:
  1468. - user_id: "*"
  1469. alias: "*"
  1470. room_id: "*"
  1471. action: allow
  1472. # Controls who can publish and which rooms can be published in the public room list.
  1473. matrix_synapse_room_list_publication_rules:
  1474. - user_id: "*"
  1475. alias: "*"
  1476. room_id: "*"
  1477. action: allow
  1478. matrix_synapse_default_room_version: "12"
  1479. # Controls whether leaving a room will automatically forget it.
  1480. # The upstream default is `false`, but we try to make Synapse less wasteful of resources, so we do things differently.
  1481. # Also see: `matrix_synapse_forgotten_room_retention_period`
  1482. matrix_synapse_forget_rooms_on_leave: true
  1483. # Controls the Synapse `modules` list.
  1484. # You can define your own list of modules here. See the `modules` syntax in `homeserver.yaml.j2`
  1485. # Certain Synapse extensions that you can enable below auto-inject themselves into `matrix_synapse_modules` at runtime.
  1486. matrix_synapse_modules: []
  1487. # matrix_synapse_media_storage_providers contains the Synapse `media_storage_providers` configuration setting.
  1488. # To add your own custom `media_storage_providers`, use `matrix_synapse_media_storage_providers_custom`.
  1489. matrix_synapse_media_storage_providers: "{{ matrix_synapse_media_storage_providers_auto + matrix_synapse_media_storage_providers_custom }}"
  1490. # matrix_synapse_media_storage_providers_auto contains a list of storage providers that are added by the playbook based on other configuration
  1491. matrix_synapse_media_storage_providers_auto: |
  1492. {{
  1493. []
  1494. +
  1495. [
  1496. lookup('ansible.builtin.template', role_path + '/templates/synapse/ext/s3-storage-provider/media_storage_provider.yaml.j2') | from_yaml
  1497. ] if matrix_synapse_ext_synapse_s3_storage_provider_enabled else []
  1498. }}
  1499. # matrix_synapse_media_storage_providers_custom contains your own custom list of storage providers.
  1500. # You're meant to define each custom module as valid keys and values, not as a YAML string that needs to be parsed.
  1501. #
  1502. # Example:
  1503. # matrix_synapse_media_storage_providers_custom:
  1504. # - module: module.SomeModule
  1505. # store_local: True
  1506. # # …
  1507. matrix_synapse_media_storage_providers_custom: []
  1508. matrix_synapse_encryption_enabled_by_default_for_room_type: "off"
  1509. matrix_synapse_trusted_key_servers:
  1510. - server_name: "matrix.org"
  1511. # Enable the following to disable the warning that is emitted when the
  1512. # matrix_synapse_trusted_key_servers include 'matrix.org'. See above.
  1513. matrix_synapse_suppress_key_server_warning: false
  1514. matrix_synapse_redaction_retention_period: 7d
  1515. # Controls how long to keep locally forgotten rooms before purging them from the DB.
  1516. # Defaults to `null`, meaning it's disabled.
  1517. # Also see: `matrix_synapse_forget_rooms_on_leave`
  1518. # Example value: 28d
  1519. matrix_synapse_forgotten_room_retention_period: 28d
  1520. matrix_synapse_user_ips_max_age: 28d
  1521. matrix_synapse_rust_synapse_compress_state_container_image: "{{ matrix_synapse_rust_synapse_compress_state_container_image_registry_prefix }}mb-saces/rust-synapse-tools:{{ matrix_synapse_rust_synapse_compress_state_container_image_version }}"
  1522. # renovate: datasource=docker depName=registry.gitlab.com/mb-saces/rust-synapse-tools
  1523. matrix_synapse_rust_synapse_compress_state_container_image_version: v0.0.3
  1524. matrix_synapse_rust_synapse_compress_state_container_image_registry_prefix: "{{ matrix_synapse_rust_synapse_compress_state_container_image_registry_prefix_upstream }}"
  1525. matrix_synapse_rust_synapse_compress_state_container_image_registry_prefix_upstream: "{{ matrix_synapse_rust_synapse_compress_state_container_image_registry_prefix_upstream_default }}"
  1526. matrix_synapse_rust_synapse_compress_state_container_image_registry_prefix_upstream_default: "registry.gitlab.com/"
  1527. matrix_synapse_rust_synapse_compress_state_container_image_force_pull: "{{ matrix_synapse_rust_synapse_compress_state_container_image.endswith(':stable') or matrix_synapse_rust_synapse_compress_state_container_image.endswith(':latest') }}"
  1528. matrix_synapse_rust_synapse_compress_state_base_path: "{{ matrix_base_data_path }}/rust-synapse-compress-state"
  1529. matrix_synapse_rust_synapse_compress_state_synapse_compress_state_in_container_path: "/usr/local/bin/synapse_compress_state"
  1530. # Default Synapse configuration template which covers the generic use case.
  1531. # You can customize it by controlling the various variables inside it.
  1532. #
  1533. # For a more advanced customization, you can extend the default (see `matrix_synapse_configuration_extension_yaml`)
  1534. # or completely replace this variable with your own template.
  1535. matrix_synapse_configuration_yaml: "{{ lookup('template', 'templates/synapse/homeserver.yaml.j2') }}"
  1536. matrix_synapse_configuration_extension_yaml: |
  1537. # Your custom YAML configuration for Synapse goes here.
  1538. # This configuration extends the default starting configuration (`matrix_synapse_configuration_yaml`).
  1539. #
  1540. # You can override individual variables from the default configuration, or introduce new ones.
  1541. #
  1542. # If you need something more special, you can take full control by
  1543. # completely redefining `matrix_synapse_configuration_yaml`.
  1544. #
  1545. # Example configuration extension follows:
  1546. #
  1547. # server_notices:
  1548. # system_mxid_localpart: notices
  1549. # system_mxid_display_name: "Server Notices"
  1550. # system_mxid_avatar_url: "mxc://example.com/oumMVlgDnLYFaPVkExemNVVZ"
  1551. # room_name: "Server Notices"
  1552. matrix_synapse_configuration_extension: "{{ matrix_synapse_configuration_extension_yaml | from_yaml if matrix_synapse_configuration_extension_yaml | from_yaml is mapping else {} }}"
  1553. # Holds the final Synapse configuration (a combination of the default and its extension).
  1554. # You most likely don't need to touch this variable. Instead, see `matrix_synapse_configuration_yaml`.
  1555. matrix_synapse_configuration: "{{ matrix_synapse_configuration_yaml | from_yaml | combine(matrix_synapse_configuration_extension, recursive=True) }}"
  1556. # Holds the path to the register-user script provided by the Matrix Authentication Service.
  1557. # When the Matrix Authentication Service is enabled, the register-user script from this role cannot be used
  1558. # and users will be pointed to the one provided by Matrix Authentication Service.
  1559. matrix_synapse_register_user_script_matrix_authentication_service_path: ""
  1560. ########################################################################################
  1561. # #
  1562. # Synapse reverse-proxy companion #
  1563. # #
  1564. ########################################################################################
  1565. # matrix-synapse-reverse-proxy-companion is a role which brings up a containerized nginx webserver which helps with reverse-proxying to Synapse when workers are enabled.
  1566. #
  1567. # When Synapse is NOT running in worker-mode, reverse-proxying is relatively simple (everything goes to `matrix-synapse:XXXX`).
  1568. # In such cases, using this reverse-proxy companion is possible, but unnecessary - it's one more service in the stack, which also impacts performance a bit.
  1569. #
  1570. # When Synapse workers are enabled, however, the reverse-proxying configuration is much more complicated - certain requests need to go to certain workers, etc.
  1571. # matrix-synapse-reverse-proxy-companion is the central place services that need to reach Synapse could be pointed to.
  1572. matrix_synapse_reverse_proxy_companion_enabled: "{{ matrix_synapse_enabled and matrix_synapse_workers_enabled }}"
  1573. # renovate: datasource=docker depName=nginx
  1574. matrix_synapse_reverse_proxy_companion_version: 1.29.6-alpine
  1575. matrix_synapse_reverse_proxy_companion_base_path: "{{ matrix_synapse_base_path }}/reverse-proxy-companion"
  1576. matrix_synapse_reverse_proxy_companion_confd_path: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/conf.d"
  1577. matrix_synapse_reverse_proxy_companion_njs_path: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/njs"
  1578. # List of systemd services that matrix-synapse-reverse-proxy-companion.service depends on
  1579. matrix_synapse_reverse_proxy_companion_systemd_required_services_list: "{{ matrix_synapse_reverse_proxy_companion_systemd_required_services_list_default + matrix_synapse_reverse_proxy_companion_systemd_required_services_list_auto + matrix_synapse_reverse_proxy_companion_systemd_required_services_list_custom }}"
  1580. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_default: []
  1581. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_auto: []
  1582. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_custom: []
  1583. # List of systemd services that matrix-synapse-reverse-proxy-companion.service wants
  1584. matrix_synapse_reverse_proxy_companion_systemd_wanted_services_list: ['matrix-synapse.service']
  1585. # We use an official nginx image, which we fix-up to run unprivileged.
  1586. # An alternative would be an `nginxinc/nginx-unprivileged` image, but
  1587. # that is frequently out of date.
  1588. matrix_synapse_reverse_proxy_companion_container_image: "{{ matrix_synapse_reverse_proxy_companion_container_image_registry_prefix }}nginx:{{ matrix_synapse_reverse_proxy_companion_container_image_tag }}"
  1589. matrix_synapse_reverse_proxy_companion_container_image_registry_prefix: "{{ matrix_synapse_reverse_proxy_companion_container_image_registry_prefix_upstream }}"
  1590. matrix_synapse_reverse_proxy_companion_container_image_registry_prefix_upstream: "{{ matrix_synapse_reverse_proxy_companion_container_image_registry_prefix_upstream_default }}"
  1591. matrix_synapse_reverse_proxy_companion_container_image_registry_prefix_upstream_default: "docker.io/"
  1592. matrix_synapse_reverse_proxy_companion_container_image_tag: "{{ matrix_synapse_reverse_proxy_companion_version }}"
  1593. matrix_synapse_reverse_proxy_companion_container_image_force_pull: "{{ matrix_synapse_reverse_proxy_companion_container_image.endswith(':latest') }}"
  1594. matrix_synapse_reverse_proxy_companion_container_network: "{{ matrix_synapse_container_network }}"
  1595. # A list of additional container networks that matrix-synapse-reverse-proxy-companion would be connected to.
  1596. # The playbook does not create these networks, so make sure they already exist.
  1597. matrix_synapse_reverse_proxy_companion_container_additional_networks: "{{ matrix_synapse_reverse_proxy_companion_container_additional_networks_auto + matrix_synapse_reverse_proxy_companion_container_additional_networks_custom }}"
  1598. matrix_synapse_reverse_proxy_companion_container_additional_networks_auto: []
  1599. matrix_synapse_reverse_proxy_companion_container_additional_networks_custom: []
  1600. # Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Client-Server API port (tcp/8008 in the container).
  1601. #
  1602. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8008"), or empty string to not expose.
  1603. matrix_synapse_reverse_proxy_companion_container_client_api_host_bind_port: ''
  1604. # Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Federation (Server-Server) API port (tcp/8048 in the container).
  1605. #
  1606. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8048"), or empty string to not expose.
  1607. matrix_synapse_reverse_proxy_companion_container_federation_api_host_bind_port: ''
  1608. # matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  1609. # See `../templates/labels.j2` for details.
  1610. #
  1611. # To inject your own other container labels, see `matrix_synapse_reverse_proxy_companion_container_labels_additional_labels`.
  1612. matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled: true
  1613. matrix_synapse_reverse_proxy_companion_container_labels_traefik_docker_network: "{{ matrix_synapse_reverse_proxy_companion_container_network }}"
  1614. matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints: web-secure
  1615. matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver: default # noqa var-naming
  1616. matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname: ''
  1617. # Controls whether a compression middleware will be injected into the middlewares list.
  1618. # This compression middleware is supposed to be defined elsewhere (using labels or a File provider, etc.) and is merely referenced by this router.
  1619. matrix_synapse_reverse_proxy_companion_container_labels_traefik_compression_middleware_enabled: false
  1620. matrix_synapse_reverse_proxy_companion_container_labels_traefik_compression_middleware_name: ""
  1621. # Controls whether labels will be added that expose the Client-Server API on a public Traefik entrypoint.
  1622. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_enabled: true
  1623. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  1624. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_path_prefix: /_matrix
  1625. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_path_prefix }}`)"
  1626. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_priority: 0
  1627. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  1628. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_entrypoints != 'web' }}"
  1629. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  1630. # Controls whether labels will be added that expose the Client-Server API on the internal Traefik entrypoint.
  1631. # This is similar to `matrix_synapse_container_labels_public_client_api_enabled`, but the entrypoint and intent is different.
  1632. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_enabled: "{{ matrix_synapse_container_labels_internal_client_api_enabled }}"
  1633. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_path_prefix: "{{ matrix_synapse_container_labels_public_client_api_traefik_path_prefix }}"
  1634. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_rule: "PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_path_prefix }}`)"
  1635. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_priority: "{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_priority }}"
  1636. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_entrypoints: "{{ matrix_synapse_container_labels_internal_client_api_traefik_entrypoints }}"
  1637. # Controls whether labels will be added that expose the /_synapse/client paths
  1638. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_enabled: "{{ matrix_synapse_container_labels_public_client_synapse_client_api_enabled }}"
  1639. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  1640. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_path_prefix: /_synapse/client
  1641. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_path_prefix }}`)"
  1642. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_priority: 0
  1643. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  1644. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_entrypoints != 'web' }}"
  1645. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  1646. # Controls whether labels will be added that expose the /_synapse/admin paths
  1647. # Following these recommendations (https://github.com/element-hq/synapse/blob/master/docs/reverse_proxy.md), by default, we don't.
  1648. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_enabled: "{{ matrix_synapse_container_labels_public_client_synapse_admin_api_enabled }}"
  1649. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  1650. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_path_prefix: /_synapse/admin
  1651. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_path_prefix }}`)"
  1652. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_priority: 0
  1653. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  1654. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_entrypoints != 'web' }}"
  1655. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  1656. # Controls whether labels will be added that expose the /_synapse/admin paths on the internal Traefik entrypoint.
  1657. # This is similar to `matrix_synapse_container_labels_public_client_api_enabled`, but the entrypoint and intent is different.
  1658. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_enabled: "{{ matrix_synapse_container_labels_internal_client_synapse_admin_api_enabled }}"
  1659. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_traefik_path_prefix: "{{ matrix_synapse_container_labels_internal_client_synapse_admin_api_traefik_path_prefix }}"
  1660. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_traefik_rule: "PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_traefik_path_prefix }}`)"
  1661. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_traefik_priority: 0
  1662. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_traefik_entrypoints: ""
  1663. # Controls whether labels will be added that expose the Server-Server API (Federation API).
  1664. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_enabled: "{{ matrix_synapse_reverse_proxy_companion_federation_api_enabled }}"
  1665. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  1666. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_path_prefix: /_matrix
  1667. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_path_prefix }}`)"
  1668. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_priority: 0
  1669. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_entrypoints: "{{ matrix_synapse_container_labels_public_federation_api_traefik_entrypoints }}"
  1670. # TLS is force-enabled here, because the spec (https://spec.matrix.org/v1.9/server-server-api/#tls) says that the federation API must use HTTPS.
  1671. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_tls: "{{ matrix_synapse_container_labels_public_federation_api_traefik_tls }}"
  1672. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  1673. # matrix_synapse_reverse_proxy_companion_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  1674. # See `../templates/labels.j2` for details.
  1675. #
  1676. # Example:
  1677. # matrix_synapse_reverse_proxy_companion_container_labels_additional_labels: |
  1678. # my.label=1
  1679. # another.label="here"
  1680. matrix_synapse_reverse_proxy_companion_container_labels_additional_labels: ''
  1681. # A list of extra arguments to pass to the container
  1682. # Also see `matrix_synapse_reverse_proxy_companion_container_arguments`
  1683. matrix_synapse_reverse_proxy_companion_container_extra_arguments: []
  1684. # matrix_synapse_reverse_proxy_companion_container_extra_arguments_auto is a list of extra arguments to pass to the container.
  1685. # This list is managed by the playbook. You're not meant to override this variable.
  1686. # If you'd like to inject your own arguments, see `matrix_synapse_reverse_proxy_companion_container_extra_arguments`.
  1687. matrix_synapse_reverse_proxy_companion_container_extra_arguments_auto: []
  1688. # matrix_synapse_reverse_proxy_companion_container_arguments holds the final list of extra arguments to pass to the container.
  1689. # You're not meant to override this variable.
  1690. # If you'd like to inject your own arguments, see `matrix_synapse_reverse_proxy_companion_container_extra_arguments`.
  1691. matrix_synapse_reverse_proxy_companion_container_arguments: "{{ matrix_synapse_reverse_proxy_companion_container_extra_arguments + matrix_synapse_reverse_proxy_companion_container_extra_arguments_auto }}"
  1692. # The amount of worker processes and connections
  1693. # Consider increasing these when you are expecting high amounts of traffic
  1694. # http://nginx.org/en/docs/ngx_core_module.html#worker_connections
  1695. matrix_synapse_reverse_proxy_companion_worker_processes: auto
  1696. matrix_synapse_reverse_proxy_companion_worker_connections: 1024
  1697. # Option to disable the access log
  1698. matrix_synapse_reverse_proxy_companion_access_log_enabled: true
  1699. # Controls the regular nginx access log format used for `/var/log/nginx/access.log`.
  1700. # `routing_debug` is the default because it includes the chosen upstream label,
  1701. # the resolved backend address, and timing data, which makes it much easier to
  1702. # verify request routing in worker deployments.
  1703. # This does not affect the separate syslog integration format used by prometheus-nginxlog-exporter.
  1704. matrix_synapse_reverse_proxy_companion_access_log_format: routing_debug
  1705. # The available values for `matrix_synapse_reverse_proxy_companion_access_log_format`.
  1706. # You can override this map to define custom formats, but that is fragile and discouraged.
  1707. matrix_synapse_reverse_proxy_companion_access_log_format_presets:
  1708. main:
  1709. - '$remote_addr - $remote_user [$time_local] "$request"'
  1710. - '$status $body_bytes_sent "$http_referer"'
  1711. - ' "$http_user_agent" "$http_x_forwarded_for"'
  1712. routing_debug:
  1713. - '$remote_addr - $remote_user [$time_local] "$request"'
  1714. - '$status $body_bytes_sent "$http_referer"'
  1715. - ' "$http_user_agent" "$http_x_forwarded_for"'
  1716. - ' "$host" "$matrix_upstream_label" "$upstream_addr" "$upstream_status" "$request_time" "$upstream_response_time"'
  1717. # Controls whether to send access logs to a remote syslog-compatible server
  1718. matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_enabled: false
  1719. matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_server_port: ''
  1720. # This is intentionally different. The maximum allowed length is 32 characters and dashes are not allowed.
  1721. matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_tag: matrix_synapse_rev_proxy_comp
  1722. # The tmpfs at /tmp needs to be large enough to handle multiple concurrent file uploads.
  1723. matrix_synapse_reverse_proxy_companion_tmp_directory_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb | int) * 50 }}"
  1724. matrix_synapse_reverse_proxy_companion_tmp_cache_directory_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb | int) * 2 }}"
  1725. # A list of strings containing additional configuration blocks to add to the nginx server configuration (nginx.conf).
  1726. # for big matrixservers to enlarge the number of open files to prevent timeouts
  1727. # matrix_synapse_reverse_proxy_companion_additional_configuration_blocks:
  1728. # - 'worker_rlimit_nofile 30000;'
  1729. matrix_synapse_reverse_proxy_companion_additional_configuration_blocks: []
  1730. # A list of strings containing additional configuration blocks to add to the nginx event server configuration (nginx.conf).
  1731. matrix_synapse_reverse_proxy_companion_event_additional_configuration_blocks: []
  1732. # A list of strings containing additional configuration blocks to add to the nginx http's server configuration (nginx-http.conf).
  1733. matrix_synapse_reverse_proxy_companion_http_additional_server_configuration_blocks: []
  1734. # To increase request timeout in NGINX using proxy_read_timeout, proxy_connect_timeout, proxy_send_timeout, send_timeout directives
  1735. # Nginx Default: proxy_connect_timeout 60s; #Defines a timeout for establishing a connection with a proxied server
  1736. # Nginx Default: proxy_send_timeout 60s; #Sets a timeout for transmitting a request to the proxied server.
  1737. # Nginx Default: proxy_read_timeout 60s; #Defines a timeout for reading a response from the proxied server.
  1738. # Nginx Default: send_timeout 60s; #Sets a timeout for transmitting a response to the client.
  1739. #
  1740. # For more information visit:
  1741. # http://nginx.org/en/docs/http/ngx_http_proxy_module.html
  1742. # http://nginx.org/en/docs/http/ngx_http_core_module.html#send_timeout
  1743. # https://www.nginx.com/resources/wiki/start/topics/examples/fullexample2/
  1744. #
  1745. # Here we are sticking with nginx default values change this value carefully.
  1746. matrix_synapse_reverse_proxy_companion_proxy_connect_timeout: 60
  1747. matrix_synapse_reverse_proxy_companion_proxy_send_timeout: 60
  1748. matrix_synapse_reverse_proxy_companion_proxy_read_timeout: 60
  1749. matrix_synapse_reverse_proxy_companion_send_timeout: 60
  1750. # For OCSP purposes, we need to define a resolver at the `server{}` level or `http{}` level (we do the latter).
  1751. #
  1752. # Otherwise, we get warnings like this:
  1753. # > [warn] 22#22: no resolver defined to resolve r3.o.lencr.org while requesting certificate status, responder: r3.o.lencr.org, certificate: "/matrix/ssl/config/live/…/fullchain.pem"
  1754. #
  1755. # We point it to the internal Docker resolver, which likely delegates to nameservers defined in `/etc/resolv.conf`.
  1756. matrix_synapse_reverse_proxy_companion_http_level_resolver: 127.0.0.11
  1757. matrix_synapse_reverse_proxy_companion_hostname: "matrix-synapse-reverse-proxy-companion"
  1758. # matrix_synapse_reverse_proxy_companion_client_api_addr specifies the address where the Client-Server API is
  1759. matrix_synapse_reverse_proxy_companion_client_api_addr: 'matrix-synapse:{{ matrix_synapse_container_client_api_port }}'
  1760. # The maximum body size for client requests to any of the endpoints on the Client-Server API.
  1761. # This needs to be equal or higher than the maximum upload size accepted by Synapse.
  1762. matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb: "{{ matrix_synapse_max_upload_size_mb }}"
  1763. # The buffer size for client requests to any of the endpoints on the Client-Server API.
  1764. matrix_synapse_reverse_proxy_companion_client_api_client_body_buffer_size_mb: "{{ matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb }}"
  1765. # matrix_synapse_reverse_proxy_companion_federation_api_enabled specifies whether reverse proxying for the Federation (Server-Server) API should be done
  1766. matrix_synapse_reverse_proxy_companion_federation_api_enabled: true
  1767. # matrix_synapse_reverse_proxy_companion_federation_api_addr specifies the address where the Federation (Server-Server) API is
  1768. matrix_synapse_reverse_proxy_companion_federation_api_addr: 'matrix-synapse:{{ matrix_synapse_container_federation_api_plain_port }}'
  1769. # The maximum body size for client requests to any of the endpoints on the Federation API.
  1770. # We auto-calculate this based on the Client-Server API's maximum body size, but use a minimum value to ensure we don't go to low.
  1771. matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb: "{{ [matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb_minimum, (matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb | int) * 3] | max }}"
  1772. matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb_minimum: 100
  1773. # The buffer size for client requests to any of the endpoints on the Federation API.
  1774. matrix_synapse_reverse_proxy_companion_federation_api_client_body_buffer_size_mb: "{{ matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb }}"
  1775. # A list of strings containing additional configuration blocks to add to the nginx vhost handling the Synapse Client-Server API
  1776. matrix_synapse_reverse_proxy_companion_synapse_client_api_additional_server_configuration_blocks: []
  1777. # A list of strings containing additional configuration blocks to add to the nginx vhost handling the Synapse Federation (Server-Server) API
  1778. matrix_synapse_reverse_proxy_companion_synapse_federation_api_additional_server_configuration_blocks: []
  1779. # synapse worker activation and endpoint mappings.
  1780. # These are all populated via Ansible group variables.
  1781. # (or fall back to role-level Synapse worker defaults when not overridden)
  1782. matrix_synapse_reverse_proxy_companion_synapse_workers_enabled: "{{ matrix_synapse_workers_enabled }}"
  1783. matrix_synapse_reverse_proxy_companion_synapse_workers_list: "{{ matrix_synapse_workers_enabled_list }}"
  1784. matrix_synapse_reverse_proxy_companion_synapse_room_worker_client_server_locations: "{{ matrix_synapse_workers_room_worker_client_server_endpoints }}"
  1785. matrix_synapse_reverse_proxy_companion_synapse_room_worker_federation_locations: "{{ matrix_synapse_workers_room_worker_federation_endpoints }}"
  1786. matrix_synapse_reverse_proxy_companion_synapse_sync_worker_client_server_locations: "{{ matrix_synapse_workers_sync_worker_client_server_endpoints }}"
  1787. matrix_synapse_reverse_proxy_companion_synapse_client_reader_client_server_locations: "{{ matrix_synapse_workers_client_reader_client_server_endpoints }}"
  1788. matrix_synapse_reverse_proxy_companion_synapse_federation_reader_federation_locations: "{{ matrix_synapse_workers_federation_reader_federation_endpoints }}"
  1789. matrix_synapse_reverse_proxy_companion_synapse_generic_worker_client_server_locations: "{{ matrix_synapse_workers_generic_worker_client_server_endpoints }}"
  1790. matrix_synapse_reverse_proxy_companion_synapse_generic_worker_federation_locations: "{{ matrix_synapse_workers_generic_worker_federation_endpoints }}"
  1791. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_typing_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_typing_stream_worker_client_server_endpoints }}"
  1792. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_to_device_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_to_device_stream_worker_client_server_endpoints }}"
  1793. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_account_data_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_account_data_stream_worker_client_server_endpoints }}"
  1794. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_receipts_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_receipts_stream_worker_client_server_endpoints }}"
  1795. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_presence_stream_worker_client_server_endpoints }}"
  1796. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_push_rules_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_push_rules_stream_worker_client_server_endpoints }}"
  1797. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_device_lists_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_endpoints }}"
  1798. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_thread_subscriptions_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_thread_subscriptions_stream_worker_client_server_endpoints }}"
  1799. matrix_synapse_reverse_proxy_companion_synapse_media_repository_locations: "{{ matrix_synapse_workers_media_repository_endpoints | default([]) }}"
  1800. matrix_synapse_reverse_proxy_companion_synapse_user_dir_locations: "{{ matrix_synapse_workers_user_dir_worker_client_server_endpoints | default([]) }}"
  1801. matrix_synapse_reverse_proxy_companion_client_server_main_override_locations_regex: ^/_matrix/client/(api/v1|r0|v3|unstable)/(account/3pid/|directory/list/room/|rooms/[^/]+/(forget|upgrade|report)|register)
  1802. matrix_synapse_reverse_proxy_companion_client_server_sso_override_locations_regex: ^/_matrix/client/(api/v1|r0|v3|unstable)/login/sso/redirect(/|$)
  1803. # Related to MSC4108 (https://github.com/matrix-org/matrix-spec-proposals/pull/4108)
  1804. matrix_synapse_reverse_proxy_companion_client_server_qr_code_login_locations_regex: ^(/_matrix/client/(unstable|v1)/org.matrix.msc4108/rendezvous|/_synapse/client/rendezvous)$
  1805. matrix_synapse_reverse_proxy_companion_federation_override_locations_regex: ^/_matrix/federation/v1/openid/userinfo$
  1806. # synapse content caching
  1807. matrix_synapse_reverse_proxy_companion_synapse_cache_enabled: false
  1808. matrix_synapse_reverse_proxy_companion_synapse_cache_path: /tmp/synapse-cache
  1809. matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_name: "STATIC"
  1810. matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_size: "10m"
  1811. matrix_synapse_reverse_proxy_companion_synapse_cache_inactive_time: "48h"
  1812. matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb: 1024
  1813. matrix_synapse_reverse_proxy_companion_synapse_cache_proxy_cache_valid_time: "24h"
  1814. # Controls whether matrix-synapse-reverse-proxy-companion trusts an upstream server's X-Forwarded-Proto header.
  1815. # The `matrix-synapse-reverse-proxy-companion` does not terminate SSL and always expects to be fronted by another reverse-proxy server.
  1816. # As such, it trusts the protocol scheme forwarded by the upstream proxy.
  1817. matrix_synapse_reverse_proxy_companion_trust_forwarded_proto: true
  1818. matrix_synapse_reverse_proxy_companion_x_forwarded_proto_value: "{{ '$http_x_forwarded_proto' if matrix_synapse_reverse_proxy_companion_trust_forwarded_proto else '$scheme' }}"
  1819. ########################################################################################
  1820. # #
  1821. # /Synapse reverse-proxy companion core settings #
  1822. # #
  1823. ########################################################################################
  1824. ########################################################################################
  1825. # #
  1826. # njs module #
  1827. # #
  1828. ########################################################################################
  1829. # Controls whether the njs module is loaded.
  1830. matrix_synapse_reverse_proxy_companion_njs_enabled: "{{ matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_enabled }}"
  1831. ########################################################################################
  1832. # #
  1833. # /njs module #
  1834. # #
  1835. ########################################################################################
  1836. ########################################################################################
  1837. # #
  1838. # Whoami-based sync worker routing #
  1839. # #
  1840. ########################################################################################
  1841. # Controls whether the whoami-based sync worker router is enabled.
  1842. # When enabled, the reverse proxy will call Synapse's /_matrix/client/v3/account/whoami endpoint
  1843. # to resolve access tokens to usernames, allowing consistent routing of requests from the same user
  1844. # to the same sync worker regardless of which device or token they use.
  1845. #
  1846. # This works with any authentication system (native Synapse auth, MAS, etc.) because Synapse
  1847. # handles the token validation internally.
  1848. #
  1849. # Enabled by default when there are sync workers, because sync workers benefit from user-level
  1850. # stickiness due to their per-user in-memory caches.
  1851. matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_enabled: "{{ matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'sync_worker') | list | length > 0 }}"
  1852. # The whoami endpoint path (Matrix spec endpoint).
  1853. matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_endpoint: /_matrix/client/v3/account/whoami
  1854. # The full URL to the whoami endpoint.
  1855. matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_url: "http://{{ matrix_synapse_reverse_proxy_companion_client_api_addr }}{{ matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_endpoint }}"
  1856. # Cache duration (in seconds) for whoami lookup results.
  1857. # Token -> username mappings are cached to avoid repeated whoami calls.
  1858. # A longer TTL reduces load on Synapse but means username changes take longer to take effect.
  1859. matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_cache_ttl_seconds: 3600
  1860. # Size of the shared memory zone for caching whoami results (in megabytes).
  1861. # Each cached entry is approximately 100-200 bytes.
  1862. matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_cache_size_mb: 1
  1863. # Controls whether verbose logging is enabled for the whoami sync worker router.
  1864. # When enabled, logs cache hits/misses and routing decisions.
  1865. # Useful for debugging, but should be disabled in production.
  1866. matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_logging_enabled: false
  1867. # The length of the access token to show in logs when logging is enabled.
  1868. # Keeping this short is a good idea from a security perspective.
  1869. matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_logging_token_length: 12
  1870. # Controls whether debug response headers are added to sync requests.
  1871. # When enabled, adds X-Sync-Worker-Router-User-Identifier and X-Sync-Worker-Router-Upstream headers.
  1872. # Useful for debugging routing behavior, but should be disabled in production.
  1873. matrix_synapse_reverse_proxy_companion_whoami_sync_worker_router_debug_headers_enabled: false
  1874. ########################################################################################
  1875. # #
  1876. # /Whoami-based sync worker routing #
  1877. # #
  1878. ########################################################################################
  1879. # matrix_synapse_reverse_proxy_companion_restart_necessary controls whether the service
  1880. # will be restarted (when true) or merely started (when false) by the
  1881. # systemd service manager role (when conditional restart is enabled).
  1882. #
  1883. # This value is automatically computed during installation based on whether
  1884. # any configuration files, the systemd service file, or the container image changed.
  1885. # The default of `false` means "no restart needed" — appropriate when the role's
  1886. # installation tasks haven't run (e.g., due to --tags skipping them).
  1887. matrix_synapse_reverse_proxy_companion_restart_necessary: false