From bcfceeec96f1cfcf12fbae695532b9a9ea2bf759 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Wed, 18 Oct 2023 08:13:41 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20b3eda?= =?UTF-8?q?16f2c3be3a5d0c44cb6375f864e7d1a8a41=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- help.html | 2 +- mcaptcha/fn.get_identity_service.html | 2 +- mcaptcha/fn.get_json_err.html | 2 +- mcaptcha/index.html | 2 +- mcaptcha/settings/index.html | 2 +- mcaptcha/settings/struct.Settings.html | 2 +- mcaptcha/struct.SETTINGS.html | 2 +- mcaptcha/struct.Settings.html | 2 +- settings.html | 2 +- src/mcaptcha/main.rs.html | 6 +++- src/mcaptcha/settings.rs.html | 44 ++++++++++++++------------ 11 files changed, 37 insertions(+), 31 deletions(-) diff --git a/help.html b/help.html index 954521fc..f636b0c6 100644 --- a/help.html +++ b/help.html @@ -1 +1 @@ -Rustdoc help

Rustdoc help

Back
\ No newline at end of file +Rustdoc help

Rustdoc help

Back
\ No newline at end of file diff --git a/mcaptcha/fn.get_identity_service.html b/mcaptcha/fn.get_identity_service.html index 2e379ad5..862a34c5 100644 --- a/mcaptcha/fn.get_identity_service.html +++ b/mcaptcha/fn.get_identity_service.html @@ -1,3 +1,3 @@ -get_identity_service in mcaptcha - Rust
pub fn get_identity_service(
+get_identity_service in mcaptcha - Rust
pub fn get_identity_service(
     settings: &Settings
 ) -> IdentityService<CookieIdentityPolicy>
\ No newline at end of file diff --git a/mcaptcha/fn.get_json_err.html b/mcaptcha/fn.get_json_err.html index e0d6c1ec..e49590ca 100644 --- a/mcaptcha/fn.get_json_err.html +++ b/mcaptcha/fn.get_json_err.html @@ -1 +1 @@ -get_json_err in mcaptcha - Rust

Function mcaptcha::get_json_err

source ·
pub fn get_json_err() -> JsonConfig
\ No newline at end of file +get_json_err in mcaptcha - Rust

Function mcaptcha::get_json_err

source ·
pub fn get_json_err() -> JsonConfig
\ No newline at end of file diff --git a/mcaptcha/index.html b/mcaptcha/index.html index a1688345..62cc5dc3 100644 --- a/mcaptcha/index.html +++ b/mcaptcha/index.html @@ -1 +1 @@ -mcaptcha - Rust
\ No newline at end of file +mcaptcha - Rust
\ No newline at end of file diff --git a/mcaptcha/settings/index.html b/mcaptcha/settings/index.html index 72620a15..ca14ce40 100644 --- a/mcaptcha/settings/index.html +++ b/mcaptcha/settings/index.html @@ -1 +1 @@ -mcaptcha::settings - Rust
\ No newline at end of file +mcaptcha::settings - Rust
\ No newline at end of file diff --git a/mcaptcha/settings/struct.Settings.html b/mcaptcha/settings/struct.Settings.html index 122c1134..bfd331aa 100644 --- a/mcaptcha/settings/struct.Settings.html +++ b/mcaptcha/settings/struct.Settings.html @@ -9,7 +9,7 @@ pub server: Server, pub captcha: Captcha, pub smtp: Option<Smtp>, -}

Fields§

§debug: bool§commercial: bool§source_code: String§allow_registration: bool§allow_demo: bool§database: Database§redis: Option<Redis>§server: Server§captcha: Captcha§smtp: Option<Smtp>

Implementations§

source§

impl Settings

source

pub fn new() -> Result<Self, ConfigError>

source

fn env_override(s: ConfigBuilder<DefaultState>) -> ConfigBuilder<DefaultState>

source

fn set_database_type(&mut self)

source

fn check_url(&self)

Trait Implementations§

source§

impl Clone for Settings

source§

fn clone(&self) -> Settings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Settings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Settings

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where +}

Fields§

§debug: bool§commercial: bool§source_code: String§allow_registration: bool§allow_demo: bool§database: Database§redis: Option<Redis>§server: Server§captcha: Captcha§smtp: Option<Smtp>

Implementations§

source§

impl Settings

source

pub fn new() -> Result<Self, ConfigError>

source

fn env_override(s: ConfigBuilder<DefaultState>) -> ConfigBuilder<DefaultState>

source

fn set_database_type(&mut self)

source

fn check_url(&self)

Trait Implementations§

source§

impl Clone for Settings

