Added lib-secret-manager which consumes secrets after application launch
Build & Publish to GHCR / build (push) Successful in 1m30s

This commit is contained in:
florian committed 2025-11-05 22:39:35 +01:00
1 parent d7c820e8fb
commit 18042a8ff5
6 files changed
+11 -17

No files matched your search

+8
View File
@@ -8,6 +8,7 @@ from send_notification import send_notification
from metrics_server import REQUEST_COUNTER
import asyncio
from uvicorn_logger_config import LOGGING_CONFIG
from secret_manager import cleanup_secret_files
logger = setup_logger(__name__)
@@ -22,6 +23,13 @@ async def lifespan(app: FastAPI):
start_healthcheck_thread()
logger.info("[DB] MySQL healthcheck thread started.")
SECRET_PATHS = frozenset({
"/etc/secrets/api_key",
"/etc/secrets/db_username",
"/etc/secrets/db_password"
})
cleanup_secret_files(SECRET_PATHS)
yield
logger.info("[App] Closing MySQL connection pool...")
close_connection_pool()