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
### Fixed
- Backup failures caused by low disk space on the Home Assistant host are now
reported as such, e.g. "not enough disk space on Home Assistant server
(1.2 GB free, threshold 2.0 GB)", instead of only "failed to extract backup slug".
- A failed `ha backup new` now includes Home Assistant's own error message in
the notification and log.
### Changed
- Free space is re-checked after the remote cleanup runs. If it is still below
`STORAGE_THRESHOLD_KB`, a warning is sent to ntfy/Discord before the backup
is attempted.
- The remote cleanup now logs how many backups it found, and says when none are
older than `REMOTE_BACKUP_CLEANUP` days.
### Added
- File logging to `/var/log/ha-backup.log`. Each line has a full date and time,
and the file is appended to on every run.
- New `LOG_FILE` setting in `home_assistant_backup.conf`. Set it to a custom
path, or to `"none"` to disable file logging.
- `ssh`/`scp` error output is also written to the log file.
- Deletions of old local backups are now logged.
### Changed
- All console messages now go through the same logger, so remote cleanup,
notification failures and config validation errors appear in the log too.
- If the log file can't be opened (for example, no write permission to
`/var/log`), a warning is printed and the backup continues without file logging.
- The terminal progress bar stays on the console only and is not written to the log.
Rewrite home_assistant_backup.sh as a single Go binary that reads the
existing home_assistant_backup.conf unchanged.
- Create a backup over SSH, scp it locally, and prune old backups both
on the HA host (when free space is low) and locally
- Send ntfy and Discord notifications at the same points as the script
- Drop the jq and yq dependencies: parse `ha backups --raw-json` and
`ha backup new --raw-json` in Go, falling back to `slug:` line parsing
- Add timestamped progress output, a heartbeat while HA builds the
backup, and live size/percent/speed reporting during the copy
- Build the Discord payload with json.Marshal and validate backup slugs
before using them in remote commands
- Abort with a notification if the remote disk-space check fails
- Add -config and -version flags
- Build with CGO_ENABLED=0 for a static binary that runs on older glibc