Hello folks
This is my first bout into Traefik and i'm having an issue setting up a reverse proxy with ssl. It's working fine as http.
I'm trying to set up a dns challenge using a script but my script doesn't seem to be called with the proper arguments.
(domain and usernames have been altered to example.com)
Here's my docker-compose:
version: '3'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.6
environment:
- EXEC_PATH="/tmp/update-dns.sh"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=exec"
- "--certificatesresolvers.myresolver.acme.email=user@example.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
labels:
- "traefik.http.routers.reverse-proxy.rule=Host(`site.example.com`)"
- 'traefik.http.routers.reverse-proxy.entrypoints=web,websecure'
- "traefik.http.routers.reverse-proxy.tls=true"
- traefik.http.routers.reverse-proxy.tls.certresolver=myresolver
# - traefik.http.routers.to-https.entrypoints=http
# - traefik.http.routers.to-https.middlewares=to-https
ports:
# The HTTP port
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- ./letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
- ./update-dns.sh:/tmp/update-dns.sh
# - ./traefic-config.yml:/traefik.yml
networks:
default:
external:
name: traefik_net
The update-dns.sh script looks like this:
#!/bin/sh
echo $1 $2 $3 >> /tmp/log.txt
case $1 in
present)
apk add -U curl
curl -u user:pass "https://dynamic.zoneedit.com/txt-create.php?host=$2&rdata=$3" >> /tmp/log.txt
;;
cleanup)
echo 'cleanup called' >> /tmp/log.txt
;;
*)
echo {"timeout": 60, "interval": 60} >> /tmp/log.txt
esac
the log looks like this showing that the script was never run with the proper arguments:
{timeout: 60, interval: 60}
I'm not sure how to proceed from here. I'm not sure I'm defining the host correctly as I can access using :80 via both the domain I'm using and the local IP but I'm not sure how else to go about this.