Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

194 linhas
10 KiB

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