2021-03-09 15:58:54 +05:30
|
|
|
<div align="center">
|
|
|
|
<h1>mCaptcha Guard</h1>
|
|
|
|
<p>
|
|
|
|
<strong>Back-end component of mCaptcha</strong>
|
|
|
|
</p>
|
|
|
|
|
2021-03-10 21:55:39 +05:30
|
|
|
[](https://mcaptcha.github.io/guard/guard/)
|
2021-03-09 15:58:54 +05:30
|
|
|
/badge.svg>)
|
|
|
|
[](https://deps.rs/repo/github/mCaptcha/guard)
|
|
|
|
[](https://codecov.io/gh/mCaptcha/guard)
|
|
|
|
<br />
|
|
|
|
[](http://www.gnu.org/licenses/agpl-3.0)
|
2021-03-10 21:55:39 +05:30
|
|
|
|
2021-03-09 15:58:54 +05:30
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2021-03-10 21:55:39 +05:30
|
|
|
Guard is the back-end component of [mCaptcha](https://mcaptcha.org)
|
|
|
|
system.
|
|
|
|
|
|
|
|
**STATUS: UNUSABLE BUT ACTIVE DEVELOPMENT**
|
2021-03-09 15:58:54 +05:30
|
|
|
|
|
|
|
### How to build
|
|
|
|
|
|
|
|
- Install Cargo using [rustup](https://rustup.rs/) with:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
|
|
```
|
|
|
|
|
|
|
|
- Clone the repository with:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ git clone https://github.com/mCaptcha/guard
|
|
|
|
```
|
|
|
|
|
|
|
|
- Build with Cargo:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ cd guard && cargo build
|
|
|
|
```
|
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
2021-03-10 21:55:39 +05:30
|
|
|
Guard is highly configurable.
|
2021-03-09 15:58:54 +05:30
|
|
|
Configuration is applied/merged in the following order:
|
|
|
|
|
|
|
|
1. `config/default.toml`
|
|
|
|
2. environment variables.
|
|
|
|
|
|
|
|
|
|
|
|
#### Setup
|
|
|
|
|
|
|
|
##### Environment variables:
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
###### Database:
|
|
|
|
|
2021-03-10 21:55:39 +05:30
|
|
|
| Name | Value |
|
|
|
|
| ------------------------- | -------------------------------------- |
|
|
|
|
| `GUARD_DATEBASE_PASSWORD` | Postgres password |
|
|
|
|
| `GUARD_DATEBASE_NAME` | Postgres database name |
|
|
|
|
| `GUARD_DATEBASE_PORT` | Postgres port |
|
|
|
|
| `GUARD_DATEBASE_HOSTNAME` | Postgres hostmane |
|
|
|
|
| `GUARD_DATEBASE_USERNAME` | Postgres username |
|
|
|
|
| `GUARD_DATEBASE_POOL` | Postgres database connection pool size |
|
2021-03-09 15:58:54 +05:30
|
|
|
|
|
|
|
###### Server:
|
|
|
|
|
2021-03-10 21:55:39 +05:30
|
|
|
| Name | Value |
|
|
|
|
| ----------------------------------- | --------------------------------------------------- |
|
|
|
|
| `GUARD_SERVER_PORT` (or) `PORT`\*\* | The port on which you want wagon to listen to |
|
|
|
|
| `GUARD_SERVER_IP` | The IP address on which you want wagon to listen to |
|
|
|
|
| `GUARD_SERVER_STATIC_FILES_DIR` | Path to directory containing static files |
|