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ů.
 
 

64 řádky
2.9 KiB

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