2020-04-10 21:44:53 +00:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2022-09-15 04:05:25 +00:00
|
|
|
worker_app: synapse.app.{{ matrix_synapse_worker_details.app }}
|
|
|
|
worker_name: {{ matrix_synapse_worker_details.name }}
|
2020-04-10 21:44:53 +00:00
|
|
|
|
2022-09-15 05:14:47 +00:00
|
|
|
worker_daemonize: false
|
|
|
|
worker_log_config: /data/{{ matrix_server_fqn_matrix }}.log.config
|
|
|
|
|
2021-01-25 11:02:01 +00:00
|
|
|
{% set http_resources = [] %}
|
|
|
|
|
2024-01-16 22:51:23 +00:00
|
|
|
{% if matrix_synapse_worker_details.type == 'room_worker' %}
|
|
|
|
{% set http_resources = http_resources + ['client', 'federation'] %}
|
|
|
|
{% elif matrix_synapse_worker_details.type == 'sync_worker' %}
|
2021-01-25 11:02:01 +00:00
|
|
|
{% set http_resources = http_resources + ['client'] %}
|
2024-01-16 22:51:23 +00:00
|
|
|
{% elif matrix_synapse_worker_details.type == 'client_reader' %}
|
|
|
|
{% set http_resources = http_resources + ['client'] %}
|
|
|
|
{% elif matrix_synapse_worker_details.type == 'federation_reader' %}
|
|
|
|
{% set http_resources = http_resources + ['federation'] %}
|
|
|
|
{% elif matrix_synapse_worker_details.type == 'user_dir' %}
|
|
|
|
{% set http_resources = http_resources + ['client'] %}
|
|
|
|
{% elif matrix_synapse_worker_details.type == 'generic_worker' %}
|
2022-09-15 04:05:25 +00:00
|
|
|
{% set http_resources = http_resources + ['client', 'federation'] %}
|
2021-01-25 11:02:01 +00:00
|
|
|
{% endif %}
|
2022-09-15 04:05:25 +00:00
|
|
|
{#
|
|
|
|
None of the background workers need to handle federation traffic.
|
|
|
|
Only some of the stream writers need to handle client traffic.
|
|
|
|
#}
|
|
|
|
{% if matrix_synapse_worker_details.type == 'stream_writer' and matrix_synapse_worker_details.webserving %}
|
|
|
|
{% set http_resources = http_resources + ['client'] %}
|
|
|
|
{% endif %}
|
|
|
|
{% if matrix_synapse_worker_details.type == 'media_repository' %}
|
2024-07-17 14:52:21 +00:00
|
|
|
{#
|
2024-07-17 14:54:10 +00:00
|
|
|
Handling authenticated media endpoints (`/_matrix/client/VERSION/media/` and `/_matrix/federation/VERSION/media/`)
|
2024-07-17 14:52:21 +00:00
|
|
|
requires serving the client and federation resources.
|
|
|
|
#}
|
|
|
|
{% set http_resources = http_resources + ['media', 'client', 'federation'] %}
|
2021-01-25 11:02:01 +00:00
|
|
|
{% endif %}
|
2020-04-10 21:44:53 +00:00
|
|
|
|
2022-09-15 04:05:25 +00:00
|
|
|
{% set replication_http_resources = [] %}
|
|
|
|
{% if matrix_synapse_worker_details.type == 'stream_writer' %}
|
|
|
|
{# All background workers need to handle replication traffic. #}
|
|
|
|
{% set replication_http_resources = replication_http_resources + ['replication'] %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if http_resources|length > 0 or matrix_synapse_metrics_enabled or replication_http_resources|length > 0 %}
|
2020-04-10 21:44:53 +00:00
|
|
|
worker_listeners:
|
2021-01-25 11:02:01 +00:00
|
|
|
{% if http_resources|length > 0 %}
|
2020-04-10 21:44:53 +00:00
|
|
|
- type: http
|
2021-01-25 10:29:47 +00:00
|
|
|
bind_addresses: ['::']
|
2022-06-18 14:13:08 +00:00
|
|
|
x_forwarded: true
|
2021-01-25 10:14:46 +00:00
|
|
|
port: {{ matrix_synapse_worker_details.port }}
|
2020-04-10 21:44:53 +00:00
|
|
|
resources:
|
2021-01-25 11:02:01 +00:00
|
|
|
- names: {{ http_resources|to_json }}
|
2020-12-01 22:49:23 +00:00
|
|
|
{% endif %}
|
2021-01-25 10:24:12 +00:00
|
|
|
{% if matrix_synapse_metrics_enabled %}
|
2020-12-01 21:49:15 +00:00
|
|
|
- type: metrics
|
2021-02-15 09:19:07 +00:00
|
|
|
bind_addresses: ['0.0.0.0']
|
2021-01-25 10:14:46 +00:00
|
|
|
port: {{ matrix_synapse_worker_details.metrics_port }}
|
2021-01-25 10:24:12 +00:00
|
|
|
{% endif %}
|
2022-09-15 04:05:25 +00:00
|
|
|
{% if replication_http_resources|length > 0 %}
|
|
|
|
- type: http
|
|
|
|
bind_addresses: ['::']
|
|
|
|
port: {{ matrix_synapse_worker_details.replication_port }}
|
|
|
|
resources:
|
|
|
|
- names: {{ replication_http_resources|to_json }}
|
|
|
|
{% endif %}
|
2021-01-25 11:02:01 +00:00
|
|
|
{% endif %}
|