Skip to content

feat: show Coder URLs for all services in ddev start and describe - #245

Draft
rfay wants to merge 1 commit into
mainfrom
20261112_rfay_external_urls
Draft

rfay wants to merge 1 commit into
mainfrom
20261112_rfay_external_urls

Conversation

@rfay

@rfay rfay commented Nov 12, 2026

Copy link
Copy Markdown
Member

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:

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.


Generated by Claude Code

## 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
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 coder-ddev | 🛠️ Build #35847702 | 📁 Comparing ec50e7b against latest (25a1676)

  🔍 Preview build  

1 file changed
± workspaces/troubleshooting/index.html

@github-actions

Copy link
Copy Markdown

Previews

Site Preview
docs.coder.ddev.com (docs/content, built by Read the Docs) https://coder-ddev--245.org.readthedocs.build/
start.coder.ddev.com (docs/*.html, deployed to gh-pages) https://start.coder.ddev.com/pr-preview/pr-245/

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants