Skip to content
Snippets Groups Projects
Commit 318c5092 authored by jurgenhaas's avatar jurgenhaas
Browse files

Merge branch 'develop' into 'main'

Merging develop into main

See merge request !79
parents 84d21c38 902b16e8
No related branches found
Tags v1.10.1
1 merge request!79Merging develop into main
Pipeline #1134083 passed
...@@ -126,13 +126,26 @@ class Handler extends BaseHandler { ...@@ -126,13 +126,26 @@ class Handler extends BaseHandler {
'overwriteconfig' => FALSE, 'overwriteconfig' => FALSE,
], ],
'mailhog' => [ 'mailhog' => [
'enable' => 1, 'enable' => 0,
'host' => $this->env->receiveGlobal('MAILHOG_HOST', 'MailHog Host', 'smtp.freesmtpservers.com'), 'host' => $this->env->receiveGlobal('MAILHOG_HOST', 'MailHog Host', 'smtp.freesmtpservers.com'),
'port' => $this->env->receiveGlobal('MAILHOG_PORT', 'MailHog Port', '25'), 'port' => $this->env->receiveGlobal('MAILHOG_PORT', 'MailHog Port', '25'),
'username' => $this->env->receiveGlobal('MAILHOG_USERNAME', 'MailHog Username'), 'username' => $this->env->receiveGlobal('MAILHOG_USERNAME', 'MailHog Username'),
'password' => $this->env->receiveGlobal('MAILHOG_PASSWORD', 'MailHog Password'), 'password' => $this->env->receiveGlobal('MAILHOG_PASSWORD', 'MailHog Password'),
'mechanism' => $this->env->receiveGlobal('MAILHOG_MECHANISM', 'MailHog Auth Mechanism', 'NONE'), 'mechanism' => $this->env->receiveGlobal('MAILHOG_MECHANISM', 'MailHog Auth Mechanism', 'NONE'),
], ],
'mailpit' => [
'enable' => 1,
'host' => $this->env->receiveGlobal('MAILPIT_HOST', 'MailPit Host', 'smtp.freesmtpservers.com'),
'port' => $this->env->receiveGlobal('MAILPIT_PORT', 'MailPit Port', '25'),
'username' => $this->env->receiveGlobal('MAILPIT_USERNAME', 'MailPit Username'),
'password' => $this->env->receiveGlobal('MAILPIT_PASSWORD', 'MailPit Password'),
'starttls' => $this->env->receiveGlobal('MAILPIT_STARTTLS', 'MailPit StartTLS'),
'allowinsecure' => $this->env->receiveGlobal('MAILPIT_ALLOW_INSECURE', 'MailPit allow insecure'),
'auth' => $this->env->receiveGlobal('MAILPIT_AUTH', 'MailPit Auth (none|plain|login|cram-md5)'),
'secret' => $this->env->receiveGlobal('MAILPIT_SECRET', 'MailPit Secret'),
'returnpath' => $this->env->receiveGlobal('MAILPIT_RETURNPATH', 'MailPit Bounce Address'),
'recipientallowlist' => $this->env->receiveGlobal('MAILPIT_RECIPIENT_ALLOW_LIST', 'MailPit Regex for allowed recipients'),
],
'varnish' => [ 'varnish' => [
'enable' => 0, 'enable' => 0,
], ],
...@@ -613,6 +626,9 @@ class Handler extends BaseHandler { ...@@ -613,6 +626,9 @@ class Handler extends BaseHandler {
'mhout.json' => [ 'mhout.json' => [
'dest' => $projectRoot . '/tests', 'dest' => $projectRoot . '/tests',
], ],
'mailpitout.yml' => [
'dest' => $projectRoot . '/tests',
],
]; ];
$files['cypress.config.js'] = [ $files['cypress.config.js'] = [
'source' => 'tests/', 'source' => 'tests/',
......
...@@ -51,6 +51,8 @@ services: ...@@ -51,6 +51,8 @@ services:
environment: environment:
{% if mailhog.enable %} {% if mailhog.enable %}
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025 PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
{% elseif mailpit.enable %}
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailpit:1025
{% endif %} {% endif %}
DB_HOST: mariadb DB_HOST: mariadb
DB_USER: drupal DB_USER: drupal
...@@ -295,8 +297,8 @@ services: ...@@ -295,8 +297,8 @@ services:
traefik.http.routers.solr-{{ projectname }}.tls.certresolver: lakedrops traefik.http.routers.solr-{{ projectname }}.tls.certresolver: lakedrops
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if mailhog.enable and (not drupal.live|default(0) or staging) %} {% if mailhog.enable and (not drupal.live|default(0) or staging) %}
mailhog: mailhog:
image: '{{ docker_image_prefix }}mailhog/mailhog' image: '{{ docker_image_prefix }}mailhog/mailhog'
{% if staging %} {% if staging %}
...@@ -325,6 +327,36 @@ services: ...@@ -325,6 +327,36 @@ services:
traefik.http.routers.mailhog-{{ projectname }}.tls: 'true' traefik.http.routers.mailhog-{{ projectname }}.tls: 'true'
traefik.http.routers.mailhog-{{ projectname }}.tls.certresolver: lakedrops traefik.http.routers.mailhog-{{ projectname }}.tls.certresolver: lakedrops
{% endif %} {% endif %}
{% elseif mailpit.enable and (not drupal.live|default(0) or staging) %}
mailpit:
image: '{{ docker_image_prefix }}axllent/mailpit'
{% if staging %}
restart: unless-stopped
{% endif %}
networks:
- traefik-public
- default
environment:
MP_SMTP_RELAY_CONFIG: /test/mailpitout.yml
privileged: true
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- {{ projectroot }}/tests/mailpitout.yml:/test/mailpitout.yml
labels:
traefik.enable: 'true'
traefik.docker.network: traefik-public
{% if basicauth.enable %}
traefik.http.middlewares.mailpit-{{ projectname }}-auth.basicauth.users: {{ basicauth.code }}
traefik.http.routers.mailpit-{{ projectname }}.middlewares: mailpit-{{ projectname }}-auth@docker
{% endif %}
traefik.http.services.{{ projectname }}_mailpit.loadbalancer.server.port: 8025
traefik.http.routers.mailpit-{{ projectname }}.rule: Host(`mailpit-{{ projectdomain }}`)
{% if drupal.live|default(0) or traefik.usessl %}
traefik.http.routers.mailpit-{{ projectname }}.tls: 'true'
traefik.http.routers.mailpit-{{ projectname }}.tls.certresolver: lakedrops
{% endif %}
{% endif %} {% endif %}
{% if node.enable %} {% if node.enable %}
......
host: '{{ mailpit.host }}'
{% if mailpit.port != '' %}
port: {{ mailpit.port }}
{% endif %}
{% if mailpit.username != '' %}
username: '{{ mailpit.username }}'
{% endif %}
{% if mailpit.password != '' %}
password: '{{ mailpit.password }}'
{% endif %}
{% if mailpit.starttls != '' %}
starttls: {{ mailpit.starttls }}
{% endif %}
{% if mailpit.allowinsecure != '' %}
allow-insecure: {{ mailpit.allowinsecure }}
{% endif %}
{% if mailpit.auth != '' %}
auth: '{{ mailpit.auth }}'
{% endif %}
{% if mailpit.secret != '' %}
secret: '{{ mailpit.secret }}'
{% endif %}
{% if mailpit.returnpath != '' %}
return-path: '{{ mailpit.returnpath }}'
{% endif %}
{% if mailpit.recipientallowlist != '' %}
recipient-allowlist: '{{ mailpit.recipientallowlist }}'
{% endif %}
...@@ -33,10 +33,10 @@ $databases = array( ...@@ -33,10 +33,10 @@ $databases = array(
), ),
), ),
); );
{% if not drupal.live|default(0) or mailhog.enable %} {% if not drupal.live|default(0) or mailhog.enable or mailpit.enable %}
$config['system.mail']['interface']['default'] = 'SMTPMailSystem'; $config['system.mail']['interface']['default'] = 'SMTPMailSystem';
$config['smtp.settings']['smtp_on'] = TRUE; $config['smtp.settings']['smtp_on'] = TRUE;
$config['smtp.settings']['smtp_host'] = 'mailhog'; $config['smtp.settings']['smtp_host'] = '{% if mailhog.enable %}mailhog{% else %}mailpit{% endif %}';
$config['smtp.settings']['smtp_hostbackup'] = ''; $config['smtp.settings']['smtp_hostbackup'] = '';
$config['smtp.settings']['smtp_port'] = '1025'; $config['smtp.settings']['smtp_port'] = '1025';
$config['smtp.settings']['smtp_protocol'] = 'standard'; $config['smtp.settings']['smtp_protocol'] = 'standard';
...@@ -65,7 +65,7 @@ $databases = array( ...@@ -65,7 +65,7 @@ $databases = array(
); );
$base_url = '{{ projectprotocol }}://{{ projectdomain }}{{ projectport }}'; $base_url = '{{ projectprotocol }}://{{ projectdomain }}{{ projectport }}';
$conf['smtp_host'] = 'mailhog'; $conf['smtp_host'] = '{% if mailhog.enable %}mailhog{% else %}mailpit{% endif %}';
$conf['smtp_hostbackup'] = ''; $conf['smtp_hostbackup'] = '';
$conf['smtp_port'] = '1025'; $conf['smtp_port'] = '1025';
$conf['smtp_protocol'] = 'standard'; $conf['smtp_protocol'] = 'standard';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment