Skip to content

fix(git): expand tilde in SSH identity file paths#1049

Open
Olshansk wants to merge 4 commits intoloderunner:mainfrom
Olshansk:git_path_fix_and_contribution_guide
Open

fix(git): expand tilde in SSH identity file paths#1049
Olshansk wants to merge 4 commits intoloderunner:mainfrom
Olshansk:git_path_fix_and_contribution_guide

Conversation

@Olshansk
Copy link

@Olshansk Olshansk commented Mar 8, 2026

tl;dr SSH git storage now works on machines where ~/.ssh/config returns identity paths with literal ~.

Summary

  • SSH identity file resolution fixed: Tilde (~) in identity file paths is now expanded to the home directory, fixing "no valid authentication method" errors
  • Contributing guide added: New docs/guide/contributing.md with copy-paste instructions for building, testing, and verifying changes locally

Table Diff

Component Before After
SSH identity file path Literal ~/.ssh/id_ed25519 passed to go-git (fails) Expanded to /Users/<user>/.ssh/id_ed25519 via go-homedir
go-homedir usage Used in local.go only Also used in git.go for SSH key paths
Contributing docs N/A New guide at docs/guide/contributing.md

SSH identity file paths from ~/.ssh/config contain literal ~ which
was not expanded to the home directory, causing "no valid authentication
method" errors. Uses go-homedir (already a dependency) to expand paths
before passing to go-git's SSH auth.

Also adds a contributing guide with build/test/verify instructions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Olshansk
Copy link
Author

Olshansk commented Mar 8, 2026

@loderunner Small fix I needed on macOS to sync to github given my ssh key setup.

As an aside - do you plan to depricate this in favor of other projects you're working with?

I personally use 1password but I love the simplicity here.

Copy link
Owner

@loderunner loderunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good addition, and simple implementation too. 👍

Love the cookbook for hackers, too. Just a small docs nit to pick. Fix it and we're good to go.

@loderunner
Copy link
Owner

@Olshansk thanks for the PR and the continued interest in scrt! I love that you're still using this.

You're right, I should probably deprecate this, I haven't been keeping it up to date.
I still think, like you, that there's something interesting there, but I think it's been superseded by the omnipresence of dotenv, and simple cloud vaults.

If you're using this as a personal vault, though, you might want to take a look at my other project apiki. Has some similarities, but it's meant for personal usage and for environment variables.

I'll try to get your PR merged, and I'd be happy to consider any further contributions.

@loderunner
Copy link
Owner

I fixed CI on main. Rebase/merge and try again.

@Olshansk
Copy link
Author

Olshansk commented Mar 9, 2026

@loderunner Appreciate the quick response.


If you're using this as a personal vault, though, you might want to take a look at my other project apiki. Has some similarities, but it's meant for personal usage and for environment variables.

Yea, I saw that you've been spending some time there and will check it out.

I'll try to get your PR merged, and I'd be happy to consider any further contributions.

Synched to HEAD/main. Should be g2g.

I still think, like you, that there's something interesting there, but I think it's been superseded by the omnipresence of dotenv, and simple cloud vaults.

I also use the 1password CLI, but love the simplicity of scrt.

Will keep you posted (if time permits), but might add 1password as a storage option in addition to local/git/s3.

@loderunner
Copy link
Owner

Alright, passes CI. Just address the comment in the contributing guide and I'll merge it.

Olshansk and others added 2 commits March 10, 2026 10:09
@Olshansk Olshansk requested a review from loderunner March 10, 2026 17:11
@loderunner loderunner enabled auto-merge (squash) March 10, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants