merge: branch 'izzy/patch/easypwned'

fix: configure new authifier properties
This commit is contained in:
izzy
2025-05-10 16:31:37 +01:00
parent 6daa8223b2
commit 3a7ebad883
7 changed files with 38 additions and 26 deletions

View File

@@ -54,6 +54,8 @@ authifier_shield_key = ""
voso_legacy_token = ""
# Whether services are behind the Cloudflare network
trust_cloudflare = false
# easypwned endpoint
easypwned = ""
[api.security.captcha]
# hCaptcha configuration

View File

@@ -168,6 +168,7 @@ pub struct ApiSecurity {
pub voso_legacy_token: String,
pub captcha: ApiSecurityCaptcha,
pub trust_cloudflare: bool,
pub easypwned: String,
}
#[derive(Deserialize, Debug, Clone)]

View File

@@ -97,7 +97,7 @@ web-push = "0.10.0"
revolt_a2 = { version = "0.10", default-features = false, features = ["ring"] }
# Authifier
authifier = { version = "1.0.10", features = ["rocket_impl"] }
authifier = { version = "1.0.13", features = ["rocket_impl"] }
# RabbitMQ
amqprs = { version = "1.7.0" }

View File

@@ -102,6 +102,9 @@ impl Database {
let config = config().await;
let mut auth_config = authifier::Config {
password_scanning: authifier::config::PasswordScanning::EasyPwned {
endpoint: config.api.security.easypwned,
},
email_verification: if !config.api.smtp.host.is_empty() {
EmailVerificationConfig::Enabled {
smtp: SMTPSettings {
@@ -118,6 +121,7 @@ impl Database {
),
port: config.api.smtp.port,
use_tls: config.api.smtp.use_tls,
use_starttls: None,
},
expiry: Default::default(),
templates: if config.production {
@@ -134,6 +138,13 @@ impl Database {
url: format!("{}/login/reset/", config.hosts.app),
html: Some(include_str!("../../templates/reset.html").into()),
},
reset_existing: Template {
title: "You already have a Revolt account, reset your password."
.into(),
text: include_str!("../../templates/reset.txt").into(),
url: format!("{}/login/reset/", config.hosts.app),
html: Some(include_str!("../../templates/reset.html").into()),
},
deletion: Template {
title: "Confirm account deletion.".into(),
text: include_str!("../../templates/deletion.txt").into(),
@@ -156,9 +167,16 @@ impl Database {
url: format!("{}/login/reset/", config.hosts.app),
html: None,
},
reset_existing: Template {
title: "Reset your password.".into(),
text: include_str!("../../templates/reset.whitelabel.txt").into(),
url: format!("{}/login/reset/", config.hosts.app),
html: None,
},
deletion: Template {
title: "Confirm account deletion.".into(),
text: include_str!("../../templates/deletion.whitelabel.txt").into(),
text: include_str!("../../templates/deletion.whitelabel.txt")
.into(),
url: format!("{}/delete/", config.hosts.app),
html: None,
},