source§

fn clone(&self) -> Settings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Settings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Settings

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<Settings> for Settings

source§

fn eq(&self, other: &Settings) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Settings

source§

impl StructuralEq for Settings

source§

impl StructuralPartialEq for Settings

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere diff --git a/mcaptcha/struct.SETTINGS.html b/mcaptcha/struct.SETTINGS.html index 003ea980..0f694b02 100644 --- a/mcaptcha/struct.SETTINGS.html +++ b/mcaptcha/struct.SETTINGS.html @@ -1,6 +1,6 @@ SETTINGS in mcaptcha - Rust

Struct mcaptcha::SETTINGS

source ·
pub struct SETTINGS {
     pub(crate) __private_field: (),
-}

Fields§

§__private_field: ()

Methods from Deref<Target = Settings>§

source

fn check_url(&self)

Trait Implementations§

source§

impl Deref for SETTINGS

§

type Target = Settings

The resulting type after dereferencing.
source§

fn deref(&self) -> &Settings

Dereferences the value.
source§

impl LazyStatic for SETTINGS

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +}

Fields§

§__private_field: ()

Methods from Deref<Target = Settings>§

source

fn check_url(&self)

Trait Implementations§

source§

impl Deref for SETTINGS

§

type Target = Settings

The resulting type after dereferencing.
source§

fn deref(&self) -> &Settings

Dereferences the value.
source§

impl LazyStatic for SETTINGS

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/mcaptcha/struct.Settings.html b/mcaptcha/struct.Settings.html index 4e7686ee..72d06e0a 100644 --- a/mcaptcha/struct.Settings.html +++ b/mcaptcha/struct.Settings.html @@ -9,7 +9,7 @@ pub server: Server, pub captcha: Captcha, pub smtp: Option<Smtp>, -}

Fields§

§debug: bool§commercial: bool§source_code: String§allow_registration: bool§allow_demo: bool§database: Database§redis: Option<Redis>§server: Server§captcha: Captcha§smtp: Option<Smtp>

Implementations§

source§

impl Settings

source

pub fn new() -> Result<Self, ConfigError>

source

fn env_override(s: ConfigBuilder<DefaultState>) -> ConfigBuilder<DefaultState>

source

fn set_database_type(&mut self)

source

fn check_url(&self)

Trait Implementations§

source§

impl Clone for Settings

source§

fn clone(&self) -> Settings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Settings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Settings

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where +}

Fields§

§debug: bool§commercial: bool§source_code: String§allow_registration: bool§allow_demo: bool§database: Database§redis: Option<Redis>§server: Server§captcha: Captcha§smtp: Option<Smtp>

Implementations§

source§

impl Settings

source

pub fn new() -> Result<Self, ConfigError>

source

fn env_override(s: ConfigBuilder<DefaultState>) -> ConfigBuilder<DefaultState>

source

fn set_database_type(&mut self)

source

fn check_url(&self)

Trait Implementations§

source§

impl Clone for Settings

source§

fn clone(&self) -> Settings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Settings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Settings

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<Settings> for Settings

source§

fn eq(&self, other: &Settings) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Settings

source§

impl StructuralEq for Settings

source§

impl StructuralPartialEq for Settings

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere diff --git a/settings.html b/settings.html index e0d3b2ed..a55c4d68 100644 --- a/settings.html +++ b/settings.html @@ -1 +1 @@ -Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file +Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src/mcaptcha/main.rs.html b/src/mcaptcha/main.rs.html index 903b09bc..da79f92c 100644 --- a/src/mcaptcha/main.rs.html +++ b/src/mcaptcha/main.rs.html @@ -181,6 +181,8 @@ 181 182 183 +184 +185

#![allow(warnings)]
 // Copyright (C) 2022  Aravinth Manivannan <realaravinth@batsense.net>
 // SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
