Skip to content

feat: add verified SMB backups with SHA-256 read-back and calendar retention - #245

Open
twproject wants to merge 1 commit into
jcwillox:mainfrom
twproject:feat/verified-nas-backups
Open

twproject wants to merge 1 commit into
jcwillox:mainfrom
twproject:feat/verified-nas-backups

Conversation

@twproject

Copy link
Copy Markdown

Adds an opt-in SMB/NAS destination that marks a backup successful and rotates older copies only after a complete NAS read-back matches the original Supervisor archive's SHA-256 and byte count.

Behaviour

  • NAS mode is disabled by default and requires Supervisor. Existing non-NAS expiry handling remains available.
  • Stream uploads through a temporary file, compare SHA-256 and size, then publish the archive and a standard .sha256 sidecar. Keep an independent verification receipt in Home Assistant storage.
  • Configurable daily/Sunday/monthly retention shares one archive across tiers and keeps at most one archive per calendar date. Only this installation's namespace is managed; unrelated files and manual local backups are preserved.
  • Failed creation or verification does not trigger rotation. Integrity errors suspend retention until full verification succeeds.
  • Add NAS options, a status sensor, check_nas and verify_nas actions, and optional validation/adoption of existing unencrypted Samba Backup archives. Historical baselines without a surviving original are explicitly distinguished from source-to-NAS comparisons.
  • Add the pinned pysmb==1.2.15 dependency. No notification destinations, NAS addresses, credentials, or installation-specific automations are included.

Validation

  • 21 standalone SMB failure-path and retention tests.
  • 4 manager-flow tests and 6 existing purge regressions exercised in a Home Assistant Python environment.
  • Live Supervisor/SMB copy, full read-back, original/NAS SHA-256 comparison, and periodic verification exercised with Home Assistant 2026.11.1.
  • Black, HACS, Hassfest, and standalone test workflows pass on the contribution branch.

Documentation covers setup, NAS recycle-bin behaviour, retention, recovery, and verification limits. Matching checksums establish byte integrity; a complete disaster-recovery restore has not been tested.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant