diff --git a/luasrc/model/cbi/openclaw/basic.lua b/luasrc/model/cbi/openclaw/basic.lua index b203995..dd9ea3e 100644 --- a/luasrc/model/cbi/openclaw/basic.lua +++ b/luasrc/model/cbi/openclaw/basic.lua @@ -253,7 +253,7 @@ act.cfgvalue = function(self, section) html[#html+1] = '}' -- ARM64 musl 专属下载问题 html[#html+1] = 'if(ll.indexOf("arm64 musl")>=0&&(ll.indexOf("release api")>=0||ll.indexOf("node-bins")>=0||ll.indexOf("未找到兼容的 arm64 musl node.js 资产")>=0||ll.indexOf("无法获取 arm64 musl node.js 发布元数据")>=0)){' - html[#html+1] = 'reasons.push("🧩 ARM64 musl Node.js 资产不可用 — 当前设备依赖仓库发布的 node-bins 资产,而不是通用 Node 镜像。
  💡 解决: 检查 hotwa/luci-app-openclawnode-bins release 是否存在满足 >=22.16.0linux-arm64-musl 资产,并确认路由器可访问 GitHub API 与 release 页面。");' + html[#html+1] = 'reasons.push("🧩 ARM64 musl Node.js 资产不可用 — 当前设备依赖仓库发布的 node-bins 资产,而不是通用 Node 镜像。
  💡 解决: 检查 10000ge10000/luci-app-openclawnode-bins release 是否存在满足 >=22.16.0linux-arm64-musl 资产,并确认路由器可访问 GitHub API 与 release 页面。");' html[#html+1] = '}' -- 通用网络问题 html[#html+1] = 'if((ll.indexOf("could not resolve")>=0||ll.indexOf("connection timed out")>=0||ll.indexOf("curl")>=0&&ll.indexOf("fail")>=0||ll.indexOf("wget")>=0&&ll.indexOf("fail")>=0||ll.indexOf("所有镜像均下载失败")>=0)&&!(ll.indexOf("arm64 musl")>=0&&(ll.indexOf("release api")>=0||ll.indexOf("node-bins")>=0||ll.indexOf("未找到兼容的 arm64 musl node.js 资产")>=0||ll.indexOf("无法获取 arm64 musl node.js 发布元数据")>=0))){' diff --git a/root/usr/bin/openclaw-env b/root/usr/bin/openclaw-env index aa688b9..416142b 100755 --- a/root/usr/bin/openclaw-env +++ b/root/usr/bin/openclaw-env @@ -55,12 +55,13 @@ PNPM_BIN="${OC_GLOBAL}/bin/pnpm" # Node.js 下载源 OPENCLAW_GITHUB_REPO="${OPENCLAW_GITHUB_REPO:-hotwa/luci-app-openclaw}" +OPENCLAW_NODE_BINS_REPO="${OPENCLAW_NODE_BINS_REPO:-10000ge10000/luci-app-openclaw}" NODE_MIRROR="${NODE_MIRROR:-https://nodejs.org/dist}" NODE_MIRROR_CN="https://npmmirror.com/mirrors/node" NODE_MUSL_MIRROR="https://unofficial-builds.nodejs.org/download/release" -NODE_SELF_HOST="${NODE_SELF_HOST:-https://github.com/${OPENCLAW_GITHUB_REPO}/releases/download/node-bins}" -NODE_RELEASE_API="${NODE_RELEASE_API:-https://api.github.com/repos/${OPENCLAW_GITHUB_REPO}/releases/tags/node-bins}" -NODE_RELEASE_PAGE="${NODE_RELEASE_PAGE:-https://github.com/${OPENCLAW_GITHUB_REPO}/releases/tag/node-bins}" +NODE_SELF_HOST="${NODE_SELF_HOST:-https://github.com/${OPENCLAW_NODE_BINS_REPO}/releases/download/node-bins}" +NODE_RELEASE_API="${NODE_RELEASE_API:-https://api.github.com/repos/${OPENCLAW_NODE_BINS_REPO}/releases/tags/node-bins}" +NODE_RELEASE_PAGE="${NODE_RELEASE_PAGE:-https://github.com/${OPENCLAW_NODE_BINS_REPO}/releases/tag/node-bins}" export PATH="${NODE_BASE}/bin:${OC_GLOBAL}/bin:$PATH" export NODE_ICU_DATA="${NODE_BASE}/share/icu" @@ -86,7 +87,7 @@ resolve_arm64_musl_node_url() { if ! download_url_to_file "$NODE_RELEASE_API" "$release_json"; then rm -f "$release_json" log_error "无法获取 ARM64 musl Node.js 发布元数据" >&2 - echo " 仓库: ${OPENCLAW_GITHUB_REPO}" >&2 + echo " 仓库: ${OPENCLAW_NODE_BINS_REPO}" >&2 echo " 最低要求: v${node_ver}" >&2 echo " Release API: ${NODE_RELEASE_API}" >&2 echo " Release 页面: ${NODE_RELEASE_PAGE}" >&2 @@ -103,7 +104,7 @@ resolve_arm64_musl_node_url() { fi log_error "未找到兼容的 ARM64 musl Node.js 资产" >&2 - echo " 仓库: ${OPENCLAW_GITHUB_REPO}" >&2 + echo " 仓库: ${OPENCLAW_NODE_BINS_REPO}" >&2 echo " 最低要求: v${node_ver}" >&2 echo " Release API: ${NODE_RELEASE_API}" >&2 echo " Release 页面: ${NODE_RELEASE_PAGE}" >&2 diff --git a/tests/test_node_packaging_contract.sh b/tests/test_node_packaging_contract.sh index b5f21b4..9c4ab54 100644 --- a/tests/test_node_packaging_contract.sh +++ b/tests/test_node_packaging_contract.sh @@ -31,9 +31,10 @@ grep -Fq 'oc_node_version_ge "$installed_ver" "$node_ver"' "$ENV_SCRIPT" || fail if grep -Fq 'mirror_list="$mirror_list ${NODE_SELF_HOST}/${v1_tarball}"' "$ENV_SCRIPT"; then fail "installer should not auto-fallback from V2 to V1 tarball" fi -grep -Fq 'OPENCLAW_GITHUB_REPO="${OPENCLAW_GITHUB_REPO:-hotwa/luci-app-openclaw}"' "$ENV_SCRIPT" || fail "installer should default to hotwa repo" -grep -Fq 'NODE_SELF_HOST="${NODE_SELF_HOST:-https://github.com/${OPENCLAW_GITHUB_REPO}/releases/download/node-bins}"' "$ENV_SCRIPT" || fail "installer should derive node-bins release URL from hotwa repo" -grep -Fq 'NODE_RELEASE_API="${NODE_RELEASE_API:-https://api.github.com/repos/${OPENCLAW_GITHUB_REPO}/releases/tags/node-bins}"' "$ENV_SCRIPT" || fail "installer should derive node-bins release API from hotwa repo" +grep -Fq 'OPENCLAW_GITHUB_REPO="${OPENCLAW_GITHUB_REPO:-hotwa/luci-app-openclaw}"' "$ENV_SCRIPT" || fail "installer should keep hotwa as primary app repo" +grep -Fq 'OPENCLAW_NODE_BINS_REPO="${OPENCLAW_NODE_BINS_REPO:-10000ge10000/luci-app-openclaw}"' "$ENV_SCRIPT" || fail "installer should default ARM64 musl node-bins to 10000ge10000 repo" +grep -Fq 'NODE_SELF_HOST="${NODE_SELF_HOST:-https://github.com/${OPENCLAW_NODE_BINS_REPO}/releases/download/node-bins}"' "$ENV_SCRIPT" || fail "installer should derive node-bins release URL from 10000ge10000 repo" +grep -Fq 'NODE_RELEASE_API="${NODE_RELEASE_API:-https://api.github.com/repos/${OPENCLAW_NODE_BINS_REPO}/releases/tags/node-bins}"' "$ENV_SCRIPT" || fail "installer should derive node-bins release API from 10000ge10000 repo" grep -Fq 'oc_select_node_release_asset_url' "$ENV_SCRIPT" || fail "installer should dynamically select ARM64 musl asset" grep -Fq 'arm64_musl_url=$(resolve_arm64_musl_node_url "$node_ver") || exit 1' "$ENV_SCRIPT" || fail "installer should resolve ARM64 musl asset dynamically" if grep -Fq 'mirror_list="${NODE_SELF_HOST}/${musl_tarball}"' "$ENV_SCRIPT"; then @@ -58,6 +59,7 @@ grep -Fq 'local GITHUB_RELEASES_URL = "https://github.com/" .. GITHUB_REPO .. "/ grep -Fq 'local GITHUB_API_RELEASES_URL = "https://api.github.com/repos/" .. GITHUB_REPO .. "/releases"' "$CONTROLLER_SCRIPT" || fail "controller should derive API URLs from hotwa repo" grep -Fq "https://github.com/hotwa/luci-app-openclaw/releases/latest" "$BASIC_LUA" || fail "UI should link manual download to hotwa repo" grep -Fq "ARM64 musl" "$BASIC_LUA" || fail "UI should mention ARM64 musl specific guidance" +grep -Fq "10000ge10000/luci-app-openclaw" "$BASIC_LUA" || fail "UI should point ARM64 musl guidance at the live node-bins repo" if grep -Fq 'NODE_MIRROR=https://npmmirror.com/mirrors/node openclaw-env setup' "$BASIC_LUA"; then fail "UI should not recommend NODE_MIRROR for ARM64 musl node download failures" fi diff --git a/tests/test_openclaw_node.sh b/tests/test_openclaw_node.sh index 0c4f8c9..60dd77f 100644 --- a/tests/test_openclaw_node.sh +++ b/tests/test_openclaw_node.sh @@ -57,11 +57,11 @@ cat > "$tmpdir/node-bins-release.json" <<'EOF' "assets": [ { "name": "node-v22.15.1-linux-arm64-musl.tar.xz", - "browser_download_url": "https://github.com/hotwa/luci-app-openclaw/releases/download/node-bins/node-v22.15.1-linux-arm64-musl.tar.xz" + "browser_download_url": "https://github.com/10000ge10000/luci-app-openclaw/releases/download/node-bins/node-v22.15.1-linux-arm64-musl.tar.xz" }, { "name": "node-v23.2.0-linux-arm64-musl.tar.xz", - "browser_download_url": "https://github.com/hotwa/luci-app-openclaw/releases/download/node-bins/node-v23.2.0-linux-arm64-musl.tar.xz" + "browser_download_url": "https://github.com/10000ge10000/luci-app-openclaw/releases/download/node-bins/node-v23.2.0-linux-arm64-musl.tar.xz" }, { "name": "node-v22.16.0-linux-x64-musl.tar.xz", @@ -72,7 +72,7 @@ cat > "$tmpdir/node-bins-release.json" <<'EOF' EOF selected_url=$(oc_select_node_release_asset_url "$tmpdir/node-bins-release.json" "linux-arm64" "22.16.0") || fail "select compatible ARM64 musl asset" -[ "$selected_url" = "https://github.com/hotwa/luci-app-openclaw/releases/download/node-bins/node-v23.2.0-linux-arm64-musl.tar.xz" ] || fail "selected asset should be newest compatible ARM64 musl release" +[ "$selected_url" = "https://github.com/10000ge10000/luci-app-openclaw/releases/download/node-bins/node-v23.2.0-linux-arm64-musl.tar.xz" ] || fail "selected asset should be newest compatible ARM64 musl release" if oc_select_node_release_asset_url "$tmpdir/node-bins-release.json" "linux-arm64" "24.0.0" >/dev/null 2>&1; then fail "asset selection should fail when no compatible version exists"