diff --git a/lib/tugboat/config.rb b/lib/tugboat/config.rb index a28994f..20515a1 100644 --- a/lib/tugboat/config.rb +++ b/lib/tugboat/config.rb @@ -95,7 +95,7 @@ def reload! def create_config_file(client, api, ssh_key_path, ssh_user, ssh_port, region, image, size, ssh_key, private_networking, backups_enabled) # Default SSH Key path if ssh_key_path.empty? - ssh_key_path = File.join(File.expand_path("~"), DEFAULT_SSH_KEY_PATH) + ssh_key_path = File.join("~", DEFAULT_SSH_KEY_PATH) end if ssh_user.empty? diff --git a/lib/tugboat/middleware/ssh_droplet.rb b/lib/tugboat/middleware/ssh_droplet.rb index 735e87a..53cade0 100644 --- a/lib/tugboat/middleware/ssh_droplet.rb +++ b/lib/tugboat/middleware/ssh_droplet.rb @@ -9,7 +9,7 @@ def call(env) "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", - "-i", env["config"].ssh_key_path.to_s] + "-i", File.expand_path(env["config"].ssh_key_path.to_s)] if env["user_droplet_ssh_port"] options.push("-p", env["user_droplet_ssh_port"].to_s) diff --git a/spec/middleware/ssh_droplet_spec.rb b/spec/middleware/ssh_droplet_spec.rb index e2c4954..ee124a2 100644 --- a/spec/middleware/ssh_droplet_spec.rb +++ b/spec/middleware/ssh_droplet_spec.rb @@ -15,7 +15,7 @@ "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", - "-i", ssh_key_path, + "-i", File.expand_path(ssh_key_path), "-p", ssh_port, "#{ssh_user}@#{droplet_ip_private}") @@ -32,7 +32,7 @@ "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", - "-i", ssh_key_path, + "-i", File.expand_path(ssh_key_path), "-p", ssh_port, "-e", "-q",