From 5e6e04514e8d9453caa6d35d9288054c253d792d Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sun, 13 Jun 2021 13:35:09 +0530 Subject: [PATCH] preload creds manager --- Cargo.lock | 4 +--- Cargo.toml | 2 +- src/data.rs | 4 ++++ templates/panel/index.html | 11 +++++++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e014cd8..011f7e9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,7 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] name = "actix" version = "0.10.0" @@ -441,7 +439,7 @@ dependencies = [ [[package]] name = "argon2-creds" version = "0.2.1" -source = "git+https://github.com/realaravinth/argon2-creds#bc5949a86cdc7e57a54deb08ed65bae978163f71" +source = "git+https://github.com/realaravinth/argon2-creds#c899181a1bdb65134cc329f26c5dd3601d89fc45" dependencies = [ "ammonia", "derive_builder 0.10.2", diff --git a/Cargo.toml b/Cargo.toml index a19b2f40..2cce9f3d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ cache-buster = { version = "0.2.0", git = "https://github.com/realaravinth/cache futures = "0.3.14" sqlx = { version = "0.4.0", features = [ "runtime-actix-rustls", "postgres", "time", "offline" ] } -argon2-creds = { version = "0.2.1", git = "https://github.com/realaravinth/argon2-creds"} +argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"} config = "0.11" validator = { version = "0.13", features = ["derive"]} diff --git a/src/data.rs b/src/data.rs index a833d4a2..9ebbab26 100644 --- a/src/data.rs +++ b/src/data.rs @@ -108,6 +108,10 @@ impl Data { .build() .unwrap(); + log::info!("Initializing credential manager"); + creds.init(); + log::info!("Initialized credential manager"); + let data = match &SETTINGS.redis { Some(val) => { let master = RedisMaster::new(RedisConfig::Single(val.url.clone())) diff --git a/templates/panel/index.html b/templates/panel/index.html index a6b52f23..3c9f5f54 100644 --- a/templates/panel/index.html +++ b/templates/panel/index.html @@ -6,6 +6,16 @@ <. include!("./help-banner/index.html"); .>
+ <. if sitekeys.is_empty() { .> + + + + <.} else {.> + <.}.>
<. include!("../components/footers.html"); .>