Download start-services.sh from dss11/vsc2: direct link, hf CLI and curl.
- Browser
- Download file 660 Bytes
-
https://huggingface.co/spaces/dss11/vsc2/resolve/main/start-services.sh
- Command line
-
hf download hf://spaces/dss11/vsc2/start-services.sh
-
curl -L -o start-services.sh https://huggingface.co/spaces/dss11/vsc2/resolve/main/start-services.sh
660 Bytes
| set -e | |
| echo "Starting services..." | |
| cd /home/user | |
| # 启动 nginx (前端伪装) | |
| echo "Starting nginx..." | |
| nginx -g "daemon off;" & | |
| # 启动 code-server (后端服务) | |
| echo "Starting code-server..." | |
| sudo -u user code-server --config /home/user/.config/code-server/config.yaml & | |
| # 等待服务启动 | |
| sleep 3 | |
| # 如果提供了 TUNNEL_TOKEN,启动 Cloudflare Tunnel | |
| if [ ! -z "$TUNNEL_TOKEN" ]; then | |
| echo "Starting Cloudflare Tunnel..." | |
| sudo -u user cloudflared tunnel --url http://localhost:7860 --token $TUNNEL_TOKEN & | |
| else | |
| echo "No TUNNEL_TOKEN provided, skipping Cloudflare Tunnel" | |
| fi | |
| echo "All services started, waiting..." | |
| wait |