Added lib-secret-manager which consumes secrets after application launch
Build & Publish to GHCR / build (push) Successful in 50s
Build & Publish to GHCR / build (push) Successful in 50s
This commit is contained in:
1 parent
ab1b48fe06
commit
d21f56a2ae
4 files changed
+14
-32
No files matched your search
+12
-1
@@ -1,7 +1,9 @@
|
||||
import asyncio
|
||||
import aio_pika
|
||||
from aio_pika.exceptions import AMQPException
|
||||
from secret_handler import return_credentials, database_lookup_by_user_id, decrypt_token, remove_inactive_push_token, database_lookup_by_uuid
|
||||
from secret_manager import return_credentials, cleanup_secret_files
|
||||
from secret_manager.fernet_encryption import decrypt_token
|
||||
from device_token_repository import database_lookup_by_user_id, remove_inactive_push_token, database_lookup_by_uuid
|
||||
import os
|
||||
from simple_logger_handler import setup_logger
|
||||
import json
|
||||
@@ -295,6 +297,15 @@ async def main():
|
||||
await consumer.consume()
|
||||
stop_event = asyncio.Event()
|
||||
|
||||
SECRET_PATHS = frozenset({
|
||||
"/etc/secrets/encryption_key",
|
||||
"/etc/secrets/db_username",
|
||||
"/etc/secrets/db_password",
|
||||
"/etc/secrets/rmq_username",
|
||||
"/etc/secrets/rmq_password"
|
||||
})
|
||||
cleanup_secret_files(SECRET_PATHS)
|
||||
|
||||
for sig in (signal.SIGINT, signal.SIGTERM):
|
||||
asyncio.get_running_loop().add_signal_handler(sig, stop_event.set)
|
||||
|
||||
|
||||
Reference in new issue
Block a user