refactor(lab): drive docker from python so the cli works on windows and posix without bash

This commit is contained in:
ZSecurity
2026-10-24 14:07:06 +07:00
parent 8366583c43
commit 476b3d2078
8 changed files with 305 additions and 54 deletions
+7 -7
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -eu
NAME=${NAME:-p2s-lab}
docker exec "$NAME" php -v | head -1
docker exec "$NAME" php -i 2>/dev/null | grep -E '^(display_errors|memory_limit|post_max_size|output_buffering|max_file_uploads|max_input_vars|session.upload_progress.enabled|session.save_handler|session.serialize_handler)'
docker exec "$NAME" sha256sum /usr/lib/apache2/modules/libphp.so
docker exec "$NAME" apache2 -v | head -1
docker exec "$NAME" sh -c "grep -v '^#' /etc/apache2/conf-enabled/zz-p2s.conf | grep -v '^$'"
docker exec "$NAME" sh -c 'pgrep -c apache2'
HERE=$(cd "$(dirname "$0")" && pwd)
cd "$HERE/.."
PY=${PYTHON:-}
if [ -z "$PY" ]; then
if command -v python >/dev/null 2>&1; then PY=python; else PY=python3; fi
fi
exec "$PY" -m poc status "$@"