Config Cloud Backuper
一款简单的 Minecraft 模组,用于备份游戏配置文件,支持可配置的备份路径以及 WebDAV 云备份功能,适用于客户端和服务器。
功能特性
- 客户端 + 服务端命令支持 — 两端均可使用命令;服务器端还支持
/server_config_backuper ...(需要 Fabric API)
- 客户端上传至服务器 — 客户端可将本地备份上传至服务器存储;文件按玩家分别保存,保留策略可配置
- 可选 GUI — 安装 ModMenu 和 Cloth Config API,然后通过 ModMenu 打开设置界面
- 备份游戏配置、模组配置、光影配置等更多文件夹(参见
config/config-cloud-backuper.json)
- 备份压缩及自动清理旧备份
- WebDAV — 启用后在备份完成后自动上传,同时提供手动列出/上传/下载的命令
- 安全检查 — 客户端上传仅接受
.zip 格式,限制文件大小并对文件名进行净化处理;服务器端验证 SHA-256 并写入审计日志
依赖要求
- Minecraft 1.21.1
- Fabric Loader >=0.16.0
- Java 21+
- Fabric API(注册命令所必需)
- ModMenu(可选)
- Cloth Config API(可选,仅在需要 ModMenu GUI 时必需)
命令(客户端/服务器)
命令分组位于:remote cloud / remote server。
根命令前缀(为兼容起见保留):
- 客户端:
/config_backuper
- 服务器端:
/config_backuper 或 /server_config_backuper(功能相同)
注意:命令前缀故意保留以保持与现有脚本和使用习惯的向后兼容性。云风格的前缀可以在未来的大版本发布中通过别名过渡引入。
| 子命令 |
描述 |
backup |
运行本地备份并清理超过 maxBackups 数量的旧文件;如果启用了 WebDAV 自动上传,则随后上传最新的备份 |
list |
列出匹配配置前缀/后缀的本地备份文件 |
config reload |
从磁盘重新加载 config-cloud-backuper.json 并刷新运行时实例 |
config show |
显示当前主配置文件值 |
config set <key> <value> |
更新并保存主配置文件(支持布尔值的 true/false 等) |
remote cloud status |
显示 WebDAV 配置(密码被遮蔽) |
remote cloud list |
列出远程 WebDAV 目录中的文件 |
remote cloud upload [file] |
强制将本地备份文件(默认为最新)上传至 WebDAV;仍需凭据 |
remote cloud download [file] |
将远程文件下载到本地备份目录(默认按名称获取最新文件) |
remote cloud set <field> <value> |
在 config-cloud-backuper_webdav.json 中写入字段:enabled, serverUrl, username, password, remotePath |
remote server status |
(客户端)查询服务器端的客户端上传配置 |
remote server list |
(客户端)查询服务器上当前玩家已上传的备份 |
remote server upload [file] |
(客户端)将本地备份上传至服务器(默认为最新文件) |
不带子命令运行根命令会打印简要帮助信息。
服务器示例
/server_config_backuper backup: 运行服务器备份
/server_config_backuper list: 列出服务器本地备份
/server_config_backuper config show: 显示当前服务器配置
/server_config_backuper remote server status: 显示客户端上传配置
/server_config_backuper remote server list: 显示你已上传的备份(需要 OP 等级 > 2)
/server_config_backuper remote server set folder ./configcloudbackuper-backups/client-uploads: 设置上传根文件夹
/server_config_backuper remote server set maxPerPlayer 20: 设置每位玩家的备份上限
配置
主配置文件:config/config-cloud-backuper.json
WebDAV 配置文件:config/config-cloud-backuper_webdav.json
你也可以通过上述 config / remote cloud / remote server 命令编辑值。
常规与备份存储
主要字段包括:includeGameConfigs, includeModConfigs, includeShaderPackConfigs, includeSchematics, include3dSkin, includeSyncmatics, includeDefaultConfigs, compressionEnabled, maxBackups, backupFolder, backupFilePrefix, backupFileSuffix。
客户端上传至服务器(主配置文件字段)
clientUploadToServerEnabled: 允许客户端上传至服务器(默认 true)
clientUploadFolder: 上传备份的服务器存储根目录(默认 ./configcloudbackuper-backups/client-uploads)
clientUploadMaxBackupsPerPlayer: 每位玩家的备份上限(-1 表示无限制,默认 10)
服务器存储结构:
<clientUploadFolder>/<playerName>/<backupFile>
WebDAV (config-cloud-backuper_webdav.json)
enabled — 在本地备份流程完成后自动上传最新备份
serverUrl, username, password, remotePath — 服务器和路径设置
WebDAV 安全行为:
- 上传时也会写入校验和文件:
<filename>.sha256
- 下载时首先读取
.sha256,然后在下载完成后验证 SHA-256;如果不匹配则删除文件并返回错误
整合包使用
你可以自由地将此模组包含在整合包中,无需请求许可。
开发
构建
cd fabric
./gradlew build
要在本地客户端测试中使用 ModMenu + Cloth GUI,本仓库已通过 modLocalRuntime 包含了 Cloth。你仍需在运行配置中添加 ModMenu(或使用 modRuntimeOnly)。
Config Cloud Backuper
A simple Minecraft mod for backing up game configuration files, with configurable backup paths and WebDAV cloud backup support for both client and server usage.
Features
- Client + server command support — both sides can use commands; server also supports
/server_config_backuper ... (requires Fabric API)
- Client-to-server upload — clients can upload local backups to server storage; files are saved per player and retention is configurable
- Optional GUI — install ModMenu and Cloth Config API, then open settings from ModMenu
- Backup game configs, mod configs, shader configs, and more folders (see
config/config-cloud-backuper.json)
- Backup compression and automatic old-backup cleanup
- WebDAV — auto upload after backup (if enabled), plus manual list/upload/download commands
- Security checks — client upload only accepts
.zip with size limit and filename sanitization; server validates SHA-256 and writes audit logs
Requirements
- Minecraft 1.21.1
- Fabric Loader >=0.16.0
- Java 21+
- Fabric API (required for command registration)
- ModMenu (optional)
- Cloth Config API (optional, needed only for ModMenu GUI)
Commands (Client/Server)
Commands are grouped under: remote cloud / remote server.
Root command prefixes (kept for compatibility):
- Client:
/config_backuper
- Server:
/config_backuper or /server_config_backuper (same functionality)
Note: The command prefix is intentionally kept for backward compatibility with existing scripts and habits. A cloud-style prefix can be introduced later in a major release with alias transition.
| Subcommand |
Description |
backup |
Run local backup and clean old files exceeding maxBackups; if WebDAV auto-upload is enabled, upload the latest backup afterward |
list |
List local backup files matching configured prefix/suffix |
config reload |
Reload config-cloud-backuper.json from disk and refresh runtime instances |
config show |
Show current main config values |
config set <key> <value> |
Update and save main config (true/false etc. are supported for booleans) |
remote cloud status |
Show WebDAV config (password masked) |
remote cloud list |
List files in remote WebDAV directory |
remote cloud upload [file] |
Force upload local backup file (latest by default) to WebDAV; credentials are still required |
remote cloud download [file] |
Download remote file into local backup directory (latest by name by default) |
remote cloud set <field> <value> |
Write fields in config-cloud-backuper_webdav.json: enabled, serverUrl, username, password, remotePath |
remote server status |
(Client) Query server-side client-upload config |
remote server list |
(Client) Query current player's uploaded backups on server |
remote server upload [file] |
(Client) Upload local backup to server (latest by default) |
Running root command without subcommand prints brief help.
Server Examples
/server_config_backuper backup: run server backup
/server_config_backuper list: list server local backups
/server_config_backuper config show: show current server config
/server_config_backuper remote server status: show client-upload config
/server_config_backuper remote server list: show your uploaded backups (requires OP level > 2)
/server_config_backuper remote server set folder ./configcloudbackuper-backups/client-uploads: set upload root folder
/server_config_backuper remote server set maxPerPlayer 20: set max backups per player
Configuration
Main config: config/config-cloud-backuper.json
WebDAV config: config/config-cloud-backuper_webdav.json
You can also edit values with config / remote cloud / remote server commands above.
General and Backup Storage
Main fields include: includeGameConfigs, includeModConfigs, includeShaderPackConfigs, includeSchematics, include3dSkin, includeSyncmatics, includeDefaultConfigs, compressionEnabled, maxBackups, backupFolder, backupFilePrefix, backupFileSuffix.
Client Upload to Server (main config fields)
clientUploadToServerEnabled: allow client uploads to server (default true)
clientUploadFolder: server storage root for uploaded backups (default ./configcloudbackuper-backups/client-uploads)
clientUploadMaxBackupsPerPlayer: max backups per player (-1 means unlimited, default 10)
Server storage structure:
<clientUploadFolder>/<playerName>/<backupFile>
WebDAV (config-cloud-backuper_webdav.json)
enabled — auto upload latest backup after local backup flow
serverUrl, username, password, remotePath — server and path settings
WebDAV security behavior:
- Upload also writes checksum file:
<filename>.sha256
- Download reads
.sha256 first, then verifies SHA-256 after download; mismatch deletes the file and returns error
Modpack Usage
You may freely include this mod in modpacks without requesting permission.
Development
Build
cd fabric
./gradlew build
For local client testing with ModMenu + Cloth GUI, this repo already includes Cloth via modLocalRuntime. You still need to add ModMenu in your run profile (or modRuntimeOnly).
评论 0
登录后参与评分
还没有评论,来抢沙发吧