75 Commits

Author SHA1 Message Date
TZERO78 ddd44c3775 docs(media): add logo assets — 800x200 banner, 1280x640 social preview,
1024x1024 master, favicon

- kopi-docka-800x200.png (72 KB): wide README header banner — used by
  the redesigned title in the preceding commit
- kopi-docka-1280x640.png (177 KB): GitHub Open Graph aspect — upload
  via Repo Settings → Social preview to control the link card on
  X/HN/Reddit/Discord (manual UI step, not scriptable via gh CLI)
- kopi-docka-logo.png (1.2 MB): 1024x1024 master for downstream
  derivations (presentations, DR-bundle templates)
- kopi-docka-favicon.png (168 KB): 420x420 for any future doc site

Total +1.58 MB to the repo. All four sit alongside the existing
demo-*.svg files under docs/media/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 10:35:57 +00:00
TZERO78 3193baeec4 docs(readme): collapse 7 demo SVGs into one sequential animation
7 individual SVG embeds back-to-back made the README quite scroll-heavy.
This combines all 7 casts into a single 113-second animation that plays
the scenes sequentially with brief banner cards between them
("1 / 7 · doctor · system health check", etc.), then loops.

The individual SVG files are preserved (other docs may reference them
directly) and exposed as a collapsible "Individual scenes" table below
the combined animation, so the user-flow narrative is still visible at
a glance without expanding anything.

Combined SVG is 743 KB — larger than any single scene but acceptable
inline; GitHub renders animated SVGs without lazy-loading anyway.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 09:33:18 +00:00
TZERO78 95c1a9068c docs: flag PowerShell binary-stream corruption + Windows AES-ZIP extraction
Real user hit this on Windows: PowerShell 5.1's `>` operator re-encodes
stdout as UTF-16, doubling the byte count and corrupting the AES ZIP
beyond recognition. Even 7-Zip rejects the file ("not an archive").
Confirmed: locally a clean stream is 7 KB; the PS-corrupted version
arrives at 14 KB. cmd.exe's `>` works correctly.

Three touch-points so this is hard to miss:

1. `--stream` help text in disaster_recovery_commands.py now mentions
   the PowerShell pitfall and points at docs/DISASTER_RECOVERY.md.
2. README.md gains an inline Windows note next to the stream example
   plus a stronger 7-Zip hint at extract time.
3. docs/DISASTER_RECOVERY.md "SSH Stream Mode" section grows two
   subsections: "Windows clients" (scp + cmd.exe patterns, verification
   command) and "Extracting on Windows" (Explorer's lack of AES-256
   support, recommended tools).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 09:27:01 +00:00
TZERO78 9d0c84a2bb docs(readme): swap DR demo to richer legacy-command transcript
The bare 'disaster-recovery export ... --yes' demo was too thin — one
panel, just file path and decrypt commands. The legacy
'disaster-recovery' (no subcommand) path triggers a more substantive
flow that's actually nicer for HN/r/selfhosted visitors:

  1. Deprecation-warning panel → demonstrates the tool actively
     guides users toward the new ZIP format (a trust signal — it
     doesn't just silently break)
  2. "Disaster Recovery Bundle Creation" intro panel
  3. Progress log (rclone.conf added, password sidecar warning)
  4. "Bundle Created" panel with all three file paths and the
     openssl-decrypt command inline

Source: real transcript provided by the user against the testlab,
faithfully reconstructed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 08:46:02 +00:00
TZERO78 f21875085b docs(readme): add history, snapshot-list, and DR-export demo SVGs
Completes the narrative arc on the README from "setup the tool" to
"recover from total loss":

  Doctor → Dry-run → Backup → History → Snapshot list → Restore → DR export

- history.svg (44 KB, ~6s): Backup History table with timestamps,
  duration, status, scope, volumes, snapshot IDs. Operations / "did the
  backups actually run?" sight.
- snapshot-list.svg (58 KB, ~8s): kopi-docka advanced snapshot list
  --snapshots — shows the tag-based organisation (every snapshot tagged
  with backup_id/type/unit so the wizard can group recipe + networks +
  volumes from one backup_id as a unit). Direct illustration of the
  Kopia-tag differentiator vs. archive-name-based tools.
- dr-export.svg (39 KB, ~8s): disaster-recovery export — shows the
  encrypted-ZIP bundle creation panel, including the "passphrase NOT
  stored in file" reminder.

All three captured from real testlab runs against the rclone+GDrive
backend (32 existing snapshots in the repo).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 08:41:41 +00:00
TZERO78 3e900f951f docs(readme): swap restore demo from --yes to the interactive wizard
The --yes (CI/CD) flow worked but missed the actual story: the wizard
is where the Kopia-tag-based session grouping becomes visible (each
"backup session" in the list is one backup_id tying recipe + networks
+ volumes), and where the safety-backup-before-overwrite step earns
user trust.

Recording reconstructed from a real interactive session captured by
the user on the testlab. Compressed from ~2min real time to ~34s while
keeping every decision point visible: session selection, "Recreate
network?" prompt, "Restore volume NOW?" confirmation, target-directory
prompt, completion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 08:34:50 +00:00
TZERO78 b94e63763d docs(readme): add backup + restore demo SVGs to complete the user-flow
Follow-up to the doctor/dry-run demos — adds the two missing pieces of
the natural user journey:

- demo-backup.svg (23 KB, ~7s): real cold backup via SFTP. Shows
  per-stack container-stop → snapshot → restart cycle for both
  test-stack-redis and test-stack-nginx. Real exit 0 capture from the
  E2E SFTP test environment.
- demo-restore.svg (93 KB, ~10s): non-interactive 'restore --yes' run
  showing the restore-wizard panel, snapshot listing, file restore,
  network recreation, and container restart.

Order on the README is now: doctor → dry-run → backup → restore, matching
the actual user workflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 08:21:44 +00:00
TZERO78 20a82793f2 docs(readme): add animated SVG demos for dry-run + doctor
HN/r/selfhosted-prep: visitors land on the README and want to see
"what does this actually do" in ten seconds, before reading any prose.
Two short animated SVGs (~7-9s each) embedded inline:

- demo-dry-run.svg: discovers the test-lab stacks (redis + nginx),
  prints the dry-run plan with estimates.
- demo-doctor.svg: dependency check, repository status, backend sanity,
  DR-readiness — the "this tool checks itself" angle.

SVGs are 56 KB / 88 KB, text-selectable when zoomed, rendered by GitHub
inline as raw.githubusercontent.com URLs (works on both GitHub and PyPI
README rendering — the URLs are absolute).

Generated with termtosvg from manually-constructed asciicast files
(the testlab session was too long to script with expect; output captured
once and timed-out for typing animation, ~8s each).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 08:16:31 +00:00
TZERO78 dbac615c72 docs(architecture): document helpers + repair pattern, refresh stale sections
Adds the 8 helper modules previously absent from ARCHITECTURE.md
(backend_helper, sudo_helper, metadata_reader, docker_run_builder,
file_operations, process_lock, system_utils, logging, ui_utils,
constants) — each with a one-paragraph purpose + signature table where
the API is non-trivial.

Adds a new "Repair pattern (rebuild_kopia_params)" section documenting
how advanced config repair-kopia-params dispatches generically through
BackendBase + MissingCredentialsError, with the extension point for
future per-backend repair logic.

Also: final Plan-XXX sweep — README's tested-backends table now uses
version anchors (v7.4.0 + v7.6.1) instead of slug refs.

Plan 0039 — Block D.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 07:42:23 +00:00
TZERO78 b394cc5c55 docs: replace plan-slug refs with version anchors in user-facing docs
Internal planning artifacts ("Plan 0022", "Plan 0028") have no meaning to
end users reading the docs — rewrite to point at the release that
delivered the change (e.g. "since v7.3.0") instead. 8 occurrences across
FEATURES, CONFIGURATION, ARCHITECTURE, TROUBLESHOOTING.

Plan slugs are kept in CHANGELOG section headers where they serve as
release-notes shorthand (e.g. "v7.3.0 — Plan 0028 + post-release"), and
in the plan/ directory itself.

Plan 0039 — Block B.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 07:36:15 +00:00
TZERO78 6ea858c836 docs(dr): document key separation + --include-ssh-key opt-in
New "What's NOT in the bundle (and why)" section in
docs/DISASTER_RECOVERY.md spells out:

* Which credentials live OUTSIDE the bundle per backend type (SSH key,
  AWS keys, B2 keys, Azure key, GCP service-account JSON).
* The defense-in-depth / NIST SP 800-57 key-separation rationale and a
  brief note that restic, Borg, Duplicity, rclone crypt all default to
  the same posture.
* Suggested storage for the SSH key (password-manager attachment,
  separate USB stick, GPG-symmetric, paper printout).
* The --include-ssh-key opt-in flag with its trade-off explicit.

Plan 0030 documentation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 14:05:05 +00:00
TZERO78 81fcb12f82 docs: update migration path to use repair-kopia-params
CONFIGURATION.md and TROUBLESHOOTING.md previously instructed
v7.0–v7.3.13 Tailscale users to copy/paste a sed line emitted by
doctor. v7.5.0 ships a real command for this; the docs now show that
instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 13:07:56 +00:00
TZERO78 bea4edda17 docs(tailscale): document v7.4.0 SFTP params + Unraid 6.12+ handling
- CONFIGURATION.md: Tailscale backend section now shows the correct
  per-flag kopia_params shape (--path / --host / --username / --keyfile
  / --known-hosts) and links to the migration writeup. Also documents
  the Unraid 6.12+ symlink detection.
- TROUBLESHOOTING.md: new "Tailscale-SFTP kopia_params migration"
  section walks v7.0.0 – v7.3.13 users through `doctor` → sed →
  `advanced repo init`. Adjacent note explains the Unraid persistent-
  path handling so users don't worry when the wizard skips the mirror.
- FEATURES.md: Tailscale "Technical Details" lists the v7.4.0
  correctness invariants (real FQDN, separate flags, inode-aware
  Unraid mirror).

Plan 0029 documentation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 12:31:24 +00:00
TZERO78 02717d7433 release: v7.3.11 — surface rclone known-slow-path in doctor + docs (no code change in hot path)
User reported multi-minute waits on a real rclone+GDrive system
(296 s for one `kopia policy set --global`, 160 s for a couple-of-KB
recipe snapshot). Searched the Kopia community — turns out this is
well-documented upstream:

- Kopia CLI docs mark rclone backend as "Not maintained".
- Forum (kopia.discourse.group/t/.../2597): `repository status` 28 s
  rclone-GDrive vs 0.8 s SFTP; 40+ min maintenance on a 100 GB rclone
  repo vs seconds locally.
- Root cause is Kopia spawning fresh `rclone serve` per call + GDrive's
  small-file write overhead — not something kopi-docka can paper over.

This release surfaces the issue everywhere a user would look:

- docs/TROUBLESHOOTING.md: new "Backups against rclone+Google Drive
  feel very slow" section with measured numbers, upstream links, and
  comparison table (Tailscale → SFTP, Backblaze B2, native gdrive
  with its 30 GB service-account-quota caveat).
- docs/CONFIGURATION.md Storage Backends: performance reality check
  callout pointing at the troubleshooting entry.
- doctor section 4 (Backend Dependencies): yellow performance warning
  when backend is rclone, with extra paragraph if kopia_params look
  like Google Drive. Also added to the bottom warnings panel.

Hot-path code unchanged; this is a documentation + observability fix.

1132 unit tests passing. Doctor warning live-verified on the rclone
testlab — yellow block appears under section 4 and the bottom panel
gets a 1-line summary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 08:51:35 +00:00
TZERO78 62a7d23e9f release: v7.3.5 — unify all user-facing references on 'advanced' (admin stays as hidden alias)
The Typer CLI itself has been registering both names for a while —
`advanced` as the documented top-level group and `admin` as a
hidden=True alias — but help texts, docstrings, error hints, the
disaster-recovery shell snippets and the bundled systemd templates
mixed the two. `kopi-docka --help` showed `advanced`, but `kopi-docka
advanced policy --help` then listed `prune` with a doc string saying
"use `kopi-docka admin config edit`", and the shipped
`kopi-docka.service` template ran `kopi-docka admin service daemon`.

134 references across 23 files unified to `advanced`. The `admin` name
stays registered as `hidden=True` on the same Typer app, so every
existing user script / cron / systemd unit that still says `admin`
keeps working — this is a documentation / display fix, not a CLI
break.

Notable churn:
- All `kopi_docka/commands/advanced/*.py` module docstrings + help text
- Backend recovery hints in `kopi_docka/backends/rclone.py`
- DR-bundle shell snippets in `cores/disaster_recovery_manager.py`
- Systemd templates (`kopi-docka.service.template`,
  `kopi-docka.timer.template`, `kopi-docka-backup.service.template`,
  `templates/systemd/README.md`) now use `advanced service daemon` /
  `advanced service write-units` for fresh installs
- Top-level docs (CLAUDE.md, CHANGELOG.md, docs/USAGE.md,
  docs/FEATURES.md)

Tests: 1124 passing. `kopi-docka --help`, `kopi-docka advanced --help`,
and the hidden `kopi-docka admin snapshot --help` all confirmed working
locally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 07:05:24 +00:00
TZERO78 c0d8f66c8a fix: v7.3.4 — migrate-config false-positive type mismatches, trailing entry, template drift
Round two of UX cleanup on scripts/migrate-config.sh after a real
production config (full notification setup, legacy hooks,
retention.yearly from an old release) exposed several false positives
and a missing template field.

Fixed
- Stop flagging `template=null` vs scalar as a type mismatch. A null
  value in the template marks a "not configured yet" slot —
  kopia.password_file, notifications.service, notifications.url and
  similar. The live system produced pages of false-positive `!` lines.
  Now suppressed in either direction; only genuine clashes surface.
- Trailing empty `! ` entry in the type-mismatch block removed. The
  block was built with `+= "$line"$'\n'` plus a terminating newline,
  printing one blank `! ` at the end. Switched to a proper bash array
  and `printf '%s\n' "${arr[@]}"`.
- Template now ships backup.database_backup. The Pydantic schema has
  had it (default "true") since 5.x but config_template.json was
  missing it — every install that still had the key got it flagged
  as "unknown" on first migrate.

Documentation
- Known legacy renames table in docs/CONFIGURATION.md. The script
  doesn't auto-rename (no opinion on your data), but the doc tells you
  which "Unknown" lines (retention.yearly → annual, pre/post_backup_hook
  → backup.hooks.*) are safe to --prune-unknown once you've copied the
  value to the new key.

Tests: 1124 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 06:44:32 +00:00
TZERO78 ebc8a95e8b fix: v7.3.3 — migrate-config.sh template auto-locate + clearer errors
UX hardening after the first live-system run of v7.3.2 surfaced
"tried: <empty>" with no actionable hint.

Fixed
- Template auto-locate now has a four-step strategy chain instead of
  a single python3 import:
    1. --template flag (explicit override)
    2. default `python3 -c 'import kopi_docka'`
    3. python from `which kopi-docka`'s shebang (handles pipx / venv
       installs where /usr/bin/python3 can't import the package)
    4. GitHub raw fallback (no install required)
  Every failed step logs why; the final "could not locate" error
  lists all four strategies with how to fix each one.
- Cleanup trap unified: previous version had two `trap … EXIT`
  clauses that clobbered each other, so the GitHub-fallback tempfile
  could leak.
- Docs chain `chmod +x` on the same line as `curl -o /usr/local/bin/…`
  so first-time copy-paste users don't get a "Permission denied"
  after the download.

Added
- `--config` is now optional. When omitted, the script probes the
  same defaults kopi-docka itself uses
  ($HOME/.config/kopi-docka/config.json first, then
  /etc/kopi-docka.json), honoring $SUDO_USER so `sudo` finds the
  invoking user's per-user config instead of root's.
- Version banner: every run prints `kopi-docka installed: X.Y.Z
  (/path/to/bin)` or `<not found on PATH — will use the GitHub-hosted
  template>`. Makes which release the migration is checking against
  visible up front.

E2E verified on the testlab:
  - explicit --config: dry-run + real run + doctor green + rollback
    sha256-identical to the original
  - no --config: probes user/etc defaults, found the testlab profile
  - stubbed PATH without python3 and kopi-docka: banner reports
    "not found", GitHub fallback fetches the template, diff produces
    the same missing/unknown buckets as the local run

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 06:29:06 +00:00
TZERO78 41dfc38f4c docs: add copy-paste GitHub download commands for migrate-config.sh
Three usage styles now documented in both CONFIGURATION.md and
TROUBLESHOOTING.md:

1. One-shot from GitHub (curl | sudo bash -s --): no clone, no install,
   single line that downloads and runs in one go. Most useful for the
   "I just upgraded, fix my config" case.
2. Download once to /usr/local/bin/kopi-docka-migrate-config — for
   users who'd rather inspect the script before running it.
3. From a source checkout — for contributors and people who already
   have the repo cloned.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 06:13:39 +00:00
TZERO78 bc80bb21b7 release: v7.3.2 — config migration helper + template kopia.profile fix
Added
- scripts/migrate-config.sh: bash + jq helper that diffs an existing
  kopi-docka.json against the template shipped with the installed
  kopi-docka and fills in missing keys with template defaults.
  Nothing hard-coded — the script reads `paths(...)` off both files
  and reports missing / unknown / type-mismatch buckets. Default is
  "add missing only" + timestamped backup; --prune-unknown opts into
  deleting deprecated keys.
  Docs: CONFIGURATION.md "Migrating an older config" section, plus a
  one-paragraph pointer from TROUBLESHOOTING.md.

Fixed
- Config template was missing `kopia.profile`. The Pydantic schema
  has had it (default "kopi-docka") since 5.x, but config_template.json
  didn't ship the field. `kopi-docka advanced config new` generated
  configs without a visible profile entry, and the new migration
  helper would otherwise flag every multi-profile install's
  kopia.profile as "unknown" on first run.

Tests: 1124 passing. Manual verification on the rclone+GDrive testlab:
  - dry-run shows 4 missing + 2 deprecated keys (parallel_workers,
    task_timeout) as expected
  - real run + doctor → Health Check Passed
  - rollback via the .backup-YYYYMMDD-HHMMSS file restores the
    original byte-for-byte (sha256 verified)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 06:11:12 +00:00
github-actions[bot] fe308815be docs: render Mermaid diagrams to SVG 2026-05-24 05:25:20 +00:00
TZERO78 de2b570e9d docs+migration: align Plan 0028 surface — docs, templates, dead config fields
Three loose ends after Plan 0028 finalize:

1. Docs
   - docs/CONFIGURATION.md: replace the old "Policy State Cache" /
     "smart-skip" section with a "Global Retention Policy (since v7.3.0)"
     explanation. Trim the historical v5.3.0 path-mismatch story to one
     paragraph (Plan 0028 makes the per-path-vs-virtual-path question
     moot anyway).
   - docs/ARCHITECTURE.md: update BackupManager step list, method
     table, and the backup sequence diagram to show
     _collect_backup_sources() + sequential repo.create_snapshots(),
     instead of the parallel ThreadPool + _ensure_policies path.
   - docs/diagrams/04_sequenceDiagram.mmd: regenerated to match.
   - docs/architecture_components.json: KopiaPolicyManager method list
     updated (list_policies / delete_* in, set_*_for_target out);
     KopiaRepository gains create_snapshots.

2. Migration
   - New _maybe_cleanup_legacy_state_files() in KopiaRepository removes
     the obsolete ~/.config/kopi-docka/policy_state.json (smart-skip
     cache from v7.2.0). Idempotent, runs on first _run() call after
     upgrade; OSError is downgraded to debug — housekeeping, not a
     hard requirement.
   - Live-verified on the rclone+GDrive testlab: created an empty
     policy_state.json, ran doctor → file removed with the expected
     INFO log line, doctor reports clean state.

3. Config templates / dead fields
   - kopi_docka/templates/config_template.json: drop parallel_workers
     and task_timeout (no longer consumed under Plan 0028).
   - kopi_docka/helpers/config.py: keep both Pydantic fields but mark
     them "Deprecated since v7.3.0 — ignored" in the description so
     existing kopi-docka.json files still validate.
   - BackupManager.__init__: remove the dead self.max_workers
     assignment that survived Phase 3.
   - DryRunReport: drop the "Parallel Workers" line from system info
     and config review sections.

Tests: 1121 unit tests pass. New TestLegacyStateCleanup (3 tests) pins
the file-removal contract. test_dry_run_manager.py updated to assert
"Parallel Workers" is absent from the report.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 05:22:43 +00:00
TZERO78 d766f38b9c release: v7.2.0 — Plan 0026 (policy overhaul + rclone-timeout fix)
- CHANGELOG.md: full v7.2.0 entry covering added/removed/side-effects/tests
- docs/CONFIGURATION.md: Policy State Cache + rclone Backend Tuning sections,
  rclone_startup_timeout in the settings table
- pyproject.toml, kopi_docka/helpers/constants.py, CLAUDE.md: version bump
  7.1.5 → 7.2.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 18:59:42 +00:00
TZERO78 30e460d9f1 docs: add policy prune to USAGE.md and FEATURES.md
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 12:49:23 +00:00
github-actions[bot] 5fbf0e53df docs: render Mermaid diagrams to SVG 2026-05-23 11:52:30 +00:00
TZERO78 1d044b2220 feat: Alerting Overhaul — pre-flight check, verbose failures, missed-backup detection (Plan 0025)
- KopiaCommandError: replaces bare RuntimeError in _run(), carries returncode + stderr_tail (UTF-8 safe)
- is_connected(force_refresh=True): bypasses 60s cache for pre-flight check; negative result also cached
- BackendUnreachableError: new exception in backends/base.py (subclass of ConnectionError)
- Pre-flight backend check in backup_unit() before container teardown; containers NOT stopped on failure
- BackupErrorDetail dataclass in types.py; BackupMetadata.error_details persisted in JSON (backward-compat)
- Verbose failure notifications: phase, exit code, stderr tail in fenced code block (Markdown-injection-safe)
- Markdown body_format for all Apprise sends; services without Markdown degrade gracefully
- send_connectivity_alert() and send_missed_backup_alert() added to NotificationManager
- MissedBackupChecker: time-based overdue detection using MetadataReader; per-unit threshold overrides
- Post-run missed-backup check after every backup_unit(); alert suppression via missed_state.json
- Doctor section 8 "Backup Freshness": age per unit, OVERDUE units highlighted
- Config: notifications.verbose, notifications.preflight_check, alerting.missed_backup.*
- Config templates and examples updated; migration guide in INSTALLATION.md

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 11:51:15 +00:00
TZERO78 da5f1dd1cc release: v7.0.0 — Snapshot Management Wizard (Plan 0024)
- New SnapshotManager with interactive wizard (manage, delete, pin/unpin,
  retention, prune-empty, maintenance)
- New commands: admin snapshot manage/delete/pin/unpin/maintenance/
  prune-empty/retention show/retention set
- KopiaRepository: pin_snapshot(), unpin_snapshot(), expire_snapshots()
- KopiaPolicyManager: get_global_policy(), update_global_retention()
- Breaking: admin repo maintenance moved to admin snapshot maintenance
- Docs: README, USAGE, FEATURES, ARCHITECTURE, CHANGELOG updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 08:57:53 +00:00
Markus 4a30e75b5f fix: Security hardening & documentation overhaul (Plan 0023)
Squash merge of Plan 0023 — security hardening, robustness improvements, documentation overhaul.

Phases:
- 1A–1C: S1–S10 security fixes (shell injection, SUDO_USER, hook validation, fchmod race, sensitive stderr filtering, mkdtemp, KOPIA_PASSWORD)
- 2A–2C: R1–R8 robustness (subprocess leak, JSON errors, bounds checks, SIGTERM grace)
- 3A–3D: D1–D13 documentation overhaul

Post-review fix: strip line-continuation formatting before shlex.split (Codex P1).
2026-04-11 12:51:47 +02:00
TZERO78 ee762f0583 feat: add backup history command (Plan 0021)
New `kopi-docka history` command to browse past backups from stored
metadata JSONs. Includes table view, detail panels, filters (--unit,
--failed, --last, --since), statistics (--stats), and JSON output
(--json). No root privileges required.

Adds MetadataReader helper and BackupMetadata.from_dict() for reusable
metadata deserialization. 43 new tests, 95%/99% coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 17:10:35 +01:00
github-actions[bot] fd5ed93770 docs: render Mermaid diagrams to SVG 2026-03-22 13:42:08 +00:00
TZERO78 e3c7bfb0d9 fix: GitHub Issues #69, #70, #71 - v6.2.2
- #71: Remove invalid `show=True` argument from cmd_config() calls
- #70: Implement missing get_backend_class() in backends/__init__.py
- #69: Add rsync as SOFT dependency in dependency_manager and docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-22 12:13:31 +01:00
TZERO78 08609e7ec4 docs: add dedicated Disaster Recovery guide and update references
- New docs/DISASTER_RECOVERY.md with full DR documentation:
  ZIP export usage, SSH streaming, recovery walkthrough,
  CLI reference, passphrase security, format comparison,
  storage best practices, troubleshooting
- README.md: updated DR section, CLI examples, documentation links
- FEATURES.md: added v6.2.0 ZIP export info, updated CLI listing
- USAGE.md: added export subcommand, updated CLI structure and
  emergency recovery steps for both ZIP and legacy format
2026-02-07 12:08:31 +01:00
Markus 0173e3925f feat: automatic docker run reconstruction for standalone containers (#59) (#65)
- Add DockerRunBuilder helper to parse inspect.json and reconstruct docker run commands
- Integrate automatic container reconstruction in restore workflow
- Interactive prompts to start containers immediately after restore
- Support for all common Docker parameters (ports, volumes, env, networks, capabilities, etc.)
- Filter Docker-injected environment variables
- Check for existing containers before attempting start
- Add 30+ comprehensive unit tests
- Update documentation (CHANGELOG, USAGE, FEATURES)
- Bump version to 6.1.0

Closes #59
2026-02-07 11:29:40 +01:00
TZERO78 ad03c1f9a7 docs(install): add pipx symlink instructions for sudo (#56)
- Added symlink command in README.md after pipx install
- Added troubleshooting section in docs/INSTALLATION.md
- Explains why sudo kopi-docka fails (PATH issue)
- Provides 3 solution options: symlink, full path, preserve PATH
2026-01-05 09:21:22 +01:00
github-actions[bot] 58d30f12f6 docs: render Mermaid diagrams to SVG 2025-12-31 09:23:21 +00:00
TZERO78 6133001015 fix(ci): resolve failing checks
- Remove unused imports (ruff F401):
  - config_commands.py: getpass, detect_existing_cloud_repo
  - repository_commands.py: get_backend_type, is_cloud_backend

- Fix Mermaid parse error in 03_graph_LR.mmd:
  - Replace parentheses with bracket notation for nodes

- Fix test_hooks_manager.py to mock run_command:
  - Tests were mocking subprocess.run but HooksManager uses run_command
  - Updated 5 tests to use correct mock target
2025-12-31 10:21:59 +01:00
TZERO78 81a873d8e4 chore(release): bump version to 6.0.0
## Changes
- Version: 5.6.0 → 6.0.0 (pyproject.toml, constants.py)
- CHANGELOG: Add [6.0.0] - 2025-12-31 entry with SafeExitManager, Pydantic validation
- Deprecation: create_snapshot_from_stdin() marked deprecated (removal planned v7.0.0)

## Documentation Updates
- ARCHITECTURE.md: Add 6 missing modules (NotificationManager, DryRunManager,
  DependencyManager, ServiceHelper, repo_helper, dependency_helper)
- FEATURES.md: Add Notification System + Dry-Run Mode sections, update CLI table
- USAGE.md: Update CLI structure to v6.0.0+
- INSTALLATION.md: Update doctor output example to 6.0.0
- README.md: Add Graceful Shutdown + Notifications features

## New Files
- .github/prompts/plan-v600UpgradeDocumentation.prompt.md (release plan)
2025-12-31 10:14:31 +01:00
TZERO78 5ec0d72982 fix: show kopia params in change-password panel 2025-12-31 00:01:58 +01:00
TZERO78 cfa243c4b5 refactor(config): improve wizard UX with new flow and existing repo handling
- Reorder wizard: Backup Scope → Repository → Password
- Add existing repository detection with 2 options:
  * Enter existing password (validated with 3 attempts)
  * Delete repository and start fresh (with confirmation)
- Replace subprocess calls with run_command from ui_utils
- Update CONFIGURATION.md to reflect new wizard flow
- Add comprehensive examples for new and existing repositories
2025-12-30 23:30:48 +01:00
TZERO78 83f8aaf3e8 docs(safety): document SafeExitManager exit safety architecture
Add comprehensive documentation for exit safety system in both user-facing
and technical documentation.

**USAGE.md - User-Facing Documentation (+155 lines):**

1. **Exit Safety & Signal Handling** section
   - Two-layer architecture explanation (Process + Strategy)
   - Signal behavior by operation (table)
   - Real-world examples:
     * Backup interrupted → containers auto-restart
     * Restore interrupted → containers stay stopped
   - Signal types reference (SIGINT/SIGTERM/SIGKILL)
   - systemd integration (sd_notify, watchdog)
   - Troubleshooting guide (3 scenarios)
   - Best practices (4 recommendations)

**ARCHITECTURE.md - Technical Documentation (+400 lines):**

1. **SafeExitManager — Two-Layer Exit Safety Architecture** section
   - Overview and problem statement
   - Two-layer architecture (Mermaid diagram)
   - Layer separation of concerns (table)
   - Process Layer implementation details
   - Strategy Layer handler details:
     * ServiceContinuityHandler (Priority 10)
     * DataSafetyHandler (Priority 20)
     * CleanupHandler (Priority 50)
   - Signal handling flow (Mermaid sequence diagram)
   - SafeExitManager core methods (table)
   - Component integration summary (table)
   - Installation & lifecycle patterns
   - Edge cases & known limitations
   - Testing strategy
   - Key learnings from implementation

**Key Documentation Features:**
- Mermaid diagrams for visual architecture understanding
- Tables for quick reference
- Code examples for integration patterns
- Troubleshooting procedures
- Real-world scenario examples

Files:
- docs/USAGE.md (+155 lines)
- docs/ARCHITECTURE.md (+400 lines)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 20:29:12 +01:00
TZERO78 6df436fad4 chore(cleanup): dead code cleanup and quality improvements
Major code cleanup initiative removing legacy code and improving quality:

Removed (727 lines):
- Delete kopi_docka/helpers/dependency_installer.py (493 lines)
  - Removed legacy DependencyInstaller class
  - Removed InstallStatus and InstallResult classes
- Delete kopi_docka/helpers/os_detect.py (234 lines)
  - Removed orphaned OS detection module

Code Quality:
- Remove 6 vulture findings (unused imports and parameters)
- Auto-fix 33 unused imports with ruff
- Remove broken install-deps and show-deps commands

Testing & Coverage:
- Increase coverage threshold from 25% to 40%
- Current coverage: 43.86%
- All 646 tests passing

Documentation:
- Update docs/architecture_components.json
  - Remove DependencyInstaller entries
  - Remove auto_install and install_missing from DependencyManager

CI/CD:
- Add GitHub Actions workflow for tests and code quality
- Add vulture dead code detection (min-confidence 80)
- Add ruff unused import checks
- Test on Python 3.10, 3.11, 3.12

Dependencies:
- Add vulture>=2.0.0 to dev dependencies
- Add ruff>=0.1.0 to dev dependencies

This cleanup removes obsolete code from Plan 0007 (Hard/Soft Gate),
enforces higher test coverage, and prevents future code quality issues
through automated CI checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 22:01:10 +01:00
TZERO78 ae22b9da26 feat(config): add Pydantic validation for configuration
- Add comprehensive Pydantic models for all config sections
  - KopiaConfig, BackupConfig, DockerConfig, RetentionConfig, LoggingConfig, NotificationsConfig
- Implement field validators for critical settings
  - Repository type validation (filesystem, rclone, s3, etc.)
  - Backup scope validation (minimal, standard, full)
  - Parallel workers range validation (auto or 1-32)
  - Log level validation (DEBUG, INFO, WARNING, ERROR, CRITICAL)
- Update config loading to use Pydantic validation
  - Early error detection at startup
  - Clear, formatted error messages showing location and issue
- Update documentation
  - Add Pydantic and Apprise to README acknowledgments
  - Add Configuration Validation section to CONFIGURATION.md
- All validation tests passed (4/4)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 20:33:13 +01:00
TZERO78 ccc0896ada docs: update ARCHITECTURE, DEVELOPMENT, and USAGE for v5.5.1
- Fix Component relationships Mermaid graph syntax in ARCHITECTURE.md
  - Remove invalid parentheses from node names
  - Add missing RestoreManager relationships
- Update version from v3.3.0 to v5.5.1 in DEVELOPMENT.md
  - Add v5.5.1 features (scope tracking, docker config backup)
  - Add v5.5.0 features (Hard/Soft Gate, Think Simple)
- Update USAGE.md to reflect v5.5.0+ breaking changes
  - Remove install-deps command (removed in v5.5.0)
  - Update CLI structure version to v5.5.1
  - Remove outdated "Migration from v3.3 to v3.4" section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 19:59:59 +01:00
TZERO78 1b09f84b2e docs: update USAGE, CONFIGURATION, and FEATURES for v5.5.1
USAGE.md:
- Add show-docker-config command to Primary Commands table
- Describe as "Extract docker_config - Manual restore helper for FULL scope backups"

CONFIGURATION.md:
- Add backup_scope to Important Settings table
- Describe three options: minimal/standard/full with restore capabilities
- Add backup_scope to config example JSON (value: "standard")

FEATURES.md:
- Add comprehensive "What's New in v5.5.1" section
- Document Backup Scope Tracking & Restore Warnings feature
- Document Docker Config Backup (FULL Scope) feature
- Document Docker Config Manual Restore Command feature
- Document Config Wizard Scope Selection feature
- Include examples, usage, and safety explanations

All documentation now comprehensively covers:
- backup_scope tag tracking in snapshots
- Restore scope detection and warnings
- docker_config backup for FULL scope
- show-docker-config manual restore command
- Interactive scope selection in config wizard

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 21:42:14 +01:00
TZERO78 d6bf45d723 Release v5.5.0 - Think Simple Dependency Management
Major refactoring implementing "Think Simple" philosophy:
Kopi-Docka now expects a prepared system instead of automatic installation.

BREAKING CHANGES:
- Removed automatic dependency installation
- Removed distro detection logic
- Removed install-deps command
- Removed distro library dependency

Added:
- Hard/Soft Gate dependency system
- DependencyHelper utility class
- Server-Baukasten integration
- Enhanced doctor command with categories
- Comprehensive test suite (97 new/updated tests)
- Backend dependency enforcement

Changed:
- DependencyManager simplified (40% code reduction)
- All backends refactored with REQUIRED_TOOLS
- Commands now check dependencies at entry point
- Documentation completely rewritten

Migration:
- Users must install Docker + Kopia before upgrading
- Use Server-Baukasten for automated system setup
- See docs/INSTALLATION.md for details

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 18:46:46 +01:00
Markus 00a92bf780 fix: proper URL encoding for email sender display name (v5.4.2) (#50)
Fixed URL encoding implementation for email notification sender display name.

## Fixed

- **Proper URL Encoding for Email Display Name**
  - Added urllib.parse.quote() to encode spaces and special characters
  - Format: 'Display Name <email>' → 'Display%20Name%20%3Cemail%3E'
  - Fixes potential issues with spaces and brackets in from parameter
  - Changed prompt from 'Display Name' to 'Sender Display Name'

## Implementation

```python
from urllib.parse import quote

# 1. Construct from-header
from_header = f"{display_name} <{username}>"

# 2. URL-encode properly
encoded_from = quote(from_header, safe='')

# 3. Build URL with encoded parameter
url = f"mailto://{username}@{smtp_server}:{smtp_port}?to={recipient}&from={encoded_from}"
```

## Example Output

**Input:**
- Display Name: "Kopi-Docka"
- Email: "user@test.com"

**Output URL:**
`mailto://user@smtp.gmail.com:587?to=recip@test.com&from=Kopi-Docka%20%3Cuser@test.com%3E`

**Encoding:**
- Space ( ) → %20
- Less-than (<) → %3C
- Greater-than (>) → %3E

## Changed Files

- kopi_docka/commands/advanced/notification_commands.py:
  - Added urllib.parse import
  - Implemented proper URL encoding for from parameter
  - Updated prompt text to 'Sender Display Name'

- docs/NOTIFICATIONS.md:
  - Updated manual config example with URL-encoded format
  - Added URL encoding reference note

- docs/CONFIGURATION.md:
  - Updated email example with properly encoded from parameter

- CHANGELOG.md:
  - Added v5.4.2 entry
  - Marked v5.4.1 as incomplete (missing URL encoding)

- Version bump: 5.4.1 → 5.4.2

## Fixes Issue

v5.4.1 added display name support but didn't properly URL-encode the from parameter,
which could cause issues with SMTP servers that strictly parse mailto URLs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 23:02:04 +01:00
Markus 545a69eb16 fix: email notification display name support (v5.4.1) (#49)
Enhanced email setup wizard to include display name for better sender identification.

## Fixed

- Email notifications now show custom display name in sender field
- Example: 'Kopi-Docka Backup <user@gmail.com>' instead of 'user@gmail.com'
- Improves email readability and professionalism

## Changed

- notification_commands.py:
  - Added 'Display Name' prompt in _setup_email()
  - Automatically builds 'from' parameter with display name
  - Default: 'Kopi-Docka'
  - Format: DisplayName<email@example.com>

- Documentation updates:
  - docs/NOTIFICATIONS.md: Added display name to setup steps
  - docs/CONFIGURATION.md: Updated email example with from parameter
  - CHANGELOG.md: Added v5.4.1 release notes

- Version bump:
  - pyproject.toml: 5.4.0 → 5.4.1
  - kopi_docka/helpers/constants.py: VERSION = '5.4.1'
  - kopi_docka/__init__.py: @version 5.4.1

## Technical Details

The from parameter is now automatically constructed as:
```
from_email = f"{display_name}<{username}>"
url = f"mailto://{username}@{smtp_server}:{smtp_port}?to={recipient}&from={from_email}"
```

This follows the standard email format and is properly handled by Apprise.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 22:53:23 +01:00
Markus 0cd148ae52 Release v5.4.0 - Notification System (#48)
* chore: add CLAUDE.md to .gitignore

Add project-specific Claude instructions file to gitignore.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Delete CLAUDE.md

* feat: add notification system (v5.4.0)

- Add NotificationManager with Apprise integration
- Support Telegram, Discord, Email, Webhook, Custom services
- Add interactive setup wizard (advanced notification setup)
- Fire-and-forget pattern with 10s timeout
- 3-way secret management (file > config > none)
- Environment variable substitution in URLs (${VAR_NAME})
- Integration with BackupManager (notifications after backup completion)
- Commands: setup, test, status, enable, disable

New files:
- kopi_docka/cores/notification_manager.py
- kopi_docka/commands/advanced/notification_commands.py

Modified files:
- kopi_docka/templates/config_template.json (notifications section)
- kopi_docka/cores/backup_manager.py (notification integration)
- kopi_docka/cores/__init__.py (exports)
- kopi_docka/commands/advanced/__init__.py (registration)
- pyproject.toml (apprise>=1.6.0 dependency)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: notification system v5.4.0 - tests, docs, and wizard integration

Complete notification feature implementation with comprehensive testing,
documentation, and seamless integration into setup workflows.

## Added

- **Unit Tests (40 tests)**
  - Comprehensive test suite for NotificationManager
  - Secret resolution (3-way priority: file > config > none)
  - Environment variable substitution (${VAR} pattern)
  - URL building for all 5 services (Telegram, Discord, Email, Webhook, Custom)
  - BackupStats dataclass factory methods
  - Message rendering (success/failure templates)
  - Fire-and-forget notification sending with mocked Apprise
  - Timeout behavior and error handling
  - All 527 unit tests passing

- **Documentation**
  - docs/NOTIFICATIONS.md (600+ lines)
    - Complete setup guides for all 5 services
    - Configuration reference with field descriptions
    - Service-specific examples and use cases
    - Troubleshooting section
    - Security best practices
    - Advanced usage patterns
    - FAQ section
  - Extended docs/CONFIGURATION.md
    - Notifications section with quick setup
    - Management commands reference
    - Service comparison table
    - Configuration examples for all services
  - Updated CHANGELOG.md with v5.4.0 release notes

## Changed

- **Setup Wizard Enhancement**
  - Added Step 5: Notification Setup (optional)
  - Integrated notification wizard into complete setup flow
  - Updated wizard header to show 5 steps
  - Prompts user with: "Setup backup notifications?"
  - Provides fallback message for later setup

- **Config Wizard Enhancement**
  - Added optional notification setup after config creation
  - Prompts: "Setup backup notifications? (Telegram, Discord, Email, etc.)"
  - Graceful error handling with skip option
  - Clear guidance for manual setup later

- **Version Bump to 5.4.0**
  - Updated pyproject.toml: 5.3.2 → 5.4.0
  - Updated kopi_docka/helpers/constants.py: VERSION = "5.4.0"
  - Updated kopi_docka/__init__.py: @version 5.4.0
  - Verified via Python import and CLI help display

## Technical Details

- Test file: tests/unit/test_cores/test_notification_manager.py (820 lines)
- Uses sys.modules mocking for Apprise (imported inside nested function)
- Proper cleanup of environment variables in tests
- Follows existing test patterns from hooks_manager tests
- 100% coverage of NotificationManager public API

## User Experience

Before:
- User runs setup → Config created
- User must manually run: kopi-docka advanced notification setup

After:
- User runs setup → Config created → Repository initialized
- Wizard asks: "Setup backup notifications?"
  - Yes: Launches notification wizard immediately
  - No: Shows reminder for manual setup later

## Testing

✓ Python syntax check passed
✓ All 527 unit tests passed
✓ 40 new notification tests
✓ CLI integration verified
✓ Version display correct: "Kopi-Docka v5.4.0"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore: add MagicMock/ to .gitignore

Test artifact directory should be ignored.

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 22:35:22 +01:00
Markus 95d5292eb9 feat: improve CLI UX for v5.3.1 (#43)
- Dynamic version display in --help header
- Rename 'admin' to 'advanced' command group
- Hide wrapper commands (keep functional for backward compatibility)
- Update version to 5.3.1
- Update documentation (CHANGELOG, USAGE, README)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 13:34:25 +01:00
TZERO78 54376bb810 Resolve merge conflicts: use v5.3.0 from dev 2025-12-27 11:33:48 +01:00
TZERO78 75ed9dcae3 chore(release): bump version to 5.3.0
- Update version in pyproject.toml, __init__.py, constants.py
- Update CHANGELOG.md with comprehensive v5.3.0 release notes:
  - Critical fix: Direct Mode retention policies now work
  - Added: Stable staging paths for metadata backups
  - Added: repo-prune-empty-sessions command
  - Added: Massive test coverage improvements
  - Added: Documentation and CI infrastructure
  - Changed: Code quality improvements (run_command refactoring)
  - Fixed: Rclone backend improvements
- Update documentation (USAGE.md, CONFIGURATION.md, ARCHITECTURE.md)
- Update all version references from 5.2.x to 5.3.0
- Update CLAUDE.md and agent metadata to 5.3.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 11:30:50 +01:00