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.
 
 

165 satır
11 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.
  3. #
  4. # When Synapse is NOT running in worker-mode, reverse-proxying is relatively simple (everything goes to `matrix-synapse:XXXX`).
  5. #
  6. # When Synapse workers are enabled, however, the reverse-proxying configuration is much more complicated.
  7. # Certain requests need to go to certain workers, etc.
  8. # In the past, the main reverse proxy (`matrix-synapse-reverse-proxy-companion`) was handling request routing to the appropriate workers,
  9. # but that only worked well for external requests (from outside of the Matrix server itself).
  10. #
  11. # Without the help of `matrix-synapse-reverse-proxy-companion`, internal services (like Dimension) that would like to talk to Synapse over the container network
  12. # did not have an endpoint for Synapse that they could be pointed to and have it just work.
  13. # If `matrix-synapse-reverse-proxy-companion` was enabled, Dimension could be pointed to its vhost handling Synapse and routing to the appropriate workers,
  14. # but when `matrix-synapse-reverse-proxy-companion` was disabled, this helpful functionality was not available and the best we could do
  15. # is point Dimension to the main Synapse process at `matrix-synapse:XXXX` itself.
  16. # Doing that breaks requests that need to go to specific workers.
  17. # See: https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/2090
  18. #
  19. # What this role does is, it extracts all the Synapse request routing out of the `matrix-synapse-reverse-proxy-companion` role here,
  20. # and makes the `matrix-synapse-reverse-proxy-companion` container service represent Synapse and route appropriately,
  21. # regardless of whether workers are enabled or disabled.
  22. # All other playbook services can then forget about `matrix-synapse` or `matrix-synapse-whatever-worker`, etc.,
  23. # and just use `matrix-synapse-reverse-proxy-companion` as their request destination.
  24. matrix_synapse_reverse_proxy_companion_enabled: true
  25. matrix_synapse_reverse_proxy_companion_version: 1.23.3-alpine
  26. matrix_synapse_reverse_proxy_companion_base_path: "{{ matrix_synapse_base_path }}/reverse-proxy-companion"
  27. matrix_synapse_reverse_proxy_companion_confd_path: "{{ matrix_synapse_reverse_proxy_companion_base_path }}/conf.d"
  28. # List of systemd services that matrix-synapse-reverse-proxy-companion.service depends on
  29. matrix_synapse_reverse_proxy_companion_systemd_required_services_list: ['docker.service']
  30. # List of systemd services that matrix-synapse-reverse-proxy-companion.service wants
  31. matrix_synapse_reverse_proxy_companion_systemd_wanted_services_list: ['matrix-synapse.service']
  32. # We use an official nginx image, which we fix-up to run unprivileged.
  33. # An alternative would be an `nginxinc/nginx-unprivileged` image, but
  34. # that is frequently out of date.
  35. matrix_synapse_reverse_proxy_companion_container_image: "{{ matrix_container_global_registry_prefix }}nginx:{{ matrix_synapse_reverse_proxy_companion_version }}"
  36. matrix_synapse_reverse_proxy_companion_container_image_force_pull: "{{ matrix_synapse_reverse_proxy_companion_container_image.endswith(':latest') }}"
  37. matrix_synapse_reverse_proxy_companion_container_network: "{{ matrix_docker_network }}"
  38. # A list of additional container networks that matrix-synapse-reverse-proxy-companion would be connected to.
  39. # The playbook does not create these networks, so make sure they already exist.
  40. #
  41. # Use this to expose matrix-synapse-reverse-proxy-companion to another reverse proxy, which runs in a different container network,
  42. # without exposing all other Matrix services to that other reverse-proxy.
  43. #
  44. # For background, see: https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1498
  45. matrix_synapse_reverse_proxy_companion_container_additional_networks: []
  46. # Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Client-Server API port (tcp/8008 in the container).
  47. #
  48. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8008"), or empty string to not expose.
  49. matrix_synapse_reverse_proxy_companion_container_client_api_host_bind_port: ''
  50. # Controls whether the matrix-synapse-reverse-proxy-companion container exposes its HTTP Federation (Server-Server) API port (tcp/8048 in the container).
  51. #
  52. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8048"), or empty string to not expose.
  53. matrix_synapse_reverse_proxy_companion_container_federation_api_host_bind_port: ''
  54. # The amount of worker processes and connections
  55. # Consider increasing these when you are expecting high amounts of traffic
  56. # http://nginx.org/en/docs/ngx_core_module.html#worker_connections
  57. matrix_synapse_reverse_proxy_companion_worker_processes: auto
  58. matrix_synapse_reverse_proxy_companion_worker_connections: 1024
  59. # Option to disable the access log
  60. matrix_synapse_reverse_proxy_companion_access_log_enabled: true
  61. # The tmpfs at /tmp needs to be large enough to handle multiple concurrent file uploads.
  62. matrix_synapse_reverse_proxy_companion_tmp_directory_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_federation_api_client_max_body_size_mb | int) * 50 }}"
  63. matrix_synapse_reverse_proxy_companion_tmp_cache_directory_size_mb: "{{ (matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb | int) * 2 }}"
  64. # A list of strings containing additional configuration blocks to add to the nginx server configuration (nginx.conf).
  65. # for big matrixservers to enlarge the number of open files to prevent timeouts
  66. # matrix_synapse_reverse_proxy_companion_additional_configuration_blocks:
  67. # - 'worker_rlimit_nofile 30000;'
  68. matrix_synapse_reverse_proxy_companion_additional_configuration_blocks: []
  69. # A list of strings containing additional configuration blocks to add to the nginx event server configuration (nginx.conf).
  70. matrix_synapse_reverse_proxy_companion_event_additional_configuration_blocks: []
  71. # A list of strings containing additional configuration blocks to add to the nginx http's server configuration (nginx-http.conf).
  72. matrix_synapse_reverse_proxy_companion_http_additional_server_configuration_blocks: []
  73. # To increase request timeout in NGINX using proxy_read_timeout, proxy_connect_timeout, proxy_send_timeout, send_timeout directives
  74. # Nginx Default: proxy_connect_timeout 60s; #Defines a timeout for establishing a connection with a proxied server
  75. # Nginx Default: proxy_send_timeout 60s; #Sets a timeout for transmitting a request to the proxied server.
  76. # Nginx Default: proxy_read_timeout 60s; #Defines a timeout for reading a response from the proxied server.
  77. # Nginx Default: send_timeout 60s; #Sets a timeout for transmitting a response to the client.
  78. #
  79. # For more information visit:
  80. # http://nginx.org/en/docs/http/ngx_http_proxy_module.html
  81. # http://nginx.org/en/docs/http/ngx_http_core_module.html#send_timeout
  82. # https://www.nginx.com/resources/wiki/start/topics/examples/fullexample2/
  83. #
  84. # Here we are sticking with nginx default values change this value carefully.
  85. matrix_synapse_reverse_proxy_companion_proxy_connect_timeout: 60
  86. matrix_synapse_reverse_proxy_companion_proxy_send_timeout: 60
  87. matrix_synapse_reverse_proxy_companion_proxy_read_timeout: 60
  88. matrix_synapse_reverse_proxy_companion_send_timeout: 60
  89. # For OCSP purposes, we need to define a resolver at the `server{}` level or `http{}` level (we do the latter).
  90. #
  91. # Otherwise, we get warnings like this:
  92. # > [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"
  93. #
  94. # We point it to the internal Docker resolver, which likely delegates to nameservers defined in `/etc/resolv.conf`.
  95. matrix_synapse_reverse_proxy_companion_http_level_resolver: 127.0.0.11
  96. matrix_synapse_reverse_proxy_companion_hostname: "matrix-synapse-reverse-proxy-companion"
  97. # matrix_synapse_reverse_proxy_companion_client_api_addr specifies the address where the Client-Server API is
  98. matrix_synapse_reverse_proxy_companion_client_api_addr: 'matrix-synapse:{{ matrix_synapse_container_client_api_port }}'
  99. # This needs to be equal or higher than the maximum upload size accepted by Synapse.
  100. matrix_synapse_reverse_proxy_companion_client_api_client_max_body_size_mb: 50
  101. # matrix_synapse_reverse_proxy_companion_federation_api_enabled specifies whether reverse proxying for the Federation (Server-Server) API should be done
  102. matrix_synapse_reverse_proxy_companion_federation_api_enabled: true
  103. # matrix_synapse_reverse_proxy_companion_federation_api_addr specifies the address where the Federation (Server-Server) API is
  104. matrix_synapse_reverse_proxy_companion_federation_api_addr: 'matrix-synapse:{{ matrix_synapse_container_federation_api_plain_port }}'
  105. 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 }}"
  106. # A list of strings containing additional configuration blocks to add to the nginx vhost handling the Synapse Client-Server API
  107. matrix_synapse_reverse_proxy_companion_synapse_client_api_additional_server_configuration_blocks: []
  108. # A list of strings containing additional configuration blocks to add to the nginx vhost handling the Synapse Federation (Server-Server) API
  109. matrix_synapse_reverse_proxy_companion_synapse_federation_api_additional_server_configuration_blocks: []
  110. # synapse worker activation and endpoint mappings
  111. matrix_synapse_reverse_proxy_companion_synapse_workers_enabled: false
  112. matrix_synapse_reverse_proxy_companion_synapse_workers_list: []
  113. matrix_synapse_reverse_proxy_companion_synapse_generic_worker_client_server_locations: []
  114. matrix_synapse_reverse_proxy_companion_synapse_generic_worker_federation_locations: []
  115. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_typing_stream_worker_client_server_locations: []
  116. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_to_device_stream_worker_client_server_locations: []
  117. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_account_data_stream_worker_client_server_locations: []
  118. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_receipts_stream_worker_client_server_locations: []
  119. matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_worker_client_server_locations: []
  120. matrix_synapse_reverse_proxy_companion_synapse_media_repository_locations: []
  121. matrix_synapse_reverse_proxy_companion_synapse_user_dir_locations: []
  122. # synapse content caching
  123. matrix_synapse_reverse_proxy_companion_synapse_cache_enabled: false
  124. matrix_synapse_reverse_proxy_companion_synapse_cache_path: /tmp/synapse-cache
  125. matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_name: "STATIC"
  126. matrix_synapse_reverse_proxy_companion_synapse_cache_keys_zone_size: "10m"
  127. matrix_synapse_reverse_proxy_companion_synapse_cache_inactive_time: "48h"
  128. matrix_synapse_reverse_proxy_companion_synapse_cache_max_size_mb: 1024
  129. matrix_synapse_reverse_proxy_companion_synapse_cache_proxy_cache_valid_time: "24h"
  130. # Controls whether matrix-synapse-reverse-proxy-companion trusts an upstream server's X-Forwarded-Proto header.
  131. # 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.).
  132. # As such, it trusts the protocol scheme forwarded by the upstream proxy.
  133. matrix_synapse_reverse_proxy_companion_trust_forwarded_proto: true
  134. matrix_synapse_reverse_proxy_companion_x_forwarded_proto_value: "{{ '$http_x_forwarded_proto' if matrix_synapse_reverse_proxy_companion_trust_forwarded_proto else '$scheme' }}"