Permalink
Browse files

Added support for an ssh gateway to tunnel connections behind a firew…

…all or proxy server. Updated documentation.
  • Loading branch information...
1 parent e5b252d commit 31bfdd45bfced32edec99e8500fe16a0d847accc @dshimy dshimy committed with Fudge Dec 10, 2009
Showing with 14 additions and 6 deletions.
  1. +3 −3 README
  2. +1 −0 config.yaml
  3. +10 −3 lib/gl_tail/sources/ssh.rb
View
6 README
@@ -29,16 +29,16 @@ Versions tested:
Installation instructions (Ubuntu/Debian):
sudo apt-get install rubygems rake ruby1.8-dev libgl1-mesa-dev libglu1-mesa-dev libglut3-dev build-essential
- sudo gem install -y net-ssh ruby-opengl -r
+ sudo gem install net-ssh ruby-opengl -r
Installation instructions (Mandriva/RedHat):
sudo urpmi ruby ruby-devel ruby-RubyGems ruby-rake
sudo urpmi libmesagl1-devel libmesaglut3-devel ruby-rbogl
- sudo gem install -y net-ssh ruby-opengl -r
+ sudo gem install net-ssh ruby-opengl -r
Installation instructions (Mac OS/X):
<install ruby & rubygems>
- sudo gem install -y net-ssh ruby-opengl -r
+ sudo gem install net-ssh ruby-opengl file-tail -r
Installation instructions (Windows):
One-click Ruby installer from http://rubyforge.org/projects/rubyinstaller/
View
@@ -8,6 +8,7 @@ servers:
parser: apache
color: 0.2, 1.0, 0.2, 1.0
rails:
+ gateway: gw-server.anotherfunsite.com
host: anotherfunsite.com
user: anotherfunuser
port: 222
View
@@ -13,21 +13,28 @@ class SSH < Base
config_attribute :port, "Port"
config_attribute :keys, "Path to the ssh private key to use"
config_attribute :password, "Password"
+ config_attribute :gateway, "Gateway"
def init
@channels = []
- puts "Connecting to #{host}..." if($VRB > 0 || $DBG > 0)
-
session_options = { }
session_options[:port] = port if port
session_options[:keys] = keys if keys
session_options[:verbose] = :debug if $DBG > 1
session_options[:password] = password if password
begin
- @session = Net::SSH.start(host, user, session_options)
+ if gateway
+ puts "Connecting via gateway #{gateway}..." if($VRB > 0 || $DBG > 0)
+ gw = Net::SSH::Gateway.new(gateway, user, session_options)
+ puts "Connecting to #{host}..." if($VRB > 0 || $DBG > 0)
+ @session = gw.ssh(host, user, session_options)
+ else
+ puts "Connecting to #{host}..." if($VRB > 0 || $DBG > 0)
+ @session = Net::SSH.start(host, user, session_options)
+ end
rescue SocketError, Errno::ECONNREFUSED => e
puts "!!! Could not connect to #{host}. Check to make sure that this is the correct url."
puts $! if $DBG > 0

0 comments on commit 31bfdd4

Please sign in to comment.