Skip to content

Commit

Permalink
build(docker): create fernet key if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Lee committed Jul 20, 2024
1 parent fc58f98 commit 46b1f17
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ fi

# Create Fernet key if not exists
if [ -z "${AIRFLOW__CORE__FERNET_KEY}" ]; then
echo "Fernet key not set"
echo "Please use the following command to generate"
echo "And set the key to AIRFLOW__CORE__FERNET_KEY environment variable"
echo ">> python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())'"
exit 1
echo "Fernet key not set. Generating a new one."
export AIRFLOW__CORE__FERNET_KEY=$(python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())')
echo "Fernet key generated and set."
echo "[WARNING] Please save the AIRFLOW__CORE__FERNET_KEY for future use."
else
echo "Fernet key exists."
fi
Expand Down

0 comments on commit 46b1f17

Please sign in to comment.