notify feature

This commit is contained in:
2026-08-10 22:43:06 +02:00
parent 43f2e96720
commit 70efc66696
7 changed files with 123 additions and 3 deletions
+11
View File
@@ -39,8 +39,19 @@ class Config:
self.healthcheck_ping_url = os.environ.get("HEALTHCHECK_PING_URL", "")
self.smtp_host = os.environ.get("SMTP_HOST", "")
self.smtp_port = int(os.environ.get("SMTP_PORT", "587"))
self.smtp_user = os.environ.get("SMTP_USER", "")
self.smtp_password = os.environ.get("SMTP_PASSWORD", "")
self.notify_email_to = os.environ.get("NOTIFY_EMAIL_TO", "")
self.notify_email_from = os.environ.get("NOTIFY_EMAIL_FROM", "")
self.state_path = os.environ.get("STATE_PATH", "/app/data/last-known-ip.json")
@property
def email_notification_enabled(self) -> bool:
return bool(self.smtp_host and self.notify_email_to and self.notify_email_from)
def validate(self):
missing = [v for v in REQUIRED_VARS if not os.environ.get(v)]
if missing: