Update start.sh
Browse files123456789101112131415161718192021222324#!/bin/bash# 设置环境变量(从Hugging Face Secrets获取)TUNNEL_TOKEN=${TUNNEL_TOKEN} # 从环境变量获取TUNNEL_NAME=${TUNNEL_NAME} # 从环境变量获取VSCODE_PASSWORD=${VSCODE_PASSWORD} # 建议添加密码保护# 将token写入配置文件echo "token: ${TUNNEL_TOKEN}" > /etc/cloudflared/config.yml# 启动 Hello World 前端 (Nginx 监听7860端口)nginx -g "daemon off;" &# 启动 VS Code (设置密码保护)code-server \--bind-addr 0.0.0.0:8080 \--auth password \--password "${VSCODE_PASSWORD:-vscode}" & # 默认密码为vscode# 启动 Cloudflare Tunnelcloudflared tunnel --config /etc/cloudflared/config.yml run ${TUNNEL_NAME} &# 保活容器wait12345678910111213#!/bin/bash# 启动 Hello World 前端 (占用 Hugging Face 的 7860 端口)nginx -g "daemon off;" &# 启动 VS Code (监听本地端口 8080)code-server --bind-addr 0.0.0.0:8080 --auth password &# 启动 Cloudflare Tunnel 使用单个令牌cloudflared tunnel run --token $TUNNEL_TOKEN &# 保活容器wait
start.sh+5-16