Read the snapshot name using the stored hostname (closes #230)
check / check (push) Canceled after 0s

A snapshot ID is hostname_name_timestamp, and purge took the name to be
everything between the first and the last underscore. With a hostname
such as my_host the name home came out as host_home, so
`snapshot create --prune` and `snapshot purge --snapshot home` purged
nothing. The name is now read by removing the hostname stored with the
snapshot, in the short form the ID uses, so both may contain
underscores. This was chosen over rejecting underscores in `hostname`
when the config loads, which would also stop restores on such a host.

The purge consistency test stored a hostname that did not match its
snapshot IDs; it now matches, as it always does in production.

Model: opus-5-5
This commit is contained in:
2026-10-07 07:56:06 +00:00
parent 5d1118d143
commit fd3f317e45
7 changed files with 123 additions and 45 deletions
+10
View File
@@ -22,6 +22,16 @@ the tag exists and is exercised; what is left is merging `next` to
# Completed Steps
- 2026-10-07: Made per-name retention work when the hostname contains `_`
([issue #230](https://git.eeqj.de/sneak/vaultik/issues/230)). A
snapshot ID is `hostname_name_timestamp`, and the name was read as
everything between the first and the last `_`, so with
`hostname: my_host` the name `home` came out as `host_home` and
`snapshot create --prune` and `snapshot purge --snapshot home` purged
nothing, without a message. The name is now read using the hostname
the `snapshots` table stores with each snapshot, cut at its first `.`
as it is in the ID.
- 2026-10-07: Made `config set` keep a string that looks like a number
([issue #229](https://git.eeqj.de/sneak/vaultik/issues/229)). It wrote
every value unquoted, and `config.Load` reads the file through untyped