@@ -276,7 +278,9 @@
 async fn main() -> std::io::Result<()> {
     use std::time::Duration;
 
-    env::set_var("RUST_LOG", "info");
+    if env::var("RUST_LOG").is_err() {
+        env::set_var("RUST_LOG", "info");
+    }
 
     pretty_env_logger::init();
     info!(
diff --git a/src/mcaptcha/settings.rs.html b/src/mcaptcha/settings.rs.html
index d216d90f..64e0451b 100644
--- a/src/mcaptcha/settings.rs.html
+++ b/src/mcaptcha/settings.rs.html
@@ -404,6 +404,7 @@
 404
 405
 406
+407
 

// Copyright (C) 2022  Aravinth Manivannan <realaravinth@batsense.net>
 // SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
 //
@@ -524,8 +525,8 @@
     ("database.pool", "MCAPTCHA_database_POOL"),
 
     /* redis */
-    ("redis.url", "MCPATCHA_redis_URL"),
-    ("redis.pool", "MCPATCHA_redis_POOL"),
+    ("redis.url", "MCAPTCHA_redis_URL"),
+    ("redis.pool", "MCAPTCHA_redis_POOL"),
 
     /* server */
     ("server.port", "PORT"),
@@ -551,12 +552,12 @@
 
 
     /* SMTP */
-    ("smtp.from", "MCPATCHA_smtp_FROM"),
-    ("smtp.reply", "MCPATCHA_smtp_REPLY"),
-    ("smtp.url", "MCPATCHA_smtp_URL"),
-    ("smtp.username", "MCPATCHA_smtp_USERNAME"),
-    ("smtp.password", "MCPATCHA_smtp_PASSWORD"),
-    ("smtp.port", "MCPATCHA_smtp_PORT"),
+    ("smtp.from", "MCAPTCHA_smtp_FROM"),
+    ("smtp.reply", "MCAPTCHA_smtp_REPLY"),
+    ("smtp.url", "MCAPTCHA_smtp_URL"),
+    ("smtp.username", "MCAPTCHA_smtp_USERNAME"),
+    ("smtp.password", "MCAPTCHA_smtp_PASSWORD"),
+    ("smtp.port", "MCAPTCHA_smtp_PORT"),
 
 
 
@@ -617,6 +618,7 @@
 
     fn env_override(mut s: ConfigBuilder<DefaultState>) -> ConfigBuilder<DefaultState> {
         for (parameter, env_var_name) in ENV_VAR_CONFIG.iter() {
+            println!("[{env_var_name}]{:?}", env::var(env_var_name));
             if let Ok(val) = env::var(env_var_name) {
                 log::debug!(
                     "Overriding [{parameter}] with environment variable {env_var_name}"
@@ -697,7 +699,7 @@
         /* redis */
 
         /* redis.url */
-        let env = "MCPATCHA_redis_URL";
+        let env = "MCAPTCHA_redis_URL";
         let val = "redis://redis.example.org";
         println!("Setting env var {} to {} for test", env, val);
         env::set_var(env, val);
@@ -710,7 +712,7 @@
         env::remove_var(env);
 
         /* redis.pool */
-        let env = "MCPATCHA_redis_POOL";
+        let env = "MCAPTCHA_redis_POOL";
         let val = 999;
         println!("Setting env var {} to {} for test", env, val);
         env::set_var(env, val.to_string());
@@ -761,12 +763,12 @@
         /* SMTP */
 
         let vals = [
-            "MCPATCHA_smtp_FROM",
-            "MCPATCHA_smtp_REPLY",
-            "MCPATCHA_smtp_URL",
-            "MCPATCHA_smtp_USERNAME",
-            "MCPATCHA_smtp_PASSWORD",
-            "MCPATCHA_smtp_PORT",
+            "MCAPTCHA_smtp_FROM",
+            "MCAPTCHA_smtp_REPLY",
+            "MCAPTCHA_smtp_URL",
+            "MCAPTCHA_smtp_USERNAME",
+            "MCAPTCHA_smtp_PASSWORD",
+            "MCAPTCHA_smtp_PORT",
         ];
         for env in vals.iter() {
             println!("Setting env var {} to {} for test", env, env);
@@ -774,15 +776,15 @@
         }
 
         let port = 9999;
-        env::set_var("MCPATCHA_smtp_PORT", port.to_string());
+        env::set_var("MCAPTCHA_smtp_PORT", port.to_string());
 
         new_settings = get_settings();
         let smtp_new = new_settings.smtp.as_ref().unwrap();
         let smtp_old = init_settings.smtp.as_ref().unwrap();
-        assert_eq!(smtp_new.from, "MCPATCHA_smtp_FROM");
-        assert_eq!(smtp_new.reply, "MCPATCHA_smtp_REPLY");
-        assert_eq!(smtp_new.username, "MCPATCHA_smtp_USERNAME");
-        assert_eq!(smtp_new.password, "MCPATCHA_smtp_PASSWORD");
+        assert_eq!(smtp_new.from, "MCAPTCHA_smtp_FROM");
+        assert_eq!(smtp_new.reply, "MCAPTCHA_smtp_REPLY");
+        assert_eq!(smtp_new.username, "MCAPTCHA_smtp_USERNAME");
+        assert_eq!(smtp_new.password, "MCAPTCHA_smtp_PASSWORD");
         assert_eq!(smtp_new.port, port);
         assert_ne!(smtp_new, smtp_old);