diff --git a/ark_nova_stats/worker/app.py b/ark_nova_stats/worker/app.py index 2d1dfec4..e3e71b87 100644 --- a/ark_nova_stats/worker/app.py +++ b/ark_nova_stats/worker/app.py @@ -91,6 +91,9 @@ def archive_logs_to_tigris( return new_archive +API_SECRET_KEY = os.getenv("API_WORKER_SECRET") + + def main() -> int: tigris_client = boto3.client("s3", endpoint_url=os.getenv("AWS_ENDPOINT_URL_S3")) with app.app_context(): diff --git a/base/flask_app.py b/base/flask_app.py index 4e4bf8c6..e9479c59 100644 --- a/base/flask_app.py +++ b/base/flask_app.py @@ -41,6 +41,7 @@ def FlaskApp(name) -> tuple[Flask, CORS, SQLAlchemy, Migrate]: app.config.update( FRONTEND_URL=frontend_url, SECRET_KEY=os.getenv("FLASK_SECRET_KEY", "testing"), + WORKER_SECRET=os.getenv("API_WORKER_SECRET", "test-api-worker-secret"), SQLALCHEMY_DATABASE_URI=database_uri(), SQLALCHEMY_ENGINE_OPTIONS={ "connect_args": { diff --git a/skeleton/worker/app.py b/skeleton/worker/app.py index e7da48f6..5b23027a 100644 --- a/skeleton/worker/app.py +++ b/skeleton/worker/app.py @@ -1,9 +1,12 @@ +import os import time from skeleton.config import app, db max_delay = 10 +API_SECRET_KEY = os.getenv("API_WORKER_SECRET") + def main() -> int: with app.app_context(): diff --git a/tools/build_rules/api/api_image.bzl b/tools/build_rules/api/api_image.bzl index d90b3ce1..4758d1dd 100644 --- a/tools/build_rules/api/api_image.bzl +++ b/tools/build_rules/api/api_image.bzl @@ -75,6 +75,7 @@ def api_image( "DB_PASSWORD": "development", "DATABASE_NAME": "api_development", "FLASK_SECRET_KEY": "testing", + "API_WORKER_SECRET": "test-api-worker-secret", } container_env.update(env) diff --git a/tools/build_rules/worker/worker.bzl b/tools/build_rules/worker/worker.bzl index 2f47f1de..0074ef0c 100644 --- a/tools/build_rules/worker/worker.bzl +++ b/tools/build_rules/worker/worker.bzl @@ -43,6 +43,7 @@ def worker( "DB_PASSWORD": "development", "DATABASE_NAME": "api_development", "FLASK_SECRET_KEY": "testing", + "API_WORKER_SECRET": "test-api-worker-secret", } all_env.update(env)