kanmon 0.6.0 → 0.7.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 +9 -1
- data/lib/kanmon/exclude_ips.rb +11 -0
- data/lib/kanmon/securitygroup.rb +2 -0
- data/lib/kanmon/server.rb +2 -0
- data/lib/kanmon/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7763fbbed4cecabc922125a30caacb18d0d5574e93af3da56598f7d3e08eb9b
|
4
|
+
data.tar.gz: 2d0dfa4d5a4e2871333db6d0be1215840da0b1f407b6deea2ad437091eef78ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51137dade3e5a63e1fa0fbdef6d7a20d791c8dfc90d42941df701632eed20d468a5aa79ab96ce3770fd9674b55594a053524d9e11e7e83c3d09f230cc7d6fe8c
|
7
|
+
data.tar.gz: 9ef021e917c5868a1d65324dde73ba8a1e8676bd0f5d852b3588324e25fee4fb869e40812ce5acfbc278cd870c9f09a230c6a7e7e22c7e273b36b91c26832656
|
data/README.md
CHANGED
@@ -27,6 +27,15 @@ targetB:
|
|
27
27
|
server: 33344444-5555-6666-7777-888800000000
|
28
28
|
```
|
29
29
|
|
30
|
+
実行する環境の IP で追加・削除したくないものがあれば、予め exclude\_ips にリストを記載しておくことで除外できます。
|
31
|
+
|
32
|
+
```yaml
|
33
|
+
$ cat kanmon.yml
|
34
|
+
security_group: 11122233-4444-5555-6666-777788889999
|
35
|
+
exclude_ips:
|
36
|
+
- 203.0.113.0
|
37
|
+
```
|
38
|
+
|
30
39
|
環境変数を設定します。
|
31
40
|
|
32
41
|
```
|
data/lib/kanmon/cli.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require "thor"
|
2
2
|
require "shellwords"
|
3
3
|
|
4
|
+
require "kanmon/version"
|
4
5
|
require "kanmon/securitygroup"
|
5
6
|
require "kanmon/server"
|
7
|
+
require "kanmon/exclude_ips"
|
6
8
|
|
7
9
|
module Yao::Resources
|
8
10
|
class Server < Yao::Resources::Base
|
@@ -38,7 +40,7 @@ module Kanmon
|
|
38
40
|
|
39
41
|
desc "ssh HOSTNAME", "Commands about exec ssh"
|
40
42
|
def ssh(*args)
|
41
|
-
invoke
|
43
|
+
invoke :exec, args.unshift("ssh")
|
42
44
|
end
|
43
45
|
|
44
46
|
desc "exec COMMAND", "Commands about open, exec command, close"
|
@@ -67,6 +69,12 @@ module Kanmon
|
|
67
69
|
if @config.key?('server')
|
68
70
|
@kanmon = Server.new(@config["server"])
|
69
71
|
end
|
72
|
+
|
73
|
+
exclude_ips = ExcludeIps.new(@config["exclude_ips"])
|
74
|
+
if exclude_ips.include?(@kanmon.ip)
|
75
|
+
puts "MyIP(#{@kanmon.ip}) is included in exclude IPs."
|
76
|
+
exit
|
77
|
+
end
|
70
78
|
end
|
71
79
|
|
72
80
|
super
|
data/lib/kanmon/securitygroup.rb
CHANGED
data/lib/kanmon/server.rb
CHANGED
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.7.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-
|
11
|
+
date: 2018-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yao
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- kanmon.gemspec
|
102
102
|
- lib/kanmon.rb
|
103
103
|
- lib/kanmon/cli.rb
|
104
|
+
- lib/kanmon/exclude_ips.rb
|
104
105
|
- lib/kanmon/myip.rb
|
105
106
|
- lib/kanmon/securitygroup.rb
|
106
107
|
- lib/kanmon/server.rb
|