DuckDNS plugin compatibility problems with Zerossl issuer

1. Caddy version (caddy version):

v2.4.0-beta.1 h1:Ed/tIaN3p6z8M3pEiXWJL/T8JmCqV62FrSJCHKquW/I=

2. How I run Caddy:

Docker

a. System environment:

Docker 20.10.5, Ubuntu 20.04.2

b. Command:

Here is my sh file to run the container

#! /usr/bin/bash

docker rm -f caddy
docker run -itd \
    --name=caddy \
    --ulimit nofile=1048576 \
    -p 8080:8080 \
    -v  /root/caddy_build/Caddyfile:/etc/caddy/Caddyfile \
    -v /root/caddy_build/data:/data \
    -v /root/caddy_build/config:/config \
    buct_caddy

c. Service/unit/compose file:

Here is my Dockerfile

FROM caddy:builder AS builder

ENV GO111MODULE on

ENV GOPROXY https://goproxy.cn

RUN xcaddy build v2.3.0 \ 

    --with github.com/caddy-dns/duckdns

FROM caddy:latest

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

and I don’t know why it turned to version 2.4.0-beta1 while building.

d. My complete Caddyfile or JSON config:

  1. This Caddyfile Can work, but cert_issuer zerossl seems to invalid,and it will issues the cert with Let’s encrypt.
{
        cert_issuer zerossl api_key
}

https://*.buct.edu.cn:8080 {
        encode zstd gzip
        respond "welcome"
        tls {
                dns duckdns my_key {
                        override_domain buct.duckdns.org
                }
        }
}

  1. This Caddyfile Can‘t work at all.
https://*.buct.edu.cn:8080 {
    encode zstd gzip
    respond "welcome"
    tls {
        dns duckdns my_key {
            override_domain buct.duckdns.org
        }
        issuer zerossl api_key
    }
}

It raised an error:

2021/03/22 04:18:58.135 INFO    using provided configuration    {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
run: adapting config using caddyfile: parsing caddyfile tokens for 'tls': /etc/caddy/Caddyfile:35 - Error during parsing: cannot mix issuer subdirective (explicit issuers) with other issuer-specific subdirectives (implicit issuers)

3. The problem I’m having:

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

You’ll want to write it like this:

	tls {
		issuer zerossl api_key {
			dns duckdns my_key {
				override_domain buct.duckdns.org
			}
		}
	}

The dns option directly in tls is for when you’re not configuring specific issuers. If you are, then you should nest the dns config inside of them. That’s what the Caddyfile adapt error is trying to tell you.

Yeah, it’s a known issue. It’s complicated.

What you can do is explicitly specify an older version of the duckdns plugin, specifically Move replacer to provisioning phase (#4) · caddy-dns/duckdns@6ce21bf · GitHub which is just before its dependencies were upgraded to require Caddy v2.4.0-beta.1. Basically just build with:

RUN xcaddy build v2.3.0 \ 
    --with github.com/caddy-dns/duckdns@6ce21bf15ef07fa76703f4bc2be2c4052226d465
1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.