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.

48 lines
2.4 KiB

  1. {% if matrix_element_call_container_labels_traefik_enabled %}
  2. traefik.enable=true
  3. # Network configuration for Traefik
  4. {% if matrix_element_call_container_labels_traefik_docker_network %}
  5. traefik.docker.network={{ matrix_element_call_container_labels_traefik_docker_network }}
  6. {% endif %}
  7. # Traefik Router and Service configuration for Element Call
  8. traefik.http.routers.element-call-router.rule=Host(`{{ matrix_element_call_container_labels_traefik_hostname }}`)
  9. traefik.http.routers.element-call-router.entrypoints={{ matrix_element_call_container_labels_traefik_entrypoints }}
  10. traefik.http.routers.element-call-router.tls.certresolver={{ matrix_element_call_container_labels_traefik_tls_certResolver }}
  11. traefik.http.services.element-call-service.loadbalancer.server.port=8080
  12. {% set middlewares = [] %}
  13. # Path prefix handling for Element Call
  14. {% if matrix_element_call_container_labels_traefik_path_prefix != '/' %}
  15. traefik.http.middlewares.element-call-slashless-redirect.redirectregex.regex=({{ matrix_element_call_container_labels_traefik_path_prefix | quote }})$
  16. traefik.http.middlewares.element-call-slashless-redirect.redirectregex.replacement=${1}/
  17. {% set middlewares = middlewares + ['element-call-slashless-redirect'] %}
  18. traefik.http.middlewares.element-call-strip-prefix.stripprefix.prefixes={{ matrix_element_call_container_labels_traefik_path_prefix }}
  19. {% set middlewares = middlewares + ['element-call-strip-prefix'] %}
  20. {% endif %}
  21. # Additional response headers for Element Call
  22. {% if matrix_element_call_container_labels_traefik_additional_response_headers is defined and matrix_element_call_container_labels_traefik_additional_response_headers | length > 0 %}
  23. {% for name, value in matrix_element_call_container_labels_traefik_additional_response_headers.items() %}
  24. traefik.http.middlewares.element-call-add-headers.headers.customresponseheaders.{{ name }}={{ value }}
  25. {% endfor %}
  26. {% set middlewares = middlewares + ['element-call-add-headers'] %}
  27. {% endif %}
  28. # Apply middlewares to the Element Call router
  29. {% if middlewares | length > 0 %}
  30. traefik.http.routers.element-call-router.middlewares={{ middlewares | join(',') }}
  31. {% endif %}
  32. {% endif %}
  33. # Additional labels (if any) specified by the user
  34. {% if matrix_element_call_container_extra_arguments is defined and matrix_element_call_container_extra_arguments | length > 0 %}
  35. {% for key, value in matrix_element_call_container_extra_arguments.items() %}
  36. {{ key }}={{ value }}
  37. {% endfor %}
  38. {% endif %}