[Caddy2] Caddyfile 使用其它 DNS provider
安装 caddy 的 dns provider 模块。
https://github.com/caddy-dns/cloudflare
如果是在 Docker 中 build 模块按文档进行,通过 caddy:2.0.0-builder 安装需要的模块,
然后 COPY --from=builder /usr/bin/caddy /usr/bin/caddy
https://hub.docker.com/_/caddy
#@maintainer <cnblogs.com/farwish>
FROM caddy:2.0.0-builder AS builder RUN go env -w GO111MODULE=on RUN go env -w GOPROXY=https://goproxy.io,direct RUN caddy-builder github.com/caddy-dns/cloudflare FROM caddy:2.0.0 ENV CLOUDFLARE_API_TOKEN=xxxxx COPY --from=builder /usr/bin/caddy /usr/bin/caddy COPY Caddyfile /etc/caddy/Caddyfile
使用 tls 指令配置 dns provider。
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
}
https://caddyserver.com/docs/caddyfile/directives/tls#tls
Refer:Caddy DNS Provider
Refer: [Caddy2] cloudflare, acme: cleaning up failed: no memory of presenting a DNS record