Add more debug tools (#158)

This commit is contained in:
CaliBrain
2025-04-22 14:39:43 -07:00
committed by GitHub
parent 93e15cbdd0
commit b6931bb774
2 changed files with 14 additions and 2 deletions
+2 -2
View File
@@ -79,7 +79,7 @@ RUN chmod -R o+rx /usr/bin/chromium && \
# Our custom wanabe curl
RUN echo "#!/bin/sh" > /usr/local/bin/pyrequests && \
echo 'python -c "import sys, requests; url=sys.argv[1]; r=requests.get(url, timeout=10); print(r.text); sys.exit(0) if r.ok else sys.exit(1)" "$@"' \
echo 'python -c "import sys, requests; url=sys.argv[1]; r=requests.get(url, timeout=60); print(r.text); sys.exit(0) if r.ok else sys.exit(1)" "$@"' \
>> /usr/local/bin/pyrequests && \
chmod +x /usr/local/bin/pyrequests
@@ -100,7 +100,7 @@ EXPOSE ${FLASK_PORT}
# Add healthcheck for container status
# This will run as root initially, but check localhost which should work if the app binds correctly.
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
HEALTHCHECK --interval=60s --timeout=60s --start-period=60s --retries=3 \
CMD pyrequests http://localhost:${FLASK_PORT}/request/api/status || exit 1
# Use dumb-init as the entrypoint to handle signals properly
+12
View File
@@ -108,6 +108,18 @@ fi
# Add environment variables (redacting sensitive info)
env | grep -v -E "(AA_DONATOR_KEY)" | sort > "$LOG_DIR/environment.txt"
echo "--- HTTPBin ---" > $LOG_DIR/network_info.txt
pyrequests https://httpbin.org/get >> $LOG_DIR/network_info.txt
ehco ""
echo "--- HowsMySSL ---" >> $LOG_DIR/network_info.txt
pyrequests https://www.howsmyssl.com/a/check >> $LOG_DIR/network_info.txt
ehco ""
echo "--- IPInfo ---" >> $LOG_DIR/network_info.txt
pyrequests https://ipinfo.io >> $LOG_DIR/network_info.txt
ehco ""
echo "--- Cloudflare Trace ---" >> $LOG_DIR/network_info.txt
pyrequests https://1.1.1.1/cdn-cgi/trace >> $LOG_DIR/network_info.txt
# Create the zip file directly from LOG_DIR
ln -s "$LOG_DIR" /tmp/$OUTPUT_FILE_NAME
(cd /tmp && zip -r "$OUTPUT_FILE" $OUTPUT_FILE_NAME > /dev/null 2>&1)