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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7763fbbed4cecabc922125a30caacb18d0d5574e93af3da56598f7d3e08eb9b
4
- data.tar.gz: 2d0dfa4d5a4e2871333db6d0be1215840da0b1f407b6deea2ad437091eef78ae
3
+ metadata.gz: 271479b1cbec8d070ad4daaaa7a47af0e77862a271f7417cb00c88d6e51f6df5
4
+ data.tar.gz: 4a0a8c012fe218f30c63ff3921038e2e817b7ea4f39d9dbccea049f199893c4f
5
5
  SHA512:
6
- metadata.gz: 51137dade3e5a63e1fa0fbdef6d7a20d791c8dfc90d42941df701632eed20d468a5aa79ab96ce3770fd9674b55594a053524d9e11e7e83c3d09f230cc7d6fe8c
7
- data.tar.gz: 9ef021e917c5868a1d65324dde73ba8a1e8676bd0f5d852b3588324e25fee4fb869e40812ce5acfbc278cd870c9f09a230c6a7e7e22c7e273b36b91c26832656
6
+ metadata.gz: 588b0c59e9697d502483ef90c3b5b1c774809c08883238b9b99ae4840002b06dd49e0e3cb7121ccac6d25ec7412ec87cd6deb27b6f668074240618d0a0c18184
7
+ data.tar.gz: 7f42b9031b1fea39f1cbdf5c9747333e30f89a6034e1402287cbb15258a4d61c1806085c114044bcfc342cbfca705e0f75e605b503ee67ecf50cd11aba083def
data/README.md CHANGED
@@ -36,6 +36,15 @@ exclude_ips:
36
36
  - 203.0.113.0
37
37
  ```
38
38
 
39
+ 開くポートはTCP/22ですが、変更することもできます。以下の例ではTCP/443を開いています。
40
+
41
+ ```
42
+ $ cat kanmon.yml
43
+ security_group: 11122233-4444-5555-6666-777788889999
44
+ port: 443
45
+ ```
46
+
47
+
39
48
  環境変数を設定します。
40
49
 
41
50
  ```
@@ -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"])
@@ -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: 22,
43
- port_range_max: 22,
43
+ port_range_min: @port,
44
+ port_range_max: @port,
44
45
  ethertype: "IPv4",
45
46
  protocol: "tcp",
46
47
  security_group_id: @id,
@@ -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: 22,
69
- port_range_max: 22,
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,
@@ -1,3 +1,3 @@
1
1
  module Kanmon
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
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.7.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: 2018-09-25 00:00:00.000000000 Z
11
+ date: 2019-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yao