/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2025 metamuffin */ #![feature(duration_constructors, let_chains)] pub mod admin; pub mod filter_sort; pub mod home; pub mod items; pub mod login; pub mod node; pub mod search; pub mod session; pub mod stats; use serde::{Deserialize, Serialize}; use std::sync::LazyLock; use std::sync::Mutex; #[rustfmt::skip] #[derive(Debug, Deserialize, Serialize, Default)] pub struct Config { login_expire: i64, session_key: Option, admin_username:Option, admin_password:Option, } pub static CONF_PRELOAD: Mutex> = Mutex::new(None); static CONF: LazyLock = LazyLock::new(|| { CONF_PRELOAD .lock() .unwrap() .take() .expect("logic config not preloaded. logic error") });