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.
 
 

224 satır
19 KiB

  1. ---
  2. # 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.
  3. #
  4. # When Synapse is NOT running in worker-mode, reverse-proxying is relatively simple (everything goes to `matrix-synapse:XXXX`).
  5. # 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.
  6. #
  7. # When Synapse workers are enabled, however, the reverse-proxying configuration is much more complicated - certain requests need to go to certain workers, etc.
  8. # matrix-synapse-reverse-proxy-companion is the central place services that need to reach Synapse could be pointed to.
  9. matrix_synapse_reverse_proxy_companion_enabled: true
  10. # renovate: datasource=docker depName=nginx
  11. matrix_synapse_reverse_proxy_companion_version: 1.25.3-alpine
  12. matrix_synapse_reverse_proxy_companion_base_path: "{{ matrix_synapse_base_path }}/reverse-proxy-companion"
  13. matrix_synapse_reverse_proxy_companion_confd_path: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/conf.d"
  14. # List of systemd services that matrix-synapse-reverse-proxy-companion.service depends on
  15. 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 }}"
  16. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_default: ['docker.service']
  17. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_auto: []
  18. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_custom: []
  19. # List of systemd services that matrix-synapse-reverse-proxy-companion.service wants
  20. matrix_synapse_reverse_proxy_companion_systemd_wanted_services_list: ['matrix-synapse.service']
  21. # We use an official nginx image, which we fix-up to run unprivileged.
  22. # An alternative would be an `nginxinc/nginx-unprivileged` image, but
  23. # that is frequently out of date.
  24. matrix_synapse_reverse_proxy_companion_container_image: "{{ matrix_container_global_registry_prefix }}nginx:{{ matrix_synapse_reverse_proxy_companion_version }}"
  25. matrix_synapse_reverse_proxy_companion_container_image_force_pull: "{{ matrix_synapse_reverse_proxy_companion_container_image.endswith(':latest') }}"
  26. matrix_synapse_reverse_proxy_companion_container_network: ""
  27. # A list of additional container networks that matrix-synapse-reverse-proxy-companion would be connected to.
  28. # The playbook does not create these networks, so make sure they already exist.
  29. matrix_synapse_reverse_proxy_companion_container_additional_networks: []
  30. # Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Client-Server API port (tcp/8008 in the container).
  31. #
  32. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8008"), or empty string to not expose.
  33. matrix_synapse_reverse_proxy_companion_container_client_api_host_bind_port: ''
  34. # Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Federation (Server-Server) API port (tcp/8048 in the container).
  35. #
  36. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8048"), or empty string to not expose.
  37. matrix_synapse_reverse_proxy_companion_container_federation_api_host_bind_port: ''
  38. # matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  39. # See `../templates/labels.j2` for details.
  40. #
  41. # To inject your own other container labels, see `matrix_synapse_reverse_proxy_companion_container_labels_additional_labels`.
  42. matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled: true
  43. matrix_synapse_reverse_proxy_companion_container_labels_traefik_docker_network: "{{ matrix_synapse_reverse_proxy_companion_container_network }}"
  44. matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints: web-secure
  45. matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver: default # noqa var-naming
  46. matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname: ''
  47. # Controls whether labels will be added that expose the Client-Server API on a public Traefik entrypoint.
  48. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_enabled: true
  49. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  50. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_path_prefix: /_matrix
  51. 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 }}`)"
  52. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_priority: 0
  53. matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  54. 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' }}"
  55. 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
  56. # Controls whether labels will be added that expose the Client-Server API on the internal Traefik entrypoint.
  57. # This is similar to `matrix_synapse_container_labels_public_client_api_enabled`, but the entrypoint and intent is different.
  58. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_enabled: false
  59. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_path_prefix: "{{ matrix_synapse_container_labels_public_client_api_traefik_path_prefix }}"
  60. 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 }}`)"
  61. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_priority: "{{ matrix_synapse_reverse_proxy_companion_container_labels_public_client_api_traefik_priority }}"
  62. matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_entrypoints: ""
  63. # Controls whether labels will be added that expose the /_synapse/client paths
  64. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_enabled: true
  65. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  66. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_path_prefix: /_synapse/client
  67. 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 }}`)"
  68. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_priority: 0
  69. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_client_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  70. 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' }}"
  71. 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
  72. # Controls whether labels will be added that expose the /_synapse/admin paths
  73. # Following these recommendations (https://github.com/element-hq/synapse/blob/master/docs/reverse_proxy.md), by default, we don't.
  74. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_enabled: false
  75. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  76. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_path_prefix: /_synapse/admin
  77. 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 }}`)"
  78. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_priority: 0
  79. matrix_synapse_reverse_proxy_companion_container_labels_public_client_synapse_admin_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  80. 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' }}"
  81. 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
  82. # Controls whether labels will be added that expose the Server-Server API (Federation API).
  83. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_enabled: "{{ matrix_synapse_reverse_proxy_companion_federation_api_enabled }}"
  84. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  85. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_path_prefix: /_matrix
  86. 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 }}`)"
  87. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_priority: 0
  88. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_entrypoints: ''
  89. # 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.
  90. matrix_synapse_reverse_proxy_companion_container_labels_public_federation_api_traefik_tls: true
  91. 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
  92. # matrix_synapse_reverse_proxy_companion_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  93. # See `../templates/labels.j2` for details.
  94. #
  95. # Example:
  96. # matrix_synapse_reverse_proxy_companion_container_labels_additional_labels: |
  97. # my.label=1
  98. # another.label="here"
  99. matrix_synapse_reverse_proxy_companion_container_labels_additional_labels: ''
  100. # The amount of worker processes and connections
  101. # Consider increasing these when you are expecting high amounts of traffic
  102. # http://nginx.org/en/docs/ngx_core_module.html#worker_connections
  103. matrix_synapse_reverse_proxy_companion_worker_processes: auto
  104. matrix_synapse_reverse_proxy_companion_worker_connections: 1024
  105. # Option to disable the access log
  106. matrix_synapse_reverse_proxy_companion_access_log_enabled: true
  107. # Controls whether to send access logs to a remote syslog-compatible server
  108. matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_enabled: false
  109. matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_server_port: ''
  110. # This is intentionally different. The maximum allowed length is 32 characters and dashes are not allowed.
  111. matrix_synapse_reverse_proxy_companion_access_log_syslog_integration_tag: matrix_synapse_rev_proxy_comp
  112. # The tmpfs at /tmp needs to be large enough to handle multiple concurrent file uploads.
  113. matrix_synapse_reverse_proxy_companion_tmp_directory_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb | int) * 50 }}"
  114. matrix_synapse_reverse_proxy_companion_tmp_cache_directory_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb | int) * 2 }}"
  115. # A list of strings containing additional configuration blocks to add to the nginx server configuration (nginx.conf).
  116. # for big matrixservers to enlarge the number of open files to prevent timeouts
  117. # matrix_synapse_reverse_proxy_companion_additional_configuration_blocks:
  118. # - 'worker_rlimit_nofile 30000;'
  119. matrix_synapse_reverse_proxy_companion_additional_configuration_blocks: []
  120. # A list of strings containing additional configuration blocks to add to the nginx event server configuration (nginx.conf).
  121. matrix_synapse_reverse_proxy_companion_event_additional_configuration_blocks: []
  122. # A list of strings containing additional configuration blocks to add to the nginx http's server configuration (nginx-http.conf).
  123. matrix_synapse_reverse_proxy_companion_http_additional_server_configuration_blocks: []
  124. # To increase request timeout in NGINX using proxy_read_timeout, proxy_connect_timeout, proxy_send_timeout, send_timeout directives
  125. # Nginx Default: proxy_connect_timeout 60s; #Defines a timeout for establishing a connection with a proxied server
  126. # Nginx Default: proxy_send_timeout 60s; #Sets a timeout for transmitting a request to the proxied server.
  127. # Nginx Default: proxy_read_timeout 60s; #Defines a timeout for reading a response from the proxied server.
  128. # Nginx Default: send_timeout 60s; #Sets a timeout for transmitting a response to the client.
  129. #
  130. # For more information visit:
  131. # http://nginx.org/en/docs/http/ngx_http_proxy_module.html
  132. # http://nginx.org/en/docs/http/ngx_http_core_module.html#send_timeout
  133. # https://www.nginx.com/resources/wiki/start/topics/examples/fullexample2/
  134. #
  135. # Here we are sticking with nginx default values change this value carefully.
  136. matrix_synapse_reverse_proxy_companion_proxy_connect_timeout: 60
  137. matrix_synapse_reverse_proxy_companion_proxy_send_timeout: 60
  138. matrix_synapse_reverse_proxy_companion_proxy_read_timeout: 60
  139. matrix_synapse_reverse_proxy_companion_send_timeout: 60
  140. # For OCSP purposes, we need to define a resolver at the `server{}` level or `http{}` level (we do the latter).
  141. #
  142. # Otherwise, we get warnings like this:
  143. # > [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"
  144. #
  145. # We point it to the internal Docker resolver, which likely delegates to nameservers defined in `/etc/resolv.conf`.
  146. matrix_synapse_reverse_proxy_companion_http_level_resolver: 127.0.0.11
  147. matrix_synapse_reverse_proxy_companion_hostname: "matrix-synapse-reverse-proxy-companion"
  148. # matrix_synapse_reverse_proxy_companion_client_api_addr specifies the address where the Client-Server API is
  149. matrix_synapse_reverse_proxy_companion_client_api_addr: 'matrix-synapse:{{ matrix_synapse_container_client_api_port }}'
  150. # This needs to be equal or higher than the maximum upload size accepted by Synapse.
  151. matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb: 50
  152. # matrix_synapse_reverse_proxy_companion_federation_api_enabled specifies whether reverse proxying for the Federation (Server-Server) API should be done
  153. matrix_synapse_reverse_proxy_companion_federation_api_enabled: true
  154. # matrix_synapse_reverse_proxy_companion_federation_api_addr specifies the address where the Federation (Server-Server) API is
  155. matrix_synapse_reverse_proxy_companion_federation_api_addr: 'matrix-synapse:{{ matrix_synapse_container_federation_api_plain_port }}'
  156. matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb | int) * 3 }}"
  157. # A list of strings containing additional configuration blocks to add to the nginx vhost handling the Synapse Client-Server API
  158. matrix_synapse_reverse_proxy_companion_synapse_client_api_additional_server_configuration_blocks: []
  159. # A list of strings containing additional configuration blocks to add to the nginx vhost handling the Synapse Federation (Server-Server) API
  160. matrix_synapse_reverse_proxy_companion_synapse_federation_api_additional_server_configuration_blocks: []
  161. # synapse worker activation and endpoint mappings
  162. matrix_synapse_reverse_proxy_companion_synapse_workers_enabled: false
  163. matrix_synapse_reverse_proxy_companion_synapse_workers_list: []
  164. matrix_synapse_reverse_proxy_companion_synapse_generic_worker_client_server_locations: []
  165. matrix_synapse_reverse_proxy_companion_synapse_generic_worker_federation_locations: []
  166. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_typing_stream_worker_client_server_locations: []
  167. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_to_device_stream_worker_client_server_locations: []
  168. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_account_data_stream_worker_client_server_locations: []
  169. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_receipts_stream_worker_client_server_locations: []
  170. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_worker_client_server_locations: []
  171. matrix_synapse_reverse_proxy_companion_synapse_media_repository_locations: []
  172. matrix_synapse_reverse_proxy_companion_synapse_user_dir_locations: []
  173. # synapse content caching
  174. matrix_synapse_reverse_proxy_companion_synapse_cache_enabled: false
  175. matrix_synapse_reverse_proxy_companion_synapse_cache_path: /tmp/synapse-cache
  176. matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_name: "STATIC"
  177. matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_size: "10m"
  178. matrix_synapse_reverse_proxy_companion_synapse_cache_inactive_time: "48h"
  179. matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb: 1024
  180. matrix_synapse_reverse_proxy_companion_synapse_cache_proxy_cache_valid_time: "24h"
  181. # Controls whether matrix-synapse-reverse-proxy-companion trusts an upstream server's X-Forwarded-Proto header.
  182. # The `matrix-synapse-reverse-proxy-companion` does not terminate SSL and always expects to be fronted by another reverse-proxy server.
  183. # As such, it trusts the protocol scheme forwarded by the upstream proxy.
  184. matrix_synapse_reverse_proxy_companion_trust_forwarded_proto: true
  185. matrix_synapse_reverse_proxy_companion_x_forwarded_proto_value: "{{ '$http_x_forwarded_proto' if matrix_synapse_reverse_proxy_companion_trust_forwarded_proto else '$scheme' }}"