docs: deployment and configuration for redis

This commit is contained in:
realaravinth 2021-06-13 13:01:23 +05:30
parent 9636180673
commit 1ddbf196ff
No known key found for this signature in database
GPG Key ID: AD9F0F08E855ED88
3 changed files with 29 additions and 16 deletions

View File

@ -29,10 +29,17 @@ you will be overriding the values set in the configuration files.
| `MCAPTCHA_DATEBASE_POOL` | Postgres database connection pool size |
| `DATABSE_URL` (overrides above vars) | databse URL in `postgres://user:pass@host:port/dbname` format |
#### Redis:
| Name | Value |
| --------------------- | -------------------------- |
| `MCAPTCHA_REDIS_URL` | Redis URL |
| `MCAPTCHA_REDIS_POOL` | Redis connection pool size |
#### Server:
| 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 |
@ -46,12 +53,12 @@ domain
### Configuration file location:
| Name | Value |
| -------------- | ------------------- |
| ----------------- | ------------------- |
| `MCAPTCHA_CONFIG` | Path to config file |
### Proof of work:
| Name | Value |
| ---------------- | --------------------------------------------------------------------------------------- |
| ------------------- | --------------------------------------------------------------------------------------- |
| `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 |

View File

@ -71,6 +71,11 @@ postgres=# CREATE USER mcaptcha WITH PASSWORD 'my super long password and yes y
$ createdb -O mcaptcha mcaptcha # create db 'mcaptcha' with 'mcaptcha' as owner
```
### 4. Install and load [`mCaptcha/cache`](https://github.com/mCaptcha/cache) module:
See [`mCaptcha/cache`](https://github.com/mCaptcha/cache) for more
details.
### 4. Build `mcaptcha`:
To build `mcaptcha`, you need the following dependencies:
@ -140,8 +145,10 @@ WantedBy=multi-user.target
```
2. Enable service:
```bash
$ sudo systemctl daemon-reload && \
sudo systemctl enable mcaptcha && \ # Auto startup during boot
sudo systemctl start mcaptcha
``
```

View File

@ -83,7 +83,6 @@ async fn spec() -> HttpResponse {
}
async fn index() -> HttpResponse {
println!("getting index");
handle_embedded_file("index.html")
}