✨ Implement ENABLE_REGISTRATION via user_api module ✨

- docker/rootfs/usr/local/share/prosody-plugins/mod_user_api.lua: new POST /user-api/register endpoint (JSON, validation, reserved names, per-IP rate limit, refuses when AUTH_TYPE is not internal)
- docker/rootfs/usr/local/bin/entrypoint.sh: read ENABLE_REGISTRATION, load user_api on the main host only when ENABLE_AUTH is on, warn otherwise
- docker/compose.yml: add ENABLE_REGISTRATION
- README.md: document registration
This commit is contained in:
casjay committed 2026-11-08 10:34:11 -05:00
1 parent 1ca3f2e79d
commit 160c552809
4 files changed
+98

No files matched your search

+11
View File
@@ -39,6 +39,7 @@ set -euo pipefail
[[ "${AUTH_TYPE}" == "openfire" ]] && OPENFIRE_AUTH_ENABLED=1
export OPENFIRE_AUTH_ENABLED
: "${DISABLE_POLLS:=0}"
: "${ENABLE_REGISTRATION:=0}"
# Derived: AUTH_TYPE selects the authentication module for user accounts
# internal -> internal_hashed (local accounts only)
@@ -239,6 +240,16 @@ VirtualHost "${XMPP_DOMAIN}"
"features_identity";
SITE_START
# Registration endpoint used by the jitsi-web /register page
# Needs ENABLE_AUTH: anonymous auth has nowhere to store accounts
if [[ "${ENABLE_REGISTRATION}" == "1" ]] || [[ "${ENABLE_REGISTRATION}" == "true" ]]; then
if [[ "${main_auth}" == "jitsi-anonymous" ]]; then
echo "WARN: ENABLE_REGISTRATION ignored: requires ENABLE_AUTH=1" >&2
else
printf ' "user_api";\n' >> "${PROSODY_SITE_CFG}"
fi
fi
# Optional XMPP_MODULES
if [[ -n "${XMPP_MODULES:-}" ]]; then
while IFS=',' read -ra mods; do