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

48 строки
2.2 KiB

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