mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-06-10 16:16:42 +00:00
configuration docs, make test
This commit is contained in:
parent
67a35a6e43
commit
0880dd27ce
11
.github/workflows/linux.yml
vendored
11
.github/workflows/linux.yml
vendored
@ -73,14 +73,19 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
|
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
|
||||||
|
|
||||||
- name: build frontend
|
- name: build
|
||||||
run: make frontend
|
run: make
|
||||||
|
env:
|
||||||
|
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
|
||||||
|
|
||||||
|
# - name: build frontend
|
||||||
|
# run: make frontend
|
||||||
|
|
||||||
- name: run tests
|
- name: run tests
|
||||||
run: make test
|
run: make test
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
|
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
|
||||||
|
|
||||||
- name: generate documentation
|
- name: generate documentation
|
||||||
if: matrix.version == 'stable' && (github.repository == 'mCaptcha/mCaptcha')
|
if: matrix.version == 'stable' && (github.repository == 'mCaptcha/mCaptcha')
|
||||||
run: make doc
|
run: make doc
|
||||||
|
6
Makefile
6
Makefile
@ -45,11 +45,7 @@ release: frontend
|
|||||||
run: frontend
|
run: frontend
|
||||||
cargo run
|
cargo run
|
||||||
|
|
||||||
test: migrate
|
test: frontend-test frontend migrate
|
||||||
cd browser && wasm-pack test --release --headless --chrome
|
|
||||||
cd browser && wasm-pack test --release --headless --firefox
|
|
||||||
${MAKE} frontend-test
|
|
||||||
${MAKE} frontend
|
|
||||||
cargo test --all --all-features --no-fail-fast
|
cargo test --all --all-features --no-fail-fast
|
||||||
|
|
||||||
xml-test-coverage: migrate
|
xml-test-coverage: migrate
|
||||||
|
@ -51,7 +51,7 @@ pool = 4
|
|||||||
|
|
||||||
[smtp]
|
[smtp]
|
||||||
from = "admin@localhost"
|
from = "admin@localhost"
|
||||||
reply_to = "admin@localhost"
|
reply = "admin@localhost"
|
||||||
url = "127.0.0.1"
|
url = "127.0.0.1"
|
||||||
port = 10025
|
port = 10025
|
||||||
username = "admin"
|
username = "admin"
|
||||||
|
@ -62,3 +62,14 @@ domain
|
|||||||
| ------------------- | --------------------------------------------------------------------------------------- |
|
| ------------------- | --------------------------------------------------------------------------------------- |
|
||||||
| `MCAPTCHA_POW_SALT` | Salt has to be long and random |
|
| `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 |
|
| `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 |
|
||||||
|
@ -46,7 +46,7 @@ async fn verification(
|
|||||||
) -> ServiceResult<()> {
|
) -> ServiceResult<()> {
|
||||||
if let Some(smtp) = SETTINGS.smtp.as_ref() {
|
if let Some(smtp) = SETTINGS.smtp.as_ref() {
|
||||||
let from = format!("mCaptcha Admin <{}>", smtp.from);
|
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";
|
const SUBJECT: &str = "[mCaptcha] Please verify your email";
|
||||||
|
|
||||||
let plain_text = format!(
|
let plain_text = format!(
|
||||||
|
@ -41,7 +41,7 @@ pub struct Captcha {
|
|||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
pub struct Smtp {
|
pub struct Smtp {
|
||||||
pub from: String,
|
pub from: String,
|
||||||
pub reply_to: String,
|
pub reply: String,
|
||||||
pub url: String,
|
pub url: String,
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user