File size: 1,048 Bytes
a792176
 
 
d05f4d3
a792176
d05f4d3
 
 
 
 
 
a792176
 
d05f4d3
 
 
 
a792176
d05f4d3
 
 
a792176
d05f4d3
 
 
d2aade5
d05f4d3
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -e

echo "[start] Booting picoclaw stack..."

# --- SOCKS5 Bridge (replaces chisel) ---
# Local SOCKS5 proxy on :1080, forwards via HTTP CONNECT to tinyproxy CF tunnel
UPSTREAM_PROXY="${UPSTREAM_PROXY:-https://relying-technology-word-talented.trycloudflare.com}"
export UPSTREAM_PROXY
python3 /app/socks5_bridge.py > /tmp/socks5_bridge.log 2>&1 &
echo "[start] SOCKS5 bridge started on :1080 (upstream: $UPSTREAM_PROXY)"
sleep 2

# --- KB server (Flask on port 8811) ---
cd /app
gunicorn -w 2 -b 0.0.0.0:8811 kb_server:app > /tmp/kb_server.log 2>&1 &
echo "[start] KB server started on :8811"

# --- Generate picoclaw config ---
python3 /app/gen_config.py > /app/.picoclaw/config.json 2>/tmp/gen_config.log
echo "[start] Config generated"

# --- Picoclaw gateway ---
/usr/local/bin/picoclaw gateway > /tmp/picoclaw.log 2>&1 &
echo "[start] Picoclaw gateway started"

# --- Code-server (port 7860, required by HF Space) ---
export PASSWORD="${PASSWORD:-Hermes2026!Dev}"
exec code-server --bind-addr 0.0.0.0:7860 --auth password /app