From 43b91885ba4f2102fefc512221c015f44388edea Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Thu, 13 Apr 2017 20:39:48 -0700 Subject: [PATCH] Add the ability to inject SSH options --- README.md | 3 +++ config/tunneler.php | 1 + src/Jobs/CreateTunnel.php | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 37d433a..3c7f27f 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,9 @@ TUNNELER_CONN_WAIT=500000 ; Do you want to ensure you have the Tunnel in place for each bootstrap of the framework? TUNNELER_ON_BOOT=false + +; Do you want to use additional SSH options when the tunnel is created? +TUNNELER_SSH_OPTIONS="-o StrictHostKeyChecking=no" ``` ## Quickstart diff --git a/config/tunneler.php b/config/tunneler.php index 0b2020b..d46072e 100644 --- a/config/tunneler.php +++ b/config/tunneler.php @@ -18,5 +18,6 @@ 'on_boot' => filter_var(env('TUNNELER_ON_BOOT', false), FILTER_VALIDATE_BOOLEAN), 'ssh_verbosity' => env('SSH_VERBOSITY',''), + 'ssh_options' => env('TUNNELER_SSH_OPTIONS', ''), 'nohup_log' => env('NOHUP_LOG', '/dev/null'), ]; diff --git a/src/Jobs/CreateTunnel.php b/src/Jobs/CreateTunnel.php index bdd891d..da49352 100644 --- a/src/Jobs/CreateTunnel.php +++ b/src/Jobs/CreateTunnel.php @@ -29,8 +29,9 @@ public function __construct() config('tunneler.local_port') ); - $this->sshCommand = sprintf('%s %s -N -i %s -L %d:%s:%d -p %d %s@%s', + $this->sshCommand = sprintf('%s %s %s -N -i %s -L %d:%s:%d -p %d %s@%s', config('tunneler.ssh_path'), + config('tunneler.ssh_options'), config('tunneler.ssh_verbosity'), config('tunneler.identity_file'), config('tunneler.local_port'),