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

141 строка
8.7 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 Slavi Pantaleev
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. {% if matrix_authentication_service_container_labels_traefik_enabled %}
  6. traefik.enable=true
  7. {% if matrix_authentication_service_container_labels_traefik_docker_network %}
  8. traefik.docker.network={{ matrix_authentication_service_container_labels_traefik_docker_network }}
  9. {% endif %}
  10. traefik.http.services.matrix-authentication-service.loadbalancer.server.port=8080
  11. ########################################################################################
  12. # #
  13. # Public Main #
  14. # #
  15. ########################################################################################
  16. {% set main_middlewares = [] %}
  17. {% if matrix_authentication_service_container_labels_public_main_path_prefix != '/' %}
  18. traefik.http.middlewares.matrix-authentication-service-slashless-redirect.redirectregex.regex=({{ matrix_authentication_service_container_labels_public_main_path_prefix | quote }})$
  19. traefik.http.middlewares.matrix-authentication-service-slashless-redirect.redirectregex.replacement=${1}/
  20. {% set main_middlewares = main_middlewares + ['matrix-authentication-service-slashless-redirect'] %}
  21. {% endif %}
  22. {% if matrix_authentication_service_container_labels_traefik_additional_response_headers.keys() | length > 0 %}
  23. {% for name, value in matrix_authentication_service_container_labels_traefik_additional_response_headers.items() %}
  24. traefik.http.middlewares.matrix-authentication-service-add-headers.headers.customresponseheaders.{{ name }}={{ value }}
  25. {% endfor %}
  26. {% set main_middlewares = main_middlewares + ['matrix-authentication-service-add-headers'] %}
  27. {% endif %}
  28. traefik.http.routers.matrix-authentication-service.rule={{ matrix_authentication_service_container_labels_public_main_rule }}
  29. {% if matrix_authentication_service_container_labels_public_main_priority | int > 0 %}
  30. traefik.http.routers.matrix-authentication-service.priority={{ matrix_authentication_service_container_labels_public_main_priority }}
  31. {% endif %}
  32. traefik.http.routers.matrix-authentication-service.service=matrix-authentication-service
  33. {% if main_middlewares | length > 0 %}
  34. traefik.http.routers.matrix-authentication-service.middlewares={{ main_middlewares | join(',') }}
  35. {% endif %}
  36. traefik.http.routers.matrix-authentication-service.entrypoints={{ matrix_authentication_service_container_labels_public_main_entrypoints }}
  37. traefik.http.routers.matrix-authentication-service.tls={{ matrix_authentication_service_container_labels_public_main_tls | to_json }}
  38. {% if matrix_authentication_service_container_labels_public_main_tls %}
  39. traefik.http.routers.matrix-authentication-service.tls.certResolver={{ matrix_authentication_service_container_labels_public_main_tls_certResolver }}
  40. {% endif %}
  41. ########################################################################################
  42. # #
  43. # /Public Main #
  44. # #
  45. ########################################################################################
  46. {% if matrix_authentication_service_container_labels_public_compatibility_layer_enabled %}
  47. ########################################################################################
  48. # #
  49. # Public Compatibility Layer #
  50. # #
  51. ########################################################################################
  52. {% set compatibility_layer_middlewares = [] %}
  53. {% if matrix_authentication_service_container_labels_public_main_path_prefix != '/' %}
  54. traefik.http.middlewares.matrix-authentication-service-add-prefix.addprefix.prefix={{ matrix_authentication_service_container_labels_public_main_path_prefix }}
  55. {% set compatibility_layer_middlewares = compatibility_layer_middlewares + ['matrix-authentication-service-add-prefix'] %}
  56. {% endif %}
  57. traefik.http.routers._internalmatrix-authentication-service-public-compatibility-layer.rule={{ matrix_authentication_service_container_labels_public_compatibility_layer_rule }}
  58. {% if matrix_authentication_service_container_labels_public_compatibility_layer_priority | int > 0 %}
  59. traefik.http.routers._internalmatrix-authentication-service-public-compatibility-layer.priority={{ matrix_authentication_service_container_labels_public_compatibility_layer_priority }}
  60. {% endif %}
  61. traefik.http.routers._internalmatrix-authentication-service-public-compatibility-layer.service=matrix-authentication-service
  62. {% if compatibility_layer_middlewares | length > 0 %}
  63. traefik.http.routers._internalmatrix-authentication-service-public-compatibility-layer.middlewares={{ compatibility_layer_middlewares | join(',') }}
  64. {% endif %}
  65. traefik.http.routers._internalmatrix-authentication-service-public-compatibility-layer.entrypoints={{ matrix_authentication_service_container_labels_public_compatibility_layer_entrypoints }}
  66. traefik.http.routers._internalmatrix-authentication-service-public-compatibility-layer.tls={{ matrix_authentication_service_container_labels_public_compatibility_layer_tls | to_json }}
  67. {% if matrix_authentication_service_container_labels_public_compatibility_layer_tls %}
  68. traefik.http.routers._internalmatrix-authentication-service-public-compatibility-layer.tls.certResolver={{ matrix_authentication_service_container_labels_public_compatibility_layer_tls_certResolver }}
  69. {% endif %}
  70. ########################################################################################
  71. # #
  72. # /Public Compatibility Layer #
  73. # #
  74. ########################################################################################
  75. {% endif %}
  76. {% if matrix_authentication_service_container_labels_internal_compatibility_layer_enabled %}
  77. ########################################################################################
  78. # #
  79. # Internal Compatibility Layer #
  80. # #
  81. ########################################################################################
  82. {% set compatibility_layer_middlewares = [] %}
  83. {% if matrix_authentication_service_container_labels_public_main_path_prefix != '/' %}
  84. traefik.http.middlewares.matrix-authentication-service-add-prefix.addprefix.prefix={{ matrix_authentication_service_container_labels_public_main_path_prefix }}
  85. {% set compatibility_layer_middlewares = compatibility_layer_middlewares + ['matrix-authentication-service-add-prefix'] %}
  86. {% endif %}
  87. traefik.http.routers._internalmatrix-authentication-service-internal-compatibility-layer.rule={{ matrix_authentication_service_container_labels_internal_compatibility_layer_rule }}
  88. {% if matrix_authentication_service_container_labels_internal_compatibility_layer_priority | int > 0 %}
  89. traefik.http.routers._internalmatrix-authentication-service-internal-compatibility-layer.priority={{ matrix_authentication_service_container_labels_internal_compatibility_layer_priority }}
  90. {% endif %}
  91. traefik.http.routers._internalmatrix-authentication-service-internal-compatibility-layer.service=matrix-authentication-service
  92. {% if compatibility_layer_middlewares | length > 0 %}
  93. traefik.http.routers._internalmatrix-authentication-service-internal-compatibility-layer.middlewares={{ compatibility_layer_middlewares | join(',') }}
  94. {% endif %}
  95. traefik.http.routers._internalmatrix-authentication-service-internal-compatibility-layer.entrypoints={{ matrix_authentication_service_container_labels_internal_compatibility_layer_entrypoints }}
  96. ########################################################################################
  97. # #
  98. # /Internal Compatibility Layer #
  99. # #
  100. ########################################################################################
  101. {% endif %}
  102. {% endif %}
  103. {{ matrix_authentication_service_container_labels_additional_labels }}