diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 23092d02..70a3ad3d 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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 diff --git a/Makefile b/Makefile index d9e96973..b487d031 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/config/default.toml b/config/default.toml index d42e7cfc..e93c0ee7 100644 --- a/config/default.toml +++ b/config/default.toml @@ -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" diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 05f96c9a..0fd60187 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -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 | diff --git a/src/email/verification.rs b/src/email/verification.rs index 89b11716..c12aebba 100644 --- a/src/email/verification.rs +++ b/src/email/verification.rs @@ -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!( diff --git a/src/settings.rs b/src/settings.rs index 3ddeb35e..043af0ef 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -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,