Improved documentation

This commit is contained in:
Jan Böhmer 2023-02-09 00:42:20 +01:00
parent 5f6671a5aa
commit 48ceaff026
3 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,37 @@
---
title: Email
layout: default
parent: Installation
nav_order: 12
---
# Email
Part-DB can communicate with its users via email.
At the moment this is only used to send password reset links, but in future this will be used for other things too.
To make emails work you have to properly configure a mail provider in Part-DB.
## Configuration
Part-DB uses [Symfony Mailer](https://symfony.com/doc/current/mailer.html) to send emails, which supports multiple
automatic mail providers (like MailChimp or SendGrid). If you want to use one of these providers, check the Symfony Mailer documentation for more information.
We will only cover the configuration of a SMTP provider here, which is sufficient for most usecases.
You will need an email account, which you can use send emails from via password-bases SMTP authentication, this account
should be dedicated to Part-DB.
To configure the SMTP provider, you have to set the following environment variables:
`MAILER_DSN`: You have to provide the SMTP server address and the credentials for the email account here. The format is the following:
`smtp://<username>:<password>@<smtp-server-address>:<port>`. In most cases the username is the email address of the account, and the port is 587.
So the resulting DSN could look like this: `smtp://j.doe@mail.invalid:SUPER_SECRET_PA$$WORD@smtp.mail.invalid:587`.
`EMAIL_SENDER_EMAIL`: This is the email address which will be used as sender address for all emails sent by Part-DB.
This should be the same email address as the one used in the `MAILER_DSN` (the email adress of your email account):
e.g. `j.doe@mail.invalid`.
`EMAIL_SENDER_NAME`: This is the name which will be used as sender name for all emails sent by Part-DB.
This can be anything you want, e.g. `My Part-DB Mailer`.
Now you can enable the possibility to reset password by setting the `ALLOW_EMAIL_PW_RESET` env to `1` (or `true`).

View file

@ -0,0 +1,19 @@
---
title: Reverse proxy
layout: default
parent: Installation
nav_order: 11
---
# Reverse proxy
If you want to put Part-DB behind a reverse proxy, you have to configure Part-DB correctly to make it work properly.
You have to set the `TRUSTED_PROXIES` environment variable to the IP address of your reverse proxy
(either in your `docker-compose.yaml` in the case of docker, or `.env.local` in case of direct installation).
If you have multiple reverse proxies, you can set multiple IP addresses separated by a comma (or specify a range).
For example, if your reverse proxy has the IP address `192.168.2.10`, your value should be:
```
TRUSTED_PROXIES=192.168.2.10
```