Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions deploy/hub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@
# 0. bun —— hub-daemon.sh 对它是硬依赖,缺了会 fail-closed 停在
# 「找不到 bun」。这一步此前只写在脚本注释里,不在步骤里(#778)。
#
# 🔴 装在 nvm 的**当前 node** 下,因为脚本优先解析
# ~/.nvm/versions/node/<ver>/bin/bun —— 换 node 版本后需要重装。
npm i -g bun # 或按 https://bun.sh/docs/installation
command -v bun && bun --version # 记下路径:换 node 版本后要重来
# 当前生产用 nvm 的 npm 安装,所以 binary 落在当前 node 的 bin 下;换
# node 版本后通常要重装。若采用其它布局,必须让 command -v bun 可见,
# 或在 hub.env 显式设置可执行的 BUN_BIN。
Comment on lines +22 to +23

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not direct operators to set BUN_BIN in hub.env

When Bun is not on the PM2 process's PATH, the newly documented hub.env fallback cannot work: deploy/hub/hub-daemon.sh resolves and validates BUN_BIN at lines 71–87, but does not source hub.env until line 129. An operator following this instruction will therefore still get the “找不到 bun” failure; either source the override before resolution or document a location that PM2 actually exports into the launcher environment.

AGENTS.md reference: AGENTS.md:L24-L24

Useful? React with 👍 / 👎.

BUN_VERSION=1.3.14
npm i -g "bun@$BUN_VERSION"
BUN_BIN="$(command -v bun)"
test -x "$BUN_BIN"
test "$("$BUN_BIN" --version)" = "$BUN_VERSION" # 版本不符即停,不拿 future latest 冒充当前运行时

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Actually stop when the Bun version differs

When command -v bun resolves an older executable—for example because the global install used another prefix—or when installation fails while an old Bun remains on PATH, this standalone test only returns a nonzero status. The block neither enables set -e nor chains subsequent recovery commands with &&, so an interactive paste silently continues installing the launcher despite the claimed fail-closed gate and can restore production with a non-reproducible runtime.

AGENTS.md reference: AGENTS.md:L25-L25

Useful? React with 👍 / 👎.

Comment on lines +26 to +28

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate the Bun executable the daemon will select

When ~/.nvm/versions/node/v20.20.0/bin/bun remains executable, hub-daemon.sh selects that hard-coded path before consulting command -v bun (lines 63–65). These new checks can therefore validate a newly installed Bun 1.3.14 on the current PATH while PM2 actually starts Hub with an older Bun from the hard-coded Node directory; the recovery gate needs to resolve and verify the same executable as the launcher.

AGENTS.md reference: AGENTS.md:L25-L25

Useful? React with 👍 / 👎.

Comment on lines +24 to +28

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Commit the claimed Docker recovery evidence

For this critical recovery-path change, the commit claims a Docker install/version-gate run but adds only the README; a repo-wide search finds neither the reported BUN_PIN_PASS output nor its log hash in docs/tests/, so a future empty-machine rebuild cannot inspect or rerun the claimed rehearsal from repository state. Add the independent Docker harness and saved report for this gate rather than leaving the only evidence outside the tree.

AGENTS.md reference: AGENTS.md:L28-L28

Useful? React with 👍 / 👎.

# (不要用 `curl … | bash` 一行流:管道退出码只反映 consumer,
# curl 失败会被吞掉 —— 见 #729 / #733 / #743。)

Expand Down
Loading