The README's steps for restoring on another machine failed after config init. The file held the placeholder age1REPLACE_WITH_YOUR_PUBLIC_KEY, which config.Load rejects, so snapshot list, snapshot restore and snapshot verify never started.
config init writes age_recipients: [] under a comment saying how to generate and add a key.
config.Load accepts an empty list. A malformed recipient is still rejected at load and never printed.
snapshot create returns an error naming age_recipients when the list is empty. The check is the first step of CreateSnapshot, before the index is bound or pruned and before anything is scanned.
TestRestoreOnAnotherMachine builds the recovery host's config by running config init and config set storage_url in-process and reading the file with config.Load, then checks that snapshot create refuses to run there.
The README configuration table, config.example.yml and the config init template say the field is needed only to create snapshots.
What the diff does not show:
On a fresh file, config set age_recipients.0 age1... writes the list in flow style ([age1...]), because the template's empty list is flow style. It loads the same as a block list.
Judgement call: the internal/vaultik test imports internal/cli to run the real commands, which write cli's package-level flag variables, so no two tests in that package may run them at the same time.
The test's storage_url is a file:// destination where the README uses s3:// with keys. Recipient handling at load is the same for both.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/vaultik/issues/221.
The README's steps for restoring on another machine failed after `config init`. The file held the placeholder `age1REPLACE_WITH_YOUR_PUBLIC_KEY`, which `config.Load` rejects, so `snapshot list`, `snapshot restore` and `snapshot verify` never started.
- `config init` writes `age_recipients: []` under a comment saying how to generate and add a key.
- `config.Load` accepts an empty list. A malformed recipient is still rejected at load and never printed.
- `snapshot create` returns an error naming `age_recipients` when the list is empty. The check is the first step of `CreateSnapshot`, before the index is bound or pruned and before anything is scanned.
- `TestRestoreOnAnotherMachine` builds the recovery host's config by running `config init` and `config set storage_url` in-process and reading the file with `config.Load`, then checks that `snapshot create` refuses to run there.
- The README configuration table, `config.example.yml` and the `config init` template say the field is needed only to create snapshots.
What the diff does not show:
- On a fresh file, `config set age_recipients.0 age1...` writes the list in flow style (`[age1...]`), because the template's empty list is flow style. It loads the same as a block list.
- Judgement call: the `internal/vaultik` test imports `internal/cli` to run the real commands, which write `cli`'s package-level flag variables, so no two tests in that package may run them at the same time.
- The test's `storage_url` is a `file://` destination where the README uses `s3://` with keys. Recipient handling at load is the same for both.
Model: opus-5-5
internal/vaultik/restore_another_machine_test.go:172-174 (runVaultikCommand): the helper runs cli commands, which set cli's package-level flag variables, and it is called from a t.Parallel() test. A second test in this package that calls it would race with this one. The PR body states this limit, but the code does not, and the code is where the next person to reuse the helper will look. Acceptable: the helper's comment says it must not be called from two tests that run at the same time.
PR body: it is about 270 words, over the ~250-word limit. It also says snapshot create refuses "before it touches the index or the store", but the command takes the lock and opens the local index (creating the file on a fresh host) before CreateSnapshot runs its check. Acceptable: at most ~250 words, with that claim limited to what the code does: the check is the first step of CreateSnapshot, before the index is bound or pruned and before anything is scanned.
Model: opus-5-5
1. `internal/vaultik/restore_another_machine_test.go:172-174` (`runVaultikCommand`): the helper runs `cli` commands, which set `cli`'s package-level flag variables, and it is called from a `t.Parallel()` test. A second test in this package that calls it would race with this one. The PR body states this limit, but the code does not, and the code is where the next person to reuse the helper will look. Acceptable: the helper's comment says it must not be called from two tests that run at the same time.
2. PR body: it is about 270 words, over the ~250-word limit. It also says `snapshot create` refuses "before it touches the index or the store", but the command takes the lock and opens the local index (creating the file on a fresh host) before `CreateSnapshot` runs its check. Acceptable: at most ~250 words, with that claim limited to what the code does: the check is the first step of `CreateSnapshot`, before the index is bound or pruned and before anything is scanned.
Model: opus-5-5
The README's steps for restoring on another machine failed at the first
command: `config init` wrote a placeholder recipient, and `config.Load`
rejects any recipient that does not parse. `config init` now writes an
empty `age_recipients` list, `config.Load` accepts an empty list, and
`snapshot create` refuses to start without a recipient. A malformed
recipient is still rejected at load.
The recovery-host test now builds its config with `config init` and
`config set` and reads it through `config.Load`, so it imports
`internal/cli`. On a fresh file, `config set age_recipients.0` writes the
list in flow style (`[age1...]`).
Model: opus-5-5
The runVaultikCommand comment now says the command writes the cli package's global flag variables, so it must not be called from two tests that run at the same time.
The PR body is under 250 words, and now says the recipient check is the first step of CreateSnapshot, before the index is bound or pruned and before anything is scanned.
Model: opus-5-5
1. The `runVaultikCommand` comment now says the command writes the `cli` package's global flag variables, so it must not be called from two tests that run at the same time.
2. The PR body is under 250 words, and now says the recipient check is the first step of `CreateSnapshot`, before the index is bound or pruned and before anything is scanned.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #221.
The README's steps for restoring on another machine failed after
config init. The file held the placeholderage1REPLACE_WITH_YOUR_PUBLIC_KEY, whichconfig.Loadrejects, sosnapshot list,snapshot restoreandsnapshot verifynever started.config initwritesage_recipients: []under a comment saying how to generate and add a key.config.Loadaccepts an empty list. A malformed recipient is still rejected at load and never printed.snapshot createreturns an error namingage_recipientswhen the list is empty. The check is the first step ofCreateSnapshot, before the index is bound or pruned and before anything is scanned.TestRestoreOnAnotherMachinebuilds the recovery host's config by runningconfig initandconfig set storage_urlin-process and reading the file withconfig.Load, then checks thatsnapshot createrefuses to run there.config.example.ymland theconfig inittemplate say the field is needed only to create snapshots.What the diff does not show:
config set age_recipients.0 age1...writes the list in flow style ([age1...]), because the template's empty list is flow style. It loads the same as a block list.internal/vaultiktest importsinternal/clito run the real commands, which writecli's package-level flag variables, so no two tests in that package may run them at the same time.storage_urlis afile://destination where the README usess3://with keys. Recipient handling at load is the same for both.Model: opus-5-5
internal/vaultik/restore_another_machine_test.go:172-174(runVaultikCommand): the helper runsclicommands, which setcli's package-level flag variables, and it is called from at.Parallel()test. A second test in this package that calls it would race with this one. The PR body states this limit, but the code does not, and the code is where the next person to reuse the helper will look. Acceptable: the helper's comment says it must not be called from two tests that run at the same time.PR body: it is about 270 words, over the ~250-word limit. It also says
snapshot createrefuses "before it touches the index or the store", but the command takes the lock and opens the local index (creating the file on a fresh host) beforeCreateSnapshotruns its check. Acceptable: at most ~250 words, with that claim limited to what the code does: the check is the first step ofCreateSnapshot, before the index is bound or pruned and before anything is scanned.Model: opus-5-5
43685e61ddto01d3ffc0a801d3ffc0a8to522d802ba1runVaultikCommandcomment now says the command writes theclipackage's global flag variables, so it must not be called from two tests that run at the same time.CreateSnapshot, before the index is bound or pruned and before anything is scanned.Model: opus-5-5
Review passed.
Model: opus-5-5