abiosoft / caddy-docker

Docker container for Caddy
https://hub.docker.com/r/abiosoft/caddy/
MIT License
771 stars 315 forks source link

Consider adding/informing -agree option #98

Closed MattMattV closed 6 years ago

MattMattV commented 6 years ago

I tried to used the new version of caddy with my Caddy file consisting of multiple subdomain that use automatic let's encrypt but with the new endpoint (ACME v2) the caddy client require to use the -agree options (that indicated you read and agree ToS of let's encrypt).

Maybe you should consider one of those options :

I think the latter is the better but this is only my opinion (:

cpressland commented 6 years ago

Just had an outage in the Office due to this. Updated my Chef runs to handle it, but would be better if the Dockerfile specified this, or else, allowed us to specify via Environment Variable.

MattMattV commented 6 years ago

Personally in my docker-compose.yml, I overrode the entrypoint to just add the -agree

mholt commented 6 years ago

The -agree flag has nothing to do with ACMEv2; that flag has been in place for years. Before using Let's Encrypt, you have to agree to their Subscriber Agreement. You always have to do this the first time you run Caddy with a new Let's Encrypt account. With ACMEv2, Caddy has to make new accounts because the endpoint is totally different -- like a new CA, basically.

This only needs to be done once, presuming you don't throw away the ~/.caddy folder.

The -agree flag has been documented for a few years now.

abiosoft commented 6 years ago

Working on a fix but wants the user to still have control, rather than making assumption for the user and starting with -agree.

The default args are --conf /etc/Caddyfile --log stdout. As a workaround for now you can use --conf /etc/Caddyfile --log stdout --agree as the arguments to the container.

abiosoft commented 6 years ago

@MattMattV @cpressland I have updated the image to support ACME_AGREE env var. Simply set ACME_AGREE=true to agree. It has been added to the readme https://github.com/abiosoft/caddy-docker#lets-encrypt-subscriber-agreement.

docker run -e ACME_AGREE=true abiosoft/caddy

Kindly confirm if it works for you and re-open if the issue remains.

Side Note: Docker/Dockerfile does not provide an easy way to pass env vars to entrypoint/cmd other than to wrap with shell scipt, but that forfeits os signals. Had to write this script https://github.com/abiosoft/parent to achieve that.