aboutsummaryrefslogtreecommitdiff
path: root/server/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-01-24 04:31:48 +0100
committermetamuffin <metamuffin@disroot.org>2026-01-24 04:31:48 +0100
commitb2e88a8beabf04adc28947cf82996e8692a68b71 (patch)
tree23d66c8672b69cce7835ffabae4092669062ada8 /server/src/main.rs
parent774f64c0789529884dd7a5232f190e347ad29532 (diff)
downloadjellything-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.rs28
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"),