Elysiadev11 commited on
Commit
2e58188
Β·
verified Β·
1 Parent(s): b9ee71a

Update start-openclaw.sh

Browse files
Files changed (1) hide show
  1. start-openclaw.sh +7 -8
start-openclaw.sh CHANGED
@@ -22,12 +22,11 @@ echo ">>> Directories ready."
22
  python3 /app/sync.py restore
23
  echo ">>> Restore done."
24
 
25
- # ── 3. Fix DNS & Hosts (TELEGRAM FIX) ────────────────────────
26
  echo "nameserver 1.1.1.1" >> /etc/resolv.conf
27
  echo "nameserver 8.8.8.8" >> /etc/resolv.conf
28
  echo "nameserver 8.8.4.4" >> /etc/resolv.conf
29
- echo "149.154.166.110 api.telegram.org" >> /etc/hosts
30
- echo ">>> DNS and Hosts fixed for Telegram."
31
 
32
  # ── 4. Chromium ──────────────────────────────────────────────
33
  export PLAYWRIGHT_BROWSERS_PATH=/root/.openclaw/browsers
@@ -198,18 +197,17 @@ function proxyWs(req, socket, head, targetPort) {
198
  }
199
 
200
  const server = http.createServer((req, res) => {
201
- const port = req.url.startsWith('/telegram/webhook') ? 8787 : 7862;
202
  proxyHttp(req, res, port);
203
  });
204
  server.on('upgrade', (req, socket, head) => {
205
- const port = req.url.startsWith('/telegram/webhook') ? 8787 : 7862;
206
- proxyWs(req, socket, head, port);
207
  });
208
  server.listen(7860, '0.0.0.0', () => {
209
- console.log('Proxy (HTTP+WebSocket) on port 7860 (Anti-Timeout Active)');
210
  });
211
  " &
212
- echo ">>> Node.js WebSocket proxy started on port 7860."
213
 
214
  # ── 8. Backup otomatis setiap 1 Jam ──────────────────────────
215
  (
@@ -262,3 +260,4 @@ while true; do
262
  echo ">>> Restarting gateway in 5 seconds..."
263
  sleep 5
264
  done
 
 
22
  python3 /app/sync.py restore
23
  echo ">>> Restore done."
24
 
25
+ # ── 3. Fix DNS (tanpa hosts override β€” apiRoot sudah handle) ─
26
  echo "nameserver 1.1.1.1" >> /etc/resolv.conf
27
  echo "nameserver 8.8.8.8" >> /etc/resolv.conf
28
  echo "nameserver 8.8.4.4" >> /etc/resolv.conf
29
+ echo ">>> DNS fixed."
 
30
 
31
  # ── 4. Chromium ──────────────────────────────────────────────
32
  export PLAYWRIGHT_BROWSERS_PATH=/root/.openclaw/browsers
 
197
  }
198
 
199
  const server = http.createServer((req, res) => {
200
+ const port = req.url.startsWith('/tg-webhook') ? 8787 : 7862;
201
  proxyHttp(req, res, port);
202
  });
203
  server.on('upgrade', (req, socket, head) => {
204
+ proxyWs(req, socket, head, 7862);
 
205
  });
206
  server.listen(7860, '0.0.0.0', () => {
207
+ console.log('Proxy on port 7860 | /tg-webhook β†’ 8787 | /* β†’ 7862');
208
  });
209
  " &
210
+ echo ">>> Node.js reverse proxy started on port 7860."
211
 
212
  # ── 8. Backup otomatis setiap 1 Jam ──────────────────────────
213
  (
 
260
  echo ">>> Restarting gateway in 5 seconds..."
261
  sleep 5
262
  done
263
+