Add local SMTP server for development

This commit is contained in:
Reginald Bondoc
2022-12-10 21:10:05 +01:00
parent 00ea296138
commit da999107f3
6 changed files with 127 additions and 79 deletions

View File

@@ -1,6 +1,6 @@
---
title: "Developing"
description: "This guide will help you set up and run Infisical in development mode."
title: 'Developing'
description: 'This guide will help you set up and run Infisical in development mode.'
---
## Clone the repo
@@ -48,14 +48,27 @@ Take into account that if you use your own `MONGO_USERNAME` and `MONGO_PASSWORD`
![image](https://user-images.githubusercontent.com/118568289/206792653-ba3211d1-1071-43f2-93a7-8b408bbd9e0e.png)
These variables are needed to use the Mail SMTP service that takes care of sending the verification code when you
register in the app.
If you want to receive actual emails (e.g. you want to test how the email message will look like), take note of the following.
For the `SMTP_USERNAME` variable, you will need an email with 2-steps-verification.
For the `SMTP_PASSWORD` variable, you will need to [generate an app password](https://support.google.com/mail/answer/185833?hl=en) with the email you used in the `SMTP_USERNAME` variable.
With this environment variables, you will be ready to run the docker-compose.
Otherwise, a local SMTP server (MailHog) is available for testing purposes. Set the following values to use this:
```
SMTP_HOST=smtp-server
SMTP_PORT=1025
SMTP_NAME=<whatever you like>
SMTP_USERNAME=team@infisical.com
SMTP_PASSWORD=
```
Make sure to leave the `SMTP_PASSWORD` blank so the backend will be able to connect to MailHog
You can browse `http://localhost:8025/` to browse email messages sent by the backend.
With these environment variables, you will be ready to run the docker-compose.
## Docker for development