add settings for Notifier (webhook & smtp)

This commit is contained in:
OMGeeky
2024-04-28 18:03:00 +02:00
parent 60092672b4
commit fc38fbc800
2 changed files with 26 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "twba-backup-config"
version = "0.1.6"
version = "0.1.7"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -20,6 +20,8 @@ pub struct Conf {
#[config(default = 5)]
pub max_items_to_process: u64,
#[config(nested)]
pub notifier: Notifier,
#[config(nested)]
pub twitch: Twitch,
#[config(nested)]
@@ -48,6 +50,29 @@ impl Conf {
PathBuf::from(path)
}
}
#[derive(Debug, Serialize, Deserialize, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Config)]
pub struct Notifier {
/// The URL for the webhook
pub webhook_url: Option<String>,
pub smtp: Option<Smtp>,
}
#[derive(Debug, Serialize, Deserialize, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Config)]
pub struct Smtp {
/// The SMTP server address
pub server: String,
/// The SMTP server port
pub port: u16,
/// The SMTP username
pub username: String,
/// The SMTP password
pub password: String,
/// The email address to send the email from
pub from: String,
/// The email address to send the email to
pub to: String,
}
#[derive(Debug, Serialize, Deserialize, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Config)]
pub struct Google {
/// The path for the auth code file.