Spaces:
dss11
/
Paused

vsc2 / start-services.sh
AdmiN1234Chat's picture
新建
7122dbd
Raw History Blame Contribute Delete
660 Bytes
#!/bin/bash
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