blob: 28ca5439af6c75c7fde61999bb02b0cc7b5e7527 (
plain) (
blame)
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
44
45
46
47
48
49
50
51
|
// Back - An extremely simple git bug visualization system. Inspired by TVL's
// panettone.
//
// Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de>
// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This file is part of Back.
//
// You should have received a copy of the License along with this program.
// If not, see <https://www.gnu.org/licenses/agpl.txt>.
use std::{process, sync::Arc};
use clap::Parser;
use crate::config::BackConfig;
mod cli;
pub mod config;
mod error;
mod web;
fn main() {
if let Err(err) = server_main() {
eprintln!("Error {err}");
process::exit(1);
}
}
#[tokio::main]
async fn server_main() -> Result<(), error::Error> {
let args = cli::Cli::parse();
stderrlog::new()
.module(module_path!())
.modules(["hyper", "http", "git_bug"])
.quiet(false)
.show_module_names(true)
.color(stderrlog::ColorChoice::Auto)
.verbosity(2)
.timestamp(stderrlog::Timestamp::Off)
.init()
.expect("Let's just hope that this does not panic");
let config = BackConfig::from_config_file(&args.config_file)?;
web::main(Arc::new(config)).await?;
Ok(())
}
|