Add an optional proof of work for joining rooms #1
Loading…
Reference in a new issue
No description provided.
Delete branch "asxpi/anotherim-server:feat/muc-pow"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Registration already sits behind an XEP-0158 SHA-256 hashcash, but
ejabberd 26.09 only offers an image CAPTCHA for captcha_protected rooms:
its captcha_pow (processone/ejabberd#4594) is wired into registration
alone. Spam bots joining public rooms are the next problem, and an image
CAPTCHA needs ImageMagick on the server and a person at the client.
Carry a patched copy of ejabberd_captcha in ejabberd/overrides that
also offers the SHA-256 field in a room's challenge, compiled and tested
in the build and swapped for the release's beam after checking that beam
is 26.09's own. upstream.diff is the same change against the 26.09
source, meant to go upstream so the override can be dropped.
MUC_CAPTCHA=1 makes new rooms captcha_protected (off by default, as the
apps cannot answer a room's challenge yet); make muc-captcha switches
existing rooms. CAPTCHA_IMAGE=1 builds an image with ImageMagick and
offers a picture beside the proof of work, for people on clients that
cannot solve it. Owners, admins, members and captcha_whitelist are never
challenged.
Tested: make test (131), make test-muc-pow (25), make test-login (18).
Part of a proof of concept across anotherim-server, libtacky and anotherim-js (branch
feat/muc-powin each). Each part is tested on its own; not yet run end to end.🤖 Generated with Claude Code
Thanks, this is close to what we did in parallel on feat/room-pow. That branch is a patch on the 26.09 source plus a .deb for servers on ProcessOne's packages, which is what production runs; this PR's override only reaches our container image.
One real issue here: with captcha_pow set and no captcha_cmd, is_feature_available/0 becomes true, and mod_register_web relies on it. Web registration would then refuse everyone (captcha_not_valid) and try to draw an image it cannot make, so those two calls need to check captcha_cmd instead. Also, the PoW-only body talks about joining a room, but create_captcha/6 serves mod_block_strangers too.
We'll go with feat/room-pow for the patch itself, so I'm closing this one. MUC_CAPTCHA and
make muc-captchacould come as a small follow-up PR on top of it if we decide we want them.Pull request closed