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

WP 4.6 Compat: set WP_HOME/SITEURL directly #647

Merged
merged 1 commit into from
Sep 2, 2016

Conversation

swalkinshaw
Copy link
Member

WordPress/WordPress@905f4ec
changed email address handling with PHPMailer. It's not validating email
addresses. This was failing since Trellis was using string interpolation
with the HTTP_HOST constant. It wasn't being evaluated in that
context.

The solution is to set these values directly with the first canonical
site host eliminating the need for the magic constant and string
interpolation.

WordPress/WordPress@905f4ec
changed email address handling with PHPMailer. It's not validating email
addresses. This was failing since Trellis was using string interpolation
with the `HTTP_HOST` constant. It wasn't being evaluated in that
context.

The solution is to set these values directly with the first canonical
site host eliminating the need for the magic constant and string
interpolation.
@swalkinshaw swalkinshaw mentioned this pull request Aug 31, 2016
@runofthemill
Copy link
Contributor

Continuing the conversation from #646 - Ansible provides easy access to system facts that can be used here and elsewhere: http://docs.ansible.com/ansible/playbooks_variables.html#information-discovered-from-systems-facts

I think it may be good to use {{ ansible_fqdn }} instead of a filter - I think it was in this video where Jeff talks about the idea that Ansible roles/playbooks shouldn't attempt to use Ansible as a programming language (i.e. using lots of complex logic, filters, etc.) and as a whole Trellis could probably benefit from a reduction in complexity - this (IMO) is a good place to take advantage of that!

@thisolivier
Copy link

@runofthemill Since ansible_fqdn relies on an external lookup, this could result in some very strange behaviour, see here.- I'm imagining if you're deploying the production version while the domain is still in use elsewhere. My apologies if that's not relevant here.

@fullyint
Copy link
Contributor

Suppose a user setting up a new DO droplet doesn't customize the hostname to be the fqdn, leaving some default value like this:
image
Then hostname --fqdn and ansible_fqdn are both ubuntu-512mb-sfo1-01. Trellis could add a task to set the hostname, but I'd be inclined to stick with {{ site_hosts_canonical | first }}.

@runofthemill
Copy link
Contributor

@thisolivier @fullyint I see your points - I was using it with vagrant in the context of the local dev server, which I mentioned in the other post (but not here); my only other thought is I'd just suggest leaving wp_siteurl as "${WP_HOME}/wp" to keep things DRY.

@swalkinshaw swalkinshaw merged commit f15444b into master Sep 2, 2016
@swalkinshaw swalkinshaw deleted the improve-wp-home-site-url-variables branch September 2, 2016 02:06
fullyint added a commit that referenced this pull request Sep 2, 2016
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.

4 participants