Adding vars clone for remote repo's - #9
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
vars clone <remote>clones an existing store from a git remote into your local store directory (e.g. to set up from a store you already pushed), instead of creating a fresh, divergent one. It replaces an empty local store but refuses to overwrite one that holds secrets, locks the store directory to0700, and reports whether the SSH key the store is encrypted to is available (that key may differ from the one that authenticated the clone).git clonesetsorigin, sovars syncworks immediately.Changed
README.md,.gitignore, or.gitattributesis recreated on the next write (a deleted.gitignorere-arms the default-deny allowlist before secrets are committed). Existing files are never overwritten. The scaffold now has a single source of truth in thevaultpackage, shared by store creation and writes.vars ls <arg>accepts only a scope.flockon a gitignored.vars.lock), so two simultaneous writes no longer race the git index, and a rename can't clobber a concurrently created key. The lock auto-releases if the process dies; it's a no-op on platforms withoutflock(vars targets Unix).[A-Za-z0-9_-]segments separated by/. This rejects accents and other non-ASCII (which collide across machines under Unicode normalization), control characters, and path-traversal, keeping keys portable and predictable.Fixed
vars settreated an existing key whose value can't be decrypted (corrupt or foreign file, or the wrong key loaded) as a brand-new key:--skipwould overwrite it and a plainsetreplaced it silently. It now surfaces the read failure instead, matchingvars import.