feat: validate configuration

This commit is contained in:
Marc Plano-Lesay 2025-05-21 22:02:42 +10:00
parent ee7d7971be
commit 48c670f455
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
33 changed files with 1076 additions and 165 deletions

View file

@ -1,4 +1,5 @@
use crate::app::Enableable;
use crate::config::types::{Host, Password, Topic, Username};
use serde::{Deserialize, Serialize};
/// Configuration for the ntfy notification service
@ -9,18 +10,18 @@ pub struct NtfyConfig {
pub enable: bool,
/// The host URL of the ntfy server
pub host: String,
pub host: Host,
/// The username for authentication (optional)
#[serde(default)]
pub username: Option<String>,
pub username: Option<Username>,
/// The password for authentication (optional)
#[serde(default)]
pub password: Option<String>,
pub password: Option<Password>,
/// The topic to publish notifications to
pub topic: String,
pub topic: Topic,
}
impl Enableable for NtfyConfig {