Spaces:
Running
Running
Anurag commited on
Commit Β·
bb608e7
1
Parent(s): d5203bf
Fix AUTO_DOCTOR guard indentation in startup block
Browse files- env-builder.js +9 -0
- start.sh +14 -5
env-builder.js
CHANGED
|
@@ -482,6 +482,15 @@ const FIELDS = [
|
|
| 482 |
"common": 1,
|
| 483 |
"tag": "build"
|
| 484 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 485 |
{
|
| 486 |
"g": "Startup",
|
| 487 |
"icon": "β‘",
|
|
|
|
| 482 |
"common": 1,
|
| 483 |
"tag": "build"
|
| 484 |
},
|
| 485 |
+
{
|
| 486 |
+
"g": "Startup",
|
| 487 |
+
"icon": "π©Ί",
|
| 488 |
+
"k": "AUTO_DOCTOR",
|
| 489 |
+
"lbl": "Auto-fix config on boot (openclaw doctor --fix)",
|
| 490 |
+
"type": "toggle",
|
| 491 |
+
"ph": "false",
|
| 492 |
+
"tag": "advanced"
|
| 493 |
+
},
|
| 494 |
{
|
| 495 |
"g": "Startup",
|
| 496 |
"icon": "β‘",
|
start.sh
CHANGED
|
@@ -1438,7 +1438,9 @@ if [ -n "${HUGGINGCLAW_OPENCLAW_PLUGINS:-}" ]; then
|
|
| 1438 |
fi
|
| 1439 |
|
| 1440 |
# ββ Fix config before running startup commands ββ
|
| 1441 |
-
|
|
|
|
|
|
|
| 1442 |
|
| 1443 |
# ββ Arbitrary startup commands from HF Variables/Secrets ββ
|
| 1444 |
# Recommended: use one variable, HUGGINGCLAW_RUN, as a full bash script. If the
|
|
@@ -1581,7 +1583,9 @@ while true; do
|
|
| 1581 |
fi
|
| 1582 |
fi
|
| 1583 |
|
| 1584 |
-
|
|
|
|
|
|
|
| 1585 |
echo "Launching OpenClaw gateway on port 7860..."
|
| 1586 |
|
| 1587 |
GATEWAY_ARGS=(gateway run --port 7860 --bind lan)
|
|
@@ -1618,9 +1622,14 @@ while true; do
|
|
| 1618 |
echo "Gateway failed to start. Last 30 lines of log:"
|
| 1619 |
echo "ββββββββββββββββββββββββββββββββββββββββββββ"
|
| 1620 |
tail -30 /home/node/.openclaw/gateway.log
|
| 1621 |
-
|
| 1622 |
-
|
| 1623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1624 |
fi
|
| 1625 |
|
| 1626 |
# 11. Start WhatsApp Guardian after the gateway is accepting connections
|
|
|
|
| 1438 |
fi
|
| 1439 |
|
| 1440 |
# ββ Fix config before running startup commands ββ
|
| 1441 |
+
if [ "${AUTO_DOCTOR:-false}" = "true" ]; then
|
| 1442 |
+
openclaw doctor --fix || true
|
| 1443 |
+
fi
|
| 1444 |
|
| 1445 |
# ββ Arbitrary startup commands from HF Variables/Secrets ββ
|
| 1446 |
# Recommended: use one variable, HUGGINGCLAW_RUN, as a full bash script. If the
|
|
|
|
| 1583 |
fi
|
| 1584 |
fi
|
| 1585 |
|
| 1586 |
+
if [ "${AUTO_DOCTOR:-false}" = "true" ]; then
|
| 1587 |
+
openclaw doctor --fix || true
|
| 1588 |
+
fi
|
| 1589 |
echo "Launching OpenClaw gateway on port 7860..."
|
| 1590 |
|
| 1591 |
GATEWAY_ARGS=(gateway run --port 7860 --bind lan)
|
|
|
|
| 1622 |
echo "Gateway failed to start. Last 30 lines of log:"
|
| 1623 |
echo "ββββββββββββββββββββββββββββββββββββββββββββ"
|
| 1624 |
tail -30 /home/node/.openclaw/gateway.log
|
| 1625 |
+
if [ "$DEV_MODE_ENABLED" = "true" ]; then
|
| 1626 |
+
echo "Gateway failed β DEV_MODE active, retrying in 10s..."
|
| 1627 |
+
sleep 10
|
| 1628 |
+
continue
|
| 1629 |
+
else
|
| 1630 |
+
echo "Gateway failed β exiting."
|
| 1631 |
+
exit 1
|
| 1632 |
+
fi
|
| 1633 |
fi
|
| 1634 |
|
| 1635 |
# 11. Start WhatsApp Guardian after the gateway is accepting connections
|