Repository navigation
Conversation
## Short Summary (TL;DR)
`ddev coder-setup` now writes DDEV's new `external_url_template` and `external_urls` settings. With a DDEV that supports them, `ddev start`, `ddev describe`, `ddev list` and `ddev launch` show the Coder URL of every routed port, including add-ons like phpMyAdmin and `web_extra_exposed_ports`.
## The Issue
Add-ons such as `ddev/ddev-phpmyadmin` were routed correctly, but DDEV showed their `*.ddev.site` URLs. The `docker-compose.coder-describe.yaml` workaround only reached `ddev describe`. It showed a new add-on one restart late, and it couldn't change the start message, the Mailpit row, Project URLs or `web_extra_exposed_ports` rows.
## How This PR Solves The Issue
- `coder-setup` writes `external_url_template: "https://{{port}}--<agent>--<workspace>--<owner>.<domain>"`, the port-forwarding URL `coder-routes` already routes with `PathPrefix`.
- Every project shares router ports 8080, 8025 and 8143, so `external_urls` maps them to the per-project `coder_app` slugs: `<project>`, `mailpit-<project>` and `xhgui-<project>`.
- When DDEV supports the settings, `coder-setup` and `coder-routes` remove `docker-compose.coder-describe.yaml`, which would only repeat the URLs. Older DDEV ignores the new keys and keeps using that file as before.
- drupal-core and drupal-contrib add `external_urls` for the `drupal-site` and `mailpit` apps, so `ddev start` and `ddev describe` show them.
- `ddev launch :<port>` now prints the Coder URL for that router port.
- `ddev launch` now labels Mailpit and add-ons by name, such as `phpmyadmin`, instead of `phpmyadmin-80`.
- With the router disabled, `ddev launch` printed a `ddev-web--…` URL that no template defines. It now prints the `drupal-site` URL.
This needs the DDEV change in ddev/ddev#9113 for the new behavior. Until a DDEV release includes it, workspaces behave as before.
## Manual Testing Instructions
In a freeform workspace whose project names include `my-site`, using a DDEV build from ddev/ddev#9113:
```bash
ddev utility download-ddev --pr 9113
export PATH="$HOME/tmp/ddev-download-ddev/pr-9113:$PATH"
mkdir ~/my-site && cd ~/my-site
ddev config --project-type=php --docroot=. --project-name=my-site
ddev coder-setup
# Expect: no docker-compose.coder-describe.yaml was written
ddev add-on get ddev/ddev-phpmyadmin
ddev start
# Expect: "Your project can be reached at https://my-site--<workspace>--<owner>.<domain>"
ddev describe
# Expect: phpmyadmin shows https://8036--main--<workspace>--<owner>.<domain> after this first start
ddev launch
# Expect: Web, Mailpit, phpmyadmin and xhgui lines with Coder URLs
ddev launch :8036
# Expect: the phpmyadmin URL; open it in a browser to see phpMyAdmin
```
Repeat with the workspace's stock DDEV to confirm the old behavior is unchanged.
## Automated Testing Overview
No automated tests were added. `freeform/scripts/test-freeform-verify.sh` still finds the web URL in `ddev launch` and `ddev describe` with either DDEV version. Claude Code ran shellcheck on the three changed scripts. Terraform wasn't installed, so `make test-templates` didn't run. Claude Code tested the scripts by hand on Linux with a DDEV build from ddev/ddev#9113, phpMyAdmin and a `web_extra_exposed_ports` entry. Nobody tested drupal-core or drupal-contrib workspaces, or the scripts with stock DDEV.
## Release/Deployment Notes
Existing projects get the new settings the next time someone runs `ddev coder-setup` in them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrTUMvJ6LYEFbNiv77H7BA
Documentation build overview
|
Previews
The landing-page preview creates workspaces on staging-coder.ddev.com, and its Documentation links open the docs preview. Read the Docs posts its build status and changed pages in its own comment; the docs preview may take a minute or two after a push to update. Updated for ec50e7b |
This branch has not been deployed
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)
ddev coder-setupnow writes DDEV's newexternal_url_templateandexternal_urlssettings. With a DDEV that supports them,ddev start,ddev describe,ddev listandddev launchshow the Coder URL of every routed port, including add-ons like phpMyAdmin andweb_extra_exposed_ports.The Issue
Add-ons such as
ddev/ddev-phpmyadminwere routed correctly, but DDEV showed their*.ddev.siteURLs. Thedocker-compose.coder-describe.yamlworkaround only reachedddev describe. It showed a new add-on one restart late, and it couldn't change the start message, the Mailpit row, Project URLs orweb_extra_exposed_portsrows.How This PR Solves The Issue
coder-setupwritesexternal_url_template: "https://{{port}}--<agent>--<workspace>--<owner>.<domain>", the port-forwarding URLcoder-routesalready routes withPathPrefix.external_urlsmaps them to the per-projectcoder_appslugs:<project>,mailpit-<project>andxhgui-<project>.coder-setupandcoder-routesremovedocker-compose.coder-describe.yaml, which would only repeat the URLs. Older DDEV ignores the new keys and keeps using that file as before.external_urlsfor thedrupal-siteandmailpitapps, soddev startandddev describeshow them.ddev launch :<port>now prints the Coder URL for that router port.ddev launchnow labels Mailpit and add-ons by name, such asphpmyadmin, instead ofphpmyadmin-80.ddev launchprinted addev-web--…URL that no template defines. It now prints thedrupal-siteURL.This needs the DDEV change in ddev/ddev#9113 for the new behavior. Until a DDEV release includes it, workspaces behave as before.
Manual Testing Instructions
In a freeform workspace whose project names include
my-site, using a DDEV build from ddev/ddev#9113:Repeat with the workspace's stock DDEV to confirm the old behavior is unchanged.
Automated Testing Overview
No automated tests were added.
freeform/scripts/test-freeform-verify.shstill finds the web URL inddev launchandddev describewith either DDEV version. Claude Code ran shellcheck on the three changed scripts. Terraform wasn't installed, somake test-templatesdidn't run. Claude Code tested the scripts by hand on Linux with a DDEV build from ddev/ddev#9113, phpMyAdmin and aweb_extra_exposed_portsentry. Nobody tested drupal-core or drupal-contrib workspaces, or the scripts with stock DDEV.Release/Deployment Notes
Existing projects get the new settings the next time someone runs
ddev coder-setupin them.Generated by Claude Code