feat: Implement notification system with Apprise integration and credential checks

This commit is contained in:
Christian Krakau-Louis
2025-04-11 01:55:10 +02:00
parent 0dad3cbb95
commit ce91dc8c79
16 changed files with 820 additions and 6 deletions
+15
View File
@@ -14,6 +14,7 @@ from pathlib import Path
from app.database import init_db
from app.config import settings
from app.utils.config_validator import check_all_configs
from app.utils.notification import init_apprise, send_notification, notify_startup, notify_shutdown
# Import the routers - now using views directly instead of frontend
from app.views import router as frontend_router
@@ -68,6 +69,20 @@ async def startup_event():
logging.info("Application started with valid configuration")
logging.info("Router organization: Using refactored API routers from app/api/ directory")
# Initialize notification system
init_apprise()
# Send startup notification
notify_startup()
@app.on_event("shutdown")
async def shutdown_event():
"""Run shutdown tasks for the application"""
logging.info("Application shutting down")
# Send shutdown notification
notify_shutdown()
# Custom 404 - we can still return the Jinja2 template, or the old static file:
@app.exception_handler(404)