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.
 
 

135 line
8.6 KiB

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