obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Bug]: git not using ssh-agent when run via obsidian-git

Open HedgeMage opened this issue 3 years ago • 4 comments

Describe the bug

I am running ssh-agent (as provided by openssh-8.6p1) on NixOS 21.05.4719.0fd9ee1aa36 (Okapi), via keychain 2.8.5. My obsidian version is v0.13.23, and my obsidian-git plugin version is 1.21.1. My git version is 2.31.1.

Everything works as expected when using git or ssh from the command line, however the obsidian-git plugin prompts me for my key's passphrase every time it takes an action. It's become quite frustrating, but I'm not sure where the problem lies.

Relevant errors (if available)

No response

Steps to reproduce

  1. Install keychain and add eval keychain -q --confhost --ignore-missing --timeout 720 --eval KEYNAME to your .bashrc
  2. Open an interactive terminal and provide your ssh key when prompted
  3. Open an Obsidian vault with obsidian-git installed and enabled.
  4. Get annoyed at the frequent prompts for ssh password

Expected Behavior

I should have to enter my ssh password just once every couple of hours, per my keychain configuration.

Addition context

No response

Operating system

Linux

HedgeMage avatar Feb 26 '22 23:02 HedgeMage

I have the same problem using the ssh agent from KeePass. My guess is that obidian-git is running git in a new environment and therefore the SSH_AUTH_SOCK env is missing for git to pick up. :thinking:

EDIT: this seams to be not the case, the env is correctly passed down to simple-git. Also, spawning a child process instead of using simple-git works

cyl3x avatar Aug 24 '23 09:08 cyl3x