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

Merged
merged 1 commit into from
Jan 13, 2025

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)

@stasadev stasadev requested a review from weitzman January 13, 2025 11:32
@weitzman weitzman merged commit 9273c66 into main Jan 13, 2025
2 checks passed
@weitzman weitzman deleted the 20250107_stasadev_external_links branch January 13, 2025 11:40
@weitzman
Copy link
Collaborator

Fancy :)

@stasadev
Copy link
Member Author

This change also needs a new release, thank you!

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