Initial work on getting nginx reverse proxying working with Dendrite

This commit is contained in:
Slavi Pantaleev
2021-12-18 10:50:44 +02:00
parent 2f57c51733
commit ecc237bbad
11 changed files with 143 additions and 28 deletions

View File

@ -68,7 +68,7 @@
- name: Ensure systemd reloaded after matrix-dendrite.service installation
service:
daemon_reload: yes
when: "matrix_dendrite_systemd_service_result.changed"
when: "matrix_dendrite_systemd_service_result.changed|bool"
- name: Ensure matrix-dendrite-create-account script created
template:

View File

@ -22,14 +22,14 @@
- import_tasks: "{{ role_path }}/tasks/self_check_client_api.yml"
delegate_to: 127.0.0.1
become: false
when: run_self_check|bool
when: run_self_check|bool and matrix_dendrite_enabled|bool
tags:
- self-check
- import_tasks: "{{ role_path }}/tasks/self_check_federation_api.yml"
delegate_to: 127.0.0.1
become: false
when: run_self_check|bool
when: run_self_check|bool and matrix_dendrite_enabled|bool
tags:
- self-check

View File

@ -7,14 +7,12 @@
register: result_matrix_dendrite_client_api
ignore_errors: true
check_mode: no
when: matrix_dendrite_enabled|bool
- name: Fail if Matrix Client API not working
fail:
msg: "Failed checking Matrix Client API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_dendrite_client_api_url_endpoint_public }}`). Is Dendrite running? Is port 443 open in your firewall? Full error: {{ result_matrix_dendrite_client_api }}"
when: "matrix_dendrite_enabled|bool and (result_matrix_dendrite_client_api.failed or 'json' not in result_matrix_dendrite_client_api)"
when: "(result_matrix_dendrite_client_api.failed or 'json' not in result_matrix_dendrite_client_api)"
- name: Report working Matrix Client API
debug:
msg: "The Matrix Client API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_dendrite_client_api_url_endpoint_public }}`) is working"
when: matrix_dendrite_enabled|bool

View File

@ -7,19 +7,18 @@
register: result_matrix_dendrite_federation_api
ignore_errors: true
check_mode: no
when: matrix_dendrite_enabled|bool
- name: Fail if Matrix Federation API not working
fail:
msg: "Failed checking Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_dendrite_federation_api_url_endpoint_public }}`). Is Dendrite running? Is port {{ matrix_federation_public_port }} open in your firewall? Full error: {{ result_matrix_dendrite_federation_api }}"
when: "matrix_dendrite_enabled|bool and matrix_dendrite_federation_enabled|bool and (result_matrix_dendrite_federation_api.failed or 'json' not in result_matrix_dendrite_federation_api)"
when: "matrix_dendrite_federation_enabled|bool and (result_matrix_dendrite_federation_api.failed or 'json' not in result_matrix_dendrite_federation_api)"
- name: Fail if Matrix Federation API unexpectedly enabled
fail:
msg: "Matrix Federation API is up at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_dendrite_federation_api_url_endpoint_public }}`) despite being disabled."
when: "matrix_dendrite_enabled|bool and not matrix_dendrite_federation_enabled|bool and not result_matrix_dendrite_federation_api.failed"
when: "not matrix_dendrite_federation_enabled|bool and not result_matrix_dendrite_federation_api.failed"
- name: Report working Matrix Federation API
debug:
msg: "The Matrix Federation API at `{{ matrix_server_fqn_matrix }}` (checked endpoint: `{{ matrix_dendrite_federation_api_url_endpoint_public }}`) is working"
when: "matrix_dendrite_enabled|bool and matrix_dendrite_federation_enabled|bool"
when: "matrix_dendrite_federation_enabled|bool"