Repository navigation
fix: remove nginx proxy router, fixes #5940 - #6739
Conversation
|
Download the artifacts for this pull request:
See Testing a PR. |
stasadev
left a comment
There was a problem hiding this comment.
We shouldn't have containers/ddev-nginx-proxy-router, right?
| configGlobalCommand.Flags().String("xdebug-ide-location", "", "For less usual IDE locations specify where the IDE is running for Xdebug to reach it") | ||
| configGlobalCommand.Flags().Bool("use-traefik", true, "If true, use Traefik for ddev-router") | ||
| _ = configGlobalCommand.Flags().MarkDeprecated("use-traefik", "please use --router instead") | ||
| configGlobalCommand.Flags().String("router", globalconfigTypes.RouterTypeTraefik, fmt.Sprintf("Valid router types are %s, default is %s", strings.Join(globalconfigTypes.GetValidRouterTypes(), ", "), globalconfigTypes.RouterTypeDefault)) |
There was a problem hiding this comment.
I think we'd better mark the --router flag as deprecated, just like we did for --use-traefik above.
Or make it accept traefik only.
I was reluctant to just remove it right away. Do you disagree? It would be reasonable either way. It's obviously there in the source code. |
2a0e7b7 to
5683c16
Compare
I'm okay with it, just asked if this was intentional to leave it there. |
5683c16 to
609634e
Compare
stasadev
left a comment
There was a problem hiding this comment.
When I use nginx-proxy with v1.23.5, and then switch to this PR:
$ ddev version
FATA[0000] unable to read global config: invalid router: nginx-proxy, valid router types are [traefik]
I guess we should change nginx-proxy to traefik automatically?
|
I agree. |
c0f5aa9 to
43b3bb3
Compare
| return fmt.Errorf("invalid router: %s, valid router types are %v", DdevGlobalConfig.Router, types.GetValidRouterTypes()) | ||
| output.UserOut.Printf("\nThe only valid router type is %s, but you have router: %s in your global configuration, using %s instead.\n", types.RouterTypeTraefik, DdevGlobalConfig.Router, types.RouterTypeTraefik) | ||
| DdevGlobalConfig.Router = types.RouterTypeTraefik | ||
| return nil |
There was a problem hiding this comment.
Return was added here to show a warning for the user each time, but when I tested it with:
router: nginx-proxy
xdebug_ide_location: "blablabla"DDEV didn't complain about wrong xdebug_ide_location.
I don't think it's worth skipping all the further validation checks here.
There was a problem hiding this comment.
Fixed, thanks for catching the erroneous return there.
Co-authored-by: Stanislav Zhuk <[email protected]>
3c3669a to
abd08ec
Compare
abd08ec to
f6c9506
Compare
stasadev
left a comment
There was a problem hiding this comment.
Thank you.
I tested upgrade/downgrade. DDEV did a great job in all cases.
Regarding the code in containers/ddev-nginx-proxy-router:
We need to keep it because we still use this image for versions 1.23.5 and earlier, and we are required to provide the source code (as requested by Docker-Sponsored Open Source Program). So, until the Docker image is available, we should keep it.
…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]>
The Issue
Remove the deprecated nginx proxy router
Manual Testing Instructions
Try setting router to nginx-proxy router
Make sure ordinary things work