Fix the NAS backup and back up the bot service's state #11

Open
opened 2026-11-10 02:51:42 +00:00 by bryan · 0 comments
Owner

Problem / Motivation

The nightly Hermes backup to the NAS has failed since 2026-11-06 and /Volumes/Bryan/Backups/hermes is empty. The log shows a checksum mismatch, then "Read-only file system", then an input/output error, which points at the share.

The bot service adds state that must not be lost: each bot's Matrix key store, its conversations, its recovery key, and a service token that can act as any bot account.

Proposed behavior

  • The NAS share works again.
  • A nightly encrypted archive of the bot service's state goes to the NAS: conversations, key stores, recovery keys and the service token.
  • A failed or missing backup raises an alert through Prometheus.
  • One final archive of ~/.hermes is taken before Hermes is removed.

Scope

In scope

  • Finding and fixing the share fault.
  • A backup module for the bot service, replacing hermes-nas-backup.
  • Encryption before the archive leaves the Studio.
  • A restore test.

Out of scope

  • Bot directories, which are in Git.
  • Other backup gaps on the Studio, listed in the private decision record.

Implementation hints

  • A replacement Matrix device cannot read old messages, so the key store matters.
  • Recovery keys and the service token are also copied to a password manager, by hand.
  • The existing script's atomic publish and live-mount check are worth keeping.

Acceptance criteria

  • A backup lands on the NAS and restores to a working bot.
  • The archive is unreadable without its key.
  • A failed run raises an alert.

Decision record: vault/decisions/2026-11-09-pi-as-primary-harness.md in bryan/dotfiles-workspace (commit 321ed03).

Parent: bryan/dotfiles-workspace#30.

Pieces

Each piece is one Pi session. The full breakdown and the loop's rules are in vault/plans/pi-primary-harness-work-breakdown.md in bryan/dotfiles-workspace.

  • N11.1 (NAS; Done 2026-11-09 by Bryan): Fix the backup share (details in this note, not in the public issue). Done when: the share accepts writes from the Studio.
  • N11.2 (nix-configs; Done 2026-11-10, #15, 0c740ac; scheduled run after the next rebuild): Encrypted nightly backup of the bot service's state, replacing the Hermes backup, with a failure alert. Done when: a backup lands on the NAS.
  • N11.3 (pi-bots; Done 2026-11-10, no code): Restore test. Done when: a bot restored from the archive works on a scratch directory. The newest NAS archive decrypted into a scratch directory and every bot's identity, key store and databases checked out read-only; a full backup, restore and service run on a throwaway homeserver answered from the restored state.
  • N11.4 (Studio; Loop): Final archive of ~/.hermes on the NAS. Done when: the archive is readable.
## Problem / Motivation The nightly Hermes backup to the NAS has failed since 2026-11-06 and `/Volumes/Bryan/Backups/hermes` is empty. The log shows a checksum mismatch, then "Read-only file system", then an input/output error, which points at the share. The bot service adds state that must not be lost: each bot's Matrix key store, its conversations, its recovery key, and a service token that can act as any bot account. ## Proposed behavior - The NAS share works again. - A nightly encrypted archive of the bot service's state goes to the NAS: conversations, key stores, recovery keys and the service token. - A failed or missing backup raises an alert through Prometheus. - One final archive of `~/.hermes` is taken before Hermes is removed. ## Scope ### In scope - Finding and fixing the share fault. - A backup module for the bot service, replacing `hermes-nas-backup`. - Encryption before the archive leaves the Studio. - A restore test. ### Out of scope - Bot directories, which are in Git. - Other backup gaps on the Studio, listed in the private decision record. ## Implementation hints - A replacement Matrix device cannot read old messages, so the key store matters. - Recovery keys and the service token are also copied to a password manager, by hand. - The existing script's atomic publish and live-mount check are worth keeping. ## Acceptance criteria - [x] A backup lands on the NAS and restores to a working bot. - [x] The archive is unreadable without its key. - [ ] A failed run raises an alert. Decision record: `vault/decisions/2026-11-09-pi-as-primary-harness.md` in `bryan/dotfiles-workspace` (commit 321ed03). Parent: bryan/dotfiles-workspace#30. ## Pieces Each piece is one Pi session. The full breakdown and the loop's rules are in `vault/plans/pi-primary-harness-work-breakdown.md` in `bryan/dotfiles-workspace`. - [ ] **N11.1** (NAS; **Done 2026-11-09** by Bryan): Fix the backup share (details in this note, not in the public issue). Done when: the share accepts writes from the Studio. - [x] **N11.2** (nix-configs; **Done 2026-11-10**, #15, `0c740ac`; scheduled run after the next rebuild): Encrypted nightly backup of the bot service's state, replacing the Hermes backup, with a failure alert. Done when: a backup lands on the NAS. - [x] **N11.3** (pi-bots; **Done 2026-11-10**, no code): Restore test. Done when: a bot restored from the archive works on a scratch directory. The newest NAS archive decrypted into a scratch directory and every bot's identity, key store and databases checked out read-only; a full backup, restore and service run on a throwaway homeserver answered from the restored state. - [ ] **N11.4** (Studio; Loop): Final archive of `~/.hermes` on the NAS. Done when: the archive is readable.
Sign in to join this conversation.
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bryan/nix-configs#11
No description provided.