AusWeis — Cloudflare Turnstile 验证
AusWeis 是一款轻量级的 Bukkit/Paper 插件,集成了 Cloudflare Turnstile,旨在让玩家在进入服务器前提供无缝的人类身份验证。它在有效阻止机器人攻击的同时,为真实玩家提供了流畅的体验。
我不是英语母语者,如果有任何错误,欢迎指正。
功能
- 简单的工作流程 – 玩家会被踢出一次并收到一个验证链接;在您的网站上完成 Turnstile 挑战后,他们可以正常重新加入。
- 实时 API 检查 – 每次登录都会查询后端 API 以获取玩家的验证状态(无本地缓存,始终最新)。
- 绕过权限 – 授予受信任的玩家(或您自己)
ausweis.bypass 权限,即可完全跳过验证。
- 高度可定制 – 踢出消息、API URL、超时时间等均可在
config.yml 中更改。支持 Minecraft 颜色代码和多行消息。
- 多语言就绪 – 可在配置中选择语言(
en、zh,或在 lang 文件夹中添加自己的 .yml 文件)。内置英文和中文翻译。
- 命令重载 – 使用
/ausweis reload 应用配置更改,无需重启服务器。
- 广泛兼容 – 适用于 Spigot/Paper 从 1.8 到最新版本(已在 1.12.2、1.16.5、1.21+ 上测试)。
安装
- 从 Releases 页面 下载最新的 AusWeis-*.jar。
- 将 JAR 文件放入服务器的
plugins/ 文件夹中。
- 重启 您的服务器(或使用
/reload – 推荐重启)。
- 插件将生成默认的
config.yml 以及包含语言文件的 lang/ 文件夹。
- 编辑
plugins/AusWeis/config.yml 以设置您自己的后端 API URL 和验证页面 URL。
- 运行
/ausweis reload 以应用更改。
配置
# 要使用的语言文件(例如 en、zh)。必须对应 lang 文件夹中的 messages_<lang>.yml 文件。
language: "en"
# 用于检查玩家验证状态的 API URL
api-url: "https://your-server.com/api/check?user={player}"
# 在踢出消息中显示的验证页面 URL
verify-url: "https://your-server.com/verify?user={player}"
# HTTP 请求超时时间(毫秒)
timeout: 5000
# 调试模式,启用更详细的日志
debug: false
命令
| 命令 |
描述 |
权限 |
默认值 |
/ausweis reload |
重载插件配置 |
ausweis.reload |
op |
/ausw reload |
上述命令的别名 |
same |
op |
| 权限 |
描述 |
默认值 |
ausweis.reload |
允许重载配置 |
op |
ausweis.bypass |
绕过验证并始终加入 |
false |
API 规范
您的网站必须提供两个端点:
1. 验证状态查询
2. 验证页面
- URL:
{verify-url}?user={player}
- 功能: 显示 Cloudflare Turnstile 小部件。验证成功后,您的后端应将玩家标记为已验证(例如更新数据库),以便后续的 API 调用返回
true。
参考实现:配套的后端 Web 项目由 @ChineseLiyao 开源 – ChineseLiyao/AusWeis。您可以直接部署它,或将其作为示例使用。
语言
- 在
plugins/AusWeis/lang/ 文件夹中创建一个新文件 messages_<code>.yml(例如法语为 messages_fr.yml)。
- 使用与内置语言文件相同的键(
kick-title、kick-message)。
- 在
config.yml 中设置 language: "<code>" 并重新加载。
构建
如果您希望自行编译插件:
git clone https://github.com/Nskawa/AusWeisPlugin.git
cd AusWeis
mvn clean package
编译后的 JAR 文件将在 target/ 目录中。
许可证
本项目遵循 MIT 许可证 – 详情请参阅 LICENSE 文件。
支持
祝您游戏愉快!
AusWeis — Cloudflare Turnstile Verification
AusWeis is a lightweight Bukkit/Paper plugin that integrates Cloudflare Turnstile to provide frictionless human verification before players enter your server. It effectively stops bot attacks while offering a smooth experience for real players.
I am not a native English speaker, so corrections are welcome if there are any mistakes.
Features
- Simple workflow – Players are kicked once with a verification URL; after completing the Turnstile challenge on your website, they can rejoin normally.
- Real‑time API check – Every login queries your backend API for the player's verification status (no local cache, always up‑to‑date).
- Bypass permission – Grant
ausweis.bypass to trusted players (or yourself) to skip verification entirely.
- Highly customisable – Kick message, API URL, timeout and more can be changed in
config.yml. Supports Minecraft colour codes and multi‑line messages.
- Multi‑language ready – Choose the language in config (
en, zh, or add your own .yml files in the lang folder). Built‑in English and Chinese translations.
- Command reload – Use
/ausweis reload to apply configuration changes without restarting the server.
- Wide compatibility – Works on Spigot/Paper from 1.8 to latest (tested on 1.12.2, 1.16.5, 1.21+).
Installation
- Download the latest AusWeis-*.jar from the Releases page.
- Place the JAR file into your server's
plugins/ folder.
- Restart your server (or use
/reload – restart is recommended).
- The plugin will generate a default
config.yml and a lang/ folder with language files.
- Edit
plugins/AusWeis/config.yml to set your own backend API URL and verification page URL.
- Run
/ausweis reload to apply the changes.
Config
# Language file to use (e.g., en, zh). Must correspond to a messages_<lang>.yml file in the lang folder.
language: "en"
# API URL to check player verification status
api-url: "https://your-server.com/api/check?user={player}"
# Verification page URL to show in kick message
verify-url: "https://your-server.com/verify?user={player}"
# HTTP request timeout in milliseconds
timeout: 5000
# Debug mode, enables more detailed logs
debug: false
Commands
| Command |
Description |
Permission |
Default |
/ausweis reload |
Reload the plugin configuration |
ausweis.reload |
op |
/ausw reload |
Alias for the above |
same |
op |
| Permission |
Description |
Default |
ausweis.reload |
Allows reloading config |
op |
ausweis.bypass |
Bypass verification and always join |
false |
API Specification
Your website must provide two endpoints:
1. Verification Status Query
2. Verification Page
- URL:
{verify-url}?user={player}
- Function: Display the Cloudflare Turnstile widget. After successful verification, your backend should mark the player as verified (e.g., update a database) so that subsequent API calls return
true.
Reference implementation: The companion web backend is open‑sourced by @ChineseLiyao – ChineseLiyao/AusWeis. You can deploy it directly or use it as an example.
Languages
- Create a new file
messages_<code>.yml in the plugins/AusWeis/lang/ folder (e.g., messages_fr.yml for French).
- Use the same keys as in the built‑in language files (
kick-title, kick-message).
- Set
language: "<code>" in config.yml and reload.
Building
If you prefer to compile the plugin yourself:
git clone https://github.com/Nskawa/AusWeisPlugin.git
cd AusWeis
mvn clean package
The compiled JAR will be in the target/ directory.
License
This project is licensed under the MIT License – see the LICENSE file for details.
Support
Happy Gaming!
评论 0
登录后参与评分
还没有评论,来抢沙发吧