mirror of
https://github.com/hotwa/luci-app-openclaw.git
synced 2026-03-31 04:52:33 +00:00
release v2.0.0: 适配 OpenClaw v2026.3.13
重大变更: - 配置管理菜单重构,更清晰的导航结构 - 新增高级配置菜单 - 新增全局环境变量 /etc/profile.d/openclaw.sh 修复: - QQ 机器人插件配置名称不匹配 (#XX) - 安装运行环境报错缺少 libstdcpp6 (#28) - 环境变量路径混乱 (#42) 新增: - 查看日志功能 - 飞书 Bot 配置流程优化 适配: - Node.js 版本升级到 22.16.0 - OpenClaw 版本升级到 v2026.3.13 - 依赖声明新增 libstdcpp6
This commit is contained in:
@@ -193,6 +193,55 @@ fi
|
||||
# 同步 UCI 到 JSON
|
||||
sync_uci_to_json
|
||||
|
||||
# v2026.3.13: 修复插件配置中的插件名称不匹配问题
|
||||
# OpenClaw 加强了配置验证,plugins.allow 中的名称必须与实际插件名完全匹配
|
||||
# 问题: 旧版本写入的是 "openclaw-qqbot",但实际插件名是 "@tencent-connect/openclaw-qqbot"
|
||||
fix_plugin_config() {
|
||||
local qqbot_ext_dir="${OC_DATA}/.openclaw/extensions/openclaw-qqbot"
|
||||
[ ! -d "$qqbot_ext_dir" ] && return
|
||||
[ ! -f "$CONFIG_FILE" ] && return
|
||||
|
||||
"$NODE_BIN" -e "
|
||||
const fs=require('fs');
|
||||
try{
|
||||
const d=JSON.parse(fs.readFileSync('${CONFIG_FILE}','utf8'));
|
||||
if(!d.plugins)d.plugins={};
|
||||
let modified=false;
|
||||
|
||||
// 修复 plugins.allow 数组中的插件名称
|
||||
if(Array.isArray(d.plugins.allow)){
|
||||
const oldName='openclaw-qqbot';
|
||||
const newName='@tencent-connect/openclaw-qqbot';
|
||||
const idx=d.plugins.allow.indexOf(oldName);
|
||||
if(idx!==-1){
|
||||
if(!d.plugins.allow.includes(newName)){
|
||||
d.plugins.allow[idx]=newName;
|
||||
modified=true;
|
||||
}else{
|
||||
d.plugins.allow.splice(idx,1);
|
||||
modified=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 同时修复 plugins.entries 中的键名
|
||||
if(d.plugins.entries && d.plugins.entries['openclaw-qqbot']){
|
||||
if(!d.plugins.entries['@tencent-connect/openclaw-qqbot']){
|
||||
d.plugins.entries['@tencent-connect/openclaw-qqbot']=d.plugins.entries['openclaw-qqbot'];
|
||||
}
|
||||
delete d.plugins.entries['openclaw-qqbot'];
|
||||
modified=true;
|
||||
}
|
||||
|
||||
if(modified){
|
||||
fs.writeFileSync('${CONFIG_FILE}',JSON.stringify(d,null,2));
|
||||
console.log('FIXED');
|
||||
}
|
||||
}catch(e){}
|
||||
" 2>/dev/null && chown openclaw:openclaw "$CONFIG_FILE" 2>/dev/null
|
||||
}
|
||||
fix_plugin_config
|
||||
|
||||
# 修复数据目录权限 (防止 root 用户操作后留下无法读取的文件)
|
||||
chown -R openclaw:openclaw "$OC_DATA" 2>/dev/null || true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user