Better-WebConsole
适用于 Paper/Purpur/Spigot 1.21.x 服务器的安全浏览器控制台和管理面板。
功能特性
Web 控制台
- 内置 Jetty Web 服务器,包含一个内嵌的 Web UI。
- 通过 WebSocket 实时流式传输控制台日志,并为新会话提供缓冲历史记录。
- 通过服务器命令映射执行控制台命令,包括来自插件(如 CMI)的命令。
- 在浏览器中支持命令历史、过滤、日志导出和清空操作。
- 通过
!alias 配置 Web 别名,支持使用 && 进行链式别名调用。
- 审计日志记录认证事件、命令执行、玩家行为及日志导出。
管理面板
- 面向桌面的双列布局仪表盘,用于服务器管理。
- 服务器健康状态:TPS、JVM 堆内存、在线玩家数、世界、已加载区块、实体数量及会话错误。
- 机器健康状态:主机 CPU 负载、Java 进程 CPU 负载、物理 RAM、服务器磁盘使用情况以及 JVM 线程计数。
- TPS、JVM RAM、在线玩家数和主机 CPU 的性能历史图表。
- 机器详情:CPU 型号、核心/线程数、内存、磁盘挂载点、操作系统、Java 运行时、PID 及 JVM 运行时间。
- 分析模块:按日志级别统计、各世界的区块/实体分布及近期活动。
- 玩家列表,支持快速踢出/封禁操作。
安全性
- Web 用户存储在
plugins/Better-WebConsole/users.dat 中,密码采用 BCrypt 哈希加密。
- 使用 HttpOnly + SameSite 会话 Cookie,HTTPS 反向代理时可选启用 Secure Cookie。
- 登录页面 CSRF 防护。
- 支持 CIDR 格式的 IP 白名单。
- 登录锁定机制及命令频率限制。
- 可选的危险命令黑名单。
首次设置
- 将 JAR 文件放入服务器的
plugins/ 文件夹。
- 启动服务器一次以生成
plugins/Better-WebConsole/config.yml。
- 创建 Web 用户:
/bwc adduser admin YourStrongPassword123
- 访问:
http://your-server-ip:4242
生产环境建议:绑定到 127.0.0.1,并通过 Nginx、Caddy、VPN 或隧道配合 HTTPS 暴露面板。
命令
主命令别名:/betterwebconsole, /bwc, /webconsole, /bwconsole, /betterconsole。
权限:betterwebconsole.admin(默认:op)。
| 命令 |
描述 |
/bwc status |
显示 Web 服务器、用户、会话及配置状态 |
/bwc reload |
重载不需要重启 Web 服务器的配置值 |
/bwc adduser <user> <password> |
添加 Web 用户 |
/bwc removeuser <user> |
移除 Web 用户并使会话失效 |
/bwc listusers |
列出 Web 用户 |
/bwc setpassword <user> <new-password> |
更改密码并使会话失效 |
/bwc logoutall <user> |
使某用户的所有活跃会话失效 |
额外命令别名:useradd, createuser, deluser, deleteuser, users, passwd, password, killsessions。
配置
默认配置文件刻意保持精简,仅包含已实现的行为。
web:
port: 4242
bind-address: "0.0.0.0"
log-buffer-size: 1000
security:
session-timeout-minutes: 60
max-login-attempts: 5
lockout-duration-minutes: 15
command-rate-limit-per-minute: 30
ip-whitelist: []
secure-cookies: false
logging:
log-commands: true
log-auth: true
audit-log: true
system-stats:
# 向仪表盘添加主机 CPU、机器 RAM、磁盘、OS 和 JVM 详情。
enabled: true
# OS 级别的轮询间隔。生产服务器请保持在 2 秒以上。
update-interval-seconds: 5
# 报告 Minecraft 服务器文件夹的磁盘使用情况。
show-disk: true
commands:
blocked: []
aliases:
tps: "tps"
list: "list"
save: "save-all"
day: "time set day"
night: "time set night"
clear-weather: "weather clear"
如果主机不允许获取 OS 级别指标,或者你只需要 Minecraft/JVM 数据,可以禁用 system-stats。
使用 commands.blocked 来阻止 Web 端访问高风险命令,例如:
commands:
blocked: ["stop", "restart", "op", "deop"]
在 Web 控制台中输入 !名称 即可使用别名。别名最多可通过 && 链接 10 个命令。
/bwc reload 会更新别名、日志、系统统计设置及命令黑名单规则。修改 web.port、web.bind-address、security.ip-whitelist、会话超时或速率限制设置后,需重启 Minecraft 服务器。
安全须知
- 除非已配置防火墙/IP 白名单/VPN 规则,否则不要直接将
0.0.0.0:4242 暴露给互联网。
- 仅在用户通过 HTTPS 访问面板时设置
secure-cookies: true。
- 阻止或避免使用破坏性命令,如
stop、restart、op、deop、ban-ip 和 whitelist。
- 保持别名简短且可审计。
- 仅当所有 Web 用户都被信任为完整控制台管理员时,才将
commands.blocked 留空。
- 将机器指标视为运营数据:仅向受信任的管理员暴露面板。
Better-WebConsole
Secure browser console and admin dashboard for Paper/Purpur/Spigot 1.21.x servers.
Features
Web Console
- Embedded Jetty web server with one built-in web UI.
- Live console log streaming over WebSocket with buffered history for new sessions.
- Console command execution through the server command map, including commands from plugins such as CMI.
- Command history, filtering, log export and clear action in the browser.
- Configurable web aliases through
!alias, including chained aliases with &&.
- Audit log for auth events, command execution, player actions and log exports.
Dashboard
- Desktop-focused two-column dashboard layout for server administration.
- Server health: TPS, JVM heap, online players, worlds, loaded chunks, entities and session errors.
- Machine health: host CPU load, Java process CPU load, physical RAM, server disk usage and JVM thread counts.
- Performance history charts for TPS, JVM RAM, online players and host CPU.
- Machine details: CPU model, cores/threads, memory, disk mount, OS, Java runtime, PID and JVM uptime.
- Analytics blocks for log levels, per-world chunks/entities and recent activity.
- Player list with quick kick/ban actions.
Security
- Web users stored in
plugins/Better-WebConsole/users.dat with BCrypt hashes.
- HttpOnly + SameSite session cookies, optional Secure cookies for HTTPS reverse proxies.
- CSRF protection for login.
- IP whitelist with CIDR support.
- Login lockout and command rate limit.
- Optional command block list for dangerous console commands.
First Setup
- Put the JAR into the server
plugins/ folder.
- Start the server once to generate
plugins/Better-WebConsole/config.yml.
- Create a web user:
/bwc adduser admin YourStrongPassword123
- Open:
http://your-server-ip:4242
Production recommendation: bind to 127.0.0.1 and expose the panel through Nginx, Caddy, a VPN or a tunnel with HTTPS.
Commands
Main command aliases: /betterwebconsole, /bwc, /webconsole, /bwconsole, /betterconsole.
Permission: betterwebconsole.admin (default: op).
| Command |
Description |
/bwc status |
Show web server, user, session and config status |
/bwc reload |
Reload config values that do not require web server restart |
/bwc adduser <user> <password> |
Add a web user |
/bwc removeuser <user> |
Remove a web user and invalidate sessions |
/bwc listusers |
List web users |
/bwc setpassword <user> <new-password> |
Change password and invalidate sessions |
/bwc logoutall <user> |
Invalidate active sessions for a user |
Extra command aliases: useradd, createuser, deluser, deleteuser, users, passwd, password, killsessions.
Configuration
The default config is intentionally small and only contains implemented behavior.
web:
port: 4242
bind-address: "0.0.0.0"
log-buffer-size: 1000
security:
session-timeout-minutes: 60
max-login-attempts: 5
lockout-duration-minutes: 15
command-rate-limit-per-minute: 30
ip-whitelist: []
secure-cookies: false
logging:
log-commands: true
log-auth: true
audit-log: true
system-stats:
# Adds host CPU, machine RAM, disk, OS and JVM details to the dashboard.
enabled: true
# OS-level polling interval. Keep this above 2 seconds for production servers.
update-interval-seconds: 5
# Reports disk usage for the Minecraft server folder.
show-disk: true
commands:
blocked: []
aliases:
tps: "tps"
list: "list"
save: "save-all"
day: "time set day"
night: "time set night"
clear-weather: "weather clear"
system-stats can be disabled if the host does not allow OS-level metrics or if you only need Minecraft/JVM data.
Use commands.blocked to prevent risky commands from web access, for example:
commands:
blocked: ["stop", "restart", "op", "deop"]
Use an alias by typing !name in the web console. Aliases can chain up to 10 commands with &&.
/bwc reload updates aliases, logging, system stats settings and command block rules. Restart the Minecraft server after changing web.port, web.bind-address, security.ip-whitelist, session timeout or rate-limit settings.
Security Notes
- Do not expose
0.0.0.0:4242 directly to the internet unless firewall/IP whitelist/VPN rules are in place.
- Set
secure-cookies: true only when users access the panel through HTTPS.
- Block or avoid destructive commands such as
stop, restart, op, deop, ban-ip and whitelist.
- Keep aliases short and auditable.
- Keep
commands.blocked empty only when every web user is trusted as a full console administrator.
- Treat machine metrics as operational data: expose the panel only to trusted administrators.
评论 0
登录后参与评分
还没有评论,来抢沙发吧