neetob 0.5.12 → 0.5.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.neetoci/default.yml +1 -1
- data/.ruby-version +1 -1
- data/.semaphore/semaphore.yml +1 -1
- data/Gemfile +4 -3
- data/Gemfile.lock +11 -9
- data/README.md +10 -0
- data/lib/neetob/cli/cloudflare/base.rb +1 -1
- data/lib/neetob/cli/neeto_deploy/certificates.rb +36 -0
- data/lib/neetob/cli/neeto_deploy/commands.rb +7 -0
- data/lib/neetob/cli/redirections/check.rb +35 -0
- data/lib/neetob/cli/redirections/commands.rb +20 -0
- data/lib/neetob/cli.rb +4 -0
- data/lib/neetob/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba3c208ac7f1da0b1593dee29b8ee0a7a0b5b98c8957b287164ebc9bbbddf371
|
4
|
+
data.tar.gz: 9b19df41c3ae723562fb147336a6895200019085225701d16e3dc1c28b5ffd37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca02040e0da97e6d32219ecd5594835293d99d919830ebf463873ca734d53c1f4b35745347e93ae94f8dc15a5dd07b4ac7afcae5e8aa035ec80c4f03058430e1
|
7
|
+
data.tar.gz: eb886f8ef5a4dd01bf77400907f131d8c352bf9427c950e2c2b33cb94517e3ccde2df664a9762f6aa75bc85454acd06fd9eb89830d79f3fe0f8292b7ce2da814
|
data/.neetoci/default.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.4
|
data/.semaphore/semaphore.yml
CHANGED
data/Gemfile
CHANGED
@@ -12,7 +12,6 @@ group :development do
|
|
12
12
|
gem "overcommit", "~> 0.59.1"
|
13
13
|
gem "pry"
|
14
14
|
gem "rake", "~> 13.0"
|
15
|
-
gem "rubocop", "~> 1.28"
|
16
15
|
gem "terminal-table", "~> 3.0.2"
|
17
16
|
end
|
18
17
|
|
@@ -21,15 +20,17 @@ group :test do
|
|
21
20
|
gem "minitest", "~> 5.0"
|
22
21
|
gem "minitest-reporters"
|
23
22
|
gem "mocha"
|
24
|
-
gem "rubocop", "~> 1.28"
|
25
23
|
gem "simplecov"
|
26
24
|
gem "webmock"
|
27
25
|
end
|
28
26
|
|
29
|
-
|
27
|
+
group :development, :test do
|
28
|
+
gem "rubocop", "~> 1.28"
|
29
|
+
end
|
30
30
|
gem "chronic"
|
31
31
|
gem "fury"
|
32
32
|
gem "neetodeploy"
|
33
|
+
gem "pry"
|
33
34
|
|
34
35
|
source "https://O6Ts9-SVDaUZpHMRs2CpJp22RwbETDE@gems.neeto.com" do
|
35
36
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neetob (0.5.
|
4
|
+
neetob (0.5.14)
|
5
5
|
brakeman (~> 5.0)
|
6
6
|
chronic
|
7
7
|
dotenv (~> 2.8.1)
|
@@ -137,7 +137,6 @@ GEM
|
|
137
137
|
bullet (7.2.0)
|
138
138
|
activesupport (>= 3.0.0)
|
139
139
|
uniform_notifier (~> 1.11)
|
140
|
-
byebug (11.1.3)
|
141
140
|
childprocess (4.1.0)
|
142
141
|
chronic (0.10.2)
|
143
142
|
coderay (1.1.3)
|
@@ -163,7 +162,7 @@ GEM
|
|
163
162
|
erubi (1.13.0)
|
164
163
|
et-orbi (1.2.11)
|
165
164
|
tzinfo
|
166
|
-
|
165
|
+
eventmachine (1.2.7)
|
167
166
|
faraday (2.12.0)
|
168
167
|
faraday-net_http (>= 2.0, < 3.4)
|
169
168
|
json
|
@@ -230,7 +229,7 @@ GEM
|
|
230
229
|
bigdecimal (~> 3.1)
|
231
230
|
multipart-post (2.4.1)
|
232
231
|
mutex_m (0.2.0)
|
233
|
-
neetodeploy (1.1.
|
232
|
+
neetodeploy (1.1.13)
|
234
233
|
colorize
|
235
234
|
dotenv (~> 2.8.1)
|
236
235
|
httparty (~> 0.21.0)
|
@@ -238,7 +237,7 @@ GEM
|
|
238
237
|
terminal-table (~> 3.0.2)
|
239
238
|
thor (~> 1.3.0)
|
240
239
|
tty-spinner
|
241
|
-
websocket-client
|
240
|
+
websocket-eventmachine-client
|
242
241
|
net-http (0.4.1)
|
243
242
|
uri
|
244
243
|
net-imap (0.4.17)
|
@@ -455,12 +454,16 @@ GEM
|
|
455
454
|
hashdiff (>= 0.4.0, < 2.0.0)
|
456
455
|
webrick (1.8.2)
|
457
456
|
websocket (1.2.11)
|
458
|
-
websocket-client-simple (0.8.0)
|
459
|
-
event_emitter
|
460
|
-
websocket
|
461
457
|
websocket-driver (0.7.6)
|
462
458
|
websocket-extensions (>= 0.1.0)
|
459
|
+
websocket-eventmachine-base (1.2.0)
|
460
|
+
eventmachine (~> 1.0)
|
461
|
+
websocket (~> 1.0)
|
462
|
+
websocket-native (~> 1.0)
|
463
|
+
websocket-eventmachine-client (1.3.0)
|
464
|
+
websocket-eventmachine-base (~> 1.0)
|
463
465
|
websocket-extensions (0.1.5)
|
466
|
+
websocket-native (1.0.0)
|
464
467
|
zeitwerk (2.6.18)
|
465
468
|
|
466
469
|
PLATFORMS
|
@@ -470,7 +473,6 @@ PLATFORMS
|
|
470
473
|
x86_64-linux
|
471
474
|
|
472
475
|
DEPENDENCIES
|
473
|
-
byebug
|
474
476
|
chronic
|
475
477
|
dotenv (~> 2.8.1)
|
476
478
|
faraday-retry
|
data/README.md
CHANGED
@@ -293,6 +293,16 @@ Authenticate through your browser and update your Github access token by utilizi
|
|
293
293
|
neetob github login
|
294
294
|
```
|
295
295
|
|
296
|
+
## Working with Redirections
|
297
|
+
|
298
|
+
### Check
|
299
|
+
|
300
|
+
The `redirections check` command can check if redirection from a given source URL to a given destination URL is working properly.
|
301
|
+
|
302
|
+
```
|
303
|
+
neetob redirections check -s https://academy.bigbinary.com -d https://bigbinaryacademy.com
|
304
|
+
```
|
305
|
+
|
296
306
|
## Working with Heroku
|
297
307
|
|
298
308
|
Utilize the `help` command to list all the available subcommands under the Heroku module for interacting with the Heroku resources.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
module Neetob
|
6
|
+
class CLI
|
7
|
+
module NeetoDeploy
|
8
|
+
class Certificates < CLI::Base
|
9
|
+
attr_accessor :app
|
10
|
+
|
11
|
+
def initialize(app)
|
12
|
+
super()
|
13
|
+
@app = app
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
certificates_command_result = `neetodeploy certificates list -a #{app}`
|
18
|
+
parseable_result = certificates_command_result.strip.gsub("=>", ":")
|
19
|
+
|
20
|
+
parsed_certificates_result = JSON.parse(parseable_result)
|
21
|
+
if parsed_certificates_result.empty?
|
22
|
+
ui.error("No certificates found for the app with name \"#{app}\".")
|
23
|
+
else
|
24
|
+
parsed_certificates_result.each do |certificate|
|
25
|
+
if certificate["expires_before_30_days"]
|
26
|
+
ui.error("Certificate #{certificate["name"]} is expiring in less than 30 days.")
|
27
|
+
else
|
28
|
+
ui.success("Certificate #{certificate["name"]} is valid for over 30 days in the future.")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -4,6 +4,7 @@ require "thor"
|
|
4
4
|
require_relative "config_vars/commands"
|
5
5
|
require_relative "./autoscaling_config"
|
6
6
|
require_relative "./scheduled_exports"
|
7
|
+
require_relative "./certificates"
|
7
8
|
|
8
9
|
module Neetob
|
9
10
|
class CLI
|
@@ -23,6 +24,12 @@ module Neetob
|
|
23
24
|
def scheduled_exports
|
24
25
|
ScheduledExports.new(options[:app]).run
|
25
26
|
end
|
27
|
+
|
28
|
+
desc "certificates", "Get the certificates for an app deployed on NeetoDeploy"
|
29
|
+
option :app, type: :string, aliases: :a, desc: "App name"
|
30
|
+
def certificates
|
31
|
+
Certificates.new(options[:app]).run
|
32
|
+
end
|
26
33
|
end
|
27
34
|
end
|
28
35
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Neetob
|
4
|
+
class CLI
|
5
|
+
module Redirections
|
6
|
+
class Check < CLI::Base
|
7
|
+
attr_accessor :sandbox, :source, :destination
|
8
|
+
|
9
|
+
def initialize(source, destination, sandbox = false)
|
10
|
+
super()
|
11
|
+
@source = source
|
12
|
+
@destination = destination
|
13
|
+
@sandbox = sandbox
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
source_url = URI.parse(source)
|
18
|
+
destination_url = URI.parse(destination)
|
19
|
+
|
20
|
+
response = Net::HTTP.get_response(source_url)
|
21
|
+
|
22
|
+
if response.code.in? %w(301 302 308)
|
23
|
+
if response["location"].chomp("/") == destination.chomp("/")
|
24
|
+
ui.success("The redirection from #{source} to #{destination} is working properly.")
|
25
|
+
else
|
26
|
+
ui.error("The redirection from #{source} to #{destination} is not working properly.")
|
27
|
+
end
|
28
|
+
else
|
29
|
+
ui.error("The redirection from #{source} to #{destination} is not working properly.")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "thor"
|
4
|
+
require_relative "check"
|
5
|
+
|
6
|
+
module Neetob
|
7
|
+
class CLI
|
8
|
+
module Redirections
|
9
|
+
class Commands < Thor
|
10
|
+
desc "check", "Check whether one URL is redirecting to another URL"
|
11
|
+
option :source, type: :string, aliases: "-s", required: true, desc: "Source URL. Example: https://academy.bigbinary.com"
|
12
|
+
option :destination, type: :string, aliases: "-d", required: true, desc: "Destination URL. Example: https://bigbinaryacademy.com"
|
13
|
+
|
14
|
+
def check
|
15
|
+
Check.new(options[:source], options[:destination], options[:sandbox]).run
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/neetob/cli.rb
CHANGED
@@ -13,6 +13,7 @@ module Neetob
|
|
13
13
|
require_relative "cli/local/commands"
|
14
14
|
require_relative "cli/code/commands"
|
15
15
|
require_relative "cli/neeto_deploy/commands"
|
16
|
+
require_relative "cli/redirections/commands"
|
16
17
|
|
17
18
|
class_option :sandbox,
|
18
19
|
{
|
@@ -48,6 +49,9 @@ module Neetob
|
|
48
49
|
desc "code", "Interact with code base of neeto products"
|
49
50
|
subcommand "code", Code::Commands
|
50
51
|
|
52
|
+
desc "redirections", "Check whether the redirections are working properly"
|
53
|
+
subcommand "redirections", Redirections::Commands
|
54
|
+
|
51
55
|
desc "make_repos_uptodate", "Uptodate all neeto repos"
|
52
56
|
option :repos, type: :array, aliases: "-r", default: ["*"],
|
53
57
|
desc: "Github repo names. Can be matched using the '*' wildcard. Example: \"neeto*\" \"neeto-cal-web\", also providing \"all\" as value matches all neeto repos. Note: The default value is \"*\", hence all neeto repos would be affected."
|
data/lib/neetob/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neetob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Udai Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -225,6 +225,7 @@ files:
|
|
225
225
|
- lib/neetob/cli/local/commands.rb
|
226
226
|
- lib/neetob/cli/local/ls.rb
|
227
227
|
- lib/neetob/cli/neeto_deploy/autoscaling_config.rb
|
228
|
+
- lib/neetob/cli/neeto_deploy/certificates.rb
|
228
229
|
- lib/neetob/cli/neeto_deploy/commands.rb
|
229
230
|
- lib/neetob/cli/neeto_deploy/config_vars/base.rb
|
230
231
|
- lib/neetob/cli/neeto_deploy/config_vars/commands.rb
|
@@ -232,6 +233,8 @@ files:
|
|
232
233
|
- lib/neetob/cli/neeto_deploy/config_vars/remove.rb
|
233
234
|
- lib/neetob/cli/neeto_deploy/config_vars/upsert.rb
|
234
235
|
- lib/neetob/cli/neeto_deploy/scheduled_exports.rb
|
236
|
+
- lib/neetob/cli/redirections/check.rb
|
237
|
+
- lib/neetob/cli/redirections/commands.rb
|
235
238
|
- lib/neetob/cli/sre/base.rb
|
236
239
|
- lib/neetob/cli/sre/check_essential_env.rb
|
237
240
|
- lib/neetob/cli/sre/checklist.rb
|
@@ -270,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
273
|
- !ruby/object:Gem::Version
|
271
274
|
version: '0'
|
272
275
|
requirements: []
|
273
|
-
rubygems_version: 3.4.
|
276
|
+
rubygems_version: 3.4.19
|
274
277
|
signing_key:
|
275
278
|
specification_version: 4
|
276
279
|
summary: Provides a set of helper scripts for Github and Heroku.
|