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
```

38
docs/troubleshooting.md Normal file
View file

@ -0,0 +1,38 @@
---
layout: default
title: Troubleshooting
---
# Troubleshooting
Sometimes things go wrong and Part-DB shows an error message. This page should help you to solve the problem.
## Error messages
When a common, easy fixable error occurs (like a non up-to-date database), Part-DB will show you some short instructions on how to fix the problem. If you have a problem that is not listed here, please open an issue on GitHub.
## General procedure
If you encounter an error, try the following steps:
* Clear cache of Part-DB with the console command:
```bash
php bin/console cache:clear
```
* Check if the database needs an update (and perform it when needed) with the console command:
```bash
php bin/console doctrine:migrations:migrate
```
If this does not help, please [open an issue on GitHub](https://github.com/Part-DB/Part-DB-symfony).
## Error logs
Detailed error logs can be found in the `var/log` directory.
When Part-DB is installed directly, the errors are written to the `var/log/prod.log` file.
When Part-DB is installed with Docker, the errors are written directly to the console output.
You can see the logs with the following command, when you are in the folder with the `docker-compose.yml` file
```bash
docker-compose logs -f
```
Please include the error logs in your issue on GitHub, if you open an issue.
## Report Issue
If an error occurs, or you found a bug, please [open an issue on GitHub](https://github.com/Part-DB/Part-DB-symfony).