Skip to content

Add backup file history - #5

Merged
1 commit merged into
mainfrom
feature/backup-file-history
Sep 24, 2026
Merged

1 commit merged into
mainfrom
feature/backup-file-history

Conversation

@Commanderx-code

Copy link
Copy Markdown
Owner

Summary

Backup & Restore → File history finds every saved copy of a file across all Restic snapshots and restores the version you choose.

  • Search: a file name (matches in any folder), an exact path (/… or ~/…) or a */? pattern, with optional Ignore case. It's one reviewed, read-only job: a fixed sh -c script runs restic snapshots --json, then restic find --json -- <pattern>, and wraps both into one JSON document. find output has no snapshot times, so this keeps it to one review and one unlock. The pattern is passed as a positional argument and never spliced into the script, and it's rejected if empty, multi-line, over 1024 characters or starting with -.
  • Results: grouped by path, newest first. Each copy shows the snapshot time, ID, host, modification time and size, marked First saved, Changed (size or mtime differs from the next older copy) or Same as previous. Show only versions that changed is on by default. If newer snapshots of the same host and backup path lack the file, a notice says it may have been deleted or moved.
  • Restore this version fills the existing restore form with that snapshot and exact path. The restore still goes through review and never overwrites.

Tests

  • Rust: pattern validation, plus a check that a malicious pattern ($(touch x); *.kdbx) is passed literally as an argument. The real temporary-repository Restic test now runs the search too: exact path, case-insensitive name, and no match.
  • JS: the parser against a realistic fixture (change detection, deletion detection that ignores another host's snapshots, unreadable output), byte formatting, and an end-to-end UI test: request fields, review, HTML-escaped paths, the changes-only toggle, and restore prefill through to the reviewed restore request.
  • Locally: 67 Rust, 76 JS, clippy -D warnings, build.

Not yet verified

Visual layout in the desktop app and a search against a large real repository. Worth one manual try before release.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FV3o3TZ5zZ2ACWD2S7EZdc

Search every Restic snapshot for a file name, path or pattern from
Backup & Restore. One reviewed, read-only job lists snapshots and runs
`restic find`, wrapped into a single JSON document so versions carry
their snapshot times. The pattern is a positional argument to a fixed
script, rejected if empty, multi-line or starting with a hyphen.

Results are grouped by path, newest first, with each copy marked first
saved, changed (size or mtime differs) or same as previous, and a
notice when newer snapshots of the same host and path lack the file.
"Restore this version" prefills the existing never-overwrite restore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FV3o3TZ5zZ2ACWD2S7EZdc
@Commanderx-code Commanderx-code closed this pull request by merging all changes into main in f415432 Sep 24, 2026
@Commanderx-code
Commanderx-code deleted the feature/backup-file-history branch September 24, 2026 16:52
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