Custom SSL Cert

Total noob question, I’ve tried adding a custom SSL cert via the supplied caddy.yml file as follows:

  • ./ssl:/etc/caddy/certs:ro
    and I’ve added labels to the seafile container in the seafile-server.yml file as follows:
    labels:
    caddy: “${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}”
    caddy.reverse_proxy: “{{upstreams 80}}”
    caddy.tls: |-
    {
    certificates {
    certificate /etc/caddy/certs/cert.crt
    key /etc/caddy/certs/key.key
    }
    }

but I’m getting the following errors when I get the logs from caddy in docker:
{“level”:“info”,“ts”:1737112664.476233,“logger”:“docker-proxy”,“msg”:“Process Caddyfile”,“logs”:“[ERROR] Removing invalid block: parsing caddyfile tokens for ‘tls’: wrong argument count or unexpected line ending after ‘/etc/caddy/certs/key.key’, at Caddyfile:3\nURL-REDACTED {\n\treverse_proxy 172.28.0.5:80\n\ttls certificates certificate /etc/caddy/certs/cert.crt key /etc/caddy/certs/key.key\n}\n\n”}

1 Like

Hey billywicks

Have you been able to find a solution to the problem in the meantime?

I am faced with the problem that I would like to use the purchased certificate.
In addition, my server is behind another nginx proxy - i.e. not directly accessible from the WAN, which makes the acme challenge impossible without forwarding port 80.

1 Like

I’ve got a similar deploy:
nginx reverse proxy which handles ssl certs and renew in front of everything. Before docker I was just pushing ssl certs inside seafile’s nginx. Now we must to use docker and caddy: how to push certs inside caddy? and should we enable https in the .env file or not?
ho to disable caddy’s feature to handle ssl certs renewal?

I’ve posted a similar question here:

https://forum.seafile.com/t/seafile-12-docker-caddy-cloudflare-lets-encrypt-dns-verification/23314?u=rodnheli

I’m missing also how to use caddy + seafile with different possibillities to provide a certificate. I like the attempt to keep as simple as possible - but sometimes it causes the opposite…