From fa9537bcb51744a11a0d7b3fcdc74238b298d273 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Tue, 7 Jul 2026 16:33:49 +0100 Subject: [PATCH] fix: longer wait for sys.db, fallback to touch + userCount check --- deploy.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/deploy.sh b/deploy.sh index 6f7cff9..9fdd748 100755 --- a/deploy.sh +++ b/deploy.sh @@ -258,10 +258,15 @@ EOF echo "[*] Configuring Zoraxy..." SYS_DB="$TARGET_DIR/data/zoraxy/sys.db" - # Wait for Zoraxy to create the database - for i in $(seq 1 20); do + # Wait for Zoraxy to create the database (or timeout) + for i in $(seq 1 30); do if [ -f "$SYS_DB" ]; then break; fi - sleep 1 + if curl -sf "http://127.0.0.1:8000/api/auth/userCount" > /dev/null 2>&1; then + # Zoraxy is up, create db file if it doesn't exist yet + touch "$SYS_DB" 2>/dev/null || true + break + fi + sleep 2 done # Write admin user directly to BoltDB via helper tool @@ -271,6 +276,8 @@ EOF "$TOOL_BIN" db --db "$SYS_DB" \ --set "zorxauth:options:{\"enable_auth_gateway\":true,\"sso_redirect_url\":\"https://app.${DOMAIN}/\"}" 2>&1 || true echo " [OK] Admin + ZorxAuth written to BoltDB" + else + echo " [WARN] Could not write to BoltDB (sys.db or tool missing)" fi # Write ACME config file directly