bastion-cli 0.6.0 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +3 -0
- data/Rakefile +18 -0
- data/bastion-cli.gemspec +1 -1
- data/bin/bastion +21 -19
- data/lib/bastion.rb +1 -4
- data/lib/bastion/version.rb +4 -0
- 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: 267c81dfe441a4e125c78f29299c0a46d851eb3e
|
4
|
+
data.tar.gz: 23d5c1f334a39934d14f235d1deafa66cec272c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e16b99e527f4b0b0c55bb87ed0229d10e4595c90a043ea8d1ab67c73bb1fcc5bd74cfbbf6034fbfb2b89766d41c58f814fc72734fdf89fe2c232676548f86a5b
|
7
|
+
data.tar.gz: 59974408b9d5d635895ab7c26cc31984cc3f43b40cd0fdcd2a0564c9ac87f768da6d88379040fac02a54efae40c8ce06a42e3f0a837d127e7ec957729eddf996
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Rakefile
CHANGED
@@ -6,6 +6,24 @@ RuboCop::RakeTask.new do |task|
|
|
6
6
|
# task.fail_on_error = false
|
7
7
|
end
|
8
8
|
|
9
|
+
desc "Cleans up stuff"
|
10
|
+
task :clean do
|
11
|
+
system("rm -fr pkg")
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "Reinstalls"
|
15
|
+
task :reinstall do
|
16
|
+
system("sudo gem uninstall -x bastion-cli")
|
17
|
+
system("sudo gem install bastion-cli")
|
18
|
+
end
|
19
|
+
|
20
|
+
task go: [
|
21
|
+
:rubocop,
|
22
|
+
:release,
|
23
|
+
:clean,
|
24
|
+
:reinstall,
|
25
|
+
]
|
26
|
+
|
9
27
|
task default: [
|
10
28
|
:rubocop,
|
11
29
|
]
|
data/bastion-cli.gemspec
CHANGED
data/bin/bastion
CHANGED
@@ -7,51 +7,53 @@ require "thor"
|
|
7
7
|
require "bastion"
|
8
8
|
|
9
9
|
module Bastion
|
10
|
-
|
11
|
-
|
12
|
-
#
|
10
|
+
### Main cli class
|
11
|
+
###
|
13
12
|
class Cli < Thor
|
14
13
|
Config.load
|
15
14
|
|
15
|
+
desc "version", "Shows current version"
|
16
|
+
def version
|
17
|
+
puts "v#{VERSION}"
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "host [HOST]", "Show or set the default bastion host"
|
21
|
+
def host(address = nil)
|
22
|
+
return Config.save(address) if address
|
23
|
+
puts Config.host
|
24
|
+
end
|
25
|
+
|
16
26
|
desc "ssh [INSTANCE]", "Logs into an instance"
|
17
27
|
option :host
|
18
28
|
option :save, type: :boolean
|
29
|
+
option :v, type: :boolean
|
19
30
|
def ssh(instance = nil)
|
20
31
|
host = options[:host] || Config.host
|
32
|
+
verb = options[:v] ? " -vvv" : ""
|
21
33
|
Config.save host if options[:save]
|
22
34
|
if instance
|
23
35
|
puts "==> Using #{host}"
|
24
36
|
puts "==> Logging into #{instance}"
|
25
|
-
exec "ssh -A -t #{host} ssh #{instance}"
|
37
|
+
exec "ssh -A -t #{host} ssh #{instance}#{verb}"
|
26
38
|
else
|
27
39
|
puts "==> Logging into #{host}"
|
28
|
-
exec "ssh -A #{host}"
|
40
|
+
exec "ssh -A #{host}#{verb}"
|
29
41
|
end
|
30
42
|
end
|
31
43
|
|
32
|
-
desc "host [HOST]", "Show or set the default bastion host"
|
33
|
-
def host(address = nil)
|
34
|
-
return Config.save(address) if address
|
35
|
-
|
36
|
-
puts "DEFAULT #{Config.default}"
|
37
|
-
puts "SAVED #{Config.file}"
|
38
|
-
puts "ENV #{Config.env}"
|
39
|
-
puts "ACTUAL #{Config.host}"
|
40
|
-
end
|
41
|
-
|
42
44
|
desc "tunnel [PORT]", "Starts a new tunnel"
|
43
45
|
option :host
|
44
46
|
option :save, type: :boolean
|
47
|
+
option :v, type: :boolean
|
45
48
|
def tunnel(port = 1200)
|
46
49
|
host = options[:host] || Config.host
|
47
|
-
|
50
|
+
Config.save host if options[:save]
|
48
51
|
puts "==> Starting tunnel to host #{host} on port #{port}"
|
49
52
|
exec "ssh -D#{port} #{host}"
|
50
53
|
end
|
51
54
|
|
52
|
-
|
53
|
-
|
54
|
-
puts "v#{VERSION}"
|
55
|
+
def method_missing(name)
|
56
|
+
ssh name
|
55
57
|
end
|
56
58
|
end
|
57
59
|
end
|
data/lib/bastion.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bastion-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ptdorf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- bin/bastion
|
70
70
|
- lib/bastion.rb
|
71
71
|
- lib/bastion/config.rb
|
72
|
+
- lib/bastion/version.rb
|
72
73
|
- license.txt
|
73
74
|
- readme.md
|
74
75
|
homepage: https://github.com/ptdorf/bastion-cli
|