StoreiiMC
云存储……在 Minecraft 箱子中。没错,真的。
StoreiiMC 是一款 PaperMC 插件 :3
StoreiiMC 将世界中的特定箱子转变为安全、可通过 Web 访问的“驱动器”。你可以从浏览器拖拽文件到箱子中,实时编辑文本文件,并流式播放音乐,所有数据完全存储在 Minecraft 的 NBT 数据中(潜影盒内的地图)。
或者,你也可以直接通过 URL 导入文件。
这基本上就是 Google Drive,但后端是一个潜影盒。
这是什么?
因为好奇心让我停不下来而构建。
原理:
- 文件被切分为 16KB 的二进制块。
- 这些块被写入填充地图的 NBT 数据中。
- 地图被打包进潜影盒。
- 潜影盒被存放在你的物理箱子中。
- 内置的 Jetty Web 服务器(端口 8080)提供一个完整的 UI 来管理这一切。
功能
-
Web 仪表板: 全暗色模式 UI,支持拖拽上传。
-
实时文本编辑器: 点击浏览器中的任何 .txt、.json 或 .yml 文件即可即时编辑和保存。非常适合用来记笔记。
-
媒体预览: 直接从仪表板查看图片和播放 .mp3 文件。
-
多用户系统: 玩家可以创建自己的私有驱动器。
-
安全性: 嗯,可能存在许多安全漏洞,但作为一名安全研究人员,我基本上对所有入口点进行了清理和检查!包括但不限于:
- 驱动器可以设置密码保护(使用 PBKDF2 哈希)。(你也可以创建没有密码的公共驱动器)
- 防止 XSS(跨站脚本攻击)和 SSRF(服务端请求伪造)。
- DoS 防护(可配置的单文件大小限制)。
-
从 URL 导入: 使用 /mcfs import <URL> <filename.extension> 直接导入短链接的文件!
-
魔法链接: 使用 /mcfs webimport <filename.extension> 生成一次性链接,以便通过长 URL 上传文件(因为 Minecraft 聊天有 256 个字符的限制)。
快速开始
- 设置: 将
StoreiiMC.jar 放入 /plugins 文件夹。
- 运行: 启动服务器。Web 服务器默认在端口
8080 上启动。
- 创建驱动器:
- 放置一个箱子。
- 看向它。
- 运行
/mcfs create MyDrive。
- 访问: 在浏览器中打开
http://localhost:8080。
- 配置: 它们位于
plugins/StoreiiMC 下的 config.yml 和 drive.yml 中
命令速查表
| 命令 |
描述 |
/mcfs create <name> |
将目标箱子转换为驱动器。 |
/mcfs password <name> <pass> |
为驱动器设置密码(需要用于 Web 登录)。 |
/mcfs webimport <filename> |
生成一个“魔法链接”以通过 URL 上传文件。 |
/mcfs list |
列出你当前正在查看的驱动器中的文件。 |
/mcfs delete <filename> |
删除文件(释放磁盘空间和箱子槽位)。 |
/mcfs deletedrive <name> |
销毁驱动器配置。 |
/mcfs purge |
管理员: 扫描磁盘上的孤立数据块并将其删除。 |
配置 (config.yml)
我们强制执行限制,以防止玩家耗尽你的磁盘空间。
limits:
# 允许上传的最大文件大小(防止 DoS)
max-file-size-mb: 1024 # 每个文件 1024 MB
# 非管理员玩家可以拥有的驱动器数量
max-drives-per-player: 1
# 除非你想让 TPS 融化,否则保持为 1。
# 1 节点 = 1 个箱子 = 通过嵌套潜影盒(深度 3)实现约 8GB 的潜在存储空间。
max-nodes-per-drive: 1
安全与架构
这不仅仅是一个玩具!我试图让它对于公共服务器来说实际上是安全的。
- 身份验证: Web 界面使用会话 Cookie 系统。如果驱动器设置了密码,你必须登录。
- 隔离: 玩家无法破坏或打开其他玩家的驱动器箱子。
- 清理: 文件名经过清理以防止路径遍历攻击(你不能上传到
../../server.properties)。
- DoS: Web 服务器检查
Content-Length 标头并监控输入流。如果有人试图上传 10GB 的炸弹,连接会立即切断。
已知限制
- 不要破坏箱子: 如果你使用 WorldEdit 或创造模式破坏驱动器箱子而没有使用
/mcfs deletedrive,插件会丢失对物品的追踪。你需要运行 /mcfs purge 来清理磁盘上的“幽灵”地图文件。
- 单个箱子规则: 目前,一个驱动器仅限于单个箱子方块。由于我们使用递归潜影盒打包,那个方块理论上拥有 GB 级的空间,所以对于普通玩家来说,扩展到双箱并没有太大必要。
许可与归属
本项目受以下协议保护:
你可以自由使用和修改此代码,前提是你明确注明 X3r0Day 的贡献并链接回此仓库。
你可以自由使用、修改和分发此软件,但你必须提供适当的署名给项目 "X3r0Day" 并提供指向此仓库的链接!
如果你修改此代码或将其集成到你自己的项目中,你必须:
- 在源文件中保留原始版权声明。
- 在你的文档或 README 中包含指向此仓库的链接。
推荐署名格式:
"基于 X3r0Day 的 StoreiiMC-Plugin。"
StoreiiMC
Cloud Storage... inside a Minecraft Chest. Yeah, really.
StoreiMC is a Plugin for PaperMC :3
StoreiiMC turns specific chests in your world into secure, web-accessible "Drives." You can drag-and-drop files from your browser into a chest, edit text files live, and stream music, all stored entirely within Minecraft's NBT data (Maps inside Shulkers).
Or you can also import your files directly via URLs.
It’s basically Google Drive, but the backend is a Shulker Box.
What is this?
Built because curiosity wouldn’t let me stop.
The Logic:
- Files are chopped into 16KB binary chunks.
- Chunks are written to the NBT data of Filled Maps.
- Maps are packed into Shulker Boxes.
- Shulker Boxes are stored in your physical chest.
- A built-in Jetty Web Server (port 8080) serves a full UI to manage it all.
Features
-
Web Dashboard: A full dark-mode UI with Drag & Drop uploads.
-
Live Text Editor: Click any .txt, .json, or .yml file in the browser to edit and save it instantly. Great for keeping notes.
-
Media Preview: View images and play .mp3 files directly from the dashboard.
-
Multi-User System: Players can create their own private Drives.
-
Security: Well there could be many security vulnerablities, as a security researcher I basically sanitized and have checks on almost every entry points! which includes but not limit to:
- Drives can be password-protected (hashed with PBKDF2). (You can create public drives too without a password)
- Protection against XSS (Cross-Site Scripting) and SSRF.
- DoS protection (configurable per-file size limits).
-
Import from URL: Use /mcfs import <URL> <filename.extension> to directly import if link is short!
-
Magic Links: Use /mcfs webimport <filename.extension> to generate a one-time link for uploading from long URLs (cuz minecraft chat have 256 char limit).
Quick Start
- Setup: Drop
StoreiiMC.jar into your /plugins folder.
- Run: Start the server. The web server starts on port
8080 by default.
- Create a Drive:
- Place a Chest.
- Look at it.
- Run
/mcfs create MyDrive.
- Access: Open
http://localhost:8080 in your browser.
- Config: They are inside plugins/StoreiiMC as
config.yml & drive.yml
Commands Cheat Sheet
| Command |
Description |
/mcfs create <name> |
Turns the target chest into a Drive. |
/mcfs password <name> <pass> |
Sets a password for the drive (req. for web login). |
/mcfs webimport <filename> |
Generates a "Magic Link" to upload files via URL. |
/mcfs list |
Lists files in the drive you are looking at. |
/mcfs delete <filename> |
Deletes a file (frees up disk space & chest slots). |
/mcfs deletedrive <name> |
Nukes the drive configuration. |
/mcfs purge |
Admin: Scans disk for orphaned data chunks and deletes them. |
Configuration (config.yml)
We enforce limits to stop players from crashing your disk space.
limits:
# Maximum file size allowed for upload (prevents DoS)
max-file-size-mb: 1024 # 1024 MB Per-File
# How many drives a non-admin player can own
max-drives-per-player: 1
# Keep this at 1 unless you want to melt your TPS.
# 1 Node = 1 Chest = ~8GB of storage potential via nested shulkers (depth 3).
max-nodes-per-drive: 1
Security & Architecture
This isn't just a toy! I tried to make it actually secure for public servers.
- Authentication: The web interface uses a session cookie system. If a drive has a password, you must log in.
- Isolation: Players cannot break or open other player's Drive chests.
- Sanitization: Filenames are sanitized to prevent Path Traversal attacks (you can't upload to
../../server.properties).
- DoS: The web server checks
Content-Length headers and monitors the input stream. If someone tries to upload a 10GB bomb, the connection is cut immediately.
Known Limitations
- Don't Break the Chest: If you use WorldEdit or Creative Mode to break a Drive chest without using
/mcfs deletedrive, the plugin loses track of the items. You'll need to run /mcfs purge to clean up the "ghost" map files from the disk.
- One Chest Rule: Currently, a Drive is limited to a single chest block. Since we use recursive Shulker packing, you technically have gigabytes of space in that one block, so expanding to double-chests isn't really necessary for normal players.
License & Attribution
This project is protected under the
You are free to use and modify this code, provided you give clear credit to X3r0Day and link back to this repository.
You are free to use, modify, and distribute this software, but you must provide appropriate credit to project "X3r0Day" and provide a link to this Repository!
If you modify this code or integrate it into your own project, you must:
- Keep the original copyright notice in the source files.
- Include a link back to this repository in your documentation or README.
Recommended Attribution Format:
"Based on StoreiiMC-Plugin by X3r0Day."
评论 0
登录后参与评分
还没有评论,来抢沙发吧