From b87cb93ac6ec89825e9b18e28d77c3e90945b801 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Thu, 20 Dec 2018 14:47:07 +0100
Subject: [PATCH] #31 Resolve SSH_AUTH_SOCK only if inside a container

---
 src/Handler.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/Handler.php b/src/Handler.php
index 054d631..f963d55 100644
--- a/src/Handler.php
+++ b/src/Handler.php
@@ -295,7 +295,9 @@ class Handler extends BaseHandler {
       $ssh_auth_sock = getenv('SSH_AUTH_SOCK');
       $options['php']['ssh'] = !empty($ssh_auth_sock);
       if ($options['php']['ssh']) {
-        $options['php']['ssh_auth_sock'] = $this->getDockerMountSource('/ssh-agent');
+        $options['php']['ssh_auth_sock'] = ($this->isCiContext() || $this->isLocalDevMode()) ?
+          $this->getDockerMountSource('/ssh-agent') :
+          '$SSH_AUTH_SOCK';
       }
 
       $options['projectroot'] = $projectRoot;
-- 
GitLab