fix: root 启动限制改为提醒
This commit is contained in:
@@ -140,7 +140,7 @@ cd cc-web
|
||||
|
||||
`start.sh` 会执行以下动作:
|
||||
|
||||
- 拒绝 root 用户运行
|
||||
- root 用户运行时提醒风险
|
||||
- 检查 Node.js >= 18 和 npm
|
||||
- 从 `.env.example` 创建 `.env`
|
||||
- 首次部署时引导设置登录密码
|
||||
|
||||
6
start.sh
6
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}"
|
||||
|
||||
Reference in New Issue
Block a user