Spaces:
Sleeping
Sleeping
Update start-openclaw.sh
Browse files- start-openclaw.sh +4 -5
start-openclaw.sh
CHANGED
|
@@ -99,7 +99,8 @@ cat > /root/.openclaw/openclaw.json <<EOF
|
|
| 99 |
"telegram": {
|
| 100 |
"enabled": true,
|
| 101 |
"botToken": "$TELEGRAM_BOT_TOKEN",
|
| 102 |
-
"dmPolicy": "
|
|
|
|
| 103 |
"webhookUrl": "https://elysiadev11-testclaw.hf.space/telegram/webhook",
|
| 104 |
"webhookSecret": "$OPENCLAW_GATEWAY_PASSWORD",
|
| 105 |
"webhookPath": "/telegram/webhook",
|
|
@@ -128,14 +129,13 @@ cat > /root/.openclaw/openclaw.json <<EOF
|
|
| 128 |
}
|
| 129 |
}
|
| 130 |
EOF
|
| 131 |
-
echo ">>> openclaw.json generated with
|
| 132 |
|
| 133 |
# ββ 7. Node.js reverse proxy (ANTI-TIMEOUT TRICK) βββββββββββββ
|
| 134 |
node -e "
|
| 135 |
const http = require('http');
|
| 136 |
const net = require('net');
|
| 137 |
|
| 138 |
-
// Mencegah proxy mati kalau ada error mendadak
|
| 139 |
process.on('uncaughtException', err => console.error('Proxy Exception:', err.message));
|
| 140 |
|
| 141 |
function proxyHttp(req, res, targetPort) {
|
|
@@ -149,7 +149,6 @@ function proxyHttp(req, res, targetPort) {
|
|
| 149 |
r.pipe(res, { end: true });
|
| 150 |
});
|
| 151 |
|
| 152 |
-
// JIKA OPENCLAW BELUM NYALA, BALAS 200 OK AGAR HF SPACE MENGANGGAP SEHAT!
|
| 153 |
pr.on('error', (e) => {
|
| 154 |
res.writeHead(200, { 'Content-Type': 'text/html' });
|
| 155 |
res.end('<html style=\"background:#1e1e2e; color:#cdd6f4; font-family:sans-serif; text-align:center; padding-top:20%;\"><body><h2>π OpenClaw is warming up...</h2><p>Hugging Face is downloading dependencies. Please refresh in a few seconds.</p></body></html>');
|
|
@@ -200,4 +199,4 @@ echo ">>> Running openclaw doctor --fix..."
|
|
| 200 |
openclaw doctor --fix
|
| 201 |
|
| 202 |
echo ">>> Starting OpenClaw on port 7862..."
|
| 203 |
-
exec openclaw gateway run --port 7862
|
|
|
|
| 99 |
"telegram": {
|
| 100 |
"enabled": true,
|
| 101 |
"botToken": "$TELEGRAM_BOT_TOKEN",
|
| 102 |
+
"dmPolicy": "whitelist",
|
| 103 |
+
"allowFrom": ["$TELEGRAM_ALLOW_ID"],
|
| 104 |
"webhookUrl": "https://elysiadev11-testclaw.hf.space/telegram/webhook",
|
| 105 |
"webhookSecret": "$OPENCLAW_GATEWAY_PASSWORD",
|
| 106 |
"webhookPath": "/telegram/webhook",
|
|
|
|
| 129 |
}
|
| 130 |
}
|
| 131 |
EOF
|
| 132 |
+
echo ">>> openclaw.json generated with User ID Allowlist."
|
| 133 |
|
| 134 |
# ββ 7. Node.js reverse proxy (ANTI-TIMEOUT TRICK) βββββββββββββ
|
| 135 |
node -e "
|
| 136 |
const http = require('http');
|
| 137 |
const net = require('net');
|
| 138 |
|
|
|
|
| 139 |
process.on('uncaughtException', err => console.error('Proxy Exception:', err.message));
|
| 140 |
|
| 141 |
function proxyHttp(req, res, targetPort) {
|
|
|
|
| 149 |
r.pipe(res, { end: true });
|
| 150 |
});
|
| 151 |
|
|
|
|
| 152 |
pr.on('error', (e) => {
|
| 153 |
res.writeHead(200, { 'Content-Type': 'text/html' });
|
| 154 |
res.end('<html style=\"background:#1e1e2e; color:#cdd6f4; font-family:sans-serif; text-align:center; padding-top:20%;\"><body><h2>π OpenClaw is warming up...</h2><p>Hugging Face is downloading dependencies. Please refresh in a few seconds.</p></body></html>');
|
|
|
|
| 199 |
openclaw doctor --fix
|
| 200 |
|
| 201 |
echo ">>> Starting OpenClaw on port 7862..."
|
| 202 |
+
exec openclaw gateway run --port 7862
|