From c5b287ed87038a7818181cfb1570890a219e8438 Mon Sep 17 00:00:00 2001 From: myrmidex Date: Mon, 30 Jun 2025 20:41:38 +0200 Subject: [PATCH] Block app from running if variables not set --- docker/entrypoint.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index f432a4f..f37a38c 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -3,6 +3,17 @@ # Exit on any error set -e +# Check required Lemmy environment variables +if [ -z "$LEMMY_INSTANCE" ] || [ -z "$LEMMY_USERNAME" ] || [ -z "$LEMMY_PASSWORD" ] || [ -z "$LEMMY_COMMUNITY" ]; then + echo "ERROR: Missing required Lemmy configuration variables:" + echo " LEMMY_INSTANCE=${LEMMY_INSTANCE:-'(not set)'}" + echo " LEMMY_USERNAME=${LEMMY_USERNAME:-'(not set)'}" + echo " LEMMY_PASSWORD=${LEMMY_PASSWORD:-'(not set)'}" + echo " LEMMY_COMMUNITY=${LEMMY_COMMUNITY:-'(not set)'}" + echo "Please set all required environment variables before starting the application." + exit 1 +fi + # Wait for database to be ready until php artisan tinker --execute="DB::connection()->getPdo();" > /dev/null 2>&1; do echo "Waiting for database connection..."