ConfigGuard
配置出错?两下点击即可回滚。
ConfigGuard 会自动为配置文件创建快照,并清晰展示各版本间的差异。你可以从快照中恢复任意单个文件或整个文件夹。它专为喜欢调整整合包的玩家、测试更新的整合包制作者以及手动编辑配置的服务端管理员而设计。
查找配置变更
运行 /configguard history 1 config/example.toml 可查看某个文件何时被添加、编辑或删除。在变更条目旁选择 [diff] 可检查保存的两个版本。使用 /configguard find 1 Before tweaking 可按标签、快照 ID 和原因进行搜索。
功能特性
- 自动快照:在游戏启动时(Fabric 环境下,在其他模组加载并重写其文件之前)和游戏关闭时自动创建。你也可以手动创建快照并为其添加标签。
- 变更检测:如果游戏关闭期间配置文件发生了更改(例如整合包更新、手动编辑或其他启动器操作),通知栏会告知你有多少个文件发生了变化。
- 可视化对比:通过快照列表 → 自该快照以来发生变化的文件(新增、修改、删除) → 逐行差异对比(红色显示删除的行,绿色显示新增的行)。
- 恢复功能:可恢复单个文件或全部文件。在恢复前,ConfigGuard 会将当前状态保存为另一个快照,因此每次恢复操作均可撤销。
- 固定快照:被固定的快照永远不会被自动清除。当达到上限时,未固定的旧快照会被清理。
- 紧凑存储:文件按其 SHA-256 哈希值存储在
configguard/文件夹中,因此未更改的文件不会重复存储。
打开界面
- Fabric:Mod Menu → ConfigGuard → config 按钮(Mod Menu 为可选安装)。
- NeoForge:Mods → ConfigGuard → Config。
- 所有加载器:在 Controls → Key Binds 中为 Open ConfigGuard snapshots 设置按键(默认未绑定)。
服务端命令
适用于操作员(权限等级 4),包括专用服务器和开启作弊的单人游戏:
| 命令 | 功能 |
|---|---|
/configguard snapshot [label] |
立即创建快照 |
/configguard list |
列出快照,最新优先(点击 ID 查看其变更) |
/configguard changes <id> |
显示自该快照以来发生变化的文件 |
/configguard diff <id> <path> |
在聊天窗口中显示单个文件的逐行差异 |
/configguard restore <id> [path] |
恢复单个文件或所有已更改的文件 |
/configguard pin <id> / unpin <id> |
永久保留快照,或解除固定 |
Tab 键可自动补全快照 ID 和文件路径。恢复后请重启游戏或服务器,以便模组读取恢复后的文件。
设置
config/configguard.json(首次启动时创建):
| 键名 | 默认值 | 功能说明 |
|---|---|---|
trackedPaths |
config, defaultconfigs, options.txt, server.properties |
游戏文件夹中被捕获的文件和文件夹 |
excludedGlobs |
**.log, **.tmp, **.bak, **.lock, **.old |
将被跳过的文件模式 |
maxFileSizeKb |
1024 |
超过此大小的文件将被跳过 |
maxSnapshots |
40 |
保留的未固定快照数量上限 |
snapshotOnStartup |
true |
游戏启动时创建快照 |
snapshotOnShutdown |
true |
游戏关闭时创建快照 |
notifyExternalChanges |
true |
游戏关闭期间的变更通知 |
兼容性
- 可在客户端、专用服务器或两者上运行。无需在另一端安装。
- Fabric 和 Quilt:需要 Fabric API;Mod Menu 为可选安装。Forge 和 NeoForge:无额外依赖。
- 兼容任何将设置保存在 config 文件夹中的模组:TOML、JSON、JSON5、properties 及其他文本格式支持逐行差异对比;二进制文件仅显示其大小。
1.1 新增功能
使用 /configguard list <page> 浏览更早的快照,每页显示十条。
使用 /configguard compare <from> <to> 比较两个已保存的快照。选择一个已更改的路径即可查看其历史逐行差异,包括新增和删除的内容。此功能直接从归档文件中读取两种状态。
许可证
MIT。欢迎将 ConfigGuard 包含在整合包中。
使用 /configguard export <id> 导出已保存的快照。服务器会在 configguard/exports 目录下生成一个便携式 ZIP 文件,并在替换之前的导出前验证每个归档文件的 SHA-256 哈希值。
ConfigGuard
Broke your configs? Roll them back in two clicks.
ConfigGuard keeps automatic snapshots of your config files and shows exactly what changed between them. Any file, or the whole folder, can be restored from a snapshot. It is made for players who tweak modpacks, pack makers who test updates and server owners who edit configs by hand.
Finding a config change
Run /configguard history 1 config/example.toml to see when one file was added, edited or removed. Select [diff] beside a change to inspect the two saved versions. Use /configguard find 1 Before tweaking to search labels, snapshot IDs and reasons.
Features
- Automatic snapshots when the game starts (on Fabric, before other mods load and rewrite their files) and when it closes. You can also take a snapshot by hand and give it a label.
- Change detection: if config files changed while the game was closed (a modpack update, manual editing, another launcher), a notification tells you how many files changed.
- Visual diff: a snapshot list → the files that changed since then (new, changed, deleted) → a line-by-line diff with removed lines in red and added lines in green.
- Restore one file or everything. Before restoring, ConfigGuard saves the current state as another snapshot, so every restore can be undone.
- Pinned snapshots are never removed automatically. Old unpinned snapshots are cleaned up once the limit is reached.
- Compact storage: files are stored by their SHA-256 hash in the
configguard/folder, so a file that did not change is never stored twice.
Opening the screen
- Fabric: Mod Menu → ConfigGuard → config button (Mod Menu is optional).
- NeoForge: Mods → ConfigGuard → Config.
- Any loader: set a key for Open ConfigGuard snapshots in Controls → Key Binds (unbound by default).
Server commands
For operators (permission level 4), on dedicated servers and in single player with cheats enabled:
| Command | What it does |
|---|---|
/configguard snapshot [label] |
Take a snapshot now |
/configguard list |
List snapshots, newest first (click an id to see its changes) |
/configguard changes <id> |
Files that changed since the snapshot |
/configguard diff <id> <path> |
Line diff of one file in chat |
/configguard restore <id> [path] |
Restore one file or all changed files |
/configguard pin <id> / unpin <id> |
Keep a snapshot forever, or release it |
Snapshot ids and file paths are suggested with Tab. Restart the game or server after a restore so mods read the restored files.
Settings
config/configguard.json (created on first launch):
| Key | Default | What it does |
|---|---|---|
trackedPaths |
config, defaultconfigs, options.txt, server.properties |
Files and folders in the game folder that are captured |
excludedGlobs |
**.log, **.tmp, **.bak, **.lock, **.old |
Files that are skipped |
maxFileSizeKb |
1024 |
Larger files are skipped |
maxSnapshots |
40 |
How many unpinned snapshots are kept |
snapshotOnStartup |
true |
Snapshot when the game starts |
snapshotOnShutdown |
true |
Snapshot when the game closes |
notifyExternalChanges |
true |
Notify about changes made while the game was closed |
Compatibility
- Works on the client, on a dedicated server, or on both. It does not need to be installed on the other side.
- Fabric and Quilt: require Fabric API; Mod Menu is optional. Forge and NeoForge: no extra dependencies.
- Works with any mod that keeps its settings in the config folder: TOML, JSON, JSON5, properties and other text formats get a line diff; binary files are listed with their size.
New in 1.1
Use /configguard list <page> to browse older snapshots, ten per page.
Compare two saved snapshots with /configguard compare <from> <to>. Select a changed path for its historical line diff, including additions and removals. This reads both states from the archive.
License
MIT. You are welcome to include ConfigGuard in modpacks.
Export a saved snapshot with /configguard export <id>. The server writes a portable ZIP under configguard/exports and verifies each archived file against its stored SHA-256 before replacing an earlier export.
下载 ConfigGuard
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ConfigGuard
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
自动备份你的配置文件夹,逐行对比差异,支持一键还原。无论是客户端还是服务器,都能撤销任何配置更改。
通过 /configguard history <page> <path> 追踪单个存档文件在创建、编辑和删除过程中的变化。选择 [diff] 可比较相邻的存档版本。使用 /configguard find <page> <query> 搜索快照标签、原因和 ID。这两个命令仅限操作员使用。
使用 /configguard export <id> 导出已保存的快照。服务器会在 configguard/exports 目录下生成一个可移植的 ZIP 文件,并在替换较早的导出之前,根据存储的 SHA-256 校验和验证每个归档文件。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