aboutsummaryrefslogtreecommitdiff
path: root/server/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-05-26 18:24:16 +0200
committermetamuffin <metamuffin@disroot.org>2025-05-26 18:24:16 +0200
commit3b15caade07e8fbe351fed9aceb3f435bf58368e (patch)
treecce91c229b78061ad36f29d76a76d67c3c737c59 /server/src/main.rs
parent1eeff5c03e8985d16d4f2b6283741dd82b369bd3 (diff)
downloadjellything-3b15caade07e8fbe351fed9aceb3f435bf58368e.tar
jellything-3b15caade07e8fbe351fed9aceb3f435bf58368e.tar.bz2
jellything-3b15caade07e8fbe351fed9aceb3f435bf58368e.tar.zst
move all direct database access to logic crate
Diffstat (limited to 'server/src/main.rs')
-rw-r--r--server/src/main.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index 5113542..7c7bbd2 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -7,9 +7,7 @@
#![allow(clippy::needless_borrows_for_generic_args)]
#![recursion_limit = "4096"]
-use anyhow::Context;
use config::load_config;
-use jellylogic::Database;
use jellylogic::{admin::log::enable_logging, login::create_admin_account};
use log::{error, info, warn};
use routes::build_rocket;
@@ -28,7 +26,6 @@ pub mod ui;
#[rustfmt::skip]
#[derive(Debug, Deserialize, Serialize, Default)]
pub struct Config {
- database_path: PathBuf,
asset_path: PathBuf,
cookie_key: Option<String>,
tls:bool,
@@ -56,15 +53,11 @@ async fn main() {
#[cfg(feature = "bypass-auth")]
log::warn!("authentification bypass enabled");
- let database = Database::open(&CONF.database_path)
- .context("opening database")
- .unwrap();
-
- if let Err(e) = create_admin_account(&database) {
+ if let Err(e) = create_admin_account() {
error!("failed to create admin account: {e:?}");
}
- let r = build_rocket(database).launch().await;
+ let r = build_rocket().launch().await;
match r {
Ok(_) => warn!("server shutdown"),
Err(e) => error!("server exited: {e}"),