feat: opnsense backup healtchecks

This commit is contained in:
auricom
2025-02-22 03:27:43 +01:00
parent f480f09082
commit ff86a327a7
2 changed files with 11 additions and 1 deletions

View File

@@ -9,6 +9,11 @@ set -o xtrace
# Cleanup temporary files on script exit
trap 'rm -f "/tmp/${config_filename}"' EXIT
# Send start ping to healthchecks
if [[ -n "${HEALTHCHECKS_ID:-}" ]]; then
curl --max-time 10 --retry 5 "https://hc-ping.com/${HEALTHCHECKS_ID}/start"
fi
config_filename="$(date "+%Y%m%d-%H%M%S").xml"
http_host=${S3_URL#*//}
@@ -35,3 +40,8 @@ curl -fsSL \
-H "Content-Type: text/xml" \
-H "Authorization: AWS ${AWS_ACCESS_KEY_ID}:${http_signature}" \
"${S3_URL}/${http_filepath}"
# Send completion ping to healthchecks
if [[ -n "${HEALTHCHECKS_ID:-}" ]]; then
curl --max-time 10 --retry 5 "https://hc-ping.com/${HEALTHCHECKS_ID}"
fi

View File

@@ -13,5 +13,5 @@ spec:
name: homelab-opnsense-backup-secret
dataFrom:
- extract:
# OPNSENSE_KEY, OPNSENSE_SECRET, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
# OPNSENSE_KEY, OPNSENSE_SECRET, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, HEALTHCHECKS_ID
key: homelab-opnsense