Skip to content

Commit 554b829

Browse files
committed
Fix using Edge Worker in Breeze due to rolling random secret
1 parent 353e17a commit 554b829

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dev/breeze/src/airflow_breeze/params/shell_params.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import os
2020
import sys
21+
from base64 import b64encode
2122
from copy import deepcopy
2223
from dataclasses import dataclass, field
2324
from functools import cached_property
@@ -507,6 +508,7 @@ def env_variables_for_docker_commands(self) -> dict[str, str]:
507508
_set_var(_env, "AIRFLOW__CELERY__BROKER_URL", self.airflow_celery_broker_url)
508509
_set_var(_env, "AIRFLOW__CORE__EXECUTOR", self.executor)
509510
_set_var(_env, "AIRFLOW__API__BASE_URL", f"http://localhost:{WEB_HOST_PORT}")
511+
_set_var(_env, "AIRFLOW__WEBSERVER__SECRET_KEY", b64encode(os.urandom(16)).decode("utf-8"))
510512
_set_var(
511513
_env,
512514
"AIRFLOW__CORE__SIMPLE_AUTH_MANAGER_PASSWORDS_FILE",
@@ -517,6 +519,9 @@ def env_variables_for_docker_commands(self) -> dict[str, str]:
517519
_env, "AIRFLOW__CORE__EXECUTOR", "airflow.providers.edge.executors.edge_executor.EdgeExecutor"
518520
)
519521
_set_var(_env, "AIRFLOW__EDGE__API_ENABLED", "true")
522+
_set_var(
523+
_env, "AIRFLOW__CORE__INTERNAL_API_SECRET_KEY", b64encode(os.urandom(16)).decode("utf-8")
524+
)
520525

521526
# For testing Edge Worker on Windows... Default Run ID is having a colon (":") from the time which is
522527
# made into the log path template, which then fails to be used in Windows. So we replace it with a dash

0 commit comments

Comments
 (0)