After copying a backup from Home Assistant, compare its SHA-256 (via sha256sum on the server) with a hash of the local file. On mismatch, delete the local copy and send an error notification; the remote backup is left in place so the run can be retried. If either checksum cannot be computed, the run fails rather than reporting an unverified copy as successful. - Add VERIFY_CHECKSUM config option (default true; "false" skips the check) - Make boolean config values case-insensitive (VERIFY_CHECKSUM, NTFY_ENABLED, DISCORD_ENABLED), so "True" now enables them. Previously only lowercase "true" did, so NTFY_ENABLED="True" silently left ntfy off - Bump version to 3.3.0
48 lines
2.4 KiB
Plaintext
48 lines
2.4 KiB
Plaintext
### Global Settings ###
|
|
# Set your Home Assistant SSH credentials
|
|
HA_SSH_KEY="SSH_PRIVATE_KEY" # Replace with your SSH Private key for HomeAssistant
|
|
HA_SSH_USER="SSH_USER" # Replace with your HomeAssistant server username (Default is root)
|
|
HA_SSH_HOST="SSH_HOST_IP_OR_HOSTNAME" # Replace with your HomeAssistant server IP address
|
|
HA_SSH_PORT="SSH_PORT" # Replace with your HomeAssistant server port
|
|
|
|
## Storage
|
|
# Set the backup destination path
|
|
BACKUP_DEST="BACKUP_FILE_DESTINATION" # Replace with the location for the backup files
|
|
|
|
# Set the location of the Home Assistant backups (Set to default location /backup)
|
|
# If you have a custom install, using the likes of Supervised
|
|
# this location should normally be /usr/share/hassio/backup
|
|
BACKUP_FILE_LOCATION="/backup"
|
|
|
|
# Storage threshold (in KB) for triggering cleanup
|
|
STORAGE_THRESHOLD_KB=2097152 # 2GB = 2 * 1024 * 1024 KB
|
|
# Set clean up old backups (adjust the number of days to keep)
|
|
LOCAL_BACKUP_CLEANUP="90" # Set the number of days that local backup files will be kept for (Default 90 days)
|
|
REMOTE_BACKUP_CLEANUP="30" # Set the number of days that backups on the Home Assistant server will be kept for (Default 30 days)
|
|
|
|
## Notification Settings
|
|
# ntfy settings
|
|
NTFY_ENABLED=false # Set to 'true' to enable ntfy notifications
|
|
NTFY_SERVER="NTFY_SERVER_FQDN_ADDRESS" # Replace with your ntfy server address
|
|
NTFY_TOPIC="NTFY_TOPIC" # Replace with your ntfy topic
|
|
|
|
# Discord webhook settings
|
|
DISCORD_ENABLED=false # Set to 'true' to enable Discord notifications
|
|
DISCORD_WEBHOOK_URL="DISCORD_WEBHOOK_URL" # Replace with your Discord webhook URL
|
|
|
|
|
|
## Logging
|
|
# Set the log file location (Default /var/log/ha-backup.log)
|
|
# The file must be writable by the user running ha-backup, see the README
|
|
# Set to "none" to disable logging to a file (console output is unaffected)
|
|
LOG_FILE="/var/log/ha-backup.log"
|
|
|
|
## File Validation
|
|
# Verify the local copy against the backup on the Home Assistant host using
|
|
# SHA-256 (sha256sum on the server, compared with the hash of the local file).
|
|
# If the hashes differ, the local copy is deleted and an error notification is
|
|
# sent; the backup on the Home Assistant server is left untouched so you can retry.
|
|
# Verification reads the whole file twice (once on each side), so it adds time
|
|
# on large backups. Set to "false" to skip it. Accepts true/false in any case.
|
|
VERIFY_CHECKSUM="true" # "true" (default) or "false"
|