From f79546c76a66510b24e146cdff5cc075b01e1004 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 2 Jul 2024 12:04:18 +0200 Subject: [PATCH] update authentik readme --- authentik/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/authentik/README.md b/authentik/README.md index a43c5c25b3..43dd5723b8 100644 --- a/authentik/README.md +++ b/authentik/README.md @@ -48,3 +48,38 @@ If you want to publish changes to the database you can use the following command (Note: this assumes you are not root and sets the permissions of the database files via sudo) (Note: make sure to shut down the database first before you run the script) + +## E-Mail testing + +Authentik e-mails can be checked locally via [Mailpit mailserver](https://mailpit.axllent.org/). + +### Prepare and start + +```bash +# in the authentik directory +# get hostname and write e-mail environment variables to .env +echo -e "\n\nAUTHENTIK_EMAIL__HOST=$(hostname) +AUTHENTIK_EMAIL__PORT=1025 +AUTHENTIK_EMAIL__USE_TLS=false +AUTHENTIK_EMAIL__USE_SSL=false +AUTHENTIK_EMAIL__TIMEOUT=10 +AUTHENTIK_EMAIL__FROM=authentik@example.com" >> .env + +# start authentik and mailserver +docker-compose -f docker-compose.yml -f docker-compose.test.yml up +``` + +### Example + +The given setup can be tested via [Authentik's e-mail testing tool](https://github.com/goauthentik/authentik/blob/main/authentik/stages/email/management/commands/test_email.py) + + +```bash +# in the authentik directory execute the email test +docker compose exec worker ak test_email test@example.com + +# in the browser see the Mailpit inbox +:8025 +# or +localhost:8025 +``` \ No newline at end of file