Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add support for multiple hostnames #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stasadev
Copy link
Member

@stasadev stasadev commented Jan 7, 2025

The Issue

external_links don't work properly when you have additional_hostnames or additional_fqdns.

external_links:
- ddev-router:${DDEV_SITENAME}.${DDEV_TLD}

 external_links: 
   - "ddev-router:${DDEV_SITENAME}.${DDEV_TLD}"

It works only for the main URL, but not for additional URLs.

How This PR Solves The Issue

Uses go templates to create the correct external_links in .ddev/docker-compose.selenium-chrome_extras.yaml

Manual Testing Instructions

This allows for example to have Mailpit to work automatically without any port change.

mkdir selenium-chrome-test && cd selenium-chrome-test
ddev config --additional-fqdns="hello.test" --additional-hostnames "extra1,extra2,more.extra"
echo '<?php echo "Hello World;"; ?>' > index.php
ddev add-on get https://github.com/ddev/ddev-selenium-standalone-chrome/tarball/20250107_stasadev_external_links

cat .ddev/docker-compose.selenium-chrome_extras.yaml
#ddev-generated
services:
  selenium-chrome:
    external_links:
      - "ddev-router:${DDEV_PROJECT}.${DDEV_TLD}"
      - "ddev-router:extra1.${DDEV_TLD}"
      - "ddev-router:extra2.${DDEV_TLD}"
      - "ddev-router:hello.test"
      - "ddev-router:more.extra.${DDEV_TLD}"

ddev start

cat .ddev/.ddev-docker-compose-full.yaml
        external_links:
            - ddev-router:selenium-chrome-test.ddev.site
            - ddev-router:extra1.ddev.site
            - ddev-router:extra2.ddev.site
            - ddev-router:hello.test
            - ddev-router:more.extra.ddev.site

Related Issue Link(s)

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.

1 participant