| @@ -99,4 +99,4 @@ matrix_mautrix_wsproxy_syncproxy_database_hostname: 'matrix-postgres' | |||||
| matrix_mautrix_wsproxy_syncproxy_database_port: 5432 | matrix_mautrix_wsproxy_syncproxy_database_port: 5432 | ||||
| matrix_mautrix_wsproxy_syncproxy_database_name: 'matrix_mautrix_wsproxy_syncproxy' | 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 }}' | |||||
| 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 }}' | |||||
| @@ -6,17 +6,20 @@ | |||||
| # If the matrix-synapse role is not used, these variables may not exist. | # If the matrix-synapse role is not used, these variables may not exist. | ||||
| - ansible.builtin.set_fact: | - ansible.builtin.set_fact: | ||||
| matrix_synapse_container_extra_arguments: > | 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: > | ||||
| {{ 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 | when: matrix_mautrix_wsproxy_enabled|bool | ||||
| - block: | - block: | ||||
| - name: Fail if matrix-nginx-proxy role already executed | - name: Fail if matrix-nginx-proxy role already executed | ||||
| ansible.builtin.fail: | ansible.builtin.fail: | ||||
| @@ -34,11 +37,11 @@ | |||||
| {% if matrix_nginx_proxy_enabled|default(False) %} | {% if matrix_nginx_proxy_enabled|default(False) %} | ||||
| {# Use the embedded DNS resolver in Docker containers to discover the service #} | {# Use the embedded DNS resolver in Docker containers to discover the service #} | ||||
| resolver 127.0.0.11 valid=5s; | 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; | proxy_pass http://$backend; | ||||
| {% else %} | {% else %} | ||||
| {# Generic configuration for use outside of our container setup #} | {# 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 %} | {% endif %} | ||||
| } | } | ||||
| @@ -82,7 +82,7 @@ | |||||
| - name: Ensure matrix-mautrix-wsproxy-syncproxy.service installed | - name: Ensure matrix-mautrix-wsproxy-syncproxy.service installed | ||||
| ansible.builtin.template: | ansible.builtin.template: | ||||
| src: "{{ role_path }}/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2" | 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 | mode: 0644 | ||||
| register: matrix_mautrix_wsproxy_syncproxy_systemd_service_result | register: matrix_mautrix_wsproxy_syncproxy_systemd_service_result | ||||
| @@ -25,9 +25,9 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-wsprox | |||||
| --cap-drop=ALL \ | --cap-drop=ALL \ | ||||
| --network={{ matrix_docker_network }} \ | --network={{ matrix_docker_network }} \ | ||||
| -p {{ matrix_mautrix_wsproxy_syncproxy_port }}:29331 \ | -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 %} | {% for arg in matrix_mautrix_wsproxy_syncproxy_container_extra_arguments %} | ||||
| {{ arg }} \ | {{ arg }} \ | ||||
| {% endfor %} | {% endfor %} | ||||
| @@ -26,11 +26,11 @@ | |||||
| {% if matrix_nginx_proxy_enabled %} | {% if matrix_nginx_proxy_enabled %} | ||||
| {# Use the embedded DNS resolver in Docker containers to discover the service #} | {# Use the embedded DNS resolver in Docker containers to discover the service #} | ||||
| resolver 127.0.0.11 valid=5s; | resolver 127.0.0.11 valid=5s; | ||||
| set $backend "wsproxy:{{ matrix_mautrix_wsproxy_port }}"; | |||||
| set $backend "wsproxy:29331"; | |||||
| proxy_pass http://$backend; | proxy_pass http://$backend; | ||||
| {% else %} | {% else %} | ||||
| {# Generic configuration for use outside of our container setup #} | {# 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 %} | {% endif %} | ||||
| proxy_set_header Host $host; | proxy_set_header Host $host; | ||||