Newspaper
一款跨平台的 Minecraft 插件/模组,通过带有双向 TLS (mTLS) 认证的 WebSocket 实现远程服务器管理。
中文文档
功能特性
- 双向 TLS (mTLS) — 基于密码生成证书,无需手动交换证书
- 双平台支持 — 共享代码库,同时支持 Paper (1.21.1–26.2) 和 Fabric (1.21.1–26.2)
- Shell 命令执行 — 支持配置超时时间,远程运行系统 Shell 命令
- 文件传输 — 通过 WebSocket 使用 Base64 编码上传和下载文件
- 反向代理 — 出站连接模式,适用于位于 NAT/防火墙后的服务器
- PROXY Protocol — 可选的 v1/v2 支持,用于在反向代理后检测客户端 IP
- 审计日志 — 具备防篡改特性的审计日志,采用持续文件锁定机制
- 密码安全 — 自动生成 128 位密钥并进行强度验证
- 国际化 — 内置英文 (
en) 和中文 (zh) 翻译 - 配置容错 — 无效的配置项会自动重置为默认值并记录警告
版本支持
| 平台 | 模块 | Minecraft 版本 | Java |
|---|---|---|---|
| Paper | paper |
1.21.1–26.2 | 21+ |
| Fabric | fabric |
26.1–26.2 | 25 |
| Fabric (Legacy) | fabric-legacy |
1.21.1–1.21.11 | 21 |
注意: 由于 Minecraft 26.1 发生了破坏性变更(Mojang 移除了类混淆,导致 Yarn 中间映射在 26.1+ 版本中不可用),Fabric 使用了两个独立的模块。
Fabric 支持目前处于实验阶段。如果遇到崩溃或意外行为,请在 Issues 页面报告。
测试版通知
当您看到标记为 Alpha 的版本(例如 v1.0.0-alpha.1)时,这通常是一个已知问题尚未修复的发布版本。Alpha 版本可能包含未完成的功能、已知的崩溃风险或性能问题,主要旨在供早期测试和收集反馈使用。
认证
Newspaper 使用纯 mTLS 认证。服务器和客户端均使用 BouncyCastle(secp256r1 + SHA-256)从共享密码派生出相同的 CA/服务器/客户端证书。TLS 握手执行相互认证——无需应用层认证消息。
如果未配置密码,将自动生成一个 128 位密钥,并根据安全规则(大写、小写、数字)进行验证,然后打印到控制台。
连接模式
| 模式 | 配置值 | 描述 |
|---|---|---|
| 直接 | direct |
服务器监听传入的 mTLS 连接 |
| 反向代理 | reverse |
服务器向外连接到远程中继,每 5 分钟重试一次 |
connection-mode: "reverse"
reverse-proxy:
host: "relay.example.com"
port: 8080
protocol: "wss"
配置
port: 8080
password: ""
ipv6: false
language: "en"
connection-mode: "direct"
enforce-password-strength: true
proxy-protocol: false
reverse-proxy:
host: ""
port: 8080
protocol: "wss"
shell:
timeout: 30
file-transfer:
enabled: true
root: ""
restrict-upload: true
disable: false
audit-log:
enabled: true
无效的配置值会自动重置为默认值,并记录 WARN 级别日志。支持的验证规则如下:
| 键 | 规则 |
|---|---|
port |
1–65535 |
connection-mode |
direct 或 reverse |
reverse-proxy.protocol |
wss 或 ws |
shell.timeout |
>= 1 |
命令
| 命令 | 权限 | 描述 |
|---|---|---|
/newspaper reload |
OP | 重新加载配置并重启 WebSocket 服务器 |
/newspaper modify <key> <value> |
OP | 修改配置字段(例如 port 9090) |
/newspaper exec <command> |
OP | 执行系统 Shell 命令 |
/newspaper lang <file> |
OP | 加载语言文件(例如 en, zh) |
WebSocket API
连接
通过 wss://<host>:<port>/ 连接(需要 mTLS)。所有数据帧必须为二进制格式(操作码 0x2)。
请求格式
{
"type": "<operation_type>",
"data": { ... }
}
操作类型
| 类型 | 描述 |
|---|---|
console_message |
订阅/轮询/取消订阅控制台输出 |
chat_message |
订阅/轮询/取消订阅聊天消息 |
command |
执行控制台命令 |
command2 |
以特定玩家身份执行命令 |
player_join |
订阅/轮询/取消订阅玩家加入事件 |
player_quit |
订阅/轮询/取消订阅玩家退出事件 |
online_players |
获取在线玩家列表及详细信息 |
server_info |
获取服务器、Java 和内存信息 |
config_modify |
修改配置字段 |
config_reload |
重新加载配置并重启 WebSocket |
shutdown |
关闭 Minecraft 服务器 |
console_broadcast |
向所有玩家广播消息 |
shell_command |
执行系统 Shell 命令 |
file_upload |
上传文件(Base64 内容) |
file_download |
下载文件(返回 Base64 内容) |
示例
Shell 命令:
{ "type": "shell_command", "data": { "command": "ls -la", "timeout": 10 } }
文件上传:
{ "type": "file_upload", "data": { "path": "backup/world.yml", "content": "<base64>" } }
文件下载:
{ "type": "file_download", "data": { "path": "config.yml" } }
安全性
- 审计日志 — 记录 WebSocket Secure (WSS) 连接 ID、登录尝试(成功/失败)、远程地址及操作详情。在服务器运行期间,日志文件(
audit.log)会持续保持锁定状态以防止篡改。针对audit.log的文件传输操作将被阻止。 - 文件传输安全 — 包含路径遍历检测、可选的上传目录限制(默认为服务器根目录),以及全局禁用文件传输的开关。
- 密码强度 — 默认启用。若禁用则会触发红色警告。自动生成的密钥符合复杂度要求(包含大写和小写字母、至少 3 个字母字符、至少 6 个数字)。
许可证
MIT — 详见 LICENSE。
Newspaper
A cross-platform Minecraft plugin/mod for remote server management via WebSocket with mutual TLS authentication.
中文文档
Features
- Mutual TLS (mTLS) — Password-derived certificate generation, zero manual cert exchange
- Dual Platform — Paper (1.21.1–26.2) and Fabric (1.21.1–26.2) from a shared codebase
- Shell Command Execution — Run system shell commands remotely with configurable timeout
- File Transfer — Upload and download files via Base64 over WebSocket
- Reverse Proxy — Outbound connection mode for servers behind NAT/firewall
- PROXY Protocol — Optional v1/v2 support for client IP detection behind reverse proxies
- Audit Logging — Tamper-proof audit log with continuous file locking
- Password Security — Auto-generated 128-bit keys with strength validation
- Internationalization — Built-in English (
en) and Chinese (zh) translations - Config Fault Tolerance — Invalid config entries are automatically reset to defaults with warnings
Version Support
| Platform | Module | Minecraft Versions | Java |
|---|---|---|---|
| Paper | paper |
1.21.1–26.2 | 21+ |
| Fabric | fabric |
26.1–26.2 | 25 |
| Fabric (Legacy) | fabric-legacy |
1.21.1–1.21.11 | 21 |
Note: Fabric uses two separate modules due to a breaking change in Minecraft 26.1 (Mojang removed class obfuscation, making Yarn intermediary mappings unavailable for 26.1+).
Fabric support is experimental. If you encounter crashes or unexpected behavior, please report them on the Issues page.
Alpha Version Notice
When you see a version tagged Alpha (e.g. v1.0.0-alpha.1), it is likely a release with known issues that has not been pulled. Alpha versions may contain unfinished features, known crash risks, or performance problems, and are primarily intended for early testing and feedback collection.
Authentication
Newspaper uses pure mTLS. Both server and client derive identical CA/server/client certificates from the shared password using BouncyCastle (secp256r1 + SHA-256). The TLS handshake performs mutual authentication — no application-layer auth messages needed.
If no password is configured, a 128-bit key is auto-generated, validated against security rules (uppercase, lowercase, digits), and printed to the console.
Connection Modes
| Mode | Config Value | Description |
|---|---|---|
| Direct | direct |
Server listens for incoming mTLS connections |
| Reverse Proxy | reverse |
Server connects outward to a remote relay, retries every 5 min |
connection-mode: "reverse"
reverse-proxy:
host: "relay.example.com"
port: 8080
protocol: "wss"
Configuration
port: 8080
password: ""
ipv6: false
language: "en"
connection-mode: "direct"
enforce-password-strength: true
proxy-protocol: false
reverse-proxy:
host: ""
port: 8080
protocol: "wss"
shell:
timeout: 30
file-transfer:
enabled: true
root: ""
restrict-upload: true
disable: false
audit-log:
enabled: true
Invalid config values are automatically reset to defaults with a WARN log. Supported validation rules:
| Key | Rule |
|---|---|
port |
1–65535 |
connection-mode |
direct or reverse |
reverse-proxy.protocol |
wss or ws |
shell.timeout |
>= 1 |
Commands
| Command | Permission | Description |
|---|---|---|
/newspaper reload |
OP | Reload config and restart WebSocket server |
/newspaper modify <key> <value> |
OP | Modify a config field (e.g. port 9090) |
/newspaper exec <command> |
OP | Execute a system shell command |
/newspaper lang <file> |
OP | Load a language file (e.g. en, zh) |
WebSocket API
Connection
Connect via wss://<host>:<port>/ (mTLS required). All data frames must be binary (opcode 0x2).
Request Format
{
"type": "<operation_type>",
"data": { ... }
}
Operation Types
| Type | Description |
|---|---|
console_message |
Subscribe/poll/unsubscribe console output |
chat_message |
Subscribe/poll/unsubscribe chat messages |
command |
Execute a console command |
command2 |
Execute a command as a specific player |
player_join |
Subscribe/poll/unsubscribe player join events |
player_quit |
Subscribe/poll/unsubscribe player quit events |
online_players |
Get online player list with details |
server_info |
Get server, Java, and memory info |
config_modify |
Modify configuration fields |
config_reload |
Reload configuration and restart WebSocket |
shutdown |
Shut down the Minecraft server |
console_broadcast |
Broadcast a message to all players |
shell_command |
Execute a system shell command |
file_upload |
Upload a file (Base64 content) |
file_download |
Download a file (returns Base64 content) |
Examples
Shell command:
{ "type": "shell_command", "data": { "command": "ls -la", "timeout": 10 } }
File upload:
{ "type": "file_upload", "data": { "path": "backup/world.yml", "content": "<base64>" } }
File download:
{ "type": "file_download", "data": { "path": "config.yml" } }
Security
- Audit Log — Records WSS connection IDs, login attempts (success/failure), remote addresses, and operation details. The log file (
audit.log) is continuously locked during server runtime to prevent tampering. File transfer operations targetingaudit.logare blocked. - File Transfer Security — Path traversal detection, optional upload directory restriction (server root by default), and global file transfer disable toggle.
- Password Strength — Enforced by default. Disabling it triggers a red warning. Auto-generated keys meet complexity requirements (uppercase, lowercase, 3+ alphabetical, 6+ digits).
License
MIT — see LICENSE.
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Newspaper
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Newspaper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
[2.1.0] - 2026-08-14
新增
-
切片文件传输协议:用多包切片传输替换单包 Base64(start -> meta -> chunks -> end),每片默认 64KB,SHA-256 校验
-
多语言 SDK(
sdk/):Python(NewspaperSDK)、C#(NewspaperSDK类库)、Node.js(NewspaperClient/NewspaperServer)纯 API 封装,均含 mTLS + WebSocket + 切片文件传输 -
Shell 命令编码参数:客户端可指定输出编码(例如 Windows
cmd.exe的gbk),以修复乱码 -
Shell 命令编码参数:客户端可指定输出编码(如 Windows
cmd.exe的gbk),修复乱码问题 -
配置容错:无效配置项自动重置为默认值并打印 WARN 警告
-
/newspaper lang <file>命令:运行时切换语言文件 -
FileTransferHandler在所有平台(Paper / Fabric / Fabric-legacy)注册,支持分块上传和下载
Changed | 变更
- 文件传输数据包从整文件 Base64 缩减为 64KB 切片,避免 WebSocket 帧过大被阻断
NewspaperRemote/目录(C# 独立客户端),由sdk/csharp/类库替代
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
评论 0
登录后参与评分
还没有评论,来抢沙发吧