Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

188 lignes
10 KiB

  1. {% if matrix_hookshot_container_labels_traefik_enabled %}
  2. traefik.enable=true
  3. {% if matrix_hookshot_container_labels_traefik_docker_network %}
  4. traefik.docker.network={{ matrix_hookshot_container_labels_traefik_docker_network }}
  5. {% endif %}
  6. traefik.http.services.matrix-hookshot-webhooks.loadbalancer.server.port={{ matrix_hookshot_webhook_port }}
  7. traefik.http.services.matrix-hookshot-appservice.loadbalancer.server.port={{ matrix_hookshot_appservice_port }}
  8. traefik.http.services.matrix-hookshot-widgets.loadbalancer.server.port={{ matrix_hookshot_widgets_port }}
  9. traefik.http.services.matrix-hookshot-provisioning.loadbalancer.server.port={{ matrix_hookshot_provisioning_port }}
  10. traefik.http.services.matrix-hookshot-metrics.loadbalancer.server.port={{ matrix_hookshot_metrics_port }}
  11. {% if matrix_hookshot_container_labels_webhooks_enabled %}
  12. ############################################################
  13. # #
  14. # Webhooks #
  15. # #
  16. ############################################################
  17. traefik.http.middlewares.matrix-hookshot-webhooks-strip-prefix.stripprefix.prefixes={{ matrix_hookshot_webhook_endpoint }}
  18. traefik.http.routers.matrix-hookshot-webhooks.rule={{ matrix_hookshot_container_labels_webhooks_traefik_rule }}
  19. traefik.http.routers.matrix-hookshot-webhooks.middlewares=matrix-hookshot-webhooks-strip-prefix
  20. {% if matrix_hookshot_container_labels_webhooks_traefik_priority | int > 0 %}
  21. traefik.http.routers.matrix-hookshot-webhooks.priority={{ matrix_hookshot_container_labels_webhooks_traefik_priority }}
  22. {% endif %}
  23. traefik.http.routers.matrix-hookshot-webhooks.service=matrix-hookshot-webhooks
  24. traefik.http.routers.matrix-hookshot-webhooks.entrypoints={{ matrix_hookshot_container_labels_webhooks_traefik_entrypoints }}
  25. traefik.http.routers.matrix-hookshot-webhooks.tls={{ matrix_hookshot_container_labels_webhooks_traefik_tls | to_json }}
  26. {% if matrix_hookshot_container_labels_webhooks_traefik_tls %}
  27. traefik.http.routers.matrix-hookshot-webhooks.tls.certResolver={{ matrix_hookshot_container_labels_webhooks_traefik_tls_certResolver }}
  28. {% endif %}
  29. ############################################################
  30. # #
  31. # /Webhooks #
  32. # #
  33. ############################################################
  34. {% endif %}
  35. {% if matrix_hookshot_container_labels_appservice_enabled %}
  36. ############################################################
  37. # #
  38. # Appservice #
  39. # #
  40. ############################################################
  41. traefik.http.middlewares.matrix-hookshot-appservice-strip-prefix.stripprefix.prefixes={{ matrix_hookshot_appservice_endpoint }}
  42. traefik.http.routers.matrix-hookshot-appservice.rule={{ matrix_hookshot_container_labels_appservice_traefik_rule }}
  43. traefik.http.routers.matrix-hookshot-appservice.middlewares=matrix-hookshot-appservice-strip-prefix
  44. {% if matrix_hookshot_container_labels_appservice_traefik_priority | int > 0 %}
  45. traefik.http.routers.matrix-hookshot-appservice.priority={{ matrix_hookshot_container_labels_appservice_traefik_priority }}
  46. {% endif %}
  47. traefik.http.routers.matrix-hookshot-appservice.service=matrix-hookshot-appservice
  48. traefik.http.routers.matrix-hookshot-appservice.entrypoints={{ matrix_hookshot_container_labels_appservice_traefik_entrypoints }}
  49. traefik.http.routers.matrix-hookshot-appservice.tls={{ matrix_hookshot_container_labels_appservice_traefik_tls | to_json }}
  50. {% if matrix_hookshot_container_labels_appservice_traefik_tls %}
  51. traefik.http.routers.matrix-hookshot-appservice.tls.certResolver={{ matrix_hookshot_container_labels_appservice_traefik_tls_certResolver }}
  52. {% endif %}
  53. ############################################################
  54. # #
  55. # /Appservice #
  56. # #
  57. ############################################################
  58. {% endif %}
  59. {% if matrix_hookshot_container_labels_widgets_enabled %}
  60. ############################################################
  61. # #
  62. # Widgets #
  63. # #
  64. ############################################################
  65. # Redirect `{PREFIX}/widgetapi/v1/static` to `{PREFIX}/widgetapi/v1/static/`.
  66. # Hookshot does it too, but does not obey the prefix, which leads people elsewhere.
  67. traefik.http.middlewares.matrix-hookshot-widgets-slashless-redirect.redirectregex.regex=({{ matrix_hookshot_widgets_endpoint | quote }}/v1/static)$
  68. traefik.http.middlewares.matrix-hookshot-widgets-slashless-redirect.redirectregex.replacement=${1}/
  69. traefik.http.middlewares.matrix-hookshot-widgets-strip-prefix.stripprefix.prefixes={{ matrix_hookshot_public_endpoint }}
  70. traefik.http.routers.matrix-hookshot-widgets.rule={{ matrix_hookshot_container_labels_widgets_traefik_rule }}
  71. traefik.http.routers.matrix-hookshot-widgets.middlewares=matrix-hookshot-widgets-slashless-redirect,matrix-hookshot-widgets-strip-prefix
  72. {% if matrix_hookshot_container_labels_widgets_traefik_priority | int > 0 %}
  73. traefik.http.routers.matrix-hookshot-widgets.priority={{ matrix_hookshot_container_labels_widgets_traefik_priority }}
  74. {% endif %}
  75. traefik.http.routers.matrix-hookshot-widgets.service=matrix-hookshot-widgets
  76. traefik.http.routers.matrix-hookshot-widgets.entrypoints={{ matrix_hookshot_container_labels_widgets_traefik_entrypoints }}
  77. traefik.http.routers.matrix-hookshot-widgets.tls={{ matrix_hookshot_container_labels_widgets_traefik_tls | to_json }}
  78. {% if matrix_hookshot_container_labels_widgets_traefik_tls %}
  79. traefik.http.routers.matrix-hookshot-widgets.tls.certResolver={{ matrix_hookshot_container_labels_widgets_traefik_tls_certResolver }}
  80. {% endif %}
  81. ############################################################
  82. # #
  83. # /Widgets #
  84. # #
  85. ############################################################
  86. {% endif %}
  87. {% if matrix_hookshot_container_labels_provisioning_enabled %}
  88. ############################################################
  89. # #
  90. # Provisioning #
  91. # #
  92. ############################################################
  93. traefik.http.middlewares.matrix-hookshot-provisioning-strip-prefix.stripprefix.prefixes={{ matrix_hookshot_provisioning_endpoint }}
  94. traefik.http.routers.matrix-hookshot-provisioning.rule={{ matrix_hookshot_container_labels_provisioning_traefik_rule }}
  95. traefik.http.routers.matrix-hookshot-provisioning.middlewares=matrix-hookshot-provisioning-strip-prefix
  96. {% if matrix_hookshot_container_labels_provisioning_traefik_priority | int > 0 %}
  97. traefik.http.routers.matrix-hookshot-provisioning.priority={{ matrix_hookshot_container_labels_provisioning_traefik_priority }}
  98. {% endif %}
  99. traefik.http.routers.matrix-hookshot-provisioning.service=matrix-hookshot-provisioning
  100. traefik.http.routers.matrix-hookshot-provisioning.entrypoints={{ matrix_hookshot_container_labels_provisioning_traefik_entrypoints }}
  101. traefik.http.routers.matrix-hookshot-provisioning.tls={{ matrix_hookshot_container_labels_provisioning_traefik_tls | to_json }}
  102. {% if matrix_hookshot_container_labels_provisioning_traefik_tls %}
  103. traefik.http.routers.matrix-hookshot-provisioning.tls.certResolver={{ matrix_hookshot_container_labels_provisioning_traefik_tls_certResolver }}
  104. {% endif %}
  105. ############################################################
  106. # #
  107. # /Provisioning #
  108. # #
  109. ############################################################
  110. {% endif %}
  111. {% if matrix_hookshot_container_labels_metrics_enabled %}
  112. ############################################################
  113. # #
  114. # Metrics #
  115. # #
  116. ############################################################
  117. {% set metricsMiddlewares = ['matrix-hookshot-metrics-replace-path'] %}
  118. traefik.http.middlewares.matrix-hookshot-metrics-replace-path.replacepath.path=/metrics
  119. {% if matrix_hookshot_container_labels_metrics_middleware_basic_auth_enabled %}
  120. {% set metricsMiddlewares = metricsMiddlewares + ['matrix-hookshot-metrics-basic-auth'] %}
  121. traefik.http.middlewares.matrix-hookshot-metrics-basic-auth.basicauth.users={{ matrix_hookshot_container_labels_metrics_middleware_basic_auth_users }}
  122. {% endif %}
  123. traefik.http.routers.matrix-hookshot-metrics.rule={{ matrix_hookshot_container_labels_metrics_traefik_rule }}
  124. traefik.http.routers.matrix-hookshot-metrics.middlewares={{ metricsMiddlewares | join(',') }}
  125. {% if matrix_hookshot_container_labels_metrics_traefik_priority | int > 0 %}
  126. traefik.http.routers.matrix-hookshot-metrics.priority={{ matrix_hookshot_container_labels_metrics_traefik_priority }}
  127. {% endif %}
  128. traefik.http.routers.matrix-hookshot-metrics.service=matrix-hookshot-metrics
  129. traefik.http.routers.matrix-hookshot-metrics.entrypoints={{ matrix_hookshot_container_labels_metrics_traefik_entrypoints }}
  130. traefik.http.routers.matrix-hookshot-metrics.tls={{ matrix_hookshot_container_labels_metrics_traefik_tls | to_json }}
  131. {% if matrix_hookshot_container_labels_metrics_traefik_tls %}
  132. traefik.http.routers.matrix-hookshot-metrics.tls.certResolver={{ matrix_hookshot_container_labels_metrics_traefik_tls_certResolver }}
  133. {% endif %}
  134. ############################################################
  135. # #
  136. # /Metrics #
  137. # #
  138. ############################################################
  139. {% endif %}
  140. {% endif %}
  141. {{ matrix_hookshot_container_labels_additional_labels }}