فهرست منبع

fix(compose): use CF_API_TOKEN_FILE for Cloudflare API token in Traefik

xcad 6 ماه پیش
والد
کامیت
e68c9c7edd
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 1 1
      library/compose/traefik/.env.secret.j2
  2. 3 0
      library/compose/traefik/compose.yaml.j2

+ 1 - 1
library/compose/traefik/.env.secret.j2

@@ -1 +1 @@
-{% if traefik_tls_enabled %}{{ traefik_tls_acme_token }}{% endif %}
+{% if traefik_tls_enabled and traefik_tls_acme_provider == 'cloudflare' %}{{ traefik_tls_acme_token }}{% endif %}

+ 3 - 0
library/compose/traefik/compose.yaml.j2

@@ -45,6 +45,9 @@ services:
     {% endif %}
     environment:
       - TZ={{ container_timezone }}
+      {% if traefik_tls_enabled and traefik_tls_acme_provider == 'cloudflare' %}
+      - CF_API_TOKEN_FILE=/.env.secret
+      {% endif %}
     healthcheck:
       test: ["CMD", "traefik", "healthcheck", "--ping"]
       interval: 30s