configuration docs, make test

This commit is contained in:
realaravinth 2021-07-09 12:04:48 +05:30
parent 67a35a6e43
commit 0880dd27ce
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88
6 changed files with 23 additions and 11 deletions

View file

@ -73,14 +73,19 @@ jobs:
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
- name: build frontend
run: make frontend
- name: build
run: make
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
# - name: build frontend
# run: make frontend
- name: run tests
run: make test
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
- name: generate documentation
if: matrix.version == 'stable' && (github.repository == 'mCaptcha/mCaptcha')
run: make doc

View file

@ -45,11 +45,7 @@ release: frontend
run: frontend
cargo run
test: migrate
cd browser && wasm-pack test --release --headless --chrome
cd browser && wasm-pack test --release --headless --firefox
${MAKE} frontend-test
${MAKE} frontend
test: frontend-test frontend migrate
cargo test --all --all-features --no-fail-fast
xml-test-coverage: migrate

View file

@ -51,7 +51,7 @@ pool = 4
[smtp]
from = "admin@localhost"
reply_to = "admin@localhost"
reply = "admin@localhost"
url = "127.0.0.1"
port = 10025
username = "admin"

View file

@ -62,3 +62,14 @@ domain
| ------------------- | --------------------------------------------------------------------------------------- |
| `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 |
### 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 |

View file

@ -46,7 +46,7 @@ async fn verification(
) -> ServiceResult<()> {
if let Some(smtp) = SETTINGS.smtp.as_ref() {
let from = format!("mCaptcha Admin <{}>", smtp.from);
let reply_to = format!("mCaptcha Admin <{}>", smtp.reply_to);
let reply_to = format!("mCaptcha Admin <{}>", smtp.reply);
const SUBJECT: &str = "[mCaptcha] Please verify your email";
let plain_text = format!(

View file

@ -41,7 +41,7 @@ pub struct Captcha {
#[derive(Debug, Clone, Deserialize)]
pub struct Smtp {
pub from: String,
pub reply_to: String,
pub reply: String,
pub url: String,
pub username: String,
pub password: String,