Update start.sh
Browse files123456789101112#!/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 &# 保活容器12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#!/bin/bash# 1. 修复 Nginx 权限问题# 使用自定义配置运行 Nginxcat > /tmp/nginx.conf <<EOFworker_processes auto;pid /tmp/nginx.pid;events {worker_connections 1024;}http {client_body_temp_path /tmp/client_body;fastcgi_temp_path /tmp/fastcgi_temp;proxy_temp_path /tmp/proxy_temp;scgi_temp_path /tmp/scgi_temp;uwsgi_temp_path /tmp/uwsgi_temp;server {listen 7860;root /var/www/html;index index.html;}}EOF# 启动 Nginxnginx -c /tmp/nginx.conf -g "daemon off;" &# 2. 修复 code-server 权限问题# 创建有权限的配置目录mkdir -p $HOME/.config/code-serverexport XDG_CONFIG_HOME=$HOME/.config# 设置 VS Code 密码PASSWORD=${VSCODE_PASSWORD:-"your_strong_password"}export PASSWORD# 启动 VS Codecode-server \--bind-addr 0.0.0.0:8080 \--auth password \--disable-telemetry \--disable-update-check \--user-data-dir $HOME/.local/share/code-server \--extensions-dir $HOME/.local/share/code-server/extensions &# 3. 启动 Cloudflare Tunnelcloudflared tunnel run --token $TUNNEL_TOKEN &# 保活容器
start.sh+45-5