caddy-dns / ovh

Caddy module: dns.providers.ovh
MIT License
12 stars 1 forks source link

Configuration for caddy-docker-proxy with caddy-dns/ovh #4

Open SR-G opened 3 days ago

SR-G commented 3 days ago

Hello. Thanks for this plugin, seems to be exactly what i need. However i'm struggling about configuring it :

    tls {
      dns ovh {
        endpoint ovh-eu
        application_key XXXXXXXXXXXXX
        application_secret XXXXXXXXXXXXXXXXXXXXXXX
        consumer_key XXXXXXXXXXXXXXXXXXX
      }
    }

Indeed, this seems to be the configuration to be added for each server ... but this is managed dynamically by caddy-docker-proxy, so i don't think i can go this way.

Then how should this be declared in a global way in a Caddyfile, whereas the Caddyfile structure does not seem to propose anything related to this ? (only things like acme_dns (https://caddyserver.com/docs/caddyfile/options#acme-dns), ...)

Thanks in advance for any help.

SR-G commented 3 days ago

Ok, well, i think i've found how it works, at least with labels at container level (and not in a global way) - for reference, probably something like :

docker run -d --name=grafana -p 3000:3000 --volume grafana-storage:/var/lib/grafana --label "caddy=grafana.domain.ovh" --label "caddy.reverse_proxy={{upstreams 3000}}" \
  --label "caddy.tls.dns=ovh" \
  --label "caddy.tls.dns.endpoint=ovh-eu" \
  --label "caddy.tls.dns.application_key=XXXXXXXXXXXXXXXXXX" \
  --label "caddy.tls.dns.application_secret=XXXXXXXXXXXXXXXXX" \
  --label "caddy.tls.dns.consumer_key=XXXXXXXXXXXXXXX" \
  grafana/grafana

However a global configuration would definitely avoid a lot of redundancies - still don't know if it's possible or not.