Skip to content

Conversation

timkandel
Copy link

This PR adds a host command to automate creation of novarnish.* host entries if a custom project_tld or additional_fqdns are used.

We have projects with a lot of additional_fqdns entries and thought this might be useful.

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this try to figure out if the hostname is resolvable (if possible) instead of just adding things not in hosts file to hosts file?

Comment on lines +33 to +39
if ddev hostname --check $NOVARNISH_HOST 127.0.0.1 ; then
echo "Already in hostfile. Skipping..."
else
echo "Not present in hostfile."
echo "Executing 'ddev hostname $NOVARNISH_HOST 127.0.0.1'"
sudo ddev hostname $NOVARNISH_HOST 127.0.0.1
fi
Copy link
Member

@stasadev stasadev Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timkandel,

sudo no longer needed (it simply won't work, call ddev hostname without sudo) with DDEV v1.24.7+

ddev_version_constraint: '>= v1.24.3'

However, it is possible that checking for VIRTUAL_HOST values should be DDEV's responsibility, not the add-on's.

Or at least the PR should implement this suggestion:

Shouldn't this try to figure out if the hostname is resolvable (if possible) instead of just adding things not in hosts file to hosts file?

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.

3 participants