Upload start.sh with huggingface_hub
Browse files
start.sh
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -e
|
| 3 |
+
|
| 4 |
+
echo "=== Dev-Box + Krevetka VPS Startup ==="
|
| 5 |
+
|
| 6 |
+
# 1. Start KB HTTP server (port 8811) — for kb_injector hook
|
| 7 |
+
echo "1/3: KB HTTP server (port 8811)"
|
| 8 |
+
cd /app
|
| 9 |
+
gunicorn -b 0.0.0.0:8811 -w 2 --timeout 30 kb_server:app &
|
| 10 |
+
KB_PID=$!
|
| 11 |
+
echo " KB server PID: $KB_PID"
|
| 12 |
+
sleep 2
|
| 13 |
+
|
| 14 |
+
# Verify KB server
|
| 15 |
+
if curl -sf http://127.0.0.1:8811/health > /dev/null 2>&1; then
|
| 16 |
+
echo " KB server: OK"
|
| 17 |
+
else
|
| 18 |
+
echo " KB server: WARNING — not responding yet"
|
| 19 |
+
fi
|
| 20 |
+
|
| 21 |
+
# 2. Generate picoclaw config from secrets
|
| 22 |
+
echo "2/3: Picoclaw config"
|
| 23 |
+
python3 /app/gen_config.py
|
| 24 |
+
|
| 25 |
+
# 3. Start picoclaw gateway (if Discord token is set)
|
| 26 |
+
if [ -n "$DISCORD_TOKEN" ]; then
|
| 27 |
+
echo "3/3: Picoclaw gateway (Discord)"
|
| 28 |
+
cd /app/.picoclaw
|
| 29 |
+
picoclaw gateway &
|
| 30 |
+
PICO_PID=$!
|
| 31 |
+
echo " Picoclaw PID: $PICO_PID"
|
| 32 |
+
else
|
| 33 |
+
echo "3/3: Picoclaw skipped (no DISCORD_TOKEN)"
|
| 34 |
+
PICO_PID=""
|
| 35 |
+
fi
|
| 36 |
+
|
| 37 |
+
# 4. Start code-server on port 7860 (for interactive access)
|
| 38 |
+
echo " Starting code-server on port 7860..."
|
| 39 |
+
PASSWORD="${PASSWORD:-krevetka2026}"
|
| 40 |
+
exec code-server --bind-addr 0.0.0.0:7860 \
|
| 41 |
+
--auth password \
|
| 42 |
+
--disable-telemetry \
|
| 43 |
+
--disable-update-check \
|
| 44 |
+
/app
|