From 5d8d77a98fb84d05d34b57df73e0bc180c3140c2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 3 May 2024 22:06:37 +0200 Subject: works --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 0136f94..706effe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,13 @@ pub mod check; -pub mod web; +pub mod log; pub mod mail; +pub mod web; +use ::log::error; use anyhow::{anyhow, Result}; use axum::{routing::get, Router}; use check::check_loop; -use log::error; +use mail::MailConfig; use serde::Deserialize; use std::{ collections::BTreeMap, @@ -16,6 +18,8 @@ use std::{ use tokio::{fs::read_to_string, sync::RwLock}; use web::send_html_page; +pub static GLOBAL_ERROR: RwLock> = RwLock::const_new(None); + #[tokio::main] async fn main() { env_logger::init_from_env("LOG"); @@ -26,6 +30,7 @@ async fn main() { #[derive(Debug, Deserialize)] pub struct Config { + mail: Option, title: String, bind: SocketAddr, interval: u64, @@ -35,6 +40,7 @@ pub struct Config { #[derive(Debug, Deserialize)] pub struct Service { title: String, + url: Option, checks: Vec, } -- cgit v1.2.3-70-g09d2