mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
rename pow section in settings to captcha and add options to configure
suggested difficulty factors for use in CAPTCHA configurations estimates The current CAPTCHA configuration panel requires the user to provide difficulty factor <--> visitor threshold mapping, which can be tedious if the user isn't familiar with those parameters. Also, it could lead to ineffective limiting from mCaptcha's side, should it be configured improperly. So an estimate computed from well known statistics like peak, avg and broke-my-site traffic could go a long way.
This commit is contained in:
@@ -36,6 +36,15 @@ pub struct Server {
|
||||
pub struct Captcha {
|
||||
pub salt: String,
|
||||
pub gc: u64,
|
||||
pub default_difficulty_strategy: DefaultDifficultyStrategy,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct DefaultDifficultyStrategy {
|
||||
pub avg_traffic_difficulty: u32,
|
||||
pub broke_my_site_traffic_difficulty: u32,
|
||||
pub peak_sustainable_traffic_difficulty: u32,
|
||||
pub duration: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
@@ -102,7 +111,7 @@ pub struct Settings {
|
||||
pub database: Database,
|
||||
pub redis: Option<Redis>,
|
||||
pub server: Server,
|
||||
pub pow: Captcha,
|
||||
pub captcha: Captcha,
|
||||
pub source_code: String,
|
||||
pub smtp: Option<Smtp>,
|
||||
pub allow_registration: bool,
|
||||
|
||||
Reference in New Issue
Block a user