From baef8c93e020fa2e9561490c81d78ff5ad2fb5ae Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Mon, 14 Oct 2019 13:28:13 +0200 Subject: [PATCH] ansible-inventories/arocom#2847 Add support for mailhog --- templates/d8_settings.php.jinja2 | 9 +++++++++ templates/vhost.conf | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/templates/d8_settings.php.jinja2 b/templates/d8_settings.php.jinja2 index 361616e..94b50a1 100644 --- a/templates/d8_settings.php.jinja2 +++ b/templates/d8_settings.php.jinja2 @@ -131,6 +131,15 @@ if (file_exists('modules/contrib/redis/redis.info.yml') && extension_loaded('red } +{% if item.mailhog|default(false) %} +$config['smtp.settings']['smtp_host'] = 'mailhog'; +$config['smtp.settings']['smtp_hostbackup'] = ''; +$config['smtp.settings']['smtp_port'] = '1025'; +$config['smtp.settings']['smtp_protocol'] = 'standard'; +$config['smtp.settings']['smtp_username'] = ''; +$config['smtp.settings']['smtp_password'] = ''; +{% endif %} + if (file_exists(__DIR__ . '/settings.local.php')) { include __DIR__ . '/settings.local.php'; } diff --git a/templates/vhost.conf b/templates/vhost.conf index b0a067f..d3f21a5 100644 --- a/templates/vhost.conf +++ b/templates/vhost.conf @@ -41,6 +41,21 @@ Header always add Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" +{% if drupal_domain.mailhog|default(false) %} +{% if drupal_domain.apache_auth is defined and drupal_domain.apache_auth.active|default('true') == 'true' %} + <Location /mailhog/> + AuthType {{ drupal_domain.apache_auth.type }} + AuthName "{{ drupal_domain.apache_auth.name }}" + AuthUserFile {{ webRoot }}/passwords/{{ drupal_domain.apache_auth.user }} + Require user {{ drupal_domain.apache_auth.user }} + </Location> +{% endif %} + ProxyPass "/mailhog/api/v2/websocket" ws://localhost:8025/api/v2/websocket + ProxyPassReverse "/mailhog/api/v2/websocket" ws://localhost:8025/api/v2/websocket + ProxyPass /mailhog/ http://localhost:8025/ + ProxyPassReverse /mailhog/ http://localhost:8025/ +{% endif %} + {% if drupal.docker|default(false) %} ServerSignature Off -- GitLab