1. Caddy version (caddy version
):
Using Docker image created by @SlothCroissant slothcroissant/caddy-cloudflaredns:latest
2. How I run Caddy:
Docker via this docker compose.
a. System environment:
Docker
b. Command:
c. Service/unit/compose file:
caddy:
container_name: Caddy
image: slothcroissant/caddy-cloudflaredns:latest
restart: unless-stopped
ports:
- '80:80'
- '443:443'
volumes:
- '/sharedfolders/appdata/Caddy-docker/data:/data'
- '/sharedfolders/appdata/Caddy-docker/config/:/config'
- '/sharedfolders/appdata/Caddy-docker/Caddyfile:/etc/caddy/Caddyfile'
environment:
- CLOUDFLARE_EMAIL=myemail@myhost.com
- CLOUDFLARE_ API_TOKEN=
- ACME_AGREE=true
I do have the CF Token set but forum will not let me post it with a bunch of Xās
d. My complete Caddyfile or JSON config:
sub.duckdns.com:443 {
tls myemail@myhost.com {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
}
reverse_proxy / localhost:8123 {
}
3. The problem Iām having:
Iāve been running Caddy since 2018 with the same install. Iām moving all my services to Docker and am trying to upgrade from my 0.11 install to latest. It was close to miracle that I got this working years ago due to my feeble brain and am asking for help in sorting this again.
4. Error messages and/or full log output:
2022/03/19 23:42:44.127 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
,2022/03/19 23:42:44.128 WARN input is not formatted with 'caddy fmt' {"adapter": "caddyfile", "file": "/etc/caddy/Caddyfile", "line": 2}
,2022/03/19 23:42:44.130 INFO admin admin endpoint started {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["localhost:2019", "[::1]:2019", "127.0.0.1:2019"]}
,2022/03/19 23:42:44.130 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc0001ae0e0"}
,2022/03/19 23:42:44.131 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc0001ae0e0"}
,run: loading initial config: loading new config: loading http app module: provision http: getting tls app: loading tls app module: provision tls: loading certificates: open /sharedfolders/appdata/Caddy/cert.pem: no such file or directory
To be honest, I did run LetsEncrypt for a short time and Iām not certain if the cert.pem is from that attempt or not.
5. What I already tried:
The error claims it cannot open the cert.pem file but I can do a listing and it appears to be there:
root@omv:~# l /sharedfolders/appdata/Caddy/cert.pem
-rw-rw-rw- 1 root users 2508 Sep 12 2018 /sharedfolders/appdata/Caddy/cert.pem
My previous Caddyfile had an entry like this:
sub.duckdns.com:443 {
tls /sharedfolders/appdata/Caddy/cert.pem /sharedfolders/appdata/Caddy/privkey.pem
proxy / localhost:8123 {
websocket
transparent
}
}
6. Links to relevant resources:
Using this guide:
Iāve been wanting to update Caddy for a long time but Iāve found myself struggling to figure this out after a few attempts. Hopefully Iāve provided the information needed but will provide any and all requested. Any guidance is most appreciated.