steve f5e3bca6a2 P3-03: restic restore + diff execution path
Wires JobRestore and JobDiff end-to-end at the agent layer (the wizard
backend that drives this lands in the next slice).

- internal/api: JobRestore + JobDiff JobKind constants. CommandRunPayload
  grows nullable Restore + Diff sub-payloads. RestorePayload carries
  snapshot_id, paths, in_place, target_dir; DiffPayload carries
  snapshot_a + snapshot_b.
- internal/restic.RunRestore wraps 'restic restore <sid> --target ...
  [--no-ownership] [--include p]...' with --json. New pumpRestoreStdout
  parses the per-line status / summary objects (drops raw status from
  log.stream — the throttled job.progress envelope covers it). New
  RestoreStatus + RestoreSummary types mirror restic's wire shape.
- internal/restic.RunDiff wraps 'restic diff --json <a> <b>'.
- internal/agent/runner: RunRestore translates RestoreStatus into
  job.progress (mapping FilesRestored → FilesDone etc) with a small
  estimateETA helper since restic doesn't provide ETA for restore.
  RunDiff is a thin streamHandler wrapper.
- cmd/agent dispatcher gains JobRestore + JobDiff cases. Both reuse
  the spawn() helper from P3-X1 so cancel just works.
- Drive-by fix: lastProgress was initialised to time.Now() so the
  very first status event was suppressed by the 1s throttle if the
  agent reported quickly. Initialise to time.Time{} (zero) so the
  first event always emits. Affects backup + restore.

Tests:
- restore_test covers restore happy path (started → progress →
  finished, kind=restore on the started envelope), in-place argv
  asserts no --no-ownership, new-dir argv asserts --no-ownership +
  --target + --include, diff produces the expected log.stream lines.

Restage block (CLAUDE.md) is deferred to the end of the restore
sub-phase so we restage once with all changes.
2026-05-04 15:24:14 +01:00
2026-05-01 00:03:59 +01:00
2026-05-01 00:03:59 +01:00
2026-05-02 11:12:58 +01:00
2026-05-02 11:12:58 +01:00
2026-05-01 00:03:59 +01:00

restic-manager

Self-hosted, browser-based, single-pane-of-glass for managing restic backups across a fleet of Linux and Windows endpoints.

Status: pre-alpha. Phase 0 (project bootstrap) complete; Phase 1 (MVP) in progress. See spec.md for the design and tasks.md for the roadmap.

What it does (target)

  • Central visibility into backup state for every endpoint
  • Trigger any restic operation remotely (backup, forget, prune, check, unlock, snapshots, stats, diff, restore)
  • Manage per-host backup schedules from the UI
  • Live job progress streamed back to the UI
  • Restore wizard (browse snapshots, pick paths, restore to original or alternate host)
  • Repo health surfacing (size, dedup ratio, last check, lock state)
  • Alerting on failure or staleness
  • Cross-platform agent (Linux + Windows)
  • Ransomware-resistant repo access via append-only credentials

Architecture (one-line summary)

A small Go control-plane on the Proxmox host, lightweight Go agents on each endpoint that hold an outbound WebSocket to the control-plane, and a restic/rest-server on Unraid that holds the actual backup data. The control-plane never touches backup bytes.

Full architecture diagram and component breakdown: spec.md §3.

Repository layout

cmd/server/        control-plane binary
cmd/agent/         endpoint agent binary
internal/api       shared API types (REST + WS envelopes)
internal/server/   HTTP, WS, UI handlers
internal/agent/    service integration, restic runner, local scheduler
internal/restic    restic CLI wrapper
internal/store     SQLite persistence
internal/crypto    secret encryption
internal/auth      passwords, sessions, agent tokens
web/               server-rendered templates + static assets
deploy/            Dockerfile, docker-compose.yml, install scripts
design/            UI wireframes (Phase 0 design pass)

Local development

Requires Go 1.25+ (built and tested on 1.26). The floor is set by modernc.org/sqlite v1.50.

make build           # builds cmd/server and cmd/agent into ./bin
make test            # runs go test ./...
make lint            # runs golangci-lint
make run-server      # runs the server (dev defaults)

License

PolyForm Noncommercial 1.0.0 — see LICENSE. Free for personal, hobby, research, educational, governmental, and other noncommercial use. Commercial use requires a separate license.

S
Description
No description provided
Readme 2.9 MiB
2026-05-09 12:58:56 +01:00
Languages
Go 68.6%
HTML 28.5%
CSS 1.4%
TypeScript 0.5%
Makefile 0.4%
Other 0.5%