add gitea sig header check, add Json errors, begin AppState

This commit is contained in:
2026-05-31 20:32:49 +00:00
parent c119bed142
commit aa746f357d
10 changed files with 288 additions and 37 deletions
+16 -3
View File
@@ -1,11 +1,24 @@
use std::sync::Arc;
use tokio::sync::Mutex;
use crate::{bot::Bot, state::AppState};
mod api;
mod env;
mod gitea;
mod bot;
mod env;
mod errors;
mod gitea;
mod state;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let config = env::load_config()?;
api::start_api(config).await
let app_state = AppState {
bot: Arc::new(Mutex::new(Bot::new(config.clone()))),
config: config,
};
api::start(app_state).await
}