mCaptcha/docs/CONFIGURATION.md

79 lines
4.9 KiB
Markdown
Raw Normal View History

2021-05-30 17:36:13 +03:00
# Configuration
2021-08-08 15:59:17 +03:00
mCaptcha is highly configurable.
2021-05-30 17:36:13 +03:00
Configuration is applied/merged in the following order:
2021-06-01 15:03:47 +03:00
1. path to configuration file passed in via `MCAPTCHA_CONFIG`
2021-05-30 17:36:13 +03:00
2. `./config/default.toml`
2021-06-01 15:03:47 +03:00
3. `/etc/mcaptcha/config.toml`
2021-05-30 17:36:13 +03:00
4. environment variables.
## Setup
2021-08-08 15:59:17 +03:00
### Environment variables
2021-05-30 17:36:13 +03:00
Setting environment variables are optional. The configuration files have
all the necessary parameters listed. By setting environment variables,
you will be overriding the values set in the configuration files.
2021-08-08 15:59:17 +03:00
### General
2021-08-09 08:07:19 +03:00
| Name | Value |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `MCAPTCHA_CONFIG` | Path to configuration file |
| `MCAPTCHA_COMMERCIAL` | Does this instance offer commercial plans? Please consider donating if it does :D |
| `MCAPTCHA_SOURCE_CODE` | Link to the source code of this instance |
| `MCAPTCHA_ALLOW_REGISTRATION` | Is registration allowed on this instance? |
| `MCAPTCHA_ALLOW_DEMO` | Allow demo access to the server? If registration(previous option) is disabled then demo users will not be allowed |
2021-08-08 15:59:17 +03:00
#### Database
2021-05-30 17:36:13 +03:00
| Name | Value |
| ------------------------------------ | ------------------------------------------------------------- |
| `MCAPTCHA_DATEBASE_PASSWORD` | Postgres password |
| `MCAPTCHA_DATEBASE_NAME` | Postgres database name |
| `MCAPTCHA_DATEBASE_PORT` | Postgres port |
2021-08-08 15:59:17 +03:00
| `MCAPTCHA_DATEBASE_HOSTNAME` | Postgres hostname |
| `MCAPTCHA_DATEBASE_USERNAME` | Postgres username |
| `MCAPTCHA_DATEBASE_POOL` | Postgres database connection pool size |
2021-05-30 17:36:13 +03:00
| `DATABSE_URL` (overrides above vars) | databse URL in `postgres://user:pass@host:port/dbname` format |
2021-08-08 15:59:17 +03:00
#### Redis
| Name | Value |
| --------------------- | -------------------------- |
| `MCAPTCHA_REDIS_URL` | Redis URL |
| `MCAPTCHA_REDIS_POOL` | Redis connection pool size |
2021-08-08 15:59:17 +03:00
#### Server
2021-05-30 17:36:13 +03:00
2021-08-08 15:59:17 +03:00
| Name | Value |
| ---------------------------------------- | ---------------------------------------------------------------------------------- |
| `MCAPTCHA_SERVER_PORT` | The port on which you want mCaptcha to listen to |
| `PORT`(overrides `MCAPTCHA_SERVER_PORT`) | The port on which you want mCaptcha to listen to |
| `MCAPTCHA_SERVER_IP` | The IP address on which you want mCaptcha to listen to |
| `MCAPTCHA_SERVER_DOMAIN` | Domain under which mCaptcha will be\* |
| `MCAPTCHA_SERVER_COOKIE_SECRET` | Cookie secret, must be long and random |
| `MCAPTCHA_SERVER_PROXY_HAS_TLS` | Is mCaptcha behind a proxy? If yes, mCaptcha can send additional headers like HSTS |
2021-05-30 17:36:13 +03:00
2021-08-08 15:59:17 +03:00
\* Authentication doesn't work without `MCAPTCHA_DOMAIN` set to the correct domain
2021-05-30 17:36:13 +03:00
2021-08-08 15:59:17 +03:00
### Proof of work
2021-05-30 17:36:13 +03:00
| Name | Value |
| ------------------- | --------------------------------------------------------------------------------------- |
2021-06-01 15:03:47 +03:00
| `MCAPTCHA_POW_SALT` | Salt has to be long and random |
| `MCAPTCHA_POW_GC` | Garbage collection duration in seconds, requires tuning but 30 is a good starting point |
2021-07-09 09:34:48 +03:00
### SMTP
| Name | Value |
| ------------------------ | ----------------------------------------------- |
| `MCAPTCHA_SMTP_FROM` | email address from which the email will be sent |
| `MCAPTCHA_SMTP_REPLY_TO` | email address to which reply can be sent |
| `MCAPTCHA_URL` | SMTP server URL |
| `MCAPTCHA_SMTP_PORT` | SMTP server port |
| `MCAPTCHA_SMTP_USERNAME` | SMTP username |
| `MCAPTCHA_SMTP_PASSWORD` | SMTP password |