Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

235 行
21 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. #
  10. # This is also similar to the matrix-homeserver-proxy role, but that one aims to wrap the homeserver
  11. # (along with other homeserver route-stealing services like the identity server, matrix-media-repo, etc.)
  12. # into a neat package that addons (bridges, bots, etc.) can consume and get a unified view of "the currently-enabled homeserver and all related services".
  13. matrix_synapse_reverse_proxy_companion_enabled: true
  14. # renovate: datasource=docker depName=nginx
  15. matrix_synapse_reverse_proxy_companion_version: 1.25.3-alpine
  16. matrix_synapse_reverse_proxy_companion_base_path: "{{ matrix_synapse_base_path }}/reverse-proxy-companion"
  17. matrix_synapse_reverse_proxy_companion_confd_path: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/conf.d"
  18. # List of systemd services that matrix-synapse-reverse-proxy-companion.service depends on
  19. 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 }}"
  20. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_default: ['docker.service']
  21. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_auto: []
  22. matrix_synapse_reverse_proxy_companion_systemd_required_services_list_custom: []
  23. # List of systemd services that matrix-synapse-reverse-proxy-companion.service wants
  24. matrix_synapse_reverse_proxy_companion_systemd_wanted_services_list: ['matrix-synapse.service']
  25. # We use an official nginx image, which we fix-up to run unprivileged.
  26. # An alternative would be an `nginxinc/nginx-unprivileged` image, but
  27. # that is frequently out of date.
  28. matrix_synapse_reverse_proxy_companion_container_image: "{{ matrix_container_global_registry_prefix }}nginx:{{ matrix_synapse_reverse_proxy_companion_version }}"
  29. matrix_synapse_reverse_proxy_companion_container_image_force_pull: "{{ matrix_synapse_reverse_proxy_companion_container_image.endswith(':latest') }}"
  30. matrix_synapse_reverse_proxy_companion_container_network: ""
  31. # A list of additional container networks that matrix-synapse-reverse-proxy-companion would be connected to.
  32. # The playbook does not create these networks, so make sure they already exist.
  33. matrix_synapse_reverse_proxy_companion_container_additional_networks: []
  34. # Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Client-Server API port (tcp/8008 in the container).
  35. #
  36. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8008"), or empty string to not expose.
  37. matrix_synapse_reverse_proxy_companion_container_client_api_host_bind_port: ''
  38. # Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Federation (Server-Server) API port (tcp/8048 in the container).
  39. #
  40. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8048"), or empty string to not expose.
  41. matrix_synapse_reverse_proxy_companion_container_federation_api_host_bind_port: ''
  42. # matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  43. # See `../templates/labels.j2` for details.
  44. #
  45. # To inject your own other container labels, see `matrix_synapse_reverse_proxy_companion_container_labels_additional_labels`.
  46. matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled: true
  47. matrix_synapse_reverse_proxy_companion_container_labels_traefik_docker_network: "{{ matrix_synapse_reverse_proxy_companion_container_network }}"
  48. matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints: web-secure
  49. matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver: default # noqa var-naming
  50. matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname: ''
  51. # Controls whether labels will be added for handling the root (/) path
  52. matrix_synapse_reverse_proxy_companion_container_labels_client_root_enabled: true
  53. matrix_synapse_reverse_proxy_companion_container_labels_client_root_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  54. matrix_synapse_reverse_proxy_companion_container_labels_client_root_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_root_traefik_hostname }}`) && Path(`/`)"
  55. matrix_synapse_reverse_proxy_companion_container_labels_client_root_traefik_priority: 0
  56. matrix_synapse_reverse_proxy_companion_container_labels_client_root_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  57. matrix_synapse_reverse_proxy_companion_container_labels_client_root_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_client_root_traefik_entrypoints != 'web' }}"
  58. matrix_synapse_reverse_proxy_companion_container_labels_client_root_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  59. matrix_synapse_reverse_proxy_companion_container_labels_client_root_redirection_enabled: false
  60. matrix_synapse_reverse_proxy_companion_container_labels_client_root_redirection_url: ""
  61. # Controls whether labels will be added that expose the Client-Server API.
  62. matrix_synapse_reverse_proxy_companion_container_labels_client_api_enabled: true
  63. matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  64. matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_path_prefix: /_matrix
  65. matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_path_prefix }}`)"
  66. matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_priority: 0
  67. matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  68. matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_entrypoints != 'web' }}"
  69. matrix_synapse_reverse_proxy_companion_container_labels_client_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  70. # Controls whether labels will be added that expose the /_synapse/client paths
  71. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_enabled: true
  72. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  73. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_path_prefix: /_synapse/client
  74. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_path_prefix }}`)"
  75. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_priority: 0
  76. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  77. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_entrypoints != 'web' }}"
  78. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_client_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  79. # Controls whether labels will be added that expose the /_synapse/oidc paths
  80. # Enable this if you need OpenID Connect authentication support.
  81. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_enabled: false
  82. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  83. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_path_prefix: /_synapse/oidc
  84. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_path_prefix }}`)"
  85. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_priority: 0
  86. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  87. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_entrypoints != 'web' }}"
  88. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_oidc_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  89. # Controls whether labels will be added that expose the /_synapse/admin paths
  90. # Following these recommendations (https://github.com/matrix-org/synapse/blob/master/docs/reverse_proxy.md), by default, we don't.
  91. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_enabled: false
  92. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  93. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_path_prefix: /_synapse/admin
  94. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_path_prefix }}`)"
  95. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_priority: 0
  96. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_entrypoints: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_entrypoints }}"
  97. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_entrypoints != 'web' }}"
  98. matrix_synapse_reverse_proxy_companion_container_labels_client_synapse_admin_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  99. # Controls whether labels will be added that expose the Server-Server API (Federation API).
  100. matrix_synapse_reverse_proxy_companion_container_labels_federation_api_enabled: "{{ matrix_synapse_reverse_proxy_companion_federation_api_enabled }}"
  101. matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_hostname: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_hostname }}"
  102. matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_path_prefix: /_matrix
  103. matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_rule: "Host(`{{ matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_path_prefix }}`)"
  104. matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_priority: 0
  105. matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_entrypoints: ''
  106. matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_tls: "{{ matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_entrypoints != 'web' }}"
  107. matrix_synapse_reverse_proxy_companion_container_labels_federation_api_traefik_tls_certResolver: "{{ matrix_synapse_reverse_proxy_companion_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  108. # matrix_synapse_reverse_proxy_companion_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  109. # See `../templates/labels.j2` for details.
  110. #
  111. # Example:
  112. # matrix_synapse_reverse_proxy_companion_container_labels_additional_labels: |
  113. # my.label=1
  114. # another.label="here"
  115. matrix_synapse_reverse_proxy_companion_container_labels_additional_labels: ''
  116. # The amount of worker processes and connections
  117. # Consider increasing these when you are expecting high amounts of traffic
  118. # http://nginx.org/en/docs/ngx_core_module.html#worker_connections
  119. matrix_synapse_reverse_proxy_companion_worker_processes: auto
  120. matrix_synapse_reverse_proxy_companion_worker_connections: 1024
  121. # Option to disable the access log
  122. matrix_synapse_reverse_proxy_companion_access_log_enabled: true
  123. # The tmpfs at /tmp needs to be large enough to handle multiple concurrent file uploads.
  124. matrix_synapse_reverse_proxy_companion_tmp_directory_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb | int) * 50 }}"
  125. matrix_synapse_reverse_proxy_companion_tmp_cache_directory_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb | int) * 2 }}"
  126. # A list of strings containing additional configuration blocks to add to the nginx server configuration (nginx.conf).
  127. # for big matrixservers to enlarge the number of open files to prevent timeouts
  128. # matrix_synapse_reverse_proxy_companion_additional_configuration_blocks:
  129. # - 'worker_rlimit_nofile 30000;'
  130. matrix_synapse_reverse_proxy_companion_additional_configuration_blocks: []
  131. # A list of strings containing additional configuration blocks to add to the nginx event server configuration (nginx.conf).
  132. matrix_synapse_reverse_proxy_companion_event_additional_configuration_blocks: []
  133. # A list of strings containing additional configuration blocks to add to the nginx http's server configuration (nginx-http.conf).
  134. matrix_synapse_reverse_proxy_companion_http_additional_server_configuration_blocks: []
  135. # To increase request timeout in NGINX using proxy_read_timeout, proxy_connect_timeout, proxy_send_timeout, send_timeout directives
  136. # Nginx Default: proxy_connect_timeout 60s; #Defines a timeout for establishing a connection with a proxied server
  137. # Nginx Default: proxy_send_timeout 60s; #Sets a timeout for transmitting a request to the proxied server.
  138. # Nginx Default: proxy_read_timeout 60s; #Defines a timeout for reading a response from the proxied server.
  139. # Nginx Default: send_timeout 60s; #Sets a timeout for transmitting a response to the client.
  140. #
  141. # For more information visit:
  142. # http://nginx.org/en/docs/http/ngx_http_proxy_module.html
  143. # http://nginx.org/en/docs/http/ngx_http_core_module.html#send_timeout
  144. # https://www.nginx.com/resources/wiki/start/topics/examples/fullexample2/
  145. #
  146. # Here we are sticking with nginx default values change this value carefully.
  147. matrix_synapse_reverse_proxy_companion_proxy_connect_timeout: 60
  148. matrix_synapse_reverse_proxy_companion_proxy_send_timeout: 60
  149. matrix_synapse_reverse_proxy_companion_proxy_read_timeout: 60
  150. matrix_synapse_reverse_proxy_companion_send_timeout: 60
  151. # For OCSP purposes, we need to define a resolver at the `server{}` level or `http{}` level (we do the latter).
  152. #
  153. # Otherwise, we get warnings like this:
  154. # > [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"
  155. #
  156. # We point it to the internal Docker resolver, which likely delegates to nameservers defined in `/etc/resolv.conf`.
  157. matrix_synapse_reverse_proxy_companion_http_level_resolver: 127.0.0.11
  158. matrix_synapse_reverse_proxy_companion_hostname: "matrix-synapse-reverse-proxy-companion"
  159. # matrix_synapse_reverse_proxy_companion_client_api_addr specifies the address where the Client-Server API is
  160. matrix_synapse_reverse_proxy_companion_client_api_addr: 'matrix-synapse:{{ matrix_synapse_container_client_api_port }}'
  161. # This needs to be equal or higher than the maximum upload size accepted by Synapse.
  162. matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb: 50
  163. # matrix_synapse_reverse_proxy_companion_federation_api_enabled specifies whether reverse proxying for the Federation (Server-Server) API should be done
  164. matrix_synapse_reverse_proxy_companion_federation_api_enabled: true
  165. # matrix_synapse_reverse_proxy_companion_federation_api_addr specifies the address where the Federation (Server-Server) API is
  166. matrix_synapse_reverse_proxy_companion_federation_api_addr: 'matrix-synapse:{{ matrix_synapse_container_federation_api_plain_port }}'
  167. 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 }}"
  168. # A list of strings containing additional configuration blocks to add to the nginx vhost handling the Synapse Client-Server API
  169. matrix_synapse_reverse_proxy_companion_synapse_client_api_additional_server_configuration_blocks: []
  170. # A list of strings containing additional configuration blocks to add to the nginx vhost handling the Synapse Federation (Server-Server) API
  171. matrix_synapse_reverse_proxy_companion_synapse_federation_api_additional_server_configuration_blocks: []
  172. # synapse worker activation and endpoint mappings
  173. matrix_synapse_reverse_proxy_companion_synapse_workers_enabled: false
  174. matrix_synapse_reverse_proxy_companion_synapse_workers_list: []
  175. matrix_synapse_reverse_proxy_companion_synapse_generic_worker_client_server_locations: []
  176. matrix_synapse_reverse_proxy_companion_synapse_generic_worker_federation_locations: []
  177. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_typing_stream_worker_client_server_locations: []
  178. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_to_device_stream_worker_client_server_locations: []
  179. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_account_data_stream_worker_client_server_locations: []
  180. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_receipts_stream_worker_client_server_locations: []
  181. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_worker_client_server_locations: []
  182. matrix_synapse_reverse_proxy_companion_synapse_media_repository_locations: []
  183. matrix_synapse_reverse_proxy_companion_synapse_user_dir_locations: []
  184. # synapse content caching
  185. matrix_synapse_reverse_proxy_companion_synapse_cache_enabled: false
  186. matrix_synapse_reverse_proxy_companion_synapse_cache_path: /tmp/synapse-cache
  187. matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_name: "STATIC"
  188. matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_size: "10m"
  189. matrix_synapse_reverse_proxy_companion_synapse_cache_inactive_time: "48h"
  190. matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb: 1024
  191. matrix_synapse_reverse_proxy_companion_synapse_cache_proxy_cache_valid_time: "24h"
  192. # Controls whether matrix-synapse-reverse-proxy-companion trusts an upstream server's X-Forwarded-Proto header.
  193. # The `matrix-synapse-reverse-proxy-companion` does not terminate SSL and always expects to be fronted by another reverse-proxy server (`matrix-nginx-proxy`, etc.).
  194. # As such, it trusts the protocol scheme forwarded by the upstream proxy.
  195. matrix_synapse_reverse_proxy_companion_trust_forwarded_proto: true
  196. matrix_synapse_reverse_proxy_companion_x_forwarded_proto_value: "{{ '$http_x_forwarded_proto' if matrix_synapse_reverse_proxy_companion_trust_forwarded_proto else '$scheme' }}"