mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-07-12 18:04:24 +03:00
7d2a2c40c9
Attaches a com.centurylinklabs.watchtower.enable=false label to the matrix-matrixto container by default, telling Watchtower (if in use) to skip it. The image is built locally from source, so Watchtower cannot update it and merely produces 'digest retrieval failed' errors on every run. A dedicated variable is used (instead of pre-filling matrix_matrixto_container_labels_additional_labels) so that people overriding the additional-labels variable do not lose the label. Fixes #4820 Based on the report and initial patch in https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4821 by @der-domi Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
64 lines
3.3 KiB
Django/Jinja
64 lines
3.3 KiB
Django/Jinja
{#
|
|
SPDX-FileCopyrightText: 2023 Slavi Pantaleev
|
|
SPDX-FileCopyrightText: 2025 Suguru Hirahara
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
#}
|
|
|
|
{% if matrix_matrixto_container_labels_traefik_enabled %}
|
|
traefik.enable=true
|
|
|
|
{% if matrix_matrixto_container_labels_traefik_docker_network %}
|
|
traefik.docker.network={{ matrix_matrixto_container_labels_traefik_docker_network }}
|
|
{% endif %}
|
|
|
|
{% set middlewares = [] %}
|
|
|
|
{% if matrix_matrixto_container_labels_traefik_path_prefix != '/' %}
|
|
traefik.http.middlewares.{{ matrix_matrixto_identifier }}-slashless-redirect.redirectregex.regex=^({{ matrix_matrixto_container_labels_traefik_path_prefix | quote }})$
|
|
traefik.http.middlewares.{{ matrix_matrixto_identifier }}-slashless-redirect.redirectregex.replacement=${1}/
|
|
{% set middlewares = middlewares + [matrix_matrixto_identifier + '-slashless-redirect'] %}
|
|
{% endif %}
|
|
|
|
{% if matrix_matrixto_container_labels_traefik_path_prefix != '/' %}
|
|
traefik.http.middlewares.{{ matrix_matrixto_identifier }}-strip-prefix.stripprefix.prefixes={{ matrix_matrixto_container_labels_traefik_path_prefix }}
|
|
{% set middlewares = middlewares + [matrix_matrixto_identifier + '-strip-prefix'] %}
|
|
{% endif %}
|
|
|
|
{% if matrix_matrixto_container_labels_traefik_additional_request_headers.keys() | length > 0 %}
|
|
{% for name, value in matrix_matrixto_container_labels_traefik_additional_request_headers.items() %}
|
|
traefik.http.middlewares.{{ matrix_matrixto_identifier }}-add-request-headers.headers.customrequestheaders.{{ name }}={{ value }}
|
|
{% endfor %}
|
|
{% set middlewares = middlewares + [matrix_matrixto_identifier + '-add-request-headers'] %}
|
|
{% endif %}
|
|
|
|
{% if matrix_matrixto_container_labels_traefik_additional_response_headers.keys() | length > 0 %}
|
|
{% for name, value in matrix_matrixto_container_labels_traefik_additional_response_headers.items() %}
|
|
traefik.http.middlewares.{{ matrix_matrixto_identifier }}-add-response-headers.headers.customresponseheaders.{{ name }}={{ value }}
|
|
{% endfor %}
|
|
{% set middlewares = middlewares + [matrix_matrixto_identifier + '-add-response-headers'] %}
|
|
{% endif %}
|
|
|
|
traefik.http.routers.{{ matrix_matrixto_identifier }}.rule={{ matrix_matrixto_container_labels_traefik_rule }}
|
|
{% if matrix_matrixto_container_labels_traefik_priority | int > 0 %}
|
|
traefik.http.routers.{{ matrix_matrixto_identifier }}.priority={{ matrix_matrixto_container_labels_traefik_priority }}
|
|
{% endif %}
|
|
traefik.http.routers.{{ matrix_matrixto_identifier }}.service={{ matrix_matrixto_identifier }}
|
|
{% if middlewares | length > 0 %}
|
|
traefik.http.routers.{{ matrix_matrixto_identifier }}.middlewares={{ middlewares | join(',') }}
|
|
{% endif %}
|
|
traefik.http.routers.{{ matrix_matrixto_identifier }}.entrypoints={{ matrix_matrixto_container_labels_traefik_entrypoints }}
|
|
traefik.http.routers.{{ matrix_matrixto_identifier }}.tls={{ matrix_matrixto_container_labels_traefik_tls | to_json }}
|
|
{% if matrix_matrixto_container_labels_traefik_tls %}
|
|
traefik.http.routers.{{ matrix_matrixto_identifier }}.tls.certResolver={{ matrix_matrixto_container_labels_traefik_tls_certResolver }}
|
|
{% endif %}
|
|
|
|
traefik.http.services.{{ matrix_matrixto_identifier }}.loadbalancer.server.port={{ matrix_matrixto_container_http_port }}
|
|
{% endif %}
|
|
|
|
{% if matrix_matrixto_container_labels_watchtower_skip_enabled %}
|
|
com.centurylinklabs.watchtower.enable=false
|
|
{% endif %}
|
|
|
|
{{ matrix_matrixto_container_labels_additional_labels }}
|