Skip to content
Snippets Groups Projects
Commit 58eb60b8 authored by jurgenhaas's avatar jurgenhaas
Browse files

Set the value of $SSH_AUTH_SOCK instead of the env variable so that the...

Set the value of $SSH_AUTH_SOCK instead of the env variable so that the containers can be started from within the dev container as well
parent f345c85e
No related branches found
Tags v v1.9.8
No related merge requests found
...@@ -74,10 +74,6 @@ class Handler extends BaseHandler { ...@@ -74,10 +74,6 @@ class Handler extends BaseHandler {
$settingsPath = 'settings/default'; $settingsPath = 'settings/default';
} }
// Check if SSH auth sockets are supported.
$ssh_auth_sock = getenv('SSH_AUTH_SOCK');
$options['php']['ssh'] = !empty($ssh_auth_sock);
// Provide all the required files. // Provide all the required files.
$twig_loader = new \Twig_Loader_Array([]); $twig_loader = new \Twig_Loader_Array([]);
$twig = new \Twig_Environment($twig_loader); $twig = new \Twig_Environment($twig_loader);
...@@ -294,6 +290,14 @@ class Handler extends BaseHandler { ...@@ -294,6 +290,14 @@ class Handler extends BaseHandler {
else { else {
$projectRoot = getcwd(); $projectRoot = getcwd();
} }
// Check if SSH auth sockets are supported.
$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['projectroot'] = $projectRoot; $options['projectroot'] = $projectRoot;
$this->options = $env->replaceEnvironmentVariables($options); $this->options = $env->replaceEnvironmentVariables($options);
......
...@@ -45,7 +45,7 @@ services: ...@@ -45,7 +45,7 @@ services:
- {{ projectroot }}:/var/www/html - {{ projectroot }}:/var/www/html
- {{ projectroot }}/drush:/etc/drush - {{ projectroot }}/drush:/etc/drush
{% if php.ssh %} {% if php.ssh %}
- $SSH_AUTH_SOCK:/ssh-agent - {{ php.ssh_auth_sock }}:/ssh-agent
{% endif %} {% endif %}
{% if webgrind.enable %} {% if webgrind.enable %}
- files:/mnt/files - files:/mnt/files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment