Improvements around Synapse worker/metrics ports exposure
There was a `matrix_nginx_proxy_enabled|default(False)` check, but: - it didn't seem to work reliably for some reason (hmm) - referring to a `matrix_nginx_proxy_*` variable from within the `matrix-synapse` role is not ideal - exposing always happened on `127.0.0.1`, which may not be good enough for some rarer setups (where the own webserver is external to the host)
This commit is contained in:
@ -45,19 +45,16 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-synapse \
|
||||
{% if matrix_synapse_manhole_enabled and matrix_synapse_container_manhole_api_host_bind_port %}
|
||||
-p {{ matrix_synapse_container_manhole_api_host_bind_port }}:9000 \
|
||||
{% endif %}
|
||||
{% if matrix_synapse_workers_enabled and matrix_synapse_workers_container_host_bind_address %}
|
||||
{% for worker in matrix_synapse_workers_enabled_list %}
|
||||
{% if matrix_synapse_workers_enabled and not matrix_nginx_proxy_enabled|default(False) %}
|
||||
{# Expose worker ports (by default in 18xxx range) on localhost, f.e. when using
|
||||
an external reverse proxy outside the matrix docker network #}
|
||||
{% if worker.port != 0 %}
|
||||
-p 127.0.0.1:{{ worker.port }}:{{ worker.port }} \
|
||||
-p {{ '' if matrix_synapse_workers_container_host_bind_address == '*' else (matrix_synapse_workers_container_host_bind_address + ':') }}{{ worker.port }}:{{ worker.port }} \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{# Expose worker metrics ports on localhost #}
|
||||
{% if worker.metrics_port != 0 %}
|
||||
-p 127.0.0.1:{{ worker.metrics_port }}:{{ worker.metrics_port }} \
|
||||
-p {{ '' if matrix_synapse_workers_container_host_bind_address == '*' else (matrix_synapse_workers_container_host_bind_address + ':') }}{{ worker.metrics_port }}:{{ worker.metrics_port }} \
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
--mount type=bind,src={{ matrix_synapse_config_dir_path }},dst=/data,ro \
|
||||
--mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \
|
||||
{% for volume in matrix_synapse_container_additional_volumes %}
|
||||
|
Reference in New Issue
Block a user