mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-09-14 04:15:06 +08:00
🎈 Sync 2026-06-08 16:57:14
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
||||
REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
CONSOLE_VIEW="$REPO_ROOT/luasrc/view/openclaw/console.htm"
|
||||
|
||||
fail() {
|
||||
echo "FAIL: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -Fq "var url = 'http://' + host + ':' + gwPort + '/'" "$CONSOLE_VIEW" || fail "console view should force HTTP gateway URL"
|
||||
grep -Fq '请点击上方「新窗口打开」访问控制台。' "$CONSOLE_VIEW" || fail "console view should direct users to a new window"
|
||||
|
||||
if grep -Fq "document.createElement('iframe')" "$CONSOLE_VIEW"; then
|
||||
fail "console view should not embed the OpenClaw UI in an iframe"
|
||||
fi
|
||||
|
||||
if grep -Fq 'window.location.protocol' "$CONSOLE_VIEW"; then
|
||||
fail "console view should not reuse the LuCI page protocol for the gateway URL"
|
||||
fi
|
||||
|
||||
cr=$(printf '\r')
|
||||
if LC_ALL=C grep -q "$cr" "$CONSOLE_VIEW"; then
|
||||
fail "console view should use LF line endings"
|
||||
fi
|
||||
|
||||
echo "ok"
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
||||
REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
BUILD_SCRIPT="$REPO_ROOT/scripts/build-node-musl.sh"
|
||||
WORKFLOW="$REPO_ROOT/.github/workflows/build-node-musl.yml"
|
||||
ENV_SCRIPT="$REPO_ROOT/root/usr/bin/openclaw-env"
|
||||
|
||||
fail() {
|
||||
echo "FAIL: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -Fq 'patchelf --set-interpreter "/lib/ld-musl-aarch64.so.1"' "$BUILD_SCRIPT" || fail "build script should use system musl loader"
|
||||
grep -Fq '$ORIGIN/../lib' "$BUILD_SCRIPT" || fail "build script should use relative rpath"
|
||||
if grep -Fq 'patchelf --set-interpreter "${INSTALL_PREFIX}/lib/ld-musl-aarch64.so.1"' "$BUILD_SCRIPT"; then
|
||||
fail "build script should not hardcode interpreter to install prefix"
|
||||
fi
|
||||
|
||||
grep -Fq 'verify_prefix /opt/openclaw/node' "$BUILD_SCRIPT" || fail "build script should verify default install path"
|
||||
grep -Fq 'verify_prefix /tmp/custom-openclaw-root/openclaw/node' "$BUILD_SCRIPT" || fail "build script should verify custom install path"
|
||||
grep -Fq 'NODE_VER="24.15.0"' "$WORKFLOW" || fail "workflow should build current Node.js"
|
||||
grep -Fq 'BUILD_MODE=cross' "$WORKFLOW" || fail "workflow should use cross mode for current ARM64 musl package"
|
||||
|
||||
grep -Fq 'oc_node_version_ge "$current_ver" "$node_ver"' "$ENV_SCRIPT" || fail "installer should require installed Node.js to satisfy target version"
|
||||
if grep -Fq 'v1_tarball' "$ENV_SCRIPT"; then
|
||||
fail "installer should not auto-fallback from current Node.js to legacy tarball"
|
||||
fi
|
||||
|
||||
echo "ok"
|
||||
@@ -6,8 +6,14 @@ fail() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -q "OC_TESTED_VERSION=\"2026.5.12\"" root/usr/bin/openclaw-env || fail "tested OpenClaw version not pinned"
|
||||
grep -q "OC_TESTED_VERSION=\"2026.6.1\"" root/usr/bin/openclaw-env || fail "tested OpenClaw version not pinned"
|
||||
grep -q "NODE_VERSION_V2=\"24.15.0\"" root/usr/bin/openclaw-env || fail "default Node.js version not pinned"
|
||||
grep -q "OC_NODE_MIN_VERSION=\"\${OC_NODE_MIN_VERSION:-22.19.0}\"" root/usr/bin/openclaw-env || fail "minimum Node.js version not pinned"
|
||||
grep -q "oc_assert_node_min_version" root/usr/bin/openclaw-env || fail "Node.js minimum version check missing"
|
||||
grep -q 'oc_node_version_ge "$from_pkg" "$required"' root/usr/bin/openclaw-env || fail "package Node.js requirement must not lower static minimum"
|
||||
if grep -q 'v1_tarball' root/usr/bin/openclaw-env; then
|
||||
fail "installer must not silently fall back to legacy Node.js tarball"
|
||||
fi
|
||||
|
||||
grep -q "wechat.htm" Makefile || fail "Makefile must install wechat.htm"
|
||||
grep -q "luci-app-openclaw.json" Makefile || fail "Makefile must install rpcd ACL"
|
||||
@@ -31,9 +37,18 @@ grep -q "command -v python3" luasrc/controller/openclaw.lua || fail "wechat inst
|
||||
grep -q "ensure_openclaw_user" luasrc/controller/openclaw.lua || fail "wechat install must ensure openclaw user"
|
||||
grep -q "NPM_CONFIG_CACHE" luasrc/controller/openclaw.lua || fail "wechat install must set npm cache"
|
||||
grep -q "openclaw-weixin" root/etc/init.d/openclaw || fail "weixin channel migration missing"
|
||||
grep -q "delete d.plugins.entries\\['openclaw-weixin'\\]" root/etc/init.d/openclaw || fail "weixin duplicate entries cleanup missing"
|
||||
grep -q "npm/projects" root/etc/init.d/openclaw || fail "npm plugin project ownership fix missing"
|
||||
grep -q "! -path.*npm/projects" root/etc/init.d/openclaw || fail "npm plugin projects should be excluded from openclaw ownership reset"
|
||||
grep -q "archived-extensions" root/etc/init.d/openclaw || fail "legacy weixin extension archive missing"
|
||||
grep -q "find_wechat_plugin_dir" luasrc/controller/openclaw.lua || fail "wechat npm plugin detection missing"
|
||||
grep -q "@tencent-weixin/openclaw-weixin/openclaw.plugin.json" root/usr/share/openclaw/oc-config.sh || fail "oc-config wechat npm detection missing"
|
||||
|
||||
grep -q "var url = 'http://'" luasrc/view/openclaw/console.htm || fail "console must force HTTP gateway URL"
|
||||
grep -q "existing.src" luasrc/view/openclaw/console.htm || fail "console iframe must refresh token URL"
|
||||
grep -q "新窗口打开" luasrc/view/openclaw/console.htm || fail "console must expose a new-window entry"
|
||||
if grep -q "document.createElement('iframe')" luasrc/view/openclaw/console.htm; then
|
||||
fail "console must not embed OpenClaw in an iframe"
|
||||
fi
|
||||
|
||||
grep -q "root/usr/libexec" scripts/build_ipk.sh || fail "ipk script must package shell helpers"
|
||||
grep -q "root/usr/libexec" scripts/build_run.sh || fail "run script must package shell helpers"
|
||||
|
||||
@@ -8,11 +8,11 @@ fail() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ "$(oc_normalize_node_version v22.16.0)" = "22.16.0" ] || fail "normalize v"
|
||||
oc_node_version_ge 22.16.0 22.16.0 || fail "exact version"
|
||||
oc_node_version_ge 22.16.1 22.16.0 || fail "patch version"
|
||||
oc_node_version_ge 23.0.0 22.16.0 || fail "major version"
|
||||
if oc_node_version_ge 22.15.1 22.16.0; then
|
||||
[ "$(oc_normalize_node_version v24.15.0)" = "24.15.0" ] || fail "normalize v"
|
||||
oc_node_version_ge 22.19.0 22.19.0 || fail "exact version"
|
||||
oc_node_version_ge 22.19.1 22.19.0 || fail "patch version"
|
||||
oc_node_version_ge 24.15.0 22.19.0 || fail "major version"
|
||||
if oc_node_version_ge 22.18.1 22.19.0; then
|
||||
fail "older minor accepted"
|
||||
fi
|
||||
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
||||
REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
|
||||
CONTROLLER="$REPO_ROOT/luasrc/controller/openclaw.lua"
|
||||
STATUS_VIEW="$REPO_ROOT/luasrc/view/openclaw/status.htm"
|
||||
INIT_SCRIPT="$REPO_ROOT/root/etc/init.d/openclaw"
|
||||
|
||||
fail() {
|
||||
echo "FAIL: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -Fq "ubus call service list" "$CONTROLLER" || fail "status API should inspect procd state via ubus"
|
||||
grep -Fq "openclaw.instances.gateway" "$CONTROLLER" || fail "status API should inspect gateway instance state"
|
||||
grep -Fq "gateway_failed" "$CONTROLLER" || fail "status API should report gateway failure state"
|
||||
grep -Fq "gateway_exit_code" "$CONTROLLER" || fail "status API should expose recent gateway exit code"
|
||||
|
||||
grep -Fq "启动失败" "$STATUS_VIEW" || fail "status panel should distinguish startup failure from startup in progress"
|
||||
grep -Fq "gateway_failed" "$STATUS_VIEW" || fail "status panel should render gateway failure state"
|
||||
|
||||
grep -Fq "ubus call service list" "$INIT_SCRIPT" || fail "status_service should inspect procd state via ubus"
|
||||
|
||||
echo "ok"
|
||||
Reference in New Issue
Block a user