diff --git a/.travis.yml b/.travis.yml index 52a3402..55e8c8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ ---- sudo: false language: ruby cache: bundler @@ -21,3 +20,5 @@ deploy: on: tags: true rvm: '2.6' + api_key: + secure: cOrwE9aso+lLtjQxcLrazKrUhuKNh5MppzYtikA0t0OGukUPNv0apXE1vY1OhXZ71NH7Q9YezYj+uFKTqh/FRYxdfMs02a+uYRD955TqFfJljlMQBkeNOm7SwFTbfSNbLozqcDoTEGKsw+03vj7Vdsbbz1MWtArG0RDotVHfT0xwiuEeOznMvaUFaybnLxNnFGWDsFl0q9sogh1ZPifZDf4Qkd4UEf80dKDD+LQ1gjfFXVe/B7GJn09pbYsi6JK5I6dCAdE1vg8g95dEB+xKvFNQndl5GPcT+8kmONijiQnrRD5MymFp7/ylGgu85oMjBTtWi0H8UABROPs+1DvkMHU3/hZPZ5acanBGhbgv5YHmOMPdR7cTXfzQhfoka6Eynrq99nlzA6iRtwHMMV1yWzR7/bMPnS5Bop4Bgdlwh4lB44kJ9BREYULVijtSEvnpAem7IYhVR55wCxifIHdOvSd8TqEEeDma6dtkffwVlwwfSAmEEaXUVMYvQN0JwcLCaoLAY0S0I2wO0Jv3oWj+rujkItFtYwPA6PZlEMe9OIi0zMWKUpKeMyyMqHbc3V0dVcI1WZyBuBC5PGboJW0mgmDaUssr5I6lY6pjun0tsHz2qHoyDDFrwA2XtvuWK0LoniPrrgcsu2c2hsvHWKqR/lJcS2eLMrOjhVoVGaF016A= diff --git a/README.md b/README.md index 720ae20..de2ac54 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,17 @@ -# Net::Ssh::Proxy::Tunnel +[![Build Status](https://travis-ci.org/kontena/net-ssh-proxy-gateway.svg?branch=master)](https://travis-ci.org/kontena/net-ssh-proxy-gateway) +[![Gem Version](https://badge.fury.io/rb/net-ssh-proxy-gateway)](https://badge.fury.io/rb/net-ssh-proxy-gateway) +[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/net-ssh-proxy-gateway) -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/net/ssh/proxy/tunnel`. To experiment with that code, run `bin/console` for an interactive prompt. +# Net::SSH::Proxy::Gateway -TODO: Delete this and the text above, and describe your gem +Allows using [`Net::SSH::Gateway`](https://github.com/net-ssh/net-ssh-gateway) as a proxy in `Net::SSH.start(host, user, proxy:..)`. ## Installation Add this line to your application's Gemfile: ```ruby -gem 'net-ssh-proxy-tunnel' +gem 'net-ssh-proxy-gateway' ``` And then execute: @@ -18,18 +20,28 @@ And then execute: Or install it yourself as: - $ gem install net-ssh-proxy-tunnel + $ gem install net-ssh-proxy-gateway ## Usage -TODO: Write usage instructions here +It accepts the same parameters as [`Net::SSH::Gateway.new`](https://www.rubydoc.info/github/net-ssh/net-ssh-gateway) which works quite a lot like [`Net::SSH.start`](https://www.rubydoc.info/github/net-ssh/net-ssh/Net%2FSSH.start). -## Development +### Example -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +```ruby +session = Net::SSH.start( + 'target-host-name-or-ip.example.com', + 'target-host-username', + proxy: Net::SSH::Proxy::Gateway.new( + 'proxy-host-hostname-or-ip.example.com', + 'proxy-host-username', + #proxy_host_connection_options (see Net::SSH.start) + ) +) +``` -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). +Tada! The session to the target host will be tunneled through the proxy host. Nothing else for you to do. The port forwarding will be automatically canceled when the main session is closed. ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/net-ssh-proxy-tunnel. +Bug reports and pull requests are welcome on GitHub at [kontena/net-ssh-proxy-gateway](https://github.com/kontena/net-ssh-proxy-gateway).