2020-04-10 23:44:53 +02:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2022-09-15 06:05:25 +02:00
|
|
|
worker_app: synapse.app.{{ matrix_synapse_worker_details.app }}
|
|
|
|
worker_name: {{ matrix_synapse_worker_details.name }}
|
2020-04-10 23:44:53 +02:00
|
|
|
|
2022-09-15 07:14:47 +02:00
|
|
|
worker_daemonize: false
|
|
|
|
worker_log_config: /data/{{ matrix_server_fqn_matrix }}.log.config
|
|
|
|
|
2021-01-25 13:02:01 +02:00
|
|
|
{% if matrix_synapse_replication_listener_enabled %}
|
2021-01-25 12:14:46 +02:00
|
|
|
worker_replication_host: matrix-synapse
|
2020-04-10 23:44:53 +02:00
|
|
|
worker_replication_http_port: {{ matrix_synapse_replication_http_port }}
|
2021-01-25 13:02:01 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2022-09-15 07:14:47 +02: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 13:02:01 +02:00
|
|
|
{% set http_resources = [] %}
|
|
|
|
|
2022-09-15 06:05:25 +02:00
|
|
|
{% if matrix_synapse_worker_details.type == 'user_dir' %}
|
2021-01-25 13:02:01 +02:00
|
|
|
{% set http_resources = http_resources + ['client'] %}
|
|
|
|
{% endif %}
|
2022-09-15 06:05:25 +02:00
|
|
|
{% if matrix_synapse_worker_details.type == 'generic_worker' %}
|
|
|
|
{% set http_resources = http_resources + ['client', 'federation'] %}
|
2021-01-25 13:02:01 +02:00
|
|
|
{% endif %}
|
2022-09-15 06:05:25 +02: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 13:02:01 +02:00
|
|
|
{% set http_resources = http_resources + ['media'] %}
|
|
|
|
{% endif %}
|
2020-04-10 23:44:53 +02:00
|
|
|
|
2022-09-15 06:05:25 +02: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 23:44:53 +02:00
|
|
|
worker_listeners:
|
2021-01-25 13:02:01 +02:00
|
|
|
{% if http_resources|length > 0 %}
|
2020-04-10 23:44:53 +02:00
|
|
|
- type: http
|
2021-01-25 12:29:47 +02:00
|
|
|
bind_addresses: ['::']
|
2022-06-18 16:13:08 +02:00
|
|
|
x_forwarded: true
|
2021-01-25 12:14:46 +02:00
|
|
|
port: {{ matrix_synapse_worker_details.port }}
|
2020-04-10 23:44:53 +02:00
|
|
|
resources:
|
2021-01-25 13:02:01 +02:00
|
|
|
- names: {{ http_resources|to_json }}
|
2020-12-02 00:49:23 +02:00
|
|
|
{% endif %}
|
2021-01-25 12:24:12 +02:00
|
|
|
{% if matrix_synapse_metrics_enabled %}
|
2020-12-01 23:49:15 +02:00
|
|
|
- type: metrics
|
2021-02-15 11:19:07 +02:00
|
|
|
bind_addresses: ['0.0.0.0']
|
2021-01-25 12:14:46 +02:00
|
|
|
port: {{ matrix_synapse_worker_details.metrics_port }}
|
2021-01-25 12:24:12 +02:00
|
|
|
{% endif %}
|
2022-09-15 06:05:25 +02: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 13:02:01 +02:00
|
|
|
{% endif %}
|