/* 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) 2023 metamuffin */ use config::{load_global_config, GlobalConfig}; use database::Database; use jellyremuxer::RemuxerContext; use library::Library; use once_cell::sync::Lazy; use rocket::launch; use routes::build_rocket; pub mod config; pub mod database; pub mod library; pub mod routes; pub static CONF: Lazy = Lazy::new(load_global_config); #[launch] fn rocket() -> _ { env_logger::builder() .filter_level(log::LevelFilter::Info) .parse_env("LOG") .init(); #[cfg(feature = "bypass-auth")] log::warn!("authentification bypass enabled"); let remuxer = RemuxerContext::new(); let library = Library::open(&CONF.library_path).unwrap(); let database = Database::open(&CONF.database_path).unwrap(); database.create_admin(); build_rocket(remuxer, library, database) }