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
No related tags found
No related merge requests found
......@@ -74,10 +74,6 @@ class Handler extends BaseHandler {
$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.
$twig_loader = new \Twig_Loader_Array([]);
$twig = new \Twig_Environment($twig_loader);
......@@ -294,6 +290,14 @@ class Handler extends BaseHandler {
else {
$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;
$this->options = $env->replaceEnvironmentVariables($options);
......
......@@ -45,7 +45,7 @@ services:
- {{ projectroot }}:/var/www/html
- {{ projectroot }}/drush:/etc/drush
{% if php.ssh %}
- $SSH_AUTH_SOCK:/ssh-agent
- {{ php.ssh_auth_sock }}:/ssh-agent
{% endif %}
{% if webgrind.enable %}
- 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