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
|
|
|
{% if matrix_synapse_replication_listener_enabled %}
|
2021-01-25 10:14:46 +00:00
|
|
|
worker_replication_host: matrix-synapse
|
2020-04-10 21:44:53 +00:00
|
|
|
worker_replication_http_port: {{ matrix_synapse_replication_http_port }}
|
2021-01-25 11:02:01 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2022-09-15 05:14:47 +00:00
|
|
|
{% if matrix_synapse_worker_details.type == 'generic_worker' %}
|
|
|
|
worker_main_http_uri: http://matrix-synapse:{{ matrix_synapse_container_client_api_port }}
|
|
|
|
{% endif %}
|
|
|
|
|
2021-01-25 11:02:01 +00:00
|
|
|
{% set http_resources = [] %}
|
|
|
|
|
2022-09-15 04:05:25 +00:00
|
|
|
{% if matrix_synapse_worker_details.type == 'user_dir' %}
|
2021-01-25 11:02:01 +00:00
|
|
|
{% set http_resources = http_resources + ['client'] %}
|
|
|
|
{% endif %}
|
2022-09-15 04:05:25 +00:00
|
|
|
{% if matrix_synapse_worker_details.type == 'generic_worker' %}
|
|
|
|
{% 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' %}
|
2021-01-25 11:02:01 +00:00
|
|
|
{% set http_resources = http_resources + ['media'] %}
|
|
|
|
{% 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 %}
|