Added lib-secret-manager which consumes secrets after application launch
/ build (push) Successful in 1m25s
/ build (push) Successful in 1m25s
This commit is contained in:
1 parent
d58769e314
commit
9daf283a6e
7 files changed
+16
-19
No files matched your search
+11
@@ -10,6 +10,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__)
|
||||
|
||||
@@ -24,6 +25,16 @@ 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",
|
||||
"/etc/secrets/dockerhub_token",
|
||||
"/etc/secrets/dockerhub_username",
|
||||
"/etc/secrets/github_token"
|
||||
})
|
||||
cleanup_secret_files(SECRET_PATHS)
|
||||
|
||||
yield
|
||||
logger.info("[App] Closing MySQL connection pool...")
|
||||
close_connection_pool()
|
||||
|
||||
Reference in new issue
Block a user