Fix welcomebot-signups: heredoc instead of -c string to avoid bash/python quote clash

This commit is contained in:
2026-07-02 16:56:21 -07:00
parent 00dec0266c
commit 0fd6f1c142
+8 -4
View File
@@ -52,11 +52,11 @@ if ! docker inspect "$CONTAINER" >/dev/null 2>&1; then
echo "welcomebot-signups: container '$CONTAINER' not found (is it deployed/running?)" >&2; exit 1 echo "welcomebot-signups: container '$CONTAINER' not found (is it deployed/running?)" >&2; exit 1
fi fi
docker exec \ docker exec -i \
-e SIG_LIMIT="$limit" \ -e SIG_LIMIT="$limit" \
-e SIG_FLAGGED_ONLY="$flagged_only" \ -e SIG_FLAGGED_ONLY="$flagged_only" \
-e SIG_ACCT="$acct_filter" \ -e SIG_ACCT="$acct_filter" \
"$CONTAINER" python3 -c ' "$CONTAINER" python3 <<'PYEOF'
import os import os
import sqlite3 import sqlite3
@@ -81,7 +81,11 @@ rows = conn.execute(sql, params).fetchall()
if not rows: if not rows:
print("(no matching signup records)") print("(no matching signup records)")
for acct, ip, classification, org, flagged, ipblock, ts in rows: for acct, ip, classification, org, flagged, ipblock, ts in rows:
acct = acct or ""
ip = ip or ""
classification = classification or ""
org = org or ""
flag = "FLAGGED" if flagged else "-" flag = "FLAGGED" if flagged else "-"
ipb = "ipblock=yes" if ipblock else "ipblock=no" ipb = "ipblock=yes" if ipblock else "ipblock=no"
print(f"{ts} {acct or '':20s} {ip or '':16s} {classification or '':12s} {flag:8s} {ipb:12s} {org or ''}") print(f"{ts} {acct:20s} {ip:16s} {classification:12s} {flag:8s} {ipb:12s} {org}")
' PYEOF