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

67 行
2.7 KiB

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