kanmon 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/kanmon/cli.rb +2 -2
- data/lib/kanmon/securitygroup.rb +4 -3
- data/lib/kanmon/server.rb +4 -3
- data/lib/kanmon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 271479b1cbec8d070ad4daaaa7a47af0e77862a271f7417cb00c88d6e51f6df5
|
4
|
+
data.tar.gz: 4a0a8c012fe218f30c63ff3921038e2e817b7ea4f39d9dbccea049f199893c4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588b0c59e9697d502483ef90c3b5b1c774809c08883238b9b99ae4840002b06dd49e0e3cb7121ccac6d25ec7412ec87cd6deb27b6f668074240618d0a0c18184
|
7
|
+
data.tar.gz: 7f42b9031b1fea39f1cbdf5c9747333e30f89a6034e1402287cbb15258a4d61c1806085c114044bcfc342cbfca705e0f75e605b503ee67ecf50cd11aba083def
|
data/README.md
CHANGED
data/lib/kanmon/cli.rb
CHANGED
@@ -64,10 +64,10 @@ module Kanmon
|
|
64
64
|
@config = @config[options[:target]] if options[:target]
|
65
65
|
|
66
66
|
if @config.key?("security_group")
|
67
|
-
@kanmon = SecurityGroup.new(@config["security_group"])
|
67
|
+
@kanmon = SecurityGroup.new(@config["security_group"], @config["port"])
|
68
68
|
end
|
69
69
|
if @config.key?('server')
|
70
|
-
@kanmon = Server.new(@config["server"])
|
70
|
+
@kanmon = Server.new(@config["server"], @config["port"])
|
71
71
|
end
|
72
72
|
|
73
73
|
exclude_ips = ExcludeIps.new(@config["exclude_ips"])
|
data/lib/kanmon/securitygroup.rb
CHANGED
@@ -6,8 +6,9 @@ module Kanmon
|
|
6
6
|
class SecurityGroup
|
7
7
|
attr_reader :ip
|
8
8
|
|
9
|
-
def initialize(id, ip = nil)
|
9
|
+
def initialize(id, port, ip = nil)
|
10
10
|
@id = id
|
11
|
+
@port = port || 22
|
11
12
|
@ip = ip || Kanmon::MyIP.get
|
12
13
|
@tenant_id = Yao.current_tenant_id
|
13
14
|
end
|
@@ -39,8 +40,8 @@ module Kanmon
|
|
39
40
|
def rule
|
40
41
|
{
|
41
42
|
direction: "ingress",
|
42
|
-
port_range_min:
|
43
|
-
port_range_max:
|
43
|
+
port_range_min: @port,
|
44
|
+
port_range_max: @port,
|
44
45
|
ethertype: "IPv4",
|
45
46
|
protocol: "tcp",
|
46
47
|
security_group_id: @id,
|
data/lib/kanmon/server.rb
CHANGED
@@ -6,8 +6,9 @@ module Kanmon
|
|
6
6
|
class Server
|
7
7
|
attr_reader :ip
|
8
8
|
|
9
|
-
def initialize(id, ip = nil)
|
9
|
+
def initialize(id, port, ip = nil)
|
10
10
|
@id = id
|
11
|
+
@port = port || 22
|
11
12
|
@ip = ip || Kanmon::MyIP.get
|
12
13
|
@tenant_id = Yao.current_tenant_id
|
13
14
|
@server = Yao::Server.get(id)
|
@@ -65,8 +66,8 @@ module Kanmon
|
|
65
66
|
def rule
|
66
67
|
{
|
67
68
|
direction: "ingress",
|
68
|
-
port_range_min:
|
69
|
-
port_range_max:
|
69
|
+
port_range_min: @port,
|
70
|
+
port_range_max: @port,
|
70
71
|
ethertype: "IPv4",
|
71
72
|
protocol: "tcp",
|
72
73
|
security_group_id: @sg.id,
|
data/lib/kanmon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kanmon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki Koya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yao
|