Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

46 строки
2.1 KiB

  1. ---
  2. - ansible.builtin.set_fact:
  3. matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-maubot.service'] }}"
  4. when: matrix_bot_maubot_enabled|bool
  5. - block:
  6. - name: Generate Maubot proxying configuration for matrix-nginx-proxy
  7. ansible.builtin.set_fact:
  8. matrix_bot_maubot_matrix_nginx_proxy_configuration: |
  9. location ~ ^/(_matrix/maubot/.*) {
  10. {% if matrix_nginx_proxy_enabled|default(False) %}
  11. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  12. resolver 127.0.0.11 valid=5s;
  13. set $backend "matrix-bot-maubot:29316/$1";
  14. proxy_pass http://$backend;
  15. proxy_set_header Upgrade $http_upgrade;
  16. proxy_set_header Connection "upgrade";
  17. {% else %}
  18. {# Generic configuration for use outside of our container setup #}
  19. proxy_pass http://127.0.0.1:{{ matrix_bot_maubot_management_interface_port }}/$1;
  20. proxy_set_header Upgrade $http_upgrade;
  21. proxy_set_header Connection "upgrade";
  22. {% endif %}
  23. }
  24. when: matrix_bot_maubot_proxy_management_interface|bool
  25. - name: Register Maubot's proxying configuration with matrix-nginx-proxy
  26. ansible.builtin.set_fact:
  27. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
  28. {{
  29. matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([])
  30. +
  31. [matrix_bot_maubot_matrix_nginx_proxy_configuration]
  32. }}
  33. when: matrix_bot_maubot_proxy_management_interface|bool
  34. - name: Warn about reverse-proxying if matrix-nginx-proxy not used
  35. ansible.builtin.debug:
  36. msg: >-
  37. NOTE: You've enabled Maubot but are not using the matrix-nginx-proxy
  38. reverse proxy.
  39. Please make sure that you're proxying the `/_matrix/maubot`
  40. URL endpoint to the matrix-maubot container.
  41. when: "matrix_bot_maubot_enabled|bool and matrix_bot_maubot_proxy_management_interface|bool and matrix_nginx_proxy_enabled is not defined"