diff --git a/src/config/server.rs b/src/config/server.rs index 7846183..d543702 100644 --- a/src/config/server.rs +++ b/src/config/server.rs @@ -27,6 +27,8 @@ pub struct Config { pub id: Option, #[validate(nested)] pub file: Option, + #[validate(nested)] + pub security: Option, } #[derive(Deserialize, Serialize, Validate, Debug)] @@ -129,3 +131,29 @@ pub struct File { pub proxy_remote_file: Option, pub cache_remote_file: Option, } + +#[derive(Deserialize, Serialize, Validate, Debug)] +pub struct Security { + pub require_authorized_fetch: Option, + pub private_mode: Option, + #[validate(nested)] + pub captcha: Option, + pub enable_strict_email_check: Option, + pub log_ip_address: Option, +} + +#[derive(Deserialize, Serialize, Validate, Debug)] +pub struct CaptchaConfig { + pub enabled: bool, + pub kind: Captcha, + pub site_key: String, + pub secret_key: String, +} + +#[derive(Deserialize, Serialize, Debug)] +pub enum Captcha { + #[serde(rename = "hCaptcha")] + HCaptcha, + #[serde(rename = "reCAPTCHA")] + ReCaptcha, +}