Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

73 wiersze
2.8 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 MDAD Team and contributors
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. #jinja2: lstrip_blocks: "True"
  6. worker_app: synapse.app.{{ matrix_synapse_worker_details.app }}
  7. worker_name: {{ matrix_synapse_worker_details.name }}
  8. worker_daemonize: false
  9. worker_log_config: /data/{{ matrix_server_fqn_matrix }}.log.config
  10. {% set http_resources = [] %}
  11. {% if matrix_synapse_worker_details.type == 'room_worker' %}
  12. {% set http_resources = http_resources + ['client', 'federation'] %}
  13. {% elif matrix_synapse_worker_details.type == 'sync_worker' %}
  14. {% set http_resources = http_resources + ['client'] %}
  15. {% elif matrix_synapse_worker_details.type == 'client_reader' %}
  16. {% set http_resources = http_resources + ['client'] %}
  17. {% elif matrix_synapse_worker_details.type == 'federation_reader' %}
  18. {% set http_resources = http_resources + ['federation'] %}
  19. {% elif matrix_synapse_worker_details.type == 'user_dir' %}
  20. {% set http_resources = http_resources + ['client'] %}
  21. {% elif matrix_synapse_worker_details.type == 'generic_worker' %}
  22. {% set http_resources = http_resources + ['client', 'federation'] %}
  23. {% endif %}
  24. {#
  25. None of the background workers need to handle federation traffic.
  26. Only some of the stream writers need to handle client traffic.
  27. #}
  28. {% if matrix_synapse_worker_details.type == 'stream_writer' and matrix_synapse_worker_details.webserving %}
  29. {% set http_resources = http_resources + ['client'] %}
  30. {% endif %}
  31. {% if matrix_synapse_worker_details.type == 'media_repository' %}
  32. {#
  33. Handling authenticated media endpoints (`/_matrix/client/VERSION/media/` and `/_matrix/federation/VERSION/media/`)
  34. requires serving the client and federation resources.
  35. #}
  36. {% set http_resources = http_resources + ['media', 'client', 'federation'] %}
  37. {% endif %}
  38. {% set replication_http_resources = [] %}
  39. {% if matrix_synapse_worker_details.type == 'stream_writer' %}
  40. {# All background workers need to handle replication traffic. #}
  41. {% set replication_http_resources = replication_http_resources + ['replication'] %}
  42. {% endif %}
  43. {% if http_resources|length > 0 or matrix_synapse_metrics_enabled or replication_http_resources|length > 0 %}
  44. worker_listeners:
  45. {% if http_resources|length > 0 %}
  46. - type: http
  47. bind_addresses: ['::']
  48. x_forwarded: true
  49. port: {{ matrix_synapse_worker_details.port }}
  50. resources:
  51. - names: {{ http_resources|to_json }}
  52. {% endif %}
  53. {% if matrix_synapse_metrics_enabled %}
  54. - type: metrics
  55. bind_addresses: ['0.0.0.0']
  56. port: {{ matrix_synapse_worker_details.metrics_port }}
  57. {% endif %}
  58. {% if replication_http_resources|length > 0 %}
  59. - type: http
  60. bind_addresses: ['::']
  61. port: {{ matrix_synapse_worker_details.replication_port }}
  62. resources:
  63. - names: {{ replication_http_resources|to_json }}
  64. {% endif %}
  65. {% endif %}