Tecnativa / doodba-scaffolding

Officially supported scaffolding template for your Doodba projects
Other
11 stars 38 forks source link

[DCK] Support mailhog auth #40

Closed yajo closed 5 years ago

yajo commented 5 years ago

A new security measure for test environments is the possibility to require authentication for reading outgoing emails.

This is only implemented in test.yaml, which is the only public-facing environment that uses MailHog.

It uses now /etc/mailhog/auth as auth file in case it is present and readable at boot.

To fill that file:

docker-compose up --no-start

That command should tell you something like Creating volume "myproject-smtpconf". Use that volume name as $volume and then:

docker container run --rm -it --uid 1000 -v $volume:/smtpconf --entrypoint= mailhog/mailhog vi /smtpconf/auth

There you can write your conf file and exit (as long as you know how to exit from vi).

After that, you can docker-compose restart smtp and get it working. You'll have to use a user and password to get access to mailhog.

Docs on MailHog's feature: https://github.com/mailhog/MailHog/blob/master/docs/Auth.md