Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

45 lines
1.9 KiB

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