Remove Conduit support from matrix-nginx-proxy

This commit is contained in:
Slavi Pantaleev 2024-01-11 09:21:00 +02:00
parent 9ae8ccac36
commit 030e8065e4
5 changed files with 9 additions and 111 deletions

View File

@ -3376,12 +3376,6 @@ matrix_nginx_proxy_proxy_dendrite_client_api_addr_sans_container: "127.0.0.1:{{
matrix_nginx_proxy_proxy_dendrite_federation_api_addr_with_container: "matrix-dendrite:{{ matrix_dendrite_http_bind_port | string }}" matrix_nginx_proxy_proxy_dendrite_federation_api_addr_with_container: "matrix-dendrite:{{ matrix_dendrite_http_bind_port | string }}"
matrix_nginx_proxy_proxy_dendrite_federation_api_addr_sans_container: "127.0.0.1:{{ matrix_dendrite_http_bind_port | string }}" matrix_nginx_proxy_proxy_dendrite_federation_api_addr_sans_container: "127.0.0.1:{{ matrix_dendrite_http_bind_port | string }}"
matrix_nginx_proxy_proxy_conduit_enabled: "{{ matrix_conduit_enabled }}"
matrix_nginx_proxy_proxy_conduit_client_api_addr_with_container: "matrix-conduit:{{ matrix_conduit_port_number|string }}"
matrix_nginx_proxy_proxy_conduit_client_api_addr_sans_container: "127.0.0.1:{{ matrix_conduit_port_number|string }}"
matrix_nginx_proxy_proxy_conduit_federation_api_addr_with_container: "matrix-conduit:{{ matrix_conduit_port_number|string }}"
matrix_nginx_proxy_proxy_conduit_federation_api_addr_sans_container: "127.0.0.1:{{ matrix_conduit_port_number|string }}"
# When matrix-nginx-proxy is disabled, the actual port number that the vhost uses may begin to matter. # When matrix-nginx-proxy is disabled, the actual port number that the vhost uses may begin to matter.
matrix_nginx_proxy_proxy_matrix_federation_port: "{{ matrix_federation_public_port }}" matrix_nginx_proxy_proxy_matrix_federation_port: "{{ matrix_federation_public_port }}"

View File

@ -143,21 +143,6 @@ matrix_nginx_proxy_proxy_dendrite_client_api_addr_sans_container: ""
# A list of strings containing additional configuration blocks to add to the Dendrite's server configuration (matrix-dendrite.conf). # A list of strings containing additional configuration blocks to add to the Dendrite's server configuration (matrix-dendrite.conf).
matrix_nginx_proxy_proxy_dendrite_additional_server_configuration_blocks: [] matrix_nginx_proxy_proxy_dendrite_additional_server_configuration_blocks: []
# Controls whether proxying for Conduit should be done.
matrix_nginx_proxy_proxy_conduit_enabled: false
matrix_nginx_proxy_proxy_conduit_hostname: "matrix-nginx-proxy"
matrix_nginx_proxy_proxy_conduit_federation_api_enabled: "{{ matrix_nginx_proxy_proxy_matrix_federation_api_enabled }}"
# Controls whether the Client API server (usually at matrix.DOMAIN:443) should explicitly reject `/_matrix/federation` endpoints.
matrix_nginx_proxy_proxy_conduit_block_federation_api_on_client_port: true
# The addresses where the Matrix Client API is, when using Conduit.
matrix_nginx_proxy_proxy_conduit_client_api_addr_with_container: ""
matrix_nginx_proxy_proxy_conduit_client_api_addr_sans_container: ""
# The addresses where the Federation API is, when using Conduit.
matrix_nginx_proxy_proxy_conduit_federation_api_addr_with_container: ""
matrix_nginx_proxy_proxy_conduit_federation_api_addr_sans_container: ""
# A list of strings containing additional configuration blocks to add to the Conduit's server configuration (matrix-conduit.conf).
matrix_nginx_proxy_proxy_conduit_additional_server_configuration_blocks: []
# Controls whether proxying the Element domain should be done. # Controls whether proxying the Element domain should be done.
matrix_nginx_proxy_proxy_element_enabled: false matrix_nginx_proxy_proxy_element_enabled: false
matrix_nginx_proxy_proxy_element_hostname: "{{ matrix_server_fqn_element }}" matrix_nginx_proxy_proxy_element_hostname: "{{ matrix_server_fqn_element }}"

View File

@ -70,19 +70,6 @@
state: absent state: absent
when: "not matrix_nginx_proxy_proxy_dendrite_enabled | bool" when: "not matrix_nginx_proxy_proxy_dendrite_enabled | bool"
- name: Ensure Matrix nginx-proxy configuration for matrix-conduit exists
ansible.builtin.template:
src: "{{ role_path }}/templates/nginx/conf.d/matrix-conduit.conf.j2"
dest: "{{ matrix_nginx_proxy_confd_path }}/matrix-conduit.conf"
mode: 0644
when: matrix_nginx_proxy_proxy_conduit_enabled | bool
- name: Ensure Matrix nginx-proxy configuration for matrix-conduit deleted
ansible.builtin.file:
path: "{{ matrix_nginx_proxy_confd_path }}/matrix-conduit.conf"
state: absent
when: "not matrix_nginx_proxy_proxy_conduit_enabled | bool"
- name: Ensure Matrix nginx-proxy configuration for Element domain exists - name: Ensure Matrix nginx-proxy configuration for Element domain exists
ansible.builtin.template: ansible.builtin.template:
src: "{{ role_path }}/templates/nginx/conf.d/matrix-client-element.conf.j2" src: "{{ role_path }}/templates/nginx/conf.d/matrix-client-element.conf.j2"

View File

@ -1,77 +0,0 @@
#jinja2: lstrip_blocks: "True"
server {
listen 12080;
server_name {{ matrix_nginx_proxy_proxy_conduit_hostname }};
server_tokens off;
root /dev/null;
gzip on;
gzip_types text/plain application/json;
{% for configuration_block in matrix_nginx_proxy_proxy_conduit_additional_server_configuration_blocks %}
{{- configuration_block }}
{% endfor %}
{% if matrix_nginx_proxy_proxy_conduit_block_federation_api_on_client_port %}
location /_matrix/federation {
{% if matrix_nginx_proxy_proxy_conduit_federation_api_enabled %}
return 404 'The Federation API is served at https://{{ matrix_server_fqn_matrix }}:{{ matrix_federation_public_port }}';
{% else %}
return 404 'This Matrix server is running with federation disabled';
{% endif %}
}
{% endif %}
{# Everything else just goes to the API server ##}
location / {
{% if matrix_nginx_proxy_enabled %}
{# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
set $backend "{{ matrix_nginx_proxy_proxy_conduit_client_api_addr_with_container }}";
proxy_pass http://$backend;
{% else %}
{# Generic configuration for use outside of our container setup #}
proxy_pass http://{{ matrix_nginx_proxy_proxy_conduit_client_api_addr_sans_container }};
{% endif %}
proxy_set_header Host $host;
client_body_buffer_size 25M;
client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_client_api_client_max_body_size_mb }}M;
proxy_max_temp_file_size 0;
}
}
{% if matrix_nginx_proxy_proxy_conduit_federation_api_enabled %}
server {
listen 12088;
server_name {{ matrix_nginx_proxy_proxy_conduit_hostname }};
server_tokens off;
root /dev/null;
gzip on;
gzip_types text/plain application/json;
location / {
{% if matrix_nginx_proxy_enabled %}
{# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver {{ matrix_nginx_proxy_http_level_resolver }} valid=5s;
set $backend "{{ matrix_nginx_proxy_proxy_conduit_federation_api_addr_with_container }}";
proxy_pass http://$backend;
{% else %}
{# Generic configuration for use outside of our container setup #}
proxy_pass http://{{ matrix_nginx_proxy_proxy_conduit_federation_api_addr_sans_container }};
{% endif %}
proxy_set_header Host $host;
client_body_buffer_size 25M;
client_max_body_size {{ matrix_nginx_proxy_proxy_matrix_federation_api_client_max_body_size_mb }}M;
proxy_max_temp_file_size 0;
}
}
{% endif %}

View File

@ -105,6 +105,15 @@
- {'old': 'matrix_nginx_proxy_proxy_matrix_3pid_registration_addr_with_container', 'new': '<removed>'} - {'old': 'matrix_nginx_proxy_proxy_matrix_3pid_registration_addr_with_container', 'new': '<removed>'}
- {'old': 'matrix_nginx_proxy_proxy_matrix_3pid_registration_addr_sans_container', 'new': '<removed>'} - {'old': 'matrix_nginx_proxy_proxy_matrix_3pid_registration_addr_sans_container', 'new': '<removed>'}
- {'old': 'matrix_nginx_proxy_proxy_matrix_3pid_registration_v3_to_r0_redirect_enabled', 'new': '<superseded by matrix_ma1sd_container_labels_matrix_client_3pid_registration_path>'} - {'old': 'matrix_nginx_proxy_proxy_matrix_3pid_registration_v3_to_r0_redirect_enabled', 'new': '<superseded by matrix_ma1sd_container_labels_matrix_client_3pid_registration_path>'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_enabled', 'new': 'matrix_conduit_container_labels_traefik_enabled'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_block_federation_api_on_client_port', 'new': '<not supported anymore - the /_matrix/federation endpoints are now also being served on the Client-Server API port>'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_federation_api_enabled', 'new': 'matrix_conduit_container_labels_federation_api_enabled'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_client_api_addr_with_container', 'new': '<removed>'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_client_api_addr_sans_container', 'new': '<removed>'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_federation_api_addr_with_container', 'new': '<removed>'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_federation_api_addr_sans_container', 'new': '<removed>'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_additional_server_configuration_blocks', 'new': '<removed>'}
- {'old': 'matrix_nginx_proxy_proxy_conduit_additional_server_configuration_blocks', 'new': '<removed>'}
- name: (Deprecation) Catch and report matrix_postgres variables - name: (Deprecation) Catch and report matrix_postgres variables
ansible.builtin.fail: ansible.builtin.fail: