Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

66 linhas
3.0 KiB

  1. ---
  2. - ansible.builtin.set_fact:
  3. matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-wsproxy.service'] }}"
  4. when: matrix_mautrix_wsproxy_enabled|bool
  5. # If the matrix-synapse role is not used, these variables may not exist.
  6. - ansible.builtin.set_fact:
  7. matrix_synapse_container_extra_arguments: >
  8. {{ matrix_synapse_container_extra_arguments|default([]) }}
  9. +
  10. ["--mount type=bind,src={{ matrix_mautrix_wsproxy_config_path }}/registration.yaml,dst=/matrix-mautrix-wsproxy-registration.yaml,ro"]
  11. matrix_synapse_app_service_config_files: >
  12. {{ matrix_synapse_app_service_config_files|default([]) }}
  13. +
  14. {{ ["/matrix-mautrix-wsproxy-registration.yaml"] }}
  15. when: matrix_mautrix_wsproxy_enabled|bool
  16. - block:
  17. - name: Fail if matrix-nginx-proxy role already executed
  18. ansible.builtin.fail:
  19. msg: >-
  20. Trying to append Mautrix Wsproxy reverse-proxying configuration to matrix-nginx-proxy,
  21. but it's pointless since the matrix-nginx-proxy role had already executed.
  22. To fix this, please change the order of roles in your playbook,
  23. so that the matrix-nginx-proxy role would run after the matrix-bridge-mautrix-wsproxy role.
  24. when: matrix_nginx_proxy_role_executed|default(False)|bool
  25. - name: Generate Mautrix Wsproxy proxying configuration for matrix-nginx-proxy
  26. ansible.builtin.set_fact:
  27. matrix_mautrix_wsproxy_matrix_nginx_proxy_configuration: |
  28. location ~ ^/(_matrix/wsproxy/.*) {
  29. {% if matrix_nginx_proxy_enabled|default(False) %}
  30. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  31. resolver 127.0.0.11 valid=5s;
  32. set $backend "matrix-mautrix-wsproxy:{{ matrix_mautrix_wsproxy_port }}";
  33. proxy_pass http://$backend;
  34. {% else %}
  35. {# Generic configuration for use outside of our container setup #}
  36. proxy_pass http://127.0.0.1:{{ matrix_mautrix_wsproxy_port }};
  37. {% endif %}
  38. }
  39. - name: Register Mautrix Wsproxy proxying configuration with matrix-nginx-proxy
  40. ansible.builtin.set_fact:
  41. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
  42. {{
  43. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([])
  44. +
  45. [matrix_mautrix_wsproxy_matrix_nginx_proxy_configuration]
  46. }}
  47. tags:
  48. - always
  49. when: matrix_mautrix_wsproxy_enabled|bool
  50. - name: Warn about reverse-proxying if matrix-nginx-proxy not used
  51. ansible.builtin.debug:
  52. msg: >-
  53. NOTE: You've enabled the Mautrix wsproxy bridge but are not using the matrix-nginx-proxy
  54. reverse proxy.
  55. Please make sure that you're proxying the `{{ matrix_mautrix_wsproxy_public_endpoint }}`
  56. URL endpoint to the matrix-mautrix-wsproxy container.
  57. You can expose the container's port using the `matrix_mautrix_wsproxy_container_http_host_bind_port` variable.
  58. when: "matrix_mautrix_wsproxy_enabled|bool and matrix_nginx_proxy_enabled is not defined"