From a794607817f9645e8393b3c1505be8201bffec40 Mon Sep 17 00:00:00 2001 From: shiyue Date: Wed, 24 Jun 2026 10:04:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20root=20=E5=90=AF=E5=8A=A8=E9=99=90?= =?UTF-8?q?=E5=88=B6=E6=94=B9=E4=B8=BA=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- start.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e5a8c7e..e6e67ad 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ cd cc-web `start.sh` 会执行以下动作: -- 拒绝 root 用户运行 +- root 用户运行时提醒风险 - 检查 Node.js >= 18 和 npm - 从 `.env.example` 创建 `.env` - 首次部署时引导设置登录密码 diff --git a/start.sh b/start.sh index 03798fd..680552f 100755 --- a/start.sh +++ b/start.sh @@ -19,6 +19,10 @@ fail() { exit 1 } +warn() { + printf '[cc-web pm2] WARNING: %s\n' "$*" >&2 +} + ensure_command() { local cmd="$1" local hint="$2" @@ -268,7 +272,7 @@ start_or_restart_app() { main() { if [[ "$(id -u)" -eq 0 ]]; then - fail "请使用非 root 用户执行。该服务会启动 Claude/Codex 子进程,root 运行风险过高。" + warn "当前正在使用 root 用户执行。该服务会启动 Claude/Codex 子进程,root 运行风险较高,建议改用非 root 用户。" fi [[ -f "${ENTRY_PATH}" ]] || fail "找不到入口文件: ${ENTRY_PATH}"