diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-24 04:31:48 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-24 04:31:48 +0100 |
| commit | b2e88a8beabf04adc28947cf82996e8692a68b71 (patch) | |
| tree | 23d66c8672b69cce7835ffabae4092669062ada8 /server/src/main.rs | |
| parent | 774f64c0789529884dd7a5232f190e347ad29532 (diff) | |
| download | jellything-b2e88a8beabf04adc28947cf82996e8692a68b71.tar jellything-b2e88a8beabf04adc28947cf82996e8692a68b71.tar.bz2 jellything-b2e88a8beabf04adc28947cf82996e8692a68b71.tar.zst | |
move things around; kv crate
Diffstat (limited to 'server/src/main.rs')
| -rw-r--r-- | server/src/main.rs | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/server/src/main.rs b/server/src/main.rs index e17083b..be1aba4 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -11,36 +11,18 @@ use crate::logger::setup_logger; use config::load_config; use log::{error, info, warn}; use routes::build_rocket; -use serde::{Deserialize, Serialize}; -use std::sync::Mutex; -use std::{path::PathBuf, process::exit, sync::LazyLock}; +use std::process::exit; pub mod api; pub mod compat; pub mod config; -pub mod helper; pub mod logger; pub mod logic; +pub mod request_info; +pub mod responders; pub mod routes; pub mod ui; -#[derive(Debug, Deserialize, Serialize, Default)] -pub struct Config { - asset_path: PathBuf, - cookie_key: Option<String>, - tls: bool, - hostname: String, -} - -pub static CONF_PRELOAD: Mutex<Option<Config>> = Mutex::new(None); -static CONF: LazyLock<Config> = LazyLock::new(|| { - CONF_PRELOAD - .lock() - .unwrap() - .take() - .expect("cache config not preloaded. logic error") -}); - #[rocket::main] async fn main() { setup_logger(); @@ -53,10 +35,6 @@ async fn main() { #[cfg(feature = "bypass-auth")] logger::warn!("authentification bypass enabled"); - if let Err(e) = create_admin_account() { - error!("failed to create admin account: {e:?}"); - } - let r = build_rocket().launch().await; match r { Ok(_) => warn!("server shutdown"), |