feat: serve mautrix bridgev2 wellknown file

This commit is contained in:
Paul ALNET
2024-10-20 21:41:08 +02:00
parent c57c9f68c0
commit 564b3cf169
5 changed files with 97 additions and 0 deletions

View File

@ -52,6 +52,10 @@
dest: "{{ matrix_static_files_public_well_known_matrix_path }}/support"
when: "{{ matrix_static_files_file_matrix_support_enabled }}"
- content: "{{ matrix_static_files_file_matrix_mautrix_configuration | to_nice_json }}"
dest: "{{ matrix_static_files_public_well_known_matrix_path }}/mautrix"
when: "{{ matrix_static_files_file_matrix_mautrix_enabled }}"
# This one will not be deleted if `matrix_static_files_file_index_html_enabled` flips to `false`.
# See the comment for `matrix_static_files_file_index_html_enabled` to learn why.
- content: "{{ matrix_static_files_file_index_html_template }}"
@ -70,6 +74,12 @@
state: absent
when: "not matrix_static_files_file_matrix_support_enabled | bool"
- name: Ensure /.well-known/matrix/mautrix file deleted if not enabled
ansible.builtin.file:
path: "{{ matrix_static_files_public_well_known_matrix_path }}/mautrix"
state: absent
when: "not matrix_static_files_file_matrix_mautrix_enabled | bool"
- name: Ensure matrix-static-files container image is pulled
community.docker.docker_image:
name: "{{ matrix_static_files_container_image }}"

View File

@ -24,6 +24,21 @@
ansible.builtin.set_fact:
well_known_file_checks: "{{ well_known_file_checks + [well_known_file_check_matrix_server] }}"
- when: matrix_static_files_file_matrix_mautrix_enabled | bool
block:
- name: Prepare /.well-known/matrix/mautrix to well-known files to check, if enabled
ansible.builtin.set_fact:
well_known_file_check_matrix_mautrix:
path: /.well-known/matrix/mautrix
purpose: Mautrix bridge discovery
cors: true
follow_redirects: safe
validate_certs: "{{ matrix_static_files_self_check_validate_certificates }}"
- name: Inject /.well-known/matrix/mautrix to well-known files to check, if enabled
ansible.builtin.set_fact:
well_known_file_checks: "{{ well_known_file_checks + [well_known_file_check_matrix_mautrix] }}"
- name: Perform well-known checks
ansible.builtin.include_tasks: "{{ role_path }}/tasks/self_check_well_known_file.yml"
with_items: "{{ well_known_file_checks }}"