mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Add SKIP_DB_PING to skip database availability test (#2346)
* Add new envvar `SKIP_DB_PING` to instruct the CTFd Docker image to not test if the database server is available --------- Co-authored-by: Smyler <smyler@hackademint.org>
This commit is contained in:
@@ -7,6 +7,7 @@ ACCESS_LOG=${ACCESS_LOG:--}
|
|||||||
ERROR_LOG=${ERROR_LOG:--}
|
ERROR_LOG=${ERROR_LOG:--}
|
||||||
WORKER_TEMP_DIR=${WORKER_TEMP_DIR:-/dev/shm}
|
WORKER_TEMP_DIR=${WORKER_TEMP_DIR:-/dev/shm}
|
||||||
SECRET_KEY=${SECRET_KEY:-}
|
SECRET_KEY=${SECRET_KEY:-}
|
||||||
|
SKIP_DB_PING=${SKIP_DB_PING:-false}
|
||||||
|
|
||||||
# Check that a .ctfd_secret_key file or SECRET_KEY envvar is set
|
# Check that a .ctfd_secret_key file or SECRET_KEY envvar is set
|
||||||
if [ ! -f .ctfd_secret_key ] && [ -z "$SECRET_KEY" ]; then
|
if [ ! -f .ctfd_secret_key ] && [ -z "$SECRET_KEY" ]; then
|
||||||
@@ -18,8 +19,11 @@ if [ ! -f .ctfd_secret_key ] && [ -z "$SECRET_KEY" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Skip db ping if SKIP_DB_PING is set to a value other than false or empty string
|
||||||
|
if [[ "$SKIP_DB_PING" == "false" ]]; then
|
||||||
# Ensures that the database is available
|
# Ensures that the database is available
|
||||||
python ping.py
|
python ping.py
|
||||||
|
fi
|
||||||
|
|
||||||
# Initialize database
|
# Initialize database
|
||||||
python manage.py db upgrade
|
python manage.py db upgrade
|
||||||
|
|||||||
Reference in New Issue
Block a user