Repository navigation
fix: replace broken http and https port lookup, fixes #7246 - #7259
Conversation
45410b1 to
f8d1480
Compare
|
Download the artifacts for this pull request:
See Testing a PR. |
f8d1480 to
26838a7
Compare
|
So |
26838a7 to
1cc5ec7
Compare
|
Thanks for studying it so carefully! |
Before I clean up and declare this ready for review, there's one remaining question about the priority and fallback logic, and if it's sufficient this way:
Should it fall back further and return the first http port like the current code does? |
|
This looks like a great strategy to me, and wow, thanks for the tests too! Could you rework the manual testing instructions (or add to) using Edit: Missed the questions:
It seems to me like your code here has done all that should be done, but great question and worthy of conversation.
In this case, we're letting Docker choose an ephemeral port unless However, related issue about the db port, Longer term it would probably be nice to not use ephemeral port by default but have static port for http/https. However, this kind of optmization always leads to new bugs and frictions. |
|
This should be on a good path, thanks for undertaking it. Move to "ready for review" when you're satisfied. |
stasadev
left a comment
There was a problem hiding this comment.
Nice work on this issue (how did I never catch it in the wild? 🙂)
rfay
left a comment
There was a problem hiding this comment.
Thanks for the great manual testing instructions and the new tests!
The code looks good to me, and I don't think it involves any risks.
Manual testing works out fine with both scenarios, thanks!
|
If you like this now @AkibaAT please move to ready for review |
1cc5ec7 to
79b179e
Compare
stasadev
left a comment
There was a problem hiding this comment.
Thank you! Looks good to me.
|
Thanks so much for the careful and thoughtful work on this @AkibaAT ! |
…t HTTPS URL TestDdevStartMultipleHostnames failed in the all-project-types job on four sites, each for a different reason: - sveltekit and nodejs: for `webserver_type: generic`, GetWebContainerDirectHTTPSPort fell back to the published `web_extra_exposed_ports` container port. The router reaches that port over plain HTTP, so `ddev describe` and GetAllURLs listed an `https://127.0.0.1:<port>` URL that answers with HTTP. The fallback was added in ddev#7259 alongside the HTTP one, which was the fallback that PR needed; the FrankenPHP add-on publishes 443 itself and never reached it. TestGetWebContainerDirectURLsWithGenericWebserver only checked the format of that URL, so it now requests every URL GetAllURLs reports; against the old code the direct HTTPS URL fails with EOF. - typo3: its static test file comes from the files tarball, which the test never imported, so it only passed when an earlier test had imported files for the first site. - silverstripe: it had no static test URL, so the test requested `/`, which redirects to `/dev/build` until a database is imported. It now uses a theme stylesheet that ships with the source. SkipIfGotestShort now runs the test anyway when DDEV_RUN_TEST_ANYWAY=true, and `.claude/settings.json` presets that and the opt-in test switches CI sets, so Claude Code can run any test locally against a single site. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t HTTPS URL TestDdevStartMultipleHostnames failed in the all-project-types job on four sites, each for a different reason: - sveltekit and nodejs: for `webserver_type: generic`, GetWebContainerDirectHTTPSPort fell back to the published `web_extra_exposed_ports` container port. The router reaches that port over plain HTTP, so `ddev describe` and GetAllURLs listed an `https://127.0.0.1:<port>` URL that answers with HTTP. The fallback was added in ddev#7259 alongside the HTTP one, which was the fallback that PR needed; the FrankenPHP add-on publishes 443 itself and never reached it. TestGetWebContainerDirectURLsWithGenericWebserver only checked the format of that URL, so it now requests every URL GetAllURLs reports; against the old code the direct HTTPS URL fails with EOF. - typo3: its static test file comes from the files tarball, which the test never imported, so it only passed when an earlier test had imported files for the first site. - silverstripe: it had no static test URL, so the test requested `/`, which redirects to `/dev/build` until a database is imported. It now uses a theme stylesheet that ships with the source. SkipIfGotestShort now runs the test anyway when DDEV_RUN_TEST_ANYWAY=true, and `.claude/settings.json` presets that and the opt-in test switches CI sets, so Claude Code can run any test locally against a single site. Co-Authored-By: Claude Opus 5.5 <[email protected]>

The Issue
How This PR Solves The Issue
Fix up
GetWebContainerDirectHTTPPortandGetWebContainerHTTPSPublicPortto preferably useapp.GetPublishedPortForPrivatePort("web", 80)andapp.GetPublishedPortForPrivatePort("web", 443), and fall back only for generic type projects.Manual Testing Instructions
Have ngrok set up and authenticated as per https://ngrok.com/docs/getting-started/
Add
web_extra_exposed_portsto.ddev/config.yaml:Verify that
ddev sharemaps to the expected port, instead of the web_extra_exposed_ports it did before.Additionally, test the same with https://ddev.readthedocs.io/en/stable/users/quickstart/#generic-frankenphp to verify that generic projects also behave correctly.
Automated Testing Overview
Added new tests:
Release/Deployment Notes
n/a