fix: longer wait for sys.db, fallback to touch + userCount check
This commit is contained in:
parent
c42807d076
commit
fa9537bcb5
1 changed files with 10 additions and 3 deletions
13
deploy.sh
13
deploy.sh
|
|
@ -258,10 +258,15 @@ EOF
|
||||||
echo "[*] Configuring Zoraxy..."
|
echo "[*] Configuring Zoraxy..."
|
||||||
SYS_DB="$TARGET_DIR/data/zoraxy/sys.db"
|
SYS_DB="$TARGET_DIR/data/zoraxy/sys.db"
|
||||||
|
|
||||||
# Wait for Zoraxy to create the database
|
# Wait for Zoraxy to create the database (or timeout)
|
||||||
for i in $(seq 1 20); do
|
for i in $(seq 1 30); do
|
||||||
if [ -f "$SYS_DB" ]; then break; fi
|
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
|
done
|
||||||
|
|
||||||
# Write admin user directly to BoltDB via helper tool
|
# Write admin user directly to BoltDB via helper tool
|
||||||
|
|
@ -271,6 +276,8 @@ EOF
|
||||||
"$TOOL_BIN" db --db "$SYS_DB" \
|
"$TOOL_BIN" db --db "$SYS_DB" \
|
||||||
--set "zorxauth:options:{\"enable_auth_gateway\":true,\"sso_redirect_url\":\"https://app.${DOMAIN}/\"}" 2>&1 || true
|
--set "zorxauth:options:{\"enable_auth_gateway\":true,\"sso_redirect_url\":\"https://app.${DOMAIN}/\"}" 2>&1 || true
|
||||||
echo " [OK] Admin + ZorxAuth written to BoltDB"
|
echo " [OK] Admin + ZorxAuth written to BoltDB"
|
||||||
|
else
|
||||||
|
echo " [WARN] Could not write to BoltDB (sys.db or tool missing)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Write ACME config file directly
|
# Write ACME config file directly
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue