Repository navigation
refactor(router): remove the unused ddev-router-letsencrypt volume (#8977) [skip ci] - #8977
Merged
Merged
Conversation
…kip buildkite] The router no longer mounts a `ddev-router-letsencrypt` volume at `/etc/letsencrypt` or sets `LETSENCRYPT_EMAIL` and `USE_LETSENCRYPT`, because nothing has used them since the nginx-proxy router was removed. Let's Encrypt works as before, through Traefik's `acme.json`. The volume and the env vars were for Certbot in the old nginx-proxy router. Traefik has always kept its ACME state in `/mnt/ddev-global-cache/traefik/acme.json`, and [ddev#6739](ddev#6739) removed the nginx router but left these in the router compose template. The `use_letsencrypt` help text in the generated `global_config.yaml` still said certificates come "via Certbot". It removes the mount, the volume definition and the two env vars from the router compose template, along with the template keys that only fed them, and corrects the help text. Existing `ddev-router-letsencrypt` volumes are left in place, which is harmless since they only hold Certbot data that Traefik can't use. A real certificate needs a host with public DNS, but the ACME path can be checked anywhere against the Let's Encrypt staging server: ```bash ddev utility download-ddev --pr 8977 export PATH="$HOME/tmp/ddev-download-ddev/pr-8977:$PATH" ddev poweroff printf 'certificatesResolvers:\n acme-tlsChallenge:\n acme:\n caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"\n' > ~/.ddev/traefik/static_config.staging.yaml ddev config global --use-letsencrypt=true mkdir -p ~/tmp/le-test && cd ~/tmp/le-test && ddev config --project-type=php && ddev start docker inspect ddev-router --format '{{range .Mounts}}{{.Name}}:{{.Destination}} {{end}}' docker exec ddev-router stat -c '%a' acme.json docker logs ddev-router 2>&1 | grep -i acme rm ~/.ddev/traefik/static_config.staging.yaml && ddev config global --use-letsencrypt=false && ddev delete -Oy le-test ``` 🤖 Developed with assistance from [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Download this PR's build for your OS and architecture with: ddev utility download-ddev --pr 8977Or download the artifact for your OS and architecture directly:
See Testing a PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Summary (TL;DR)
The router no longer mounts a
ddev-router-letsencryptvolume at/etc/letsencryptor setsLETSENCRYPT_EMAILandUSE_LETSENCRYPT, because nothing has used them since the nginx-proxy router was removed. Let's Encrypt works as before, through Traefik'sacme.json.The Issue
Discovered while studying #8976:
The
ddev-router-letsencryptvolume and the env vars were for Certbot in the old nginx-proxy router (#2458). Traefik has always kept its ACME state in/mnt/ddev-global-cache/traefik/acme.json(#4248), and #6739 removed the nginx router but left these in the router compose template. Theuse_letsencrypthelp text in the generatedglobal_config.yamlstill said certificates come "via Certbot".How This PR Solves The Issue
It removes the mount, the volume definition and the two env vars from the router compose template, along with the template keys that only fed them, and corrects the help text. Existing
ddev-router-letsencryptvolumes are left in place, which is harmless since they only hold Certbot data that Traefik can't use.Manual Testing Instructions
A real certificate needs a host with ports 80 and 443 reachable from the internet and a DNS name pointing at it. On such a host:
Without a public host, the ACME path can still be checked against the Let's Encrypt staging server by adding a
~/.ddev/traefik/static_config.staging.yamlas described in hosting. The router logs then show a staging account registered and an order that fails with "no valid A records", which is expected for a site that isn't public.Automated Testing Overview
No test covered the removed mount, and the existing Traefik tests exercise the compose template that remains.
Testing Done
I ran the same test with the
upstream/mainbinary and with this PR's binary on an internet-reachable Ubuntu 26.04 host (Docker 27.4), using*.traefik.thefays.us. Each run used a fresh global config directory, and every Docker volume was deleted between the runs, so the PR run started with no ACME account or certificate.upstream/mainddev-global-cache,ddev-router-letsencrypt:/etc/letsencryptddev-global-cacheonlyLETSENCRYPT_*envddev-global-cache,ddev-router-letsencryptddev-global-cachelebase.traefik.thefays.uslepr.traefik.thefays.usacme.jsonleprcertificateIn both runs
curlfrom another machine fetched the site without-k.🤖 Generated with Claude Code