Lightweight containerized prosody tooling + moved auth scripts + xmpp reconnect/auth stabilization

This commit is contained in:
2026-03-05 02:18:12 +00:00
parent 0718a06c19
commit 2140c5facf
69 changed files with 3767 additions and 144 deletions

View File

@@ -0,0 +1,26 @@
#!/bin/sh
set -eu
AUTH_PY_IN_CONTAINER="/code/utilities/prosody/auth_django.py"
STACK_ID="${GIA_STACK_ID:-${STACK_ID:-}}"
STACK_ID="$(echo "$STACK_ID" | tr -cs 'a-zA-Z0-9._-' '-' | sed 's/^-*//; s/-*$//')"
if [ -n "$STACK_ID" ]; then
GIA_CONTAINER="gia_${STACK_ID}"
else
GIA_CONTAINER="gia"
fi
# Prosody external auth uses line-oriented stdin/stdout.
# We execute one short-lived auth check per line to avoid stale stdin issues
# in long-lived `podman exec -i` sessions after disconnects/restarts.
while IFS= read -r line; do
if [ -z "$line" ]; then
printf '0\n'
continue
fi
printf '%s\n' "$line" | podman exec -i "$GIA_CONTAINER" sh -lc '
cd /code &&
. /venv/bin/activate &&
exec python -u '"$AUTH_PY_IN_CONTAINER"' --once
'
done