readme and env var prefix

This commit is contained in:
realaravinth
2021-03-10 21:55:39 +05:30
parent 7f289cce03
commit 68322def60
2 changed files with 21 additions and 27 deletions

View File

@@ -4,18 +4,21 @@
<strong>Back-end component of mCaptcha</strong> <strong>Back-end component of mCaptcha</strong>
</p> </p>
[![Documentation](https://img.shields.io/badge/docs-master-blue)](https://mcaptcha.github.io/mCaptcha/guard/index.html) [![Documentation](https://img.shields.io/badge/docs-master-blue)](https://mcaptcha.github.io/guard/guard/)
![CI (Linux)](<https://github.com/mCaptcha/guard/workflows/CI%20(Linux)/badge.svg>) ![CI (Linux)](<https://github.com/mCaptcha/guard/workflows/CI%20(Linux)/badge.svg>)
[![dependency status](https://deps.rs/repo/github/mCaptcha/guard/status.svg)](https://deps.rs/repo/github/mCaptcha/guard) [![dependency status](https://deps.rs/repo/github/mCaptcha/guard/status.svg)](https://deps.rs/repo/github/mCaptcha/guard)
[![codecov](https://codecov.io/gh/mCaptcha/guard/branch/master/graph/badge.svg)](https://codecov.io/gh/mCaptcha/guard) [![codecov](https://codecov.io/gh/mCaptcha/guard/branch/master/graph/badge.svg)](https://codecov.io/gh/mCaptcha/guard)
<br /> <br />
[![AGPL License](https://img.shields.io/badge/license-AGPL-blue.svg)](http://www.gnu.org/licenses/agpl-3.0) [![AGPL License](https://img.shields.io/badge/license-AGPL-blue.svg)](http://www.gnu.org/licenses/agpl-3.0)
</div> </div>
</div> </div>
**placeholder-repo** is an placeholder-repo and access management platform built for the Guard is the back-end component of [mCaptcha](https://mcaptcha.org)
[IndieWeb](indieweb.org) system.
**STATUS: UNUSABLE BUT ACTIVE DEVELOPMENT**
### How to build ### How to build
@@ -39,14 +42,12 @@ $ cd guard && cargo build
### Configuration: ### Configuration:
placeholder-repo is highly configurable. Guard is highly configurable.
Configuration is applied/merged in the following order: Configuration is applied/merged in the following order:
1. `config/default.toml` 1. `config/default.toml`
2. environment variables. 2. environment variables.
To make installation process seamless, placeholder-repo ships with a CLI tool to
assist in database migrations.
#### Setup #### Setup
@@ -59,25 +60,18 @@ you will be overriding the values set in the configuration files.
###### Database: ###### Database:
| Name | Value | | Name | Value |
| ------------------------------- | -------------------------------------- | | ------------------------- | -------------------------------------- |
| `PLACEHOLDER_DATEBASE_PASSWORD` | Postgres password | | `GUARD_DATEBASE_PASSWORD` | Postgres password |
| `PLACEHOLDER_DATEBASE_NAME` | Postgres database name | | `GUARD_DATEBASE_NAME` | Postgres database name |
| `PLACEHOLDER_DATEBASE_PORT` | Postgres port | | `GUARD_DATEBASE_PORT` | Postgres port |
| `PLACEHOLDER_DATEBASE_HOSTNAME` | Postgres hostmane | | `GUARD_DATEBASE_HOSTNAME` | Postgres hostmane |
| `PLACEHOLDER_DATEBASE_USERNAME` | Postgres username | | `GUARD_DATEBASE_USERNAME` | Postgres username |
| `PLACEHOLDER_DATEBASE_POOL` | Postgres database connection pool size | | `GUARD_DATEBASE_POOL` | Postgres database connection pool size |
###### Redis cache:
| Name | Value |
| ---------------------------- | -------------- |
| `PLACEHOLDER_REDIS_PORT` | Redis port |
| `PLACEHOLDER_REDIS_HOSTNAME` | Redis hostmane |
###### Server: ###### Server:
| Name | Value | | Name | Value |
| ----------------------------------------- | --------------------------------------------------- | | ----------------------------------- | --------------------------------------------------- |
| `PLACEHOLDER_SERVER_PORT` (or) `PORT`\*\* | The port on which you want wagon to listen to | | `GUARD_SERVER_PORT` (or) `PORT`\*\* | The port on which you want wagon to listen to |
| `PLACEHOLDER_SERVER_IP` | The IP address on which you want wagon to listen to | | `GUARD_SERVER_IP` | The IP address on which you want wagon to listen to |
| `PLACEHOLDER_SERVER_STATIC_FILES_DIR` | Path to directory containing static files | | `GUARD_SERVER_STATIC_FILES_DIR` | Path to directory containing static files |

View File

@@ -103,7 +103,7 @@ impl Settings {
s.merge(File::with_name("./config/default.toml"))?; s.merge(File::with_name("./config/default.toml"))?;
// TODO change PLACEHOLDER to app name // TODO change PLACEHOLDER to app name
s.merge(Environment::with_prefix("WEBHUNT"))?; s.merge(Environment::with_prefix("GUARD"))?;
match env::var("PORT") { match env::var("PORT") {
Ok(val) => { Ok(val) => {