Can't build caddy with cloudflare dns provider

Hi,

I use the abiosoft/caddy docker container and after seeing that a new release of caddy was available wanted to rebuild to take advantage of any fixes. Unfortunately, the build fails do to a missing function in the Cloudflare provider:

# github.com/caddyserver/dnsproviders/cloudflare
../../../caddyserver/dnsproviders/cloudflare/cloudflare.go:27:10: undefined: "github.com/xenolf/lego/providers/dns/cloudflare".NewDNSProviderCredentials

Is anyone else able to replicate this error or is this a “just me” problem? Looking at the latest master in the cloudflare.go source file I don’t see this function defined.

Relevant snippet from docker compose file:

  caddy:
    build:
      context: github.com/abiosoft/caddy-docker.git
      args:
        - plugins=cloudflare,realip,cache,expires,ipfilter,git,cors
    container_name: caddy
    hostname: caddy
    restart: unless-stopped
    command: --conf /etc/Caddyfile --log /var/logs/caddy.log --agree=true
    cap_add:
      - NET_ADMIN
    networks:
      dockernet:
        ipv4_address: 172.31.220.4
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ${DOCKER_SVC}/caddy/data/Caddyfile:/etc/Caddyfile
      - ${DOCKER_SVC}/caddy/data/.caddy:/root/.caddy
      - ${DOCKER_SVC}/caddy/data/logs:/var/logs
      - ${DOCKER_SVC}/caddy/data/www:/srv
    ulimits:
      nofile:
        soft: 64000
        hard: 64000
    labels:
      - com.centurylinklabs.watchtower.enable=false
    environment:
      - TZ=${TZ}
      - PUID=${PUID}
      - PGID=${PGID}
      - CADDYPATH=/root/.caddy
      - ACME_AGREE=true
      - CLOUDFLARE_EMAIL=${CLOUDFLARE_EMAIL}
      - CLOUDFLARE_API_KEY=${CLOUDFLARE_API_KEY}
      - LOG_LONG="[{when}] {remote} {hostname} | {scheme} {method} | {host} | {uri} | {rewrite_uri} | {status} {latency} {size} | {>X-Forwarded-For} {>X-Forwarded-Proto} {>X-Dest-Ip}"

Hi @dem3tre,

I just kicked off a build and was successful.

services:
  caddy:
    build:
      context: github.com/abiosoft/caddy-docker.git
      args:
        - plugins=git,cloudflare
    command: ["-log", "stdout", "-agree",
      "-conf", "/etc/Caddyfile",
      "-email", "[snip]"]
    environment:
      - CLOUDFLARE_EMAIL=[snip]
      - CLOUDFLARE_API_KEY=[snip]
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/Caddyfile
      - ./certs:/root/.caddy
      - ./keys:/root/.ssh
      - ./sites:/srv
    restart: unless-stopped
1 Like

It’s building for me now as well. Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.