File size: 624 Bytes
ff35c21 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #!/bin/bash
# 1. Start Cloudflare Tunnel in the background
# We use the TUNNEL_TOKEN secret configured in HF Spaces settings
if [ -z "$TUNNEL_TOKEN" ]; then
echo "WARNING: TUNNEL_TOKEN not found. External access via Cloudflare will be unavailable."
else
echo "Starting Cloudflare Tunnel..."
cloudflared tunnel --no-autoupdate run --token $TUNNEL_TOKEN &
fi
# 2. Start the IDE (code-server)
# We bind to 0.0.0.0:7860 so the HF proxy can still see it
echo "Starting Agent-1st IDE on port 7860..."
code-server --bind-addr 0.0.0.0:7860 \
--auth none \
--disable-telemetry \
/home/puppet/agent_workspace |