From 309a78d246ff175eaf12f6a7d4e9d70845b9edda Mon Sep 17 00:00:00 2001 From: KunoiSayami <46131041+KunoiSayami@users.noreply.github.com> Date: Mon, 10 May 2021 16:09:19 +0800 Subject: feat: Add reset database subcommand * fix: Fix CI build failure --- src/datastructures.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/datastructures.rs') diff --git a/src/datastructures.rs b/src/datastructures.rs index bb91cfb..319446d 100644 --- a/src/datastructures.rs +++ b/src/datastructures.rs @@ -35,9 +35,9 @@ use rand_core::OsRng; const DEFAULT_CONFIG_LOCATION: &str = "/etc/cgitrc"; const DEFAULT_COOKIE_TTL: u64 = 1200; const DEFAULT_DATABASE_LOCATION: &str = "/etc/cgit/auth.db"; -pub const CACHE_DIR: &str = "/var/cache/cgit"; +//pub const CACHE_DIR: &str = "/var/cache/cgit"; pub type RandIntType = u32; -pub const MINIMUM_SECRET_LENGTH: usize = 8; +//pub const MINIMUM_SECRET_LENGTH: usize = 8; pub fn get_current_timestamp() -> u64 { let start = std::time::SystemTime::now(); @@ -100,7 +100,7 @@ impl Config { let mut cookie_ttl: u64 = DEFAULT_COOKIE_TTL; let mut database: &str = "/etc/cgit/auth.db"; let mut bypass_root: bool = false; - let mut secret: &str = ""; + //let mut secret: &str = ""; for line in file.lines() { let line = line.trim(); if !line.contains('=') || !line.starts_with("cgit-simple-auth-") { @@ -117,7 +117,7 @@ impl Config { "cookie-ttl" => cookie_ttl = value.parse().unwrap_or(DEFAULT_COOKIE_TTL), "database" => database = value, "bypass-root" => bypass_root = value.to_lowercase().eq("true"), - "secret" => secret = value, + //"secret" => secret = value, _ => {} } } -- cgit v1.3.1