Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

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