One Password Auth
一个轻量级的服务端模组/插件,通过一个共享密码保护你的离线(或在线)服务器。专为小型好友团体和私人社区设计——无需个人账户,无需复杂的认证方案,只需一个大家共享的密码!
✅ 核心功能
- 整个服务器访问使用单一共享密码
- 在认证之前保护所有玩家/物品栏,即使拥有 OP 权限的玩家也不例外
- 缓解常见攻击向量(详见 SECURITY.md),包括来自破解客户端的破坏方块数据包
- 玩家通过
/login <password>进行一次认证后,其 IP 将被加入白名单 - 可自定义登录标题和描述
- Discord Webhook 集成,用于事件日志记录
🚀 快速开始
Fabric: 将 one-password-auth-fabric-*.jar 放入 mods/ 目录。需要 Fabric API。
Paper: 将 one-password-auth-paper-*.jar 放入 plugins/ 目录。无需其他依赖。
就是这样!一切开箱即用!下次任何人登录时,将会看到一个登录对话框。
注意: 首次启动时,会生成一个拼音密码(例如
komipu42!)并写入配置文件。该密码不会打印到控制台(日志通常会被共享或保留)——请打开配置文件查看或修改它,或者提前自行编写配置文件以选择您自己的密码。
文件位置
| Fabric | Paper | |
|---|---|---|
| 配置文件 | config/one_password_auth_config.properties |
plugins/OnePasswordAuth/one_password_auth_config.properties |
| IP + UUID 白名单 | config/one_password_auth_ip_whitelist.txt |
plugins/OnePasswordAuth/one_password_auth_ip_whitelist.txt |
| 待处理会话 | config/one_password_auth_sessions.json |
plugins/OnePasswordAuth/one_password_auth_sessions.json |
⚙️ 自定义设置
插件在首次启动时会生成一个包含默认密码(如 komipu42!)以及所有其他可自定义设置的配置文件(其位置见上表)。生成的密码仅写入该文件,而不会输出到控制台,因此请打开文件以读取密码。
除了 password= 这一行之外,其余所有配置项都是可选的!如果未设置密码,服务器将会踢出所有玩家。
要更改任何设置,只需编辑配置文件并重启服务器即可。
设置
| 设置项 | 默认值 | 功能说明 |
|---|---|---|
password |
自动生成 | 所有人通过 /login 命令输入的共享密码。这是唯一必须配置的选项。 |
webhook_url |
无 | 用于玩家动态的 Discord Webhook:包括加入服务器、登录尝试(包含输入的内容)、成功登录、超时以及登录后获得的成就。 |
admin_webhook_url |
无 | 用于安全警报的 Discord Webhook:服务器启动、停止和崩溃,每次连接和断开连接,以及在未认证状态下获得的成就。 |
login_title |
内置 | 锁定屏幕上的大标题。支持 § 代码。 |
login_description |
内置 | 标题下方的副标题。支持 § 代码。 |
timeout_seconds |
180 |
未认证玩家在多少秒无活动后被踢出。 |
| geolocation_url | https://ipwho.is/ | 用于在 Discord 日志中显示尽力而为的 IP 地理定位的基础 URL。使用 HTTPS。将其留为空白以完全禁用第三方 IP 查询(例如出于隐私考虑)。 |
示例
password=komipu42!
webhook_url=https://discord.com/api/webhooks/xxx/yyy
admin_webhook_url=https://discord.com/api/webhooks/xxx/zzz
login_title=§6欢迎来到我的服务器!
login_description=§7输入 /login <密码> 以加入
timeout_seconds=180
在 login_title 或 login_description 中使用 § 后跟颜色/格式代码进行样式设置(例如 §6 金色,§l 加粗)。完整列表请参阅 。
🛡️ 防御的攻击向量
在玩家登录之前,他们会被冻结在原地、获得无敌效果、致盲并进入旁观者模式。此外,该模组还会阻止:
- 破坏方块 — 通过发送虚假数据包的作弊客户端实现
- 移动或传送离开 — 玩家在每个游戏刻(tick)的位置都被锁定
- 外部状态漂移与模组干扰 — 封锁效果在每个游戏刻都会被重新施加
- 管理员命令与 OP 权限 — 在封锁期间,所有 OP 权限均被移除
- 最小化 IP 欺骗 — 成功的登录会被保存为用户 UUID 和 IP 的配对记录
- 同账号会话劫持 — 如果用户已经登录,第二次登录尝试将被拒绝,而不是将其踢出
- 暴力破解 —
/login尝试之间设有每个 IP 的最小间隔时间,从而限制暴力破解速度;尝试 7 次后仍会被踢出,长时间空闲也会被踢出。基于 IP 的限制会跨重连保持有效(你无法通过重新加入服务器来重置该限制)。 - 连接洪水攻击(DoS) — 基于每个 IP 的连接速率限制(令牌桶算法)会在入口处阻止连接洪水攻击,且该限制同样支持跨重连持久化。待处理会话存储有上限,并在主线程之外进行持久化,因此即使出现大量唯一用户的连接请求,也不会导致服务器卡顿或使内存/会话文件无限增长。
有关完整的威胁模型及各项缓解措施的限制,请参阅 SECURITY.md。
🔨 未来开发
如有需要,我可能会为该模组添加新功能。它目前运行于 Fabric 和 Paper 平台;如果其他平台用户感兴趣,后续可能会适配更多平台。
One Password Auth
A lightweight server-side mod/plugin that protects your offline (or online) server with a single shared password. Designed for small friend groups and private communities—no per-user accounts, no complex authentication schemes, just one password everyone shares!
✅ Core Features
- Single shared password for entire server access
- Secures all players/inventories before authenticating, even those with OP access
- Mitigates common attack vectors (see SECURITY.md) including block-breaking packets from hacked clients
- Players authenticate once with
/login <password>then they're IP whitelisted - Customizable login title and description
- Discord webhook integration for event logging
🚀 Getting Started
Fabric: drop one-password-auth-fabric-*.jar into mods/. Needs Fabric API.
Paper: drop one-password-auth-paper-*.jar into plugins/. Nothing else needed.
That's it! Everything should work out of the box! The next time anyone logs in, they will be greeted with a login dialogue.
Note: On first boot a phonetic password (e.g.
komipu42!) is generated and written to the config file. The password is not printed to the console (logs are often shared/retained) — open the config file to view or change it, or write the config file yourself beforehand to choose your own.
Where the files live
| Fabric | Paper | |
|---|---|---|
| Config | config/one_password_auth_config.properties |
plugins/OnePasswordAuth/one_password_auth_config.properties |
| IP + UUID whitelist | config/one_password_auth_ip_whitelist.txt |
plugins/OnePasswordAuth/one_password_auth_ip_whitelist.txt |
| Pending sessions | config/one_password_auth_sessions.json |
plugins/OnePasswordAuth/one_password_auth_sessions.json |
⚙️ Customization
Upon first boot the plugin will generate a config file with a default password (such as komipu42!) and all additional customizable settings (see the table above for where it is). The generated password is written only to that file, not the console, so open the file to read it.
All the lines except for password= are optional! The server will kick everyone if no password is set.
To change any settings, just edit the config file and restart the server.
Settings
| Setting | Default | What it does |
|---|---|---|
password |
generated | The shared password everyone types with /login. The only required line. |
webhook_url |
none | Discord webhook for the player feed: joins, login attempts (including what was typed), successes, timeouts, and advancements earned after logging in. |
admin_webhook_url |
none | Discord webhook for security: server start, stop and crash, every connect and disconnect, and advancements earned while still unauthenticated. |
login_title |
built in | Big title on the lockdown screen. Supports § codes. |
login_description |
built in | Subtitle under it. Supports § codes. |
timeout_seconds |
180 |
Kick an unauthenticated player after this many seconds of inactivity. |
geolocation_url |
https://ipwho.is/ |
Base URL for best-effort IP geolocation shown in Discord logs. Uses HTTPS. Leave blank to disable third-party IP lookups entirely (e.g. for privacy). |
Example
password=komipu42!
webhook_url=https://discord.com/api/webhooks/xxx/yyy
admin_webhook_url=https://discord.com/api/webhooks/xxx/zzz
login_title=§6Welcome to my server!
login_description=§7Type /login <password> to join
timeout_seconds=180
Use § followed by a color/format code in login_title or login_description for styling (e.g. §6 gold, §l bold). See for the full list.
🛡️ Attack Vectors Defended
Before they log in, players are frozen in place, made invincible, blinded, and put into spectator. On top of that, this mod also blocks:
- Breaking blocks — via hacked clients that send fake packets
- Moving or teleporting away — players are locked in position on every tick
- External state drift & Mod interference — lockdown effects are re-asserted every tick
- Admin commands & OP powers — all op permissions are taken away on lockdown
- Minimized IP-spoofing — successful logins are saved as a user UUID and IP pair
- Same-account session hijacking — if they're already logged in, a second login gets denied instead of kicking them
- Bruteforcing — a per-IP minimum interval between
/loginattempts caps brute-force speed; still kicked after 7 tries and kicked if idle too long. The per-IP throttle is keyed by IP, so it survives reconnects (you can't reset it by rejoining). - Connection flooding (DoS) — a per-IP connection rate limit (token bucket) refuses connection floods at the door, and it too survives reconnects. The pending-session store is bounded and persisted off the main thread, so a flood of unique joins can't stall the server or grow memory/the session file without limit.
See SECURITY.md for the full threat model and the limits of each mitigation.
🔨 Future Development
Upon request I may add features to this mod. It runs on Fabric and Paper; other platforms may follow if others are interested.
下载 One Password Auth
下载 One Password Auth
下载 One Password Auth
下载 One Password Auth
下载 One Password Auth
下载 One Password Auth
下载 One Password Auth
下载 One Password Auth
下载 One Password Auth
下载 One Password Auth
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