scafer / traefik-duckdns-letsencrypt

Traefik, DuckDNS, and Let's Encrypt Integration Demo
10 stars 2 forks source link

Cannot move /etc/letsencrypt #2

Closed hoelger closed 4 months ago

hoelger commented 5 months ago

When I move the volume path "/etc/letsencrypt:/letsencrypt" to somewhere else let's say "~/letsencrypt:/letsencrypt" then everything breaks, and does not work anymore.

I notice that in the /etc/letsencrypt folder there is the output from when I ran certbot before, that's my guess why it was working previously. So for me it looks like you need the certificates beforehand, and I'm unsure if the dnschallenge.provider=duckdns and DUCKDNS_TOKEN actually do something?

scafer commented 5 months ago

Hi @hoelger,

I haven't had a chance to look at the other issue you created. But regarding this one, you don't need to do anything before running the command, the folder content is automatically created and managed by traefik. These environment variables should be all you need.

Anyway, let me check, as something might have changed in the meantime.

scafer commented 5 months ago

Btw, Traefik takes a few minutes to run the SSL Challenge, so it may take a while to retrieve the certificates the first time you run it.

scafer commented 5 months ago

@hoelger I was able to get it to work by adding the ACME_EMAIL, DOMAIN and DUCKDNS_TOKEN values and changing WEB_ENTRYPOINT to websecure.

Have you renamed the example.env to .env? I noticed that the command on the readme is wrong, it should be: mv example.env .env

Does Traefik container throw any particular error? As I said, it can take some time to generate the certificate.

If you're having trouble, we can have a call to fix it!

hoelger commented 5 months ago

Dear @scafer, thanks for the quick response in the middle of the night.

I didn't use the .env file but just directly filled the docker-compose.yml with the values.

I'm not sure why it doesn't work for me. The log output doesn't indicate errors either.

One thing did a little trick for me: "Each router that is supposed to use the resolver must reference it." After adding - traefik.http.routers.whoami.tls.certresolver=myresolver now I always see, how the challenge is executed. Takes about one minute or two. But in my case, any challenge (dns or http or tls) still fails.

Here are the logs: log_0.txt log_1_dnschallenge_timelimit.txt log_2_tlschallenge.txt

I'm so confused, how did I generate this one working acme.json in the first place? :D Thanks for your offer! Would be lovely if we could have a look together on it some time next week :)

scafer commented 4 months ago

Sorry for the delay. Have you managed to fix it? If not, when would you like to have a look?

scafer commented 4 months ago

Feel free to reopen it if the error persists!

hoelger commented 4 months ago

Dear Sandro, Sorry for my late reply, I was not working on this project since my last post. I'll continue tomorrow + Friday. Would you have spontaneously time to look into the code some time tomorrow evening?

scafer commented 4 months ago

I @hoelger , we can do it today until 17:00 Lisbon time or if you prefer Monday during the day

hoelger commented 4 months ago

That would be great! Can we do 3pm Lisbon / 4pm Berlin? Does skype work for you? My skype handle is ballin-hoelger.

scafer commented 4 months ago

Yes, I will add you.