From 969e3c00a7da9cc0c96ae876bba083e7fda9e3da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 4 Jul 2026 18:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Sync=202026-07-04=2018:41:29?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beszel-agent/Makefile | 16 +- beszel-agent/files/beszel-agent.config | 1 + beszel-agent/files/beszel-agent.init | 40 ++- luci-app-openclaw/CHANGELOG.md | 13 + luci-app-openclaw/Makefile | 2 +- luci-app-openclaw/README.md | 1 - luci-app-openclaw/VERSION | 2 +- .../luasrc/controller/openclaw.lua | 84 +++++++ luci-app-openclaw/scripts/sync_openlist.sh | 230 ------------------ luci-app-openclaw/scripts/upload_openlist.sh | 67 ----- .../tests/test_openclaw_contracts.sh | 5 + natflow/Makefile | 4 +- openwrt-alwaysonline/Makefile | 4 +- quectel_MHI/Makefile | 2 +- quickfile/Makefile | 2 +- quickfile/files/quickfile.locations | 6 +- 16 files changed, 143 insertions(+), 336 deletions(-) delete mode 100755 luci-app-openclaw/scripts/sync_openlist.sh delete mode 100755 luci-app-openclaw/scripts/upload_openlist.sh mode change 100755 => 100644 quectel_MHI/Makefile diff --git a/beszel-agent/Makefile b/beszel-agent/Makefile index 440f7ddb..23b877e6 100644 --- a/beszel-agent/Makefile +++ b/beszel-agent/Makefile @@ -2,21 +2,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=beszel-agent PKG_VERSION:=0.18.7 -PKG_RELEASE:=6 +PKG_RELEASE:=7 -ifeq ($(ARCH),aarch64) - PKG_ARCH:=arm64 -else ifeq ($(ARCH),x86_64) - PKG_ARCH:=amd64 -else ifeq ($(ARCH),mipsel) - PKG_ARCH:=mipsle -else ifeq ($(ARCH),powerpc64le) - PKG_ARCH:=ppc64le -else - PKG_ARCH:=$(ARCH) -endif - -PKG_SOURCE:=$(PKG_NAME)_linux_$(PKG_ARCH).tar.gz +PKG_SOURCE:=$(PKG_NAME)_linux_$(or $(BESZEL_GOARCH),arm64).tar.gz PKG_SOURCE_URL:=https://github.com/henrygd/beszel/releases/download/v$(PKG_VERSION)/ PKG_HASH:=skip diff --git a/beszel-agent/files/beszel-agent.config b/beszel-agent/files/beszel-agent.config index 4adb7a59..25716be2 100644 --- a/beszel-agent/files/beszel-agent.config +++ b/beszel-agent/files/beszel-agent.config @@ -5,4 +5,5 @@ config agent 'agent' option hub_url '' # optional, for outbound mode (websockets) option token '' # optional, for outbound mode (websockets) option extra_filesystems '' # optional, comma-separated, e.g. 'sda1__NAS' + option fingerprint '' # auto-populated on first start, do not edit diff --git a/beszel-agent/files/beszel-agent.init b/beszel-agent/files/beszel-agent.init index aa3fdaaf..adc597e8 100644 --- a/beszel-agent/files/beszel-agent.init +++ b/beszel-agent/files/beszel-agent.init @@ -5,9 +5,12 @@ STOP=10 USE_PROCD=1 PROG=/usr/bin/beszel-agent +DATA_DIR=/var/lib/beszel-agent +FP_FILE="$DATA_DIR/fingerprint" +OLD_FP_FILE=/usr/share/beszel-agent/fingerprint start_service() { - local enabled port key url token extra_fs + local enabled port key url token extra_fs fp config_load 'beszel-agent' config_get_bool enabled 'agent' 'enabled' '0' @@ -16,6 +19,7 @@ start_service() { config_get url 'agent' 'hub_url' '' config_get token 'agent' 'token' '' config_get extra_fs 'agent' 'extra_filesystems' '' + config_get fp 'agent' 'fingerprint' '' [ "$enabled" -eq 0 ] && return 0 @@ -31,7 +35,26 @@ start_service() { fi fi - mkdir -p /usr/share/beszel-agent + mkdir -p "$DATA_DIR" + + # migrate from pre-UCI storage on flash + [ -z "$fp" ] && [ -s "$OLD_FP_FILE" ] && fp=$(cat "$OLD_FP_FILE") + + if [ -z "$fp" ]; then + DATA_DIR="$DATA_DIR" "$PROG" fingerprint > /dev/null 2>&1 + [ -s "$FP_FILE" ] && fp=$(cat "$FP_FILE") + fi + + if [ -n "$fp" ]; then + printf '%s' "$fp" > "$FP_FILE" + [ "$(uci -q get beszel-agent.agent.fingerprint)" = "$fp" ] || { + uci set beszel-agent.agent.fingerprint="$fp" + uci commit beszel-agent + logger -t beszel-agent "Fingerprint saved to UCI: $fp" + } + else + logger -t beszel-agent "Failed to obtain fingerprint, agent will generate one" + fi procd_open_instance beszel-agent procd_set_param command "$PROG" -listen "$port" -key "$key" @@ -39,23 +62,14 @@ start_service() { procd_append_param command -url "$url" -token "$token" } - procd_set_param env DATA_DIR=/usr/share/beszel-agent + procd_set_param env DATA_DIR="$DATA_DIR" [ -n "$extra_fs" ] && procd_append_param env EXTRA_FILESYSTEMS="$extra_fs" procd_set_param respawn 3600 5 5 procd_set_param stdout 1 procd_set_param stderr 1 - procd_set_param user root procd_close_instance } -stop_service() { - service_stop "$PROG" -} - -reload_service() { - restart -} - service_triggers() { - procd_add_reload_trigger "beszel-agent" + procd_add_reload_trigger 'beszel-agent' } diff --git a/luci-app-openclaw/CHANGELOG.md b/luci-app-openclaw/CHANGELOG.md index 5a500540..fb82e215 100644 --- a/luci-app-openclaw/CHANGELOG.md +++ b/luci-app-openclaw/CHANGELOG.md @@ -4,6 +4,19 @@ 格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/)。 +## [2.0.9] - 2026-07-04 + +### 修复微信 npm 插件注册 + +- 微信插件安装和升级成功后,自动把 npm 安装目录注册到 OpenClaw 配置的 `plugins.installs.openclaw-weixin`。 +- 同步确保 `plugins.allow` 包含 `openclaw-weixin`,并启用 `channels.openclaw-weixin.enabled`,避免登录时再次提示安装插件。 + +### 测试 + +- 增加微信 npm 插件安装后配置注册的契约断言。 + +--- + ## [2.0.8] - 2026-07-04 ### 修复 ARM64 Node.js 下载资产不一致 diff --git a/luci-app-openclaw/Makefile b/luci-app-openclaw/Makefile index 7a36e2a4..31f33080 100644 --- a/luci-app-openclaw/Makefile +++ b/luci-app-openclaw/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclaw PKG_VERSION:=$(strip $(shell cat $(CURDIR)/VERSION 2>/dev/null || echo "1.0.0")) -PKG_RELEASE:=18 +PKG_RELEASE:=19 PKG_MAINTAINER:=10000ge10000 <10000ge10000@users.noreply.github.com> PKG_LICENSE:=GPL-3.0 diff --git a/luci-app-openclaw/README.md b/luci-app-openclaw/README.md index 039039e3..5d837e6f 100644 --- a/luci-app-openclaw/README.md +++ b/luci-app-openclaw/README.md @@ -154,7 +154,6 @@ luci-app-openclaw/ │ ├── build_ipk.sh # 本地 IPK 构建 │ ├── build_run.sh # .run 安装包构建 │ ├── download_deps.sh # 下载离线依赖 (Node.js + OpenClaw) -│ ├── upload_openlist.sh # 上传到网盘 (OpenList) │ └── build-node-musl.sh # 编译 Node.js musl 静态链接版本 └── .github/workflows/ ├── build.yml # 在线构建 + 发布 diff --git a/luci-app-openclaw/VERSION b/luci-app-openclaw/VERSION index 815e68dd..09843e3b 100644 --- a/luci-app-openclaw/VERSION +++ b/luci-app-openclaw/VERSION @@ -1 +1 @@ -2.0.8 +2.0.9 diff --git a/luci-app-openclaw/luasrc/controller/openclaw.lua b/luci-app-openclaw/luasrc/controller/openclaw.lua index 7419aa6a..2ed75a0e 100644 --- a/luci-app-openclaw/luasrc/controller/openclaw.lua +++ b/luci-app-openclaw/luasrc/controller/openclaw.lua @@ -86,6 +86,88 @@ local function find_wechat_plugin_dir(install_path) return nil end +local function wechat_register_plugin_cmd(install_path, node_bin, log_file) + local oc_data = install_path .. "/data" + local config_file = oc_data .. "/.openclaw/openclaw.json" + local npm_projects = oc_data .. "/.openclaw/npm/projects" + local legacy_ext_dir = oc_data .. "/.openclaw/extensions/openclaw-weixin" + local register_js = [[ +const fs = require('fs'); +const path = require('path'); +const configPath = process.env.OC_CONFIG; +const npmProjects = process.env.OC_NPM_PROJECTS; +const legacyDir = process.env.OC_LEGACY_WECHAT_DIR; +const candidates = []; +function addPluginDir(dir) { + if (!dir) return; + const pluginJson = path.join(dir, 'openclaw.plugin.json'); + try { + const st = fs.statSync(pluginJson); + if (st.isFile()) candidates.push({ dir, mtime: st.mtimeMs }); + } catch (e) {} +} +function walk(dir) { + let entries = []; + try { + entries = fs.readdirSync(dir, { withFileTypes: true }); + } catch (e) { + return; + } + for (const entry of entries) { + if (!entry.isDirectory()) continue; + const full = path.join(dir, entry.name); + if (full.endsWith(path.join('node_modules', '@tencent-weixin', 'openclaw-weixin'))) { + addPluginDir(full); + continue; + } + walk(full); + } +} +addPluginDir(legacyDir); +walk(npmProjects); +candidates.sort((a, b) => b.mtime - a.mtime); +if (!candidates.length) { + console.error('openclaw-weixin plugin directory not found'); + process.exit(2); +} +let d = {}; +try { + d = JSON.parse(fs.readFileSync(configPath, 'utf8')); +} catch (e) { + d = {}; +} +if (!d.plugins || typeof d.plugins !== 'object') d.plugins = {}; +if (!d.plugins.installs || typeof d.plugins.installs !== 'object') d.plugins.installs = {}; +if (!Array.isArray(d.plugins.allow)) d.plugins.allow = []; +d.plugins.installs['openclaw-weixin'] = { + kind: 'npm', + installPath: candidates[0].dir, + packageName: '@tencent-weixin/openclaw-weixin' +}; +if (!d.plugins.allow.includes('openclaw-weixin')) d.plugins.allow.push('openclaw-weixin'); +if (!d.channels || typeof d.channels !== 'object') d.channels = {}; +if (!d.channels['openclaw-weixin'] || typeof d.channels['openclaw-weixin'] !== 'object') { + d.channels['openclaw-weixin'] = {}; +} +d.channels['openclaw-weixin'].enabled = true; +fs.mkdirSync(path.dirname(configPath), { recursive: true }); +fs.writeFileSync(configPath, JSON.stringify(d, null, 2) + '\n'); +]] + return "if [ $RC -eq 0 ]; then " .. + "if [ -x " .. shellquote(node_bin) .. " ]; then " .. + "OC_CONFIG=" .. shellquote(config_file) .. " " .. + "OC_NPM_PROJECTS=" .. shellquote(npm_projects) .. " " .. + "OC_LEGACY_WECHAT_DIR=" .. shellquote(legacy_ext_dir) .. " " .. + shellquote(node_bin) .. " -e " .. shellquote(register_js) .. " >> " .. shellquote(log_file) .. " 2>&1; " .. + "REG_RC=$?; " .. + "if [ $REG_RC -eq 0 ]; then " .. + "chown openclaw:openclaw " .. shellquote(config_file) .. " 2>/dev/null; " .. + "echo 'Registered openclaw-weixin npm plugin in OpenClaw config.' >> " .. shellquote(log_file) .. "; " .. + "else RC=$REG_RC; echo $RC > /tmp/openclaw-wechat-install.exit; echo 'Failed to register openclaw-weixin npm plugin in OpenClaw config.' >> " .. shellquote(log_file) .. "; fi; " .. + "else RC=127; echo $RC > /tmp/openclaw-wechat-install.exit; echo 'Node.js not found, cannot register openclaw-weixin plugin.' >> " .. shellquote(log_file) .. "; fi; " .. + "fi; " +end + local function write_wechat_log_and_exit(log_file, exit_file, content, exit_code) local f = io.open(log_file, "w") if f then @@ -1370,6 +1452,7 @@ function action_wechat_install() "PATH=%s/node/bin:%s/global/bin:$PATH " .. "%s -y @tencent-weixin/openclaw-weixin-cli install' >> /tmp/openclaw-wechat-install.log 2>&1; " .. "RC=$?; echo $RC > /tmp/openclaw-wechat-install.exit; " .. + wechat_register_plugin_cmd(install_path, node_bin, "/tmp/openclaw-wechat-install.log") .. -- 关键修复: 安装完成后强制修复插件目录权限 (确保 Gateway 可读取插件) -- 原因: npx/npm 以 root 身份创建目录,默认权限 700 导致其他用户无法读取 -- 注意: 保持 root:root 属主 (OpenClaw v2026.4.9+ 安全要求),仅修复权限模式 @@ -1781,6 +1864,7 @@ function action_wechat_upgrade_plugin() "PATH=%s/node/bin:%s/global/bin:$PATH " .. "%s -y @tencent-weixin/openclaw-weixin-cli install' >> /tmp/openclaw-wechat-install.log 2>&1; " .. "RC=$?; echo $RC > /tmp/openclaw-wechat-install.exit; " .. + wechat_register_plugin_cmd(install_path, node_bin, "/tmp/openclaw-wechat-install.log") .. -- 关键修复: 升级完成后强制修复插件目录权限 (确保 Gateway 可读取插件) -- 注意: 保持 root:root 属主 (OpenClaw v2026.4.9+ 安全要求),仅修复权限模式 "chown -R root:root %s 2>/dev/null; chmod -R 755 %s 2>/dev/null; " .. diff --git a/luci-app-openclaw/scripts/sync_openlist.sh b/luci-app-openclaw/scripts/sync_openlist.sh deleted file mode 100755 index bc988949..00000000 --- a/luci-app-openclaw/scripts/sync_openlist.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/sh -# ============================================================================ -# OpenList 网盘同步脚本 — 补齐所有历史版本 + 上传更新记录 -# -# 功能: -# 1. 从 GitHub Releases 下载所有版本的 .run + .ipk -# 2. 从 CHANGELOG.md 提取每个版本的更新记录,生成 更新记录.txt -# 3. 上传到 OpenList 网盘的 openclaw-在线安装 目录 -# -# 用法: -# sh scripts/sync_openlist.sh -# ============================================================================ -set -e - -SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) -PKG_DIR=$(cd "$SCRIPT_DIR/.." && pwd) - -# ── 配置 ── -GITHUB_REPO="10000ge10000/luci-app-openclaw" -OPENLIST_URL="http://124.243.178.237:15244" -OPENLIST_USER="admin" -OPENLIST_PASS="mingmenmama" -OPENLIST_ROOT="/Quark" -UPLOAD_SUBDIR="openclaw-在线安装" -CHANGELOG="$PKG_DIR/CHANGELOG.md" -WORK_DIR="/tmp/openlist-sync" - -# 所有已发布的版本 (按时间顺序) -ALL_VERSIONS="1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.0.10 1.0.11 1.0.12 1.0.14 1.0.15" - -log_info() { printf " [\033[32m✓\033[0m] %s\n" "$1"; } -log_warn() { printf " [\033[33m!\033[0m] %s\n" "$1"; } -log_error() { printf " [\033[31m✗\033[0m] %s\n" "$1"; } -log_skip() { printf " [\033[36m-\033[0m] %s\n" "$1"; } - -# ── 获取 Token ── -get_token() { - local resp - resp=$(curl -s -X POST "${OPENLIST_URL}/api/auth/login" \ - -H "Content-Type: application/json" \ - -d "{\"username\":\"${OPENLIST_USER}\",\"password\":\"${OPENLIST_PASS}\"}") - - local token - token=$(echo "$resp" | grep -o '"token":"[^"]*"' | sed 's/"token":"//;s/"//') - - if [ -z "$token" ]; then - log_error "OpenList 登录失败" - echo " 响应: $resp" - exit 1 - fi - echo "$token" -} - -# ── 创建远程目录 ── -create_remote_dir() { - local token="$1" - local remote_path="$2" - curl -s -X POST "${OPENLIST_URL}/api/fs/mkdir" \ - -H "Authorization: ${token}" \ - -H "Content-Type: application/json" \ - -d "{\"path\":\"${remote_path}\"}" >/dev/null 2>&1 || true -} - -# ── 检查远程文件是否存在 ── -remote_file_exists() { - local token="$1" - local remote_path="$2" - local filename="$3" - - local resp - resp=$(curl -s -X POST "${OPENLIST_URL}/api/fs/list" \ - -H "Authorization: ${token}" \ - -H "Content-Type: application/json" \ - -d "{\"path\":\"${remote_path}\",\"refresh\":false}") - - echo "$resp" | grep -q "\"name\":\"${filename}\"" -} - -# ── 上传单个文件 ── -upload_file() { - local token="$1" - local local_file="$2" - local remote_path="$3" - local filename=$(basename "$local_file") - local fsize=$(du -h "$local_file" | cut -f1) - - local resp - resp=$(curl -s -X PUT "${OPENLIST_URL}/api/fs/put" \ - -H "Authorization: ${token}" \ - -H "File-Path: ${remote_path}/${filename}" \ - -H "Content-Type: application/octet-stream" \ - --data-binary "@${local_file}" \ - --max-time 300 2>/dev/null) - - local code="" - code=$(echo "$resp" | grep -o '"code":[0-9]*' | grep -o '[0-9]*') - - if [ "$code" = "200" ]; then - log_info "${filename} (${fsize}) 上传成功" - else - log_error "${filename} 上传失败: $resp" - fi -} - -# ── 从 CHANGELOG.md 提取指定版本的更新日志 ── -extract_changelog() { - local version="$1" - local output_file="$2" - - awk "/^## \\[${version}\\]/{found=1; next} /^## \\[/{if(found) exit} found{print}" \ - "$CHANGELOG" > "$output_file" - - # 去掉首尾空行 - sed -i '/./,$!d' "$output_file" # 去掉开头空行 - sed -i ':a; /^[[:space:]]*$/{ $d; N; ba }' "$output_file" # 去掉末尾空行 (GNU sed) - - if [ ! -s "$output_file" ]; then - echo "暂无更新日志" > "$output_file" - fi -} - -# ── 从 GitHub 下载文件 ── -download_release_file() { - local version="$1" - local filename="$2" - local output="$3" - - local url="https://github.com/${GITHUB_REPO}/releases/download/v${version}/${filename}" - - if [ -f "$output" ]; then - log_skip "${filename} 已在本地缓存" - return 0 - fi - - if curl -sL --fail -o "$output" "$url" 2>/dev/null; then - # 检查是否为有效文件 (排除 GitHub 返回 Not Found HTML) - local size=$(wc -c < "$output") - if [ "$size" -lt 1000 ]; then - local content=$(cat "$output") - if echo "$content" | grep -qi "not found"; then - rm -f "$output" - return 1 - fi - fi - return 0 - else - rm -f "$output" - return 1 - fi -} - -# ══════════════════════════════════════════════════════════════ -# 主流程 -# ══════════════════════════════════════════════════════════════ - -echo "" -echo "================================================================" -echo " OpenList 网盘同步 — 补齐所有历史版本" -echo "================================================================" -echo "" - -# 准备工作目录 -rm -rf "$WORK_DIR" -mkdir -p "$WORK_DIR" - -# 登录 -echo "正在登录 OpenList..." -TOKEN=$(get_token) -log_info "登录成功" -echo "" - -TOTAL_UPLOADED=0 - -for VER in $ALL_VERSIONS; do - echo "── v${VER} ──────────────────────────────────────" - REMOTE_DIR="${OPENLIST_ROOT}/${UPLOAD_SUBDIR}/v${VER}" - VER_DIR="${WORK_DIR}/v${VER}" - mkdir -p "$VER_DIR" - - # 创建远程目录 - create_remote_dir "$TOKEN" "$REMOTE_DIR" - - # 1) 下载 .run - RUN_FILE="luci-app-openclaw_${VER}.run" - if remote_file_exists "$TOKEN" "$REMOTE_DIR" "$RUN_FILE"; then - log_skip "${RUN_FILE} 已存在于网盘" - else - echo " 下载 ${RUN_FILE}..." - if download_release_file "$VER" "$RUN_FILE" "${VER_DIR}/${RUN_FILE}"; then - upload_file "$TOKEN" "${VER_DIR}/${RUN_FILE}" "$REMOTE_DIR" - TOTAL_UPLOADED=$((TOTAL_UPLOADED + 1)) - else - log_error "${RUN_FILE} 下载失败" - fi - fi - - # 2) 下载 .ipk - IPK_FILE="luci-app-openclaw_${VER}-1_all.ipk" - if remote_file_exists "$TOKEN" "$REMOTE_DIR" "$IPK_FILE"; then - log_skip "${IPK_FILE} 已存在于网盘" - else - echo " 下载 ${IPK_FILE}..." - if download_release_file "$VER" "$IPK_FILE" "${VER_DIR}/${IPK_FILE}"; then - upload_file "$TOKEN" "${VER_DIR}/${IPK_FILE}" "$REMOTE_DIR" - TOTAL_UPLOADED=$((TOTAL_UPLOADED + 1)) - else - log_error "${IPK_FILE} 下载失败" - fi - fi - - # 3) 生成并上传 更新记录.txt - CHANGELOG_FILE="更新记录.txt" - if remote_file_exists "$TOKEN" "$REMOTE_DIR" "$CHANGELOG_FILE"; then - log_skip "${CHANGELOG_FILE} 已存在于网盘" - else - extract_changelog "$VER" "${VER_DIR}/${CHANGELOG_FILE}" - upload_file "$TOKEN" "${VER_DIR}/${CHANGELOG_FILE}" "$REMOTE_DIR" - TOTAL_UPLOADED=$((TOTAL_UPLOADED + 1)) - fi - - echo "" -done - -# 清理 -rm -rf "$WORK_DIR" - -echo "================================================================" -echo " 同步完成!共上传 ${TOTAL_UPLOADED} 个文件" -echo "================================================================" -echo "" diff --git a/luci-app-openclaw/scripts/upload_openlist.sh b/luci-app-openclaw/scripts/upload_openlist.sh deleted file mode 100755 index 270d782b..00000000 --- a/luci-app-openclaw/scripts/upload_openlist.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -set -e - -SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) -PKG_DIR=$(cd "$SCRIPT_DIR/.." && pwd) -DIST_DIR="${1:-$PKG_DIR/dist}" - -if [ -z "$OPENLIST_URL" ]; then -echo "错误: 请设置 OPENLIST_URL 环境变量" -exit 1 -fi - -if [ -z "$OPENLIST_TOKEN" ] && { [ -z "$OPENLIST_USER" ] || [ -z "$OPENLIST_PASS" ]; }; then -echo "错误: 请设置登录凭据" -exit 1 -fi - -UPLOAD_ROOT="${OPENLIST_PATH:-/}" -PKG_VERSION=$(cat "$PKG_DIR/VERSION" 2>/dev/null | tr -d '[:space:]' || echo "unknown") -UPLOAD_ROOT="${UPLOAD_ROOT%/}" -UPLOAD_SUBDIR="openclaw-在线安装" -OPENLIST_URL="${OPENLIST_URL%/}" - -get_token() { -if [ -n "$OPENLIST_TOKEN" ]; then echo "$OPENLIST_TOKEN"; return; fi -local resp=$(curl -s -X POST "${OPENLIST_URL}/api/auth/login" \ --H "Content-Type: application/json" \ --d "{\"username\":\"${OPENLIST_USER}\",\"password\":\"${OPENLIST_PASS}\"}") -local token=$(echo "$resp" | grep -o '"token":"[^"]*"' | sed 's/"token":"//;s/"//' | head -n 1) -if [ -z "$token" ]; then exit 1; fi -echo "$token" -} - -create_remote_dir() { -curl -s -X POST "${OPENLIST_URL}/api/fs/mkdir" \ --H "Authorization: ${1}" \ --H "Content-Type: application/json" \ --d "{\"path\":\"${2}\"}" >/dev/null 2>&1 || true -} - -upload_file() { -local filename=$(basename "$2") -echo " 上传: ${filename} ..." -local resp=$(curl -s -X PUT "${OPENLIST_URL}/api/fs/put" \ --H "Authorization: ${1}" \ --H "File-Path: ${3}/${filename}" \ --H "Content-Type: application/octet-stream" \ ---data-binary "@${2}" \ ---max-time 3600) -local code=$(echo "$resp" | grep -o '"code":[0-9]*' | grep -o '[0-9]*' | head -n 1) -if [ "$code" = "200" ]; then echo " [✓] 上传成功"; else echo " [✗] 失败: $resp"; fi -} - -UPLOAD_FILES=$(find "$DIST_DIR" -type f -name "*.run" -o -name "*.ipk" 2>/dev/null) -if [ -z "$UPLOAD_FILES" ]; then echo "错误: 未找到可上传文件"; exit 1; fi - -TOKEN=$(get_token) -REMOTE_DIR="${UPLOAD_ROOT}/${UPLOAD_SUBDIR}/v${PKG_VERSION}" -REMOTE_DIR=$(echo "$REMOTE_DIR" | sed 's#^//#/#g') - -echo "创建远程目录: ${REMOTE_DIR}" -create_remote_dir "$TOKEN" "$REMOTE_DIR" - -for f in $UPLOAD_FILES; do -upload_file "$TOKEN" "$f" "$REMOTE_DIR" -done -echo "✅ 上传完成!" diff --git a/luci-app-openclaw/tests/test_openclaw_contracts.sh b/luci-app-openclaw/tests/test_openclaw_contracts.sh index 2135c5f1..c0e62712 100755 --- a/luci-app-openclaw/tests/test_openclaw_contracts.sh +++ b/luci-app-openclaw/tests/test_openclaw_contracts.sh @@ -45,6 +45,11 @@ grep -q "npm/projects" root/etc/init.d/openclaw || fail "npm plugin project owne 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 "wechat_register_plugin_cmd" luasrc/controller/openclaw.lua || fail "wechat install must register npm plugin config" +grep -q "plugins.installs\\['openclaw-weixin'\\]" luasrc/controller/openclaw.lua || fail "wechat plugin installPath registration missing" +grep -q "packageName: '@tencent-weixin/openclaw-weixin'" luasrc/controller/openclaw.lua || fail "wechat plugin packageName registration missing" +grep -q "channels\\['openclaw-weixin'\\].enabled = true" luasrc/controller/openclaw.lua || fail "wechat channel enable registration missing" +grep -q "Registered openclaw-weixin npm plugin" luasrc/controller/openclaw.lua || fail "wechat install log must confirm config registration" 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" diff --git a/natflow/Makefile b/natflow/Makefile index c73dc924..ee172b74 100644 --- a/natflow/Makefile +++ b/natflow/Makefile @@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=natflow PKG_VERSION:=20260531 -PKG_RELEASE:=32 +PKG_RELEASE:=33 PKG_SOURCE:=$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ptpt52/natflow.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=64c938edd2fb7def7eb3c7cfe4afdf0bc85ecfc4 +PKG_SOURCE_VERSION:=0a039fc3e686237efa6f89cd593731a039965b14 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_MAINTAINER:=Chen Minqiang PKG_LICENSE:=GPL-2.0 diff --git a/openwrt-alwaysonline/Makefile b/openwrt-alwaysonline/Makefile index 7c540b66..82cb429b 100644 --- a/openwrt-alwaysonline/Makefile +++ b/openwrt-alwaysonline/Makefile @@ -8,12 +8,12 @@ PKG_NAME:=alwaysonline PKG_UPSTREAM_VERSION:=1.2.1 PKG_UPSTREAM_GITHASH:=206292ca68e4d6c81b215163a7bbd0cd2eb36860 PKG_VERSION:=$(PKG_UPSTREAM_VERSION)~$(call version_abbrev,$(PKG_UPSTREAM_GITHASH)) -PKG_RELEASE:=7 +PKG_RELEASE:=8 UCI_VERSION:=0.2025.01.25 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/Jamesits/alwaysonline.git -PKG_SOURCE_VERSION:=5d66f9b28a2054f4b73fd447d531e10f82af416d +PKG_SOURCE_VERSION:=0b7050013224cea1e9d4843817f9baa12b0bfe19 PKG_MIRROR_HASH:=skip PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION) diff --git a/quectel_MHI/Makefile b/quectel_MHI/Makefile old mode 100755 new mode 100644 index 3f81ee55..ec5a218e --- a/quectel_MHI/Makefile +++ b/quectel_MHI/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pcie_mhi PKG_VERSION:=1.3.8 -PKG_RELEASE:=30 +PKG_RELEASE:=31 include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk diff --git a/quickfile/Makefile b/quickfile/Makefile index ff2321cc..5617e0b9 100644 --- a/quickfile/Makefile +++ b/quickfile/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=quickfile PKG_VERSION:=1.0.25 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_SOURCE:=quickfile-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://r2.cooluc.com/source diff --git a/quickfile/files/quickfile.locations b/quickfile/files/quickfile.locations index df6e27b1..bcbfdff7 100644 --- a/quickfile/files/quickfile.locations +++ b/quickfile/files/quickfile.locations @@ -19,7 +19,7 @@ location /cgi-bin/luci/quickfile { proxy_set_header Connection "upgrade"; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_pass http://unix:/tmp/run/quickfile/quickfile.sock:; + proxy_pass http://unix:/tmp/run/quickfile/quickfile.sock; } location /cgi-bin/luci/quickfile/api/ { @@ -36,7 +36,7 @@ location /cgi-bin/luci/quickfile/api/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; rewrite ^/cgi-bin/luci/quickfile/api/(.*) /api/$1?host=$scheme://$host break; - proxy_pass http://unix:/tmp/run/quickfile/quickfile.sock:/api/; + proxy_pass http://unix:/tmp/run/quickfile/quickfile.sock; } location /cgi-bin/luci/quickfile-static/ { @@ -44,5 +44,5 @@ location /cgi-bin/luci/quickfile-static/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; rewrite ^/cgi-bin/luci/quickfile-static/(.*) /static/$1?host=$scheme://$host break; - proxy_pass http://unix:/tmp/run/quickfile/quickfile.sock:/static/; + proxy_pass http://unix:/tmp/run/quickfile/quickfile.sock; }