Config Rollback
OpenClaw 配置回滚管理 - 备份、超时保护、自动回滚
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 63 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description (config backup, timeout protection, automatic rollback) match the provided scripts and README. Required binary is only bash and the scripts act on ~/.openclaw and the openclaw CLI, which is appropriate for the stated purpose.
Instruction Scope
SKILL.md and the shell scripts confine their actions to the user's home (~/.openclaw), workspace docs, /tmp logs, and the local openclaw CLI. They create backups, write a state file, update a PENDING_VERIFICATION.md, and call openclaw gateway status/restart — all within the expected scope.
Install Mechanism
No network downloads or external installers are used. An install.sh is provided that copies bundled scripts into ~/.openclaw and adds a cron entry. This is a typical local, instruction-only install and not disproportionate to the feature set.
Credentials
The skill requests no environment variables or external credentials. It writes files under the user's home and updates the user's crontab — these are necessary for the stated functionality and are proportionate.
Persistence & Privilege
The install script modifies the user's crontab to run rollback-guardian.sh every minute and installs scripts under ~/.openclaw. This is expected for a guardian service but is a persistent change the user should explicitly review before enabling.
Assessment
This skill appears internally consistent and implements a local backup-and-rollback flow. Before enabling or running the installer, review the provided scripts yourself (prepare-config-change.sh, rollback-guardian.sh, install.sh, config-alias.sh). Note the script will:
- copy files into ~/.openclaw and create ~/.openclaw/backups
- add a per-user cron job that runs every minute (crontab modification)
- invoke the local openclaw CLI to check status and restart the gateway
- automatically copy the most recent backup back to ~/.openclaw/openclaw.json after a 5-minute timeout
Actions you may want to take first:
- Inspect the scripts to confirm they contain only the shown behavior and no additional commands or network calls.
- Backup your existing ~/.openclaw/openclaw.json and your current crontab (crontab -l > crontab.bak).
- Confirm the openclaw CLI behaves as expected on your system (openclaw gateway status/restart).
- Be aware the scripts use date -v+5M which is BSD/macOS-specific and may behave differently on some Linux distributions; test in a safe environment.
If you trust the author and are comfortable with the cron-based guardian behavior, the skill is coherent for its stated purpose. If you do not trust the source, do not run the install script and inspect the code in a sandbox first.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.2
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
Runtime requirements
🔄 Clawdis
Binsbash
SKILL.md
Config Rollback Skill
OpenClaw 配置回滚管理技能,提供配置修改前的自动备份、超时保护和自动回滚功能。
🎯 功能
- 配置备份 - 修改前自动备份到
~/.openclaw/backups/ - 超时保护 - 5 分钟倒计时,超时自动回滚
- 状态管理 - 跟踪配置修改状态
- 待验证事项 - 动态记录验证事项
- 启动自检 - Gateway 启动后自动验证配置
📋 使用方式
1. 准备修改配置
~/.openclaw/scripts/prepare-config-change.sh "修改描述" "验证事项 1,验证事项 2"
参数:
修改描述- 简要描述修改内容(必需)验证事项- 逗号分隔的验证事项列表(可选)
示例:
~/.openclaw/scripts/prepare-config-change.sh "启用 obsidian 技能" "验证技能状态,验证 Gateway 启动"
输出:
- 备份文件路径
- 回滚截止时间(5 分钟后)
- 下一步操作提示
2. 修改配置
编辑 ~/.openclaw/openclaw.json
3. 重启 Gateway
必须在 5 分钟内完成:
openclaw gateway restart
🔄 自动回滚机制
守护进程
脚本: ~/.openclaw/scripts/rollback-guardian.sh
Cron 任务: 每分钟执行一次
*/1 * * * * ~/.openclaw/scripts/rollback-guardian.sh
工作逻辑
| 状态 | 行为 |
|---|---|
| 无配置修改 | 直接退出(安静模式) |
| Gateway 正常运行 | 清除状态文件(任务完成) |
| Gateway 未运行 + 未超时 | 继续等待 |
| Gateway 未运行 + 超时 | 执行回滚 |
📁 相关文件
| 文件 | 作用 |
|---|---|
scripts/prepare-config-change.sh | 修改准备脚本 |
scripts/rollback-guardian.sh | 超时回滚守护 |
scripts/config-alias.sh | 交互式助手 |
backups/ | 配置备份目录 |
docs/PENDING_VERIFICATION.md | 待验证事项记录 |
🚨 紧急回滚
cp $(ls -t ~/.openclaw/backups/*.json | head -1) ~/.openclaw/openclaw.json
openclaw gateway restart
🔧 安装
自动安装(推荐)
openclaw skills enable openclaw-config-rollback
手动安装
-
复制脚本
# 脚本已在工作区 ls ~/.openclaw/workspace/skills/config-rollback/scripts/ -
设置权限
chmod +x ~/.openclaw/workspace/skills/config-rollback/scripts/*.sh -
设置 Cron
(crontab -l 2>/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * ~/.openclaw/workspace/skills/config-rollback/scripts/rollback-guardian.sh") | crontab - -
验证
crontab -l | grep rollback
📊 配置流程
修改配置
↓
执行 prepare-config-change.sh
├─ 自动备份到 backups/
├─ 创建状态文件 .config-modified-state
└─ 记录到 PENDING_VERIFICATION.md
↓
5 分钟倒计时开始
↓
守护进程每分钟检查
├─ 无状态文件 → 直接退出(安静模式)
├─ Gateway 正常运行 → 清除状态文件 ✅
├─ Gateway 未运行 + 未超时 → 继续等待
└─ Gateway 未运行 + 超时 → 自动回滚 ⚠️
🎯 最佳实践
修改前
- 执行
prepare-config-change.sh - 记录修改原因到
docs/CONFIG_CHANGELOG.md
修改后
- 5 分钟内重启 Gateway
- 查看 Discord 上的 BOOT.md 自检报告
- 更新
PENDING_VERIFICATION.md中的验证状态
⚠️ 注意事项
- 修改前必须执行准备脚本 - 否则没有备份和超时保护
- 5 分钟内必须重启 - 否则会自动回滚
- 验证事项与修改目的关联 - 不是固定的验证内容
📚 相关文档
docs/CONFIG_QUICKREF.md- 快速参考CONFIG_CHANGE_RULES.md- 详细规则docs/CONFIG_MEMORY_SYSTEM.md- 记忆系统设计skills/brain2claw-content-manager/work/cases/001-config-management-flow.md- 设计案例
版本: 1.0.2
作者: 小麦 🌲
日期: 2026-03-16
Files
8 totalSelect a file
Select a file to preview.
Comments
Loading comments…
