allow source inspection of cgi script

This commit is contained in:
Thomas (Tom) C. Gorordo 2026-05-22 04:09:27 -07:00
parent 47de09c59c
commit 84d6380081
Signed by: tgorordo
GPG key ID: 0CBED22BB0D94490

View file

@ -1,5 +1,15 @@
#!/usr/bin/bash
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [[ "$QUERY_STRING" == "source" ]]; then
echo "Content-Type: text/plain"
echo
echo "<pre>"
sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' "$0"
echo "</pre>"
exit 0
fi
exec "$SCRIPT_DIR/../../.venv/bin/python" "$SCRIPT_DIR/script.py"