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.
 
 

103 lines
5.8 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 Slavi Pantaleev
  3. SPDX-FileCopyrightText: 2024 Suguru Hirahara
  4. SPDX-License-Identifier: AGPL-3.0-or-later
  5. #}
  6. {% if matrix_static_files_container_labels_traefik_enabled %}
  7. traefik.enable=true
  8. {% if matrix_static_files_container_labels_traefik_docker_network %}
  9. traefik.docker.network={{ matrix_static_files_container_labels_traefik_docker_network }}
  10. {% endif %}
  11. traefik.http.services.{{ matrix_static_files_identifier }}.loadbalancer.server.port={{ matrix_static_files_environment_variable_server_port }}
  12. {% if matrix_static_files_container_labels_well_known_matrix_endpoint_enabled %}
  13. ############################################################
  14. # #
  15. # Related to /.well-known/matrix on the Matrix domain #
  16. # #
  17. ############################################################
  18. {% set well_known_matrix_endpoint_middlewares = [] %}
  19. {% if matrix_static_files_container_labels_well_known_matrix_endpoint_middleware_compress_enabled %}
  20. traefik.http.middlewares.{{ matrix_static_files_identifier }}-well-known-matrix-compress.compress=true
  21. traefik.http.middlewares.{{ matrix_static_files_identifier }}-well-known-matrix-compress.compress.minResponseBodyBytes={{ matrix_static_files_container_labels_well_known_matrix_endpoint_middleware_compress_minResponseBodyBytes }}
  22. {% set well_known_matrix_endpoint_middlewares = well_known_matrix_endpoint_middlewares + [matrix_static_files_identifier + '-well-known-matrix-compress'] %}
  23. {% endif %}
  24. traefik.http.routers.{{ matrix_static_files_identifier }}-well-known-matrix.rule={{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_rule }}
  25. {% if well_known_matrix_endpoint_middlewares | length > 0 %}
  26. traefik.http.routers.{{ matrix_static_files_identifier }}-well-known-matrix.middlewares={{ well_known_matrix_endpoint_middlewares | join(',') }}
  27. {% endif %}
  28. {% if matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_priority | int > 0 %}
  29. traefik.http.routers.{{ matrix_static_files_identifier }}-well-known-matrix.priority={{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_priority }}
  30. {% endif %}
  31. traefik.http.routers.{{ matrix_static_files_identifier }}-well-known-matrix.service={{ matrix_static_files_identifier }}
  32. traefik.http.routers.{{ matrix_static_files_identifier }}-well-known-matrix.entrypoints={{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_entrypoints }}
  33. traefik.http.routers.{{ matrix_static_files_identifier }}-well-known-matrix.tls={{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_tls | to_json }}
  34. {% if matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_tls %}
  35. traefik.http.routers.{{ matrix_static_files_identifier }}-well-known-matrix.tls.certResolver={{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_tls_certResolver }}
  36. {% endif %}
  37. ############################################################
  38. # #
  39. # /Related to /.well-known/matrix on the Matrix domain #
  40. # #
  41. ############################################################
  42. {% endif %}
  43. {% if matrix_static_files_container_labels_base_domain_enabled %}
  44. ############################################################
  45. # #
  46. # Base domain serving #
  47. # #
  48. ############################################################
  49. {% set middlewares = [] %}
  50. {% if matrix_static_files_container_labels_base_domain_root_path_redirection_enabled %}
  51. traefik.http.middlewares.{{ matrix_static_files_identifier }}-base-domain-root-path-redirect.redirectregex.regex={{ matrix_static_files_container_labels_base_domain_root_path_redirection_regex }}
  52. traefik.http.middlewares.{{ matrix_static_files_identifier }}-base-domain-root-path-redirect.redirectregex.replacement={{ matrix_static_files_container_labels_base_domain_root_path_redirection_url }}
  53. {% set middlewares = middlewares + [matrix_static_files_identifier + '-base-domain-root-path-redirect'] %}
  54. {% endif %}
  55. traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.rule={{ matrix_static_files_container_labels_base_domain_traefik_rule }}
  56. {% if matrix_static_files_container_labels_base_domain_traefik_priority | int > 0 %}
  57. traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.priority={{ matrix_static_files_container_labels_base_domain_traefik_priority }}
  58. {% endif %}
  59. {% if middlewares | length > 0 %}
  60. traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.middlewares={{ middlewares | join(',') }}
  61. {% endif %}
  62. traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.service={{ matrix_static_files_identifier }}
  63. traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.entrypoints={{ matrix_static_files_container_labels_base_domain_traefik_entrypoints }}
  64. traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.tls={{ matrix_static_files_container_labels_base_domain_traefik_tls | to_json }}
  65. {% if matrix_static_files_container_labels_base_domain_traefik_tls %}
  66. traefik.http.routers.{{ matrix_static_files_identifier }}-base-domain.tls.certResolver={{ matrix_static_files_container_labels_base_domain_traefik_tls_certResolver }}
  67. {% endif %}
  68. ############################################################
  69. # #
  70. # /Base domain serving #
  71. # #
  72. ############################################################
  73. {% endif %}
  74. {% endif %}
  75. {{ matrix_static_files_container_labels_additional_labels }}