From ce663b1346a2aaee248621972638e19e8b913e3c Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 20 May 2024 01:53:10 +0000 Subject: [PATCH] scripts: add `health-check` as a sort of poor-mans manual CI --- scripts/health-check | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/health-check diff --git a/scripts/health-check b/scripts/health-check new file mode 100755 index 00000000..2ab0e88e --- /dev/null +++ b/scripts/health-check @@ -0,0 +1,25 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl -p dig +set -eu + +echo "this script will check that uninsane.org is baseline operational" +echo "it doesn't check all services, just the most critical ones" +echo "" + +set -x + +nslookup uninsane.org. > /dev/null || echo "uninsane.org. DNS not reachable" +nslookup uninsane.org. 1.1.1.1 > /dev/null || echo "uninsane.org. DNS not reachable via external resolver" +nslookup uninsane.org. ovpns.uninsane.org > /dev/null || echo "uninsane.org. bootstrap DNS not reachable" + +curl --silent --fail-with-body https://uninsane.org > /dev/null || echo "https://uninsane.org not online" +curl --silent --fail-with-body https://matrix.uninsane.org > /dev/null || echo "https://matrix.uninsane.org not online" +curl --silent --fail-with-body https://fed.uninsane.org > /dev/null || echo "https://fed.uninsane.org not online" + +nslookup -querytype=TXT _dmarc.uninsane.org. > /dev/null || echo "missing DMARC record for uninsane.org" + +set +x +echo "" +echo "SUCCESS" +echo "now manually test email services:" +echo "- "