diff options
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"), |