clusterlb 0.1.7 → 0.1.8

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: aed93ab589b4d6415358f05fcbc0016624803bb1bc9a5e335882d669ac224700
4
- data.tar.gz: b3259920929de2cf7f904af212d6d61a5ced8eedb4d8534afee717ce4a469583
3
+ metadata.gz: 6f2b68c868029ba21c26c6112e8fee790acae40764a0ce268a18b2dc23f53d06
4
+ data.tar.gz: 910ba842e1eaa9113ba3fd959446d48572ccf97cddfb78075b82e5c96db0b416
5
5
  SHA512:
6
- metadata.gz: e34220d2e2bf57c503ef036289dbc77a73a583db20ce363a25285c88a794f152b8d0b616121085f66cfe5acf0efd70c5be6dbd192cc744932edf8adb253d8fbd
7
- data.tar.gz: 6846de3cefbd2d4b6d80591e0b235f4f05a7e7f76eb073fb1ff104ec6cf116dc710240328160e8fb90bc46cfe331c11c7fa97b7a2bf1ed6e7052580aa321d6b2
6
+ metadata.gz: f108db402812945f787ac3e413afd088d1db438569e09591433fade1dfac0120fda69605d25bb827985377cb0b5f33e252754eb1f0f08fd5876fe369b4ac0ec5
7
+ data.tar.gz: f960fc17ab4bb73a0369967a404a670d68eecae08e18cc6d3c70bfd11a71d3feef434be501a6dc634ef3566f707eb32d8fbeac97aebd15caca1a6c9d7e38d8ed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clusterlb (0.1.7)
4
+ clusterlb (0.1.8)
5
5
  aws-sdk (~> 3.0, >= 3.0.1)
6
6
  colorize (~> 0.8.1)
7
7
  console_table (~> 0.3.0)
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH << 'lib'
3
+ require 'clusterlb'
4
+ require 'colorize'
5
+ require 'getoptlong'
6
+
7
+ include Clusterlb
8
+
9
+ def display_help
10
+ puts
11
+ puts "Tool for getting SSL Certificates from AWS S3 or Let's Encrypt"
12
+ puts "VERSION: #{Clusterlb::VERSION}".colorize(:light_blue)
13
+ puts "CONFIG: #{Clusterlb.config_file}".colorize(:light_blue)
14
+ puts "CLUSTERLB_HOME: #{ENV['CLUSTERLB_HOME']}".colorize(:light_blue)
15
+ puts
16
+ puts "Options:"
17
+ puts "-h or --help ".ljust(30) + "-> Display this help message"
18
+ puts "-s or --s3".ljust(30) + "-> Retrive an already stored certificate from AWS S3"
19
+ puts "-l or --letsencrypt".ljust(30) + "-> use Let's Encrypt to retrive an certificate"
20
+ puts "-r or --renew-all-letsencrypt".ljust(30) + "-> Attempt to renew all the Let's Encrypt Certificates"
21
+ puts "-f or --fqdn".ljust(30) + "-> FQDN of site to retreve certificate for"
22
+ puts
23
+ exit 1
24
+ end
25
+
26
+
27
+ def parse_cli
28
+ opts = GetoptLong.new(
29
+ ["-h", "--help", GetoptLong::NO_ARGUMENT],
30
+ ["-s", "--s3", GetoptLong::NO_ARGUMENT],
31
+ ["-l", "--letsencrypt", GetoptLong::NO_ARGUMENT],
32
+ ["-r", "--renew-all-letsencrypt", GetoptLong::NO_ARGUMENT],
33
+ ["-f", "--fqdn", GetoptLong::REQUIRED_ARGUMENT]
34
+ )
35
+
36
+ opts.each do |opt, arg|
37
+ case opt
38
+ when "-h" || "--help"
39
+ display_help; exit
40
+ when "-s" || "--s3"
41
+ @mode="s3"
42
+ when "-l" || "--letsencrypt"
43
+ display_help; exit
44
+ when "-r" || "--renew-all-letsencrypt"
45
+ display_help; exit
46
+ when "-f" || "--fqdn"
47
+ @fqdn = arg.strip().downcase();
48
+ end
49
+ end
50
+
51
+ end
52
+
53
+ parse_cli
54
+
55
+ if @mode == "s3"
56
+ Clusterlb.get_s3_cert(@fqdn)
57
+ exit
58
+ end
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH << 'lib'
3
+ require 'clusterlb'
4
+ require 'colorize'
5
+ require 'getoptlong'
6
+
7
+ include Clusterlb
8
+
9
+ def display_help
10
+ @node=nil
11
+
12
+ puts
13
+ puts "Nginx tool"
14
+ puts "VERSION: #{Clusterlb::VERSION}".colorize(:light_blue)
15
+ puts "CONFIG: #{Clusterlb.config_file}".colorize(:light_blue)
16
+ puts "CLUSTERLB_HOME: #{ENV['CLUSTERLB_HOME']}".colorize(:light_blue)
17
+ puts
18
+ puts "Options:"
19
+ puts "-h or --help ".ljust(30) + "-> Display this help message"
20
+ puts "-a or --action".ljust(30) + "-> Action to preform (test|stop|start|reload|restart)"
21
+ puts "-n or --node".ljust(30) + "-> Apply Action to ONLY ONE NODE, if omitted actions apply to all Nodes"
22
+ puts "-l or --list".ljust(30) + "-> List Nodes"
23
+ puts
24
+ exit
25
+ end
26
+
27
+ def parse_cli
28
+ opts = GetoptLong.new(
29
+ ["-h", "--help", GetoptLong::NO_ARGUMENT],
30
+ ["-a", "--action", GetoptLong::REQUIRED_ARGUMENT],
31
+ ["-n", "--node", GetoptLong::REQUIRED_ARGUMENT],
32
+ ["-l", "--list", GetoptLong::NO_ARGUMENT]
33
+ )
34
+
35
+ opts.each do |opt, arg|
36
+ case opt
37
+ when "-h" || "--help"
38
+ display_help; exit;
39
+ when "-a" || "--action"
40
+ @mode = arg.strip().downcase();
41
+ when "-n" || "--node"
42
+ @node = arg.strip().downcase();
43
+ when "-l" || "--list"
44
+ puts Clusterlb.list_lbs; exit
45
+ end
46
+ end
47
+
48
+ end
49
+
50
+ parse_cli
51
+
52
+ if @node.nil?
53
+ Clusterlb.cmd_nginx(@mode,"all")
54
+ else
55
+ Clusterlb.cmd_nginx(@mode,@node)
56
+ end
@@ -1,3 +1,3 @@
1
1
  module Clusterlb
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  name "sensu-gem"
2
- default_version "0.1.6"
2
+ default_version "0.1.7"
3
3
 
4
4
  dependency "ruby"
5
5
  dependency "ncurses"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clusterlb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr. Ogg
@@ -158,6 +158,8 @@ description: Simple tools to manage a group of nginx lb's with shared nfs config
158
158
  email:
159
159
  - ogg@sr375.com
160
160
  executables:
161
+ - clusterlb-getcert
162
+ - clusterlb-nginx
161
163
  - clusterlb-stectrl
162
164
  extensions: []
163
165
  extra_rdoc_files: []
@@ -173,6 +175,8 @@ files:
173
175
  - bin/setup
174
176
  - build.sh
175
177
  - clusterlb.gemspec
178
+ - exe/clusterlb-getcert
179
+ - exe/clusterlb-nginx
176
180
  - exe/clusterlb-stectrl
177
181
  - lib/clusterlb.rb
178
182
  - lib/clusterlb/version.rb