Trellis Updates: 0.9.1 Release

As Trellis finally gets closer to 1.0.0, some useful features have been contributed in the past few weeks.

MailHog

Pull request by @louim

Dealing with emails in development is never fun. The two common solutions are usually:

  1. Ignore it and hope it works fine on production
  2. Set up real SMTP credentials to send emails

Enter MailHog. It’s a simple tool which captures outgoing email and lets you view them from a web UI. And after that you can optionally "release" them which would actually send the email.

trellis-mailhog-preview

MailHog is automatically set up in development. You can access it at http://yourdevelopmentdomain.dev:8025 (replacing the domain with yours of course).

Another benefit of using MailHog is that if are using real SMTP credentials in development, you can ensure you don’t accidentally send emails to real email addresses which might exist in your database.

Thanks to an existing MailHog role on Ansible Galaxy, this feature was able to be quickly implemented without much code or configuration.

Customizable timezones

Pull request by @Kimisyl

By default, Ubuntu uses UTC for system time which PHP inherits. Trellis has a new variable available: default_timezone. The default value is Etc/UTC to match the Ubuntu default.

This can easily be changed to any valid timezone which can be found here. My local timezone is America/Toronto for example.

While this PR seems like a small feature, Kimisyl did a great job implementing it. The setting validates the default_timezone value and returns a friendly error message instead of failing with the usual Ansible error message which can be tough to debug.

- name: Validate timezone variable
  stat: path=/usr/share/zoneinfo/{{ default_timezone }}
  register: timezone_path
  changed_when: false

- name: Explain timezone error
  fail: msg="{{ default_timezone }} is not a valid timezone. For a list of valid timezones, check https://php.net/manual/en/timezones.php"
  when: not timezone_path.stat.exists

This is a good example of how we can make Trellis easier to use with some simpler error-checking.

Bug fixes

A couple bug fixes/improvements were also merged in.

Deploy git-remote fix by @fullyint

This PR ensures that if you change the repo variable between deploys that Trellis will correctly update the remote cloned repo to the new repo URL and deploy the repository it actually should.

Improvements to custom Nginx includes by @chriszarate

@chriszarate had previously contribute this initial feature and made some improvements in this PR. This feature is quite useful to extend Nginx by including configuration files. More documentation can be found in the Trellis Wiki.

Read the discussion on our Discourse

Get our latest updates & occasional tips on building better WordPress sites

Follow @rootswp on Twitter