diff --git a/verifier/README.md b/verifier/README.md new file mode 100644 index 0000000..6985e88 --- /dev/null +++ b/verifier/README.md @@ -0,0 +1,4 @@ + +Script and Containerfile for deployment verification + + diff --git a/verifier/qrverify.sh b/verifier/qrverify.sh new file mode 100755 index 0000000..1591316 --- /dev/null +++ b/verifier/qrverify.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# EP should contain the hostname? +# If passing it is impossible, maybe we should interrogate Ingress resource? +# +# uuidgen comes from util-linux, zbarimg from zbar + +set -e + +DATA=$(uuidgen) +TMPFILE=$(mktemp --suffix .png) + +echo "➡️ Checking ${EP} with data: ${DATA}" + +curl --verbose "http://${EP}/render/?data=${DATA}" --output ${TMPFILE} + +DECODED=$(zbarimg --quiet ${TMPFILE}) + +if [ "QR-Code:${DATA}" != "${DECODED}" ]; then + echo "❌ Error, got ${DECODED}" + exit 1 +else + echo "✅ OK!" +fi + +exit 0 + +