peopleinside/fla-powcaptcha
Composer 安装命令:
composer require peopleinside/fla-powcaptcha
包简介
Local Proof-of-Work CAPTCHA for Flarum – protect login, registration and password reset without any external service
README 文档
README
A local Proof-of-Work CAPTCHA extension for Flarum that protects login, registration and password-reset forms without relying on any external service (no Cloudflare, no Google reCAPTCHA, no cookies).
How it works
- When an auth modal opens, the browser silently fetches a one-time challenge from the Flarum API.
- The browser solves a SHA-256 hash puzzle (finds a nonce N such that
SHA-256(challenge:N)starts with D hex zeros, where D is the configured difficulty). - The solution token
challenge:nonceis appended to the form submission. - The server verifies the solution and rejects the request if the check fails.
Bots must solve the same puzzle for every request; legitimate users complete it invisibly in the background (< 100 ms at the default difficulty).
Features
- 🔒 No external services – fully self-hosted
- ⚡ Invisible to users – solved automatically while they fill the form
- ⚙️ Configurable difficulty – 3 levels (~100 ms → ~10 s)
- 🌓 Dark / light mode – widget adapts to Flarum's current theme
- 🌍 Italian & English – auto-detected; add more locales in
locale/ - 🔁 Replay-proof – each challenge is single-use (stored in Flarum's cache)
- ✅ Flarum 1.x and 2.x compatible
Requirements
| Dependency | Version |
|---|---|
| PHP | ≥ 8.1 |
| Flarum | ^1.8 or ^2.0 |
Screenshot
Disclaimer
This software is provided "AS IS", without any warranty. While it has been tested and reasonable efforts are made to ensure security and reliability, no guarantees are provided. As an open project, anyone may contribute or report issues, but this does not imply endorsement or liability from the maintainers.
You use this software entirely at your own risk. The authors and contributors are not liable for any damages, data loss, or unexpected behavior resulting from its use, modification, or distribution. Always review and test the code independently before deploying it in critical or production environments.
Installation
composer require peopleinside/fla-powcaptcha
For Flarum 1.8 use the version 2.3
The future will be Flarum 2.0 that support the latest release.
Install with
composer require peopleinside/fla-powcaptcha:2.3
Update
composer update peopleinside/fla-powcaptcha
How to remove
composer remove peopleinside/fla-powcaptcha
Then enable the extension in the Flarum admin panel.
Configuration
Go to Admin → Extensions → PoW CAPTCHA and choose:
| Setting | Default | Description |
|---|---|---|
| Enable on Login | ✓ | Protect the login form |
| Enable on Registration | ✓ | Protect the sign-up form |
| Enable on Password Reset | ✓ | Protect the forgot-password form |
| Difficulty | 4 – High (~1 s) | SHA-256 leading-zero count (3–5) |
Development (for contributors only)
The extension is distributed with pre-compiled frontend assets (js/dist/*), so no JS build step is required to install or use it on Flarum 2.x.
After upgrading from an older release on Flarum 1.8, rebuild the forum bundle so auth modals are extended correctly:
cd vendor/peopleinside/fla-powcaptcha/js
npm install
npm run build
php flarum cache:clear
Security Notes
- Each challenge is valid for 5 minutes and is single-use (deleted after successful verification).
- The challenge is a 128-bit cryptographically random value; it cannot be guessed or forged.
- The server independently re-computes the SHA-256 hash to verify the solution.
Running Behind a Reverse Proxy / Load Balancer
Challenges and tokens are bound to the visitor's IP address. If your Flarum instance sits
behind a reverse proxy or load balancer that does not populate REMOTE_ADDR with the real
client IP, you must set one of the following keys in your config.php so Flarum (and
this extension) can resolve the correct IP from forwarded headers:
'proxy_headers' => true(or an explicit list of trusted proxy IPs), or'proxy_all' => true
If neither is set and the server also can't fall back to REMOTE_ADDR, IP resolution
returns empty and this extension will reject all challenge requests with a 429 to fail
safe. A warning is logged in that case ([fla-powcaptcha] ...) — check your Flarum log if
users report being unable to log in, register, or reset their password.
License
peopleinside/fla-powcaptcha 适用场景与选型建议
peopleinside/fla-powcaptcha 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 273 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「security」 「captcha」 「proof-of-work」 「pow」 「flarum」 「bot-protection」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 peopleinside/fla-powcaptcha 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 peopleinside/fla-powcaptcha 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 peopleinside/fla-powcaptcha 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
Provide a way to secure accesses to all routes of an symfony application.
Two Captcha
It's a barebone security class written on PHP
Laravel 5 Securimage helper
Contao CMS integrity check for some files
统计信息
- 总下载量: 273
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 46
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2026-05-14