Spaces:
Running
Running
Commit Β·
27f94dd
1
Parent(s): 74e4d41
resolve merge conflict
Browse files- iframe-fix.cjs +4 -0
- start.sh +36 -0
iframe-fix.cjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
/**
|
| 2 |
* iframe-fix.cjs β Node.js preload script
|
| 3 |
*
|
|
|
|
| 1 |
+
process.on('uncaughtException', function(err) {
|
| 2 |
+
if (err.code === 'EPIPE') return;
|
| 3 |
+
throw err;
|
| 4 |
+
});
|
| 5 |
/**
|
| 6 |
* iframe-fix.cjs β Node.js preload script
|
| 7 |
*
|
start.sh
CHANGED
|
@@ -536,6 +536,29 @@ if [ -n "${CLOUDFLARE_WORKERS_TOKEN:-}" ]; then
|
|
| 536 |
python3 /home/node/app/cloudflare-keepalive-setup.py || true
|
| 537 |
fi
|
| 538 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 539 |
# ββ Re-install previously installed plugins ββ
|
| 540 |
EXISTING_CONFIG="/home/node/.openclaw/openclaw.json"
|
| 541 |
if [ -f "$EXISTING_CONFIG" ]; then
|
|
@@ -557,6 +580,19 @@ if [ -f "$EXISTING_CONFIG" ]; then
|
|
| 557 |
fi
|
| 558 |
fi
|
| 559 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 560 |
# ββ Launch gateway ββ
|
| 561 |
echo "Launching OpenClaw gateway on port 7860..."
|
| 562 |
|
|
|
|
| 536 |
python3 /home/node/app/cloudflare-keepalive-setup.py || true
|
| 537 |
fi
|
| 538 |
|
| 539 |
+
# ββ Write shell capture wrappers to .bashrc ββ
|
| 540 |
+
STARTUP_FILE="/home/node/.openclaw/workspace/startup.sh"
|
| 541 |
+
cat > /home/node/.bashrc << 'BASHRC'
|
| 542 |
+
STARTUP_FILE="/home/node/.openclaw/workspace/startup.sh"
|
| 543 |
+
_hc_append() {
|
| 544 |
+
local line="$*"
|
| 545 |
+
grep -qxF "$line" "$STARTUP_FILE" 2>/dev/null || echo "$line" >> "$STARTUP_FILE"
|
| 546 |
+
}
|
| 547 |
+
apt-get() {
|
| 548 |
+
command apt-get "$@"
|
| 549 |
+
[[ "$1" == "install" ]] && _hc_append "apt-get install -y ${@:2}"
|
| 550 |
+
}
|
| 551 |
+
apt() {
|
| 552 |
+
command apt "$@"
|
| 553 |
+
[[ "$1" == "install" ]] && _hc_append "apt-get install -y ${@:2}"
|
| 554 |
+
}
|
| 555 |
+
pip() { command pip "$@"; [[ "$1" == "install" ]] && _hc_append "pip install ${@:2}"; }
|
| 556 |
+
pip3() { command pip3 "$@"; [[ "$1" == "install" ]] && _hc_append "pip3 install ${@:2}"; }
|
| 557 |
+
npm() { command npm "$@"; [[ "$1" == "install" && "$2" == "-g" ]] && _hc_append "npm install -g ${@:3}"; }
|
| 558 |
+
openclaw() { command openclaw "$@"; [[ "$1" == "plugins" && "$2" == "install" ]] && _hc_append "openclaw plugins install ${@:3}"; }
|
| 559 |
+
BASHRC
|
| 560 |
+
echo "Shell capture wrappers ready."
|
| 561 |
+
|
| 562 |
# ββ Re-install previously installed plugins ββ
|
| 563 |
EXISTING_CONFIG="/home/node/.openclaw/openclaw.json"
|
| 564 |
if [ -f "$EXISTING_CONFIG" ]; then
|
|
|
|
| 580 |
fi
|
| 581 |
fi
|
| 582 |
|
| 583 |
+
# ββ Run workspace startup script ββ
|
| 584 |
+
STARTUP_FILE="/home/node/.openclaw/workspace/startup.sh"
|
| 585 |
+
if [ ! -f "$STARTUP_FILE" ]; then
|
| 586 |
+
touch "$STARTUP_FILE"
|
| 587 |
+
chmod +x "$STARTUP_FILE"
|
| 588 |
+
echo "Created workspace/startup.sh"
|
| 589 |
+
fi
|
| 590 |
+
if [ -s "$STARTUP_FILE" ]; then
|
| 591 |
+
echo "Running workspace/startup.sh..."
|
| 592 |
+
bash "$STARTUP_FILE" || echo "Warning: startup.sh had errors, continuing..."
|
| 593 |
+
echo "Startup script complete."
|
| 594 |
+
fi
|
| 595 |
+
|
| 596 |
# ββ Launch gateway ββ
|
| 597 |
echo "Launching OpenClaw gateway on port 7860..."
|
| 598 |
|