Matrix Docker Ansible eploy
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

162 rader
8.5 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-metrics.loadbalancer.server.port={{ matrix_hookshot_metrics_port }}
  14. {% if matrix_hookshot_container_labels_webhooks_enabled %}
  15. ############################################################
  16. # #
  17. # Webhooks #
  18. # #
  19. ############################################################
  20. traefik.http.middlewares.matrix-hookshot-webhooks-strip-prefix.stripprefix.prefixes={{ matrix_hookshot_webhook_endpoint }}
  21. traefik.http.routers.matrix-hookshot-webhooks.rule={{ matrix_hookshot_container_labels_webhooks_traefik_rule }}
  22. traefik.http.routers.matrix-hookshot-webhooks.middlewares=matrix-hookshot-webhooks-strip-prefix
  23. {% if matrix_hookshot_container_labels_webhooks_traefik_priority | int > 0 %}
  24. traefik.http.routers.matrix-hookshot-webhooks.priority={{ matrix_hookshot_container_labels_webhooks_traefik_priority }}
  25. {% endif %}
  26. traefik.http.routers.matrix-hookshot-webhooks.service=matrix-hookshot-webhooks
  27. traefik.http.routers.matrix-hookshot-webhooks.entrypoints={{ matrix_hookshot_container_labels_webhooks_traefik_entrypoints }}
  28. traefik.http.routers.matrix-hookshot-webhooks.tls={{ matrix_hookshot_container_labels_webhooks_traefik_tls | to_json }}
  29. {% if matrix_hookshot_container_labels_webhooks_traefik_tls %}
  30. traefik.http.routers.matrix-hookshot-webhooks.tls.certResolver={{ matrix_hookshot_container_labels_webhooks_traefik_tls_certResolver }}
  31. {% endif %}
  32. ############################################################
  33. # #
  34. # /Webhooks #
  35. # #
  36. ############################################################
  37. {% endif %}
  38. {% if matrix_hookshot_container_labels_appservice_enabled %}
  39. ############################################################
  40. # #
  41. # Appservice #
  42. # #
  43. ############################################################
  44. traefik.http.middlewares.matrix-hookshot-appservice-strip-prefix.stripprefix.prefixes={{ matrix_hookshot_appservice_endpoint }}
  45. traefik.http.routers.matrix-hookshot-appservice.rule={{ matrix_hookshot_container_labels_appservice_traefik_rule }}
  46. traefik.http.routers.matrix-hookshot-appservice.middlewares=matrix-hookshot-appservice-strip-prefix
  47. {% if matrix_hookshot_container_labels_appservice_traefik_priority | int > 0 %}
  48. traefik.http.routers.matrix-hookshot-appservice.priority={{ matrix_hookshot_container_labels_appservice_traefik_priority }}
  49. {% endif %}
  50. traefik.http.routers.matrix-hookshot-appservice.service=matrix-hookshot-appservice
  51. traefik.http.routers.matrix-hookshot-appservice.entrypoints={{ matrix_hookshot_container_labels_appservice_traefik_entrypoints }}
  52. traefik.http.routers.matrix-hookshot-appservice.tls={{ matrix_hookshot_container_labels_appservice_traefik_tls | to_json }}
  53. {% if matrix_hookshot_container_labels_appservice_traefik_tls %}
  54. traefik.http.routers.matrix-hookshot-appservice.tls.certResolver={{ matrix_hookshot_container_labels_appservice_traefik_tls_certResolver }}
  55. {% endif %}
  56. ############################################################
  57. # #
  58. # /Appservice #
  59. # #
  60. ############################################################
  61. {% endif %}
  62. {% if matrix_hookshot_container_labels_widgets_enabled %}
  63. ############################################################
  64. # #
  65. # Widgets #
  66. # #
  67. ############################################################
  68. # Redirect `{PREFIX}/widgetapi/v1/static` to `{PREFIX}/widgetapi/v1/static/`.
  69. # Hookshot does it too, but does not obey the prefix, which leads people elsewhere.
  70. traefik.http.middlewares.matrix-hookshot-widgets-slashless-redirect.redirectregex.regex=({{ matrix_hookshot_widgets_endpoint | quote }}/v1/static)$
  71. traefik.http.middlewares.matrix-hookshot-widgets-slashless-redirect.redirectregex.replacement=${1}/
  72. traefik.http.middlewares.matrix-hookshot-widgets-strip-prefix.stripprefix.prefixes={{ matrix_hookshot_public_endpoint }}
  73. traefik.http.routers.matrix-hookshot-widgets.rule={{ matrix_hookshot_container_labels_widgets_traefik_rule }}
  74. traefik.http.routers.matrix-hookshot-widgets.middlewares=matrix-hookshot-widgets-slashless-redirect,matrix-hookshot-widgets-strip-prefix
  75. {% if matrix_hookshot_container_labels_widgets_traefik_priority | int > 0 %}
  76. traefik.http.routers.matrix-hookshot-widgets.priority={{ matrix_hookshot_container_labels_widgets_traefik_priority }}
  77. {% endif %}
  78. traefik.http.routers.matrix-hookshot-widgets.service=matrix-hookshot-widgets
  79. traefik.http.routers.matrix-hookshot-widgets.entrypoints={{ matrix_hookshot_container_labels_widgets_traefik_entrypoints }}
  80. traefik.http.routers.matrix-hookshot-widgets.tls={{ matrix_hookshot_container_labels_widgets_traefik_tls | to_json }}
  81. {% if matrix_hookshot_container_labels_widgets_traefik_tls %}
  82. traefik.http.routers.matrix-hookshot-widgets.tls.certResolver={{ matrix_hookshot_container_labels_widgets_traefik_tls_certResolver }}
  83. {% endif %}
  84. ############################################################
  85. # #
  86. # /Widgets #
  87. # #
  88. ############################################################
  89. {% endif %}
  90. {% if matrix_hookshot_container_labels_metrics_enabled %}
  91. ############################################################
  92. # #
  93. # Metrics #
  94. # #
  95. ############################################################
  96. {% set metricsMiddlewares = ['matrix-hookshot-metrics-replace-path'] %}
  97. traefik.http.middlewares.matrix-hookshot-metrics-replace-path.replacepath.path=/metrics
  98. {% if matrix_hookshot_container_labels_metrics_middleware_basic_auth_enabled %}
  99. {% set metricsMiddlewares = metricsMiddlewares + ['matrix-hookshot-metrics-basic-auth'] %}
  100. traefik.http.middlewares.matrix-hookshot-metrics-basic-auth.basicauth.users={{ matrix_hookshot_container_labels_metrics_middleware_basic_auth_users }}
  101. {% endif %}
  102. traefik.http.routers.matrix-hookshot-metrics.rule={{ matrix_hookshot_container_labels_metrics_traefik_rule }}
  103. traefik.http.routers.matrix-hookshot-metrics.middlewares={{ metricsMiddlewares | join(',') }}
  104. {% if matrix_hookshot_container_labels_metrics_traefik_priority | int > 0 %}
  105. traefik.http.routers.matrix-hookshot-metrics.priority={{ matrix_hookshot_container_labels_metrics_traefik_priority }}
  106. {% endif %}
  107. traefik.http.routers.matrix-hookshot-metrics.service=matrix-hookshot-metrics
  108. traefik.http.routers.matrix-hookshot-metrics.entrypoints={{ matrix_hookshot_container_labels_metrics_traefik_entrypoints }}
  109. traefik.http.routers.matrix-hookshot-metrics.tls={{ matrix_hookshot_container_labels_metrics_traefik_tls | to_json }}
  110. {% if matrix_hookshot_container_labels_metrics_traefik_tls %}
  111. traefik.http.routers.matrix-hookshot-metrics.tls.certResolver={{ matrix_hookshot_container_labels_metrics_traefik_tls_certResolver }}
  112. {% endif %}
  113. ############################################################
  114. # #
  115. # /Metrics #
  116. # #
  117. ############################################################
  118. {% endif %}
  119. {% endif %}
  120. {{ matrix_hookshot_container_labels_additional_labels }}