mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-09-24 15:00:19 +01:00
Add more debug tools (#158)
This commit is contained in:
+2
-2
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user