From 0c82caf817626ee0eca22e99efd962ca90ccadb5 Mon Sep 17 00:00:00 2001 From: Timo Schwarzer Date: Sun, 13 Oct 2019 21:31:36 +0200 Subject: [PATCH] Allow specifying the traefik version for cert dumping --- docs/compose/traefik/docker-compose.yml | 2 ++ optional/traefik-certdumper/run.sh | 2 +- towncrier/newsfragments/1011.feature | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 towncrier/newsfragments/1011.feature diff --git a/docs/compose/traefik/docker-compose.yml b/docs/compose/traefik/docker-compose.yml index 607fcaf1..f295d2f8 100644 --- a/docs/compose/traefik/docker-compose.yml +++ b/docs/compose/traefik/docker-compose.yml @@ -25,6 +25,8 @@ services: # Make sure this is the same as the main=-domain in traefik.toml # !!! Also don’t forget to add "TRAEFIK_DOMAIN=[...]" to your .env! - DOMAIN=$TRAEFIK_DOMAIN + # Set TRAEFIK_VERSION to v2 in your .env if you're using Traefik v2 + - TRAEFIK_VERSION=${TRAEFIK_VERSION:-v1} volumes: - "/data/traefik:/traefik" - "$ROOT/certs:/output" diff --git a/optional/traefik-certdumper/run.sh b/optional/traefik-certdumper/run.sh index 2880d44f..16f22dbc 100755 --- a/optional/traefik-certdumper/run.sh +++ b/optional/traefik-certdumper/run.sh @@ -3,7 +3,7 @@ function dump() { echo "$(date) Dumping certificates" - traefik-certs-dumper file --crt-name "cert" --crt-ext ".pem" --key-name "key" --key-ext ".pem" --domain-subdir --dest /tmp/work --source /traefik/acme.json > /dev/null + traefik-certs-dumper file --version ${TRAEFIK_VERSION:-v1} --crt-name "cert" --crt-ext ".pem" --key-name "key" --key-ext ".pem" --domain-subdir --dest /tmp/work --source /traefik/acme.json > /dev/null if [[ -f /tmp/work/${DOMAIN}/cert.pem && -f /tmp/work/${DOMAIN}/key.pem && -f /output/cert.pem && -f /output/key.pem ]] && \ diff -q /tmp/work/${DOMAIN}/cert.pem /output/cert.pem >/dev/null && \ diff --git a/towncrier/newsfragments/1011.feature b/towncrier/newsfragments/1011.feature new file mode 100644 index 00000000..f7b6afd7 --- /dev/null +++ b/towncrier/newsfragments/1011.feature @@ -0,0 +1 @@ +Add support for Traefik v2 certificate dumping \ No newline at end of file