WIP
This commit is contained in:
parent
2b320c128f
commit
41d8776016
@ -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 }}'
|
||||
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.
|
||||
- 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 %}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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 %}
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user