canals 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +3 -0
- data/Gemfile +0 -1
- data/README.md +21 -0
- data/lib/canals/cli/helpers.rb +2 -1
- data/lib/canals/cli/list.rb +0 -2
- data/lib/canals/cli/session.rb +11 -2
- data/lib/canals/version.rb +1 -1
- data/spec/canals/environment_spec.rb +0 -1
- data/spec/canals/options_spec.rb +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3df35b01f8f9e53a33d3b7f4f382cf5a7be93e44
|
4
|
+
data.tar.gz: 54eed2eb3f91b7d9c3c0dff54d58fa19ed066062
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6678efe399cdd797b6972f9db2f156747d0998b196f08259095e05eba1d22715e9348c883693b48b7aed800fb09a27f70ccbd221a5deb661bfe845ce7c0ad06e
|
7
|
+
data.tar.gz: 27f72678f52e4cf58cf48ff02c3f6cc6ba3896f265e3f211e7d507bc799ba70f186cbedfbc5d27b8109b5cbd6c2fa2d2bfb8921cbcb1d46be203ae1a1e808b89
|
data/.rspec
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -11,3 +11,24 @@ Behind the scenes, Canals creates SSH tunnels using the standard OpenSSH library
|
|
11
11
|
gem install canals
|
12
12
|
canal setup wizard
|
13
13
|
```
|
14
|
+
|
15
|
+
### SSH tips
|
16
|
+
#### Keep Alive
|
17
|
+
SSH tunnels tend to die after some time. it's sad but true.
|
18
|
+
but we can do something to try and keep them alive as long as possible.
|
19
|
+
Edit your `~/.ssh/config` file (and if it doesn't exist, create it)
|
20
|
+
and add the following 2 lines:
|
21
|
+
```
|
22
|
+
Host *
|
23
|
+
ServerAliveInterval 60
|
24
|
+
```
|
25
|
+
so in the end:
|
26
|
+
```
|
27
|
+
$ cat ~/.ssh/config
|
28
|
+
Host *
|
29
|
+
ServerAliveInterval 60
|
30
|
+
|
31
|
+
$ chmod 600 ~/.ssh/config
|
32
|
+
$ chown uesr:group ~/.ssh/config
|
33
|
+
```
|
34
|
+
(where user:group is your user:group on your system)
|
data/lib/canals/cli/helpers.rb
CHANGED
@@ -13,7 +13,8 @@ module Canals
|
|
13
13
|
|
14
14
|
def tstart(name)
|
15
15
|
pid = Canals.start(name)
|
16
|
-
|
16
|
+
tunnel = Canals.repository.get(name)
|
17
|
+
say "Created tunnel #{name.inspect} with pid #{pid}. You can access it using '#{tunnel.bind_address}:#{tunnel.local_port}'"
|
17
18
|
pid
|
18
19
|
end
|
19
20
|
|
data/lib/canals/cli/list.rb
CHANGED
@@ -2,7 +2,6 @@ require 'canals'
|
|
2
2
|
require 'canals/options'
|
3
3
|
require 'canals/environment'
|
4
4
|
require 'thor'
|
5
|
-
require 'pry'
|
6
5
|
|
7
6
|
module Canals
|
8
7
|
module Cli
|
@@ -23,7 +22,6 @@ module Canals
|
|
23
22
|
|
24
23
|
desc 'commands', 'List all the base level commands'
|
25
24
|
def commands(subcommand=nil)
|
26
|
-
#binding.pry
|
27
25
|
thor_class = Canals::Cli::Application
|
28
26
|
if !subcommand.nil?
|
29
27
|
thor_class = thor_class.subcommand_classes[subcommand]
|
data/lib/canals/cli/session.rb
CHANGED
@@ -14,8 +14,8 @@ module Canals
|
|
14
14
|
return if session_empty?
|
15
15
|
require 'terminal-table'
|
16
16
|
require 'canals/core_ext/string'
|
17
|
-
columns = ["pid", "name", "socket"]
|
18
|
-
rows = Canals.session.map{ |s| columns.map{ |c| s[c.to_sym] } }
|
17
|
+
columns = ["pid", "name", "local_port", "socket"]
|
18
|
+
rows = Canals.session.map{ |s| columns.map{ |c| s[c.to_sym] || get_session_col_val(s, c) } }
|
19
19
|
table = Terminal::Table.new :headings => columns.map{|c| c.sub("_"," ").titleize }, :rows => rows
|
20
20
|
say table
|
21
21
|
end
|
@@ -57,6 +57,15 @@ module Canals
|
|
57
57
|
say "#{command} done.", :green
|
58
58
|
end
|
59
59
|
|
60
|
+
def get_session_col_val(session, key)
|
61
|
+
case key
|
62
|
+
when "local_port"
|
63
|
+
entry = Canals.repository.get(session[:name])
|
64
|
+
return entry.local_port if entry
|
65
|
+
end
|
66
|
+
nil
|
67
|
+
end
|
68
|
+
|
60
69
|
def session_empty?
|
61
70
|
if Canals.session.empty?
|
62
71
|
say "Canal session is currently empty."
|
data/lib/canals/version.rb
CHANGED
data/spec/canals/options_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ido Abramovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
+
- ".rspec"
|
63
64
|
- ".rvmrc"
|
64
65
|
- Gemfile
|
65
66
|
- LICENSE
|