aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-05-03 22:06:37 +0200
committermetamuffin <metamuffin@disroot.org>2024-05-03 22:06:37 +0200
commit5d8d77a98fb84d05d34b57df73e0bc180c3140c2 (patch)
tree3cb47c2eca0c815f14f4db85f282845796889484 /src/main.rs
parentd60bedc20dc0cc54cb697f3a45e5b222de6f1479 (diff)
downloadstatuspage-5d8d77a98fb84d05d34b57df73e0bc180c3140c2.tar
statuspage-5d8d77a98fb84d05d34b57df73e0bc180c3140c2.tar.bz2
statuspage-5d8d77a98fb84d05d34b57df73e0bc180c3140c2.tar.zst
works
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 8 insertions, 2 deletions
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<Option<anyhow::Error>> = 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<MailConfig>,
title: String,
bind: SocketAddr,
interval: u64,
@@ -35,6 +40,7 @@ pub struct Config {
#[derive(Debug, Deserialize)]
pub struct Service {
title: String,
+ url: Option<String>,
checks: Vec<Check>,
}