This commit is contained in:
naskya 2024-06-23 17:08:45 +09:00
parent d851dbbea6
commit ca392ed20c
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -27,6 +27,8 @@ pub struct Config {
pub id: Option<Id>, pub id: Option<Id>,
#[validate(nested)] #[validate(nested)]
pub file: Option<File>, pub file: Option<File>,
#[validate(nested)]
pub security: Option<Security>,
} }
#[derive(Deserialize, Serialize, Validate, Debug)] #[derive(Deserialize, Serialize, Validate, Debug)]
@ -129,3 +131,29 @@ pub struct File {
pub proxy_remote_file: Option<bool>, pub proxy_remote_file: Option<bool>,
pub cache_remote_file: Option<bool>, pub cache_remote_file: Option<bool>,
} }
#[derive(Deserialize, Serialize, Validate, Debug)]
pub struct Security {
pub require_authorized_fetch: Option<bool>,
pub private_mode: Option<bool>,
#[validate(nested)]
pub captcha: Option<CaptchaConfig>,
pub enable_strict_email_check: Option<bool>,
pub log_ip_address: Option<bool>,
}
#[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,
}