From 9564a70313d63edc5b5a3f463fef332dc794df6f Mon Sep 17 00:00:00 2001 From: Jean Froment Date: Mon, 30 Sep 2019 23:37:17 +0200 Subject: [PATCH] Enable Cloudflare in Traefik --- .env.sample | 3 +++ docker-compose.yml | 3 +++ traefik.toml | 7 +++++-- tunnel-options.sh.sample | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.env.sample b/.env.sample index 0a627f4..c6cb8df 100644 --- a/.env.sample +++ b/.env.sample @@ -6,6 +6,9 @@ PORTAINER_ADMIN_PASSWORD=h4ckMePleAse PGID=1000 PUID=1000 +CLOUDFLARE_EMAIL=your@email.com +CLOUDFLARE_API_KEY=your_cloudflare_api_key + # Nextcloud NEXTCLOUD_ADMIN_USER=admin NEXTCLOUD_ADMIN_PASSWORD=nextcloud_admin_password diff --git a/docker-compose.yml b/docker-compose.yml index 27f10e2..7e03519 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,9 @@ services: - "80:80" - "443:443" #- "8080:8080" + environment: + - CF_API_EMAIL=${CLOUDFLARE_EMAIL} + - CF_API_KEY=${CLOUDFLARE_API_KEY} volumes: - /var/run/docker.sock:/var/run/docker.sock - ./traefik.toml:/traefik.toml diff --git a/traefik.toml b/traefik.toml index 00a1c72..5f246de 100644 --- a/traefik.toml +++ b/traefik.toml @@ -24,8 +24,11 @@ storage = "acme.json" entryPoint = "https" onHostRule = true acmeLogging = true -[acme.httpChallenge] -entryPoint = "http" +[acme.dnsChallenge] + dnsProvider = "cloudflare" + delayBeforeCheck = 300 +#[acme.httpChallenge] +#entryPoint = "http" ################################################################ # Web configuration backend diff --git a/tunnel-options.sh.sample b/tunnel-options.sh.sample index 19e899a..e270b9b 100644 --- a/tunnel-options.sh.sample +++ b/tunnel-options.sh.sample @@ -11,7 +11,7 @@ hostname="example.com" username="bob" # Plex container name for WebTools IP fetching -container="seedbox_plex_1" +container="plex" # Port for WebTools on the container port=33442