mirror of
https://github.com/auricom/home-cluster.git
synced 2025-09-17 18:24:14 +02:00
feat: opnsense backup healtchecks
This commit is contained in:
@@ -9,6 +9,11 @@ set -o xtrace
|
|||||||
# Cleanup temporary files on script exit
|
# Cleanup temporary files on script exit
|
||||||
trap 'rm -f "/tmp/${config_filename}"' 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"
|
config_filename="$(date "+%Y%m%d-%H%M%S").xml"
|
||||||
|
|
||||||
http_host=${S3_URL#*//}
|
http_host=${S3_URL#*//}
|
||||||
@@ -35,3 +40,8 @@ curl -fsSL \
|
|||||||
-H "Content-Type: text/xml" \
|
-H "Content-Type: text/xml" \
|
||||||
-H "Authorization: AWS ${AWS_ACCESS_KEY_ID}:${http_signature}" \
|
-H "Authorization: AWS ${AWS_ACCESS_KEY_ID}:${http_signature}" \
|
||||||
"${S3_URL}/${http_filepath}"
|
"${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
|
||||||
|
@@ -13,5 +13,5 @@ spec:
|
|||||||
name: homelab-opnsense-backup-secret
|
name: homelab-opnsense-backup-secret
|
||||||
dataFrom:
|
dataFrom:
|
||||||
- extract:
|
- 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
|
key: homelab-opnsense
|
||||||
|
Reference in New Issue
Block a user