blob: be1aba42d86b27f1e3d8a137b004b76bcadcb09a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/*
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) 2026 metamuffin <metamuffin.org>
*/
#![feature(int_roundings, str_as_str, duration_constructors)]
#![allow(clippy::needless_borrows_for_generic_args)]
#![recursion_limit = "4096"]
use crate::logger::setup_logger;
use config::load_config;
use log::{error, info, warn};
use routes::build_rocket;
use std::process::exit;
pub mod api;
pub mod compat;
pub mod config;
pub mod logger;
pub mod logic;
pub mod request_info;
pub mod responders;
pub mod routes;
pub mod ui;
#[rocket::main]
async fn main() {
setup_logger();
info!("loading config...");
if let Err(e) = load_config().await {
error!("error {e:?}");
exit(1);
}
#[cfg(feature = "bypass-auth")]
logger::warn!("authentification bypass enabled");
let r = build_rocket().launch().await;
match r {
Ok(_) => warn!("server shutdown"),
Err(e) => error!("server exited: {e}"),
}
}
|