diff --git a/roles/matrix-bridge-mautrix-wsproxy/defaults/main.yml b/roles/matrix-bridge-mautrix-wsproxy/defaults/main.yml index 94602d809..54434c2a5 100644 --- a/roles/matrix-bridge-mautrix-wsproxy/defaults/main.yml +++ b/roles/matrix-bridge-mautrix-wsproxy/defaults/main.yml @@ -99,4 +99,4 @@ matrix_mautrix_wsproxy_syncproxy_database_hostname: 'matrix-postgres' matrix_mautrix_wsproxy_syncproxy_database_port: 5432 matrix_mautrix_wsproxy_syncproxy_database_name: 'matrix_mautrix_wsproxy_syncproxy' -matrix_mautrix_signal_wsproxy_syncproxy_connection_string: 'postgres://{{ matrix_mautrix_wsproxy_syncproxy_database_username }}:{{ matrix_mautrix_wsproxy_syncproxy_database_password }}@{{ matrix_mautrix_wsproxy_syncproxy_database_hostname }}:{{ matrix_mautrix_wsproxy_syncproxy_database_port }}/{{ matrix_mautrix_wsproxy_syncproxy_database_name }}' \ No newline at end of file +matrix_mautrix_signal_wsproxy_syncproxy_connection_string: 'postgres://{{ matrix_mautrix_wsproxy_syncproxy_database_username }}:{{ matrix_mautrix_wsproxy_syncproxy_database_password }}@{{ matrix_mautrix_wsproxy_syncproxy_database_hostname }}:{{ matrix_mautrix_wsproxy_syncproxy_database_port }}/{{ matrix_mautrix_wsproxy_syncproxy_database_name }}' diff --git a/roles/matrix-bridge-mautrix-wsproxy/tasks/init.yml b/roles/matrix-bridge-mautrix-wsproxy/tasks/init.yml index e17ef2233..819c3b041 100644 --- a/roles/matrix-bridge-mautrix-wsproxy/tasks/init.yml +++ b/roles/matrix-bridge-mautrix-wsproxy/tasks/init.yml @@ -6,17 +6,20 @@ # If the matrix-synapse role is not used, these variables may not exist. - ansible.builtin.set_fact: matrix_synapse_container_extra_arguments: > - {{ matrix_synapse_container_extra_arguments|default([]) }} - + - ["--mount type=bind,src={{ matrix_mautrix_wsproxy_config_path }}/registration.yaml,dst=/matrix-mautrix-wsproxy-registration.yaml,ro"] + {{ + matrix_synapse_container_extra_arguments | default([]) + + + ["--mount type=bind,src={{ matrix_mautrix_wsproxy_config_path }}/registration.yaml,dst=/matrix-mautrix-wsproxy-registration.yaml,ro"] + }} matrix_synapse_app_service_config_files: > - {{ matrix_synapse_app_service_config_files|default([]) }} - + - {{ ["/matrix-mautrix-wsproxy-registration.yaml"] }} + {{ + matrix_synapse_app_service_config_files | default([]) + + + ["/matrix-mautrix-wsproxy-registration.yaml"] + }} when: matrix_mautrix_wsproxy_enabled|bool - - block: - name: Fail if matrix-nginx-proxy role already executed ansible.builtin.fail: @@ -34,11 +37,11 @@ {% if matrix_nginx_proxy_enabled|default(False) %} {# Use the embedded DNS resolver in Docker containers to discover the service #} resolver 127.0.0.11 valid=5s; - set $backend "matrix-mautrix-wsproxy:{{ matrix_mautrix_wsproxy_port }}"; + set $backend "matrix-mautrix-wsproxy:29331"; proxy_pass http://$backend; {% else %} {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_mautrix_wsproxy_port }}; + proxy_pass http://127.0.0.1:29331; {% endif %} } diff --git a/roles/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml index aab1d3c50..2404ae2f1 100644 --- a/roles/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml @@ -82,7 +82,7 @@ - name: Ensure matrix-mautrix-wsproxy-syncproxy.service installed ansible.builtin.template: src: "{{ role_path }}/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2" - dest: "{{ matrix_systemd_path }}/matrix-mautrix-wsproxy.service" + dest: "{{ matrix_systemd_path }}/matrix-mautrix-wsproxy-syncproxy.service" mode: 0644 register: matrix_mautrix_wsproxy_syncproxy_systemd_service_result diff --git a/roles/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 b/roles/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 index d468ec0df..e16e1919e 100644 --- a/roles/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 +++ b/roles/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 @@ -25,9 +25,9 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-wsprox --cap-drop=ALL \ --network={{ matrix_docker_network }} \ -p {{ matrix_mautrix_wsproxy_syncproxy_port }}:29331 \ - -e DATABASE_URL={{ matrix_mautrix_signal_wsproxy_syncproxy_connection_string }} - -e HOMESERVER_URL={{ matrix_homeserver_container_url }} - -e SHARED_SECRET={{ matrix_mautrix_wsproxy_syncproxy_shared_secret }} + -e DATABASE_URL={{ matrix_mautrix_signal_wsproxy_syncproxy_connection_string }} \ + -e HOMESERVER_URL={{ matrix_homeserver_container_url }} \ + -e SHARED_SECRET={{ matrix_mautrix_wsproxy_syncproxy_shared_secret }} \ {% for arg in matrix_mautrix_wsproxy_syncproxy_container_extra_arguments %} {{ arg }} \ {% endfor %} diff --git a/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-mautrix-wsproxy.conf.j2 b/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-mautrix-wsproxy.conf.j2 index 0cdcddf30..47e4c4328 100644 --- a/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-mautrix-wsproxy.conf.j2 +++ b/roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-mautrix-wsproxy.conf.j2 @@ -26,11 +26,11 @@ {% if matrix_nginx_proxy_enabled %} {# Use the embedded DNS resolver in Docker containers to discover the service #} resolver 127.0.0.11 valid=5s; - set $backend "wsproxy:{{ matrix_mautrix_wsproxy_port }}"; + set $backend "wsproxy:29331"; proxy_pass http://$backend; {% else %} {# Generic configuration for use outside of our container setup #} - proxy_pass http://127.0.0.1:{{ matrix_mautrix_wsproxy_port }}; + proxy_pass http://127.0.0.1:29331; {% endif %} proxy_set_header Host $host;