neetob 0.4.36 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -10
- data/lib/neetob/cli/base.rb +8 -0
- data/lib/neetob/cli/cloudflare/always_use_https.rb +4 -1
- data/lib/neetob/cli/cloudflare/base.rb +2 -2
- data/lib/neetob/cli/cloudflare/bot_fight_mode.rb +4 -1
- data/lib/neetob/cli/cloudflare/commands.rb +4 -4
- data/lib/neetob/cli/cloudflare/dns_proxy_status.rb +1 -1
- data/lib/neetob/cli/cloudflare/{ensure_cloudflare_cdn.rb → ensure_cdn.rb} +1 -1
- data/lib/neetob/cli/cloudflare/min_tls_version.rb +4 -1
- data/lib/neetob/cli/cloudflare/ssl_mode.rb +4 -1
- data/lib/neetob/cli/heroku/autoscaling_config.rb +2 -2
- data/lib/neetob/cli/sre/base.rb +245 -4
- data/lib/neetob/cli/sre/check_essential_env.rb +12 -9
- data/lib/neetob/cli/sre/checklist.rb +66 -0
- data/lib/neetob/cli/sre/commands.rb +18 -2
- data/lib/neetob/cli/sre/report.rb +40 -0
- data/lib/neetob/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b3d361ac2b2a6e6e135dd47cc1f445dc805a556862fea7c5fbdb3b574d45f53
|
4
|
+
data.tar.gz: 54daf0d3a4c27f05d1a484d860134f09aaf695060c9e2ba279aca0d821da650b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cfac2e067944b1d3cadc33d9ec784c0add718cac09b93c030ce7dab9f1876d3d851c0123b9d1e3c97385d3533d59d0041874b2e1076daec95ae7cc9a111a24d
|
7
|
+
data.tar.gz: 69d33a4653768925a9ee42e9ea37e5cd5168d6798dd0979d60ab9c14d36d4ac01dd2873e4817631f5de305a477d1c9bf4b77008b1edfae9ade9f8fd5b5ec08c9
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neetob (0.
|
4
|
+
neetob (0.5.0)
|
5
5
|
brakeman (~> 5.0)
|
6
6
|
chronic
|
7
7
|
dotenv (~> 2.8.1)
|
@@ -43,7 +43,7 @@ GEM
|
|
43
43
|
sidekiq-failures
|
44
44
|
solid_cache
|
45
45
|
webmock
|
46
|
-
neeto-compliance (1.
|
46
|
+
neeto-compliance (1.2.39)
|
47
47
|
colorize
|
48
48
|
hash-deep-merge
|
49
49
|
hashdiff
|
@@ -126,8 +126,8 @@ GEM
|
|
126
126
|
minitest (>= 5.1)
|
127
127
|
mutex_m
|
128
128
|
tzinfo (~> 2.0)
|
129
|
-
addressable (2.8.
|
130
|
-
public_suffix (>= 2.0.2, <
|
129
|
+
addressable (2.8.7)
|
130
|
+
public_suffix (>= 2.0.2, < 7.0)
|
131
131
|
ansi (1.5.0)
|
132
132
|
ast (2.4.2)
|
133
133
|
base64 (0.2.0)
|
@@ -221,10 +221,11 @@ GEM
|
|
221
221
|
mixpanel-ruby (2.3.0)
|
222
222
|
mocha (2.0.2)
|
223
223
|
ruby2_keywords (>= 0.0.5)
|
224
|
-
multi_xml (0.
|
224
|
+
multi_xml (0.7.1)
|
225
|
+
bigdecimal (~> 3.1)
|
225
226
|
multipart-post (2.4.1)
|
226
227
|
mutex_m (0.2.0)
|
227
|
-
neetodeploy (1.1.
|
228
|
+
neetodeploy (1.1.6)
|
228
229
|
colorize
|
229
230
|
dotenv (~> 2.8.1)
|
230
231
|
httparty (~> 0.21.0)
|
@@ -293,7 +294,7 @@ GEM
|
|
293
294
|
method_source (~> 1.0)
|
294
295
|
psych (5.1.2)
|
295
296
|
stringio
|
296
|
-
public_suffix (
|
297
|
+
public_suffix (6.0.0)
|
297
298
|
pundit (2.3.2)
|
298
299
|
activesupport (>= 3.0.0)
|
299
300
|
raabro (1.4.0)
|
@@ -363,8 +364,8 @@ GEM
|
|
363
364
|
io-console (~> 0.5)
|
364
365
|
request_store (1.7.0)
|
365
366
|
rack (>= 1.4)
|
366
|
-
rexml (3.2
|
367
|
-
strscan
|
367
|
+
rexml (3.3.2)
|
368
|
+
strscan
|
368
369
|
rinku (2.0.6)
|
369
370
|
rubocop (1.39.0)
|
370
371
|
json (~> 2.3)
|
@@ -445,7 +446,7 @@ GEM
|
|
445
446
|
crack (>= 0.3.2)
|
446
447
|
hashdiff (>= 0.4.0, < 2.0.0)
|
447
448
|
webrick (1.8.1)
|
448
|
-
websocket (1.2.
|
449
|
+
websocket (1.2.11)
|
449
450
|
websocket-client-simple (0.8.0)
|
450
451
|
event_emitter
|
451
452
|
websocket
|
data/lib/neetob/cli/base.rb
CHANGED
@@ -129,5 +129,13 @@ module Neetob
|
|
129
129
|
all_available_packages = NeetoCompliance::NeetoRepos.nanos_frontend
|
130
130
|
match_apps(packages || ["*"], all_available_packages)
|
131
131
|
end
|
132
|
+
|
133
|
+
def print_success(str)
|
134
|
+
"\u001b[32m#{str}\u001b[0m"
|
135
|
+
end
|
136
|
+
|
137
|
+
def print_failure(str)
|
138
|
+
"\u001b[31m#{str}\u001b[0m"
|
139
|
+
end
|
132
140
|
end
|
133
141
|
end
|
@@ -19,7 +19,10 @@ module Neetob
|
|
19
19
|
|
20
20
|
url = create_url(zone_id, "settings/always_use_https")
|
21
21
|
response = get(url)
|
22
|
-
|
22
|
+
always_use_https = response[:result][:value] == "on" ?
|
23
|
+
print_success(response[:result][:value]) :
|
24
|
+
print_failure(response[:result][:value])
|
25
|
+
ui.info("Always use HTTPS is turned #{always_use_https}")
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
@@ -69,8 +69,6 @@ module Neetob
|
|
69
69
|
"neetotestify.net": "1bbb5bf2ea04121c57a3690d2f40c5dc",
|
70
70
|
"neetotower.com": "9175d2e1bb19735b9b22c101ac162d31",
|
71
71
|
"neetotower.net": "10f9eba21876cd174952b830aba0ba71",
|
72
|
-
"neetotrail.com": "5c88708910e51c140b5f4c8d02e648fe",
|
73
|
-
"neetotrail.net": "317026e5fd62381767b1e351dab24bd4",
|
74
72
|
"neetotribe.com": "45eb5b7d96820cf7c375dcdaf608d4c7",
|
75
73
|
"neetotribe.net": "f49cb0229b1d67d228da7ab39a17dde3",
|
76
74
|
"neetowireframe.com": "d6d17a3dab91dc0ca4b9f4f65b086ccc",
|
@@ -82,6 +80,8 @@ module Neetob
|
|
82
80
|
end
|
83
81
|
|
84
82
|
def process(*args)
|
83
|
+
raise(StandardError, "CLOUDFLARE_API_KEY is not given") if ENV["CLOUDFLARE_API_KEY"].nil?
|
84
|
+
|
85
85
|
run(*args)
|
86
86
|
end
|
87
87
|
|
@@ -19,7 +19,10 @@ module Neetob
|
|
19
19
|
|
20
20
|
url = create_url(zone_id, "bot_management")
|
21
21
|
response = get(url)
|
22
|
-
ui.info(
|
22
|
+
ui.info(
|
23
|
+
"Bot fight mode is turned #{response[:result][:fight_mode] ?
|
24
|
+
print_success("on") :
|
25
|
+
print_failure("off")}")
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
@@ -5,7 +5,7 @@ require_relative "ssl_mode"
|
|
5
5
|
require_relative "min_tls_version"
|
6
6
|
require_relative "always_use_https"
|
7
7
|
require_relative "dns_proxy_status"
|
8
|
-
require_relative "
|
8
|
+
require_relative "ensure_cdn"
|
9
9
|
require_relative "bot_fight_mode"
|
10
10
|
|
11
11
|
module Neetob
|
@@ -36,10 +36,10 @@ module Neetob
|
|
36
36
|
DnsProxyStatus.new(options[:domain]).process
|
37
37
|
end
|
38
38
|
|
39
|
-
desc "
|
39
|
+
desc "ensure_cdn", "Check if an app is using Cloudflare CDN. App name is the app name in NeetoDeploy (Example: neeto-replay-web-production)"
|
40
40
|
option :app, type: :string, aliases: "-a", required: true, description: "App name (neeto-replay-web)"
|
41
|
-
def
|
42
|
-
|
41
|
+
def ensure_cdn
|
42
|
+
EnsureCdn.new(options[:app]).process
|
43
43
|
end
|
44
44
|
|
45
45
|
desc "bot_fight_mode", "Check if a domain has bot fight mode turned on or not."
|
@@ -25,7 +25,7 @@ module Neetob
|
|
25
25
|
response[:result].each do |record|
|
26
26
|
if record[:proxiable]
|
27
27
|
ui.info(
|
28
|
-
"DNS proxy is turned #{record[:proxied] ? "on" : "off"} " \
|
28
|
+
"DNS proxy is turned #{record[:proxied] ? print_success("on") : print_failure("off")} " \
|
29
29
|
"for #{record[:type]} record #{record[:name]}")
|
30
30
|
end
|
31
31
|
end
|
@@ -19,7 +19,10 @@ module Neetob
|
|
19
19
|
|
20
20
|
url = create_url(zone_id, "settings/min_tls_version")
|
21
21
|
response = get(url)
|
22
|
-
|
22
|
+
tls_version = response[:result][:value] == "1.2" ?
|
23
|
+
print_success(response[:result][:value]) :
|
24
|
+
print_failure(response[:result][:value])
|
25
|
+
ui.info("Minimum TLS version is set to #{tls_version}")
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
@@ -19,7 +19,10 @@ module Neetob
|
|
19
19
|
|
20
20
|
url = create_url(zone_id, "settings/ssl")
|
21
21
|
response = get(url)
|
22
|
-
|
22
|
+
ssl_mode = response[:result][:value] == "full" ?
|
23
|
+
print_success(response[:result][:value]) :
|
24
|
+
print_failure(response[:result][:value])
|
25
|
+
ui.info("SSL Mode is set to #{ssl_mode}")
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
@@ -22,9 +22,9 @@ module Neetob
|
|
22
22
|
url = create_url(app)
|
23
23
|
response = get(url)
|
24
24
|
if response.any? { |addon| addon[:addon_service][:name] == "judoscale" }
|
25
|
-
ui.success("Judoscale addon is enabled for #{app}")
|
25
|
+
ui.success("Judoscale addon is #{print_success('enabled')} for #{app}")
|
26
26
|
else
|
27
|
-
ui.error("Judoscale not present for #{app}")
|
27
|
+
ui.error("Judoscale #{print_failure('not present')} for #{app}")
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
data/lib/neetob/cli/sre/base.rb
CHANGED
@@ -16,7 +16,6 @@ module Neetob
|
|
16
16
|
"neeto-invoice-web-production",
|
17
17
|
"neeto-form-web-production",
|
18
18
|
"neeto-runner-web-production",
|
19
|
-
"neeto-course-web-production",
|
20
19
|
"neeto-deploy-web-production"
|
21
20
|
],
|
22
21
|
"neetodeploy": [
|
@@ -29,6 +28,7 @@ module Neetob
|
|
29
28
|
"neeto-form-web-staging",
|
30
29
|
"neeto-runner-web-staging",
|
31
30
|
"neeto-course-web-staging",
|
31
|
+
"neeto-course-web-production",
|
32
32
|
"neeto-ci-web-production",
|
33
33
|
"neeto-code-web-production",
|
34
34
|
"neeto-code-web-staging",
|
@@ -52,16 +52,257 @@ module Neetob
|
|
52
52
|
"neeto-testify-web-staging",
|
53
53
|
"neeto-tower-web-production",
|
54
54
|
"neeto-tower-web-staging",
|
55
|
-
"neeto-trail-web-production",
|
56
|
-
"neeto-trail-web-staging",
|
57
55
|
"neeto-wireframe-web-production",
|
58
|
-
"neeto-wireframe-web-staging"
|
56
|
+
"neeto-wireframe-web-staging",
|
57
|
+
"neeto-publish-web-staging",
|
58
|
+
"neeto-publish-web-production"
|
59
59
|
]
|
60
60
|
}
|
61
61
|
|
62
|
+
RESOURCES = {
|
63
|
+
"NeetoChat": {
|
64
|
+
"staging": {
|
65
|
+
dns: "neetochat.net",
|
66
|
+
app: "neeto-chat-web-staging"
|
67
|
+
},
|
68
|
+
"production": {
|
69
|
+
dns: "neetochat.com",
|
70
|
+
app: "neeto-chat-web-production"
|
71
|
+
}
|
72
|
+
},
|
73
|
+
"NeetoAuth": {
|
74
|
+
"staging": {
|
75
|
+
dns: "neetoauth.net",
|
76
|
+
app: "neeto-auth-web-staging"
|
77
|
+
},
|
78
|
+
"production": {
|
79
|
+
dns: "neetoauth.com",
|
80
|
+
app: "neeto-auth-web-production"
|
81
|
+
}
|
82
|
+
},
|
83
|
+
"NeetoCal": {
|
84
|
+
"staging": {
|
85
|
+
dns: "neetocal.net",
|
86
|
+
app: "neeto-cal-web-staging"
|
87
|
+
},
|
88
|
+
"production": {
|
89
|
+
dns: "neetocal.com",
|
90
|
+
app: "neeto-cal-web-production"
|
91
|
+
}
|
92
|
+
},
|
93
|
+
"NeetoDesk": {
|
94
|
+
"staging": {
|
95
|
+
dns: "neetodesk.net",
|
96
|
+
app: "neeto-desk-web-staging"
|
97
|
+
},
|
98
|
+
"production": {
|
99
|
+
dns: "neetodesk.com",
|
100
|
+
app: "neeto-desk-web-production"
|
101
|
+
}
|
102
|
+
},
|
103
|
+
"NeetoKB": {
|
104
|
+
"staging": {
|
105
|
+
dns: "neetokb.net",
|
106
|
+
app: "neeto-kb-web-staging"
|
107
|
+
},
|
108
|
+
"production": {
|
109
|
+
dns: "neetokb.com",
|
110
|
+
app: "neeto-kb-web-production"
|
111
|
+
}
|
112
|
+
},
|
113
|
+
"NeetoInvoice": {
|
114
|
+
"staging": {
|
115
|
+
dns: "neetoinvoice.net",
|
116
|
+
app: "neeto-invoice-web-staging"
|
117
|
+
},
|
118
|
+
"production": {
|
119
|
+
dns: "neetoinvoice.com",
|
120
|
+
app: "neeto-invoice-web-production"
|
121
|
+
}
|
122
|
+
},
|
123
|
+
"NeetoForm": {
|
124
|
+
"staging": {
|
125
|
+
dns: "neetoform.net",
|
126
|
+
app: "neeto-form-web-staging"
|
127
|
+
},
|
128
|
+
"production": {
|
129
|
+
dns: "neetoform.com",
|
130
|
+
app: "neeto-form-web-production"
|
131
|
+
}
|
132
|
+
},
|
133
|
+
"NeetoRunner": {
|
134
|
+
"staging": {
|
135
|
+
dns: "neetorunner.net",
|
136
|
+
app: "neeto-runner-web-staging"
|
137
|
+
},
|
138
|
+
"production": {
|
139
|
+
dns: "neetorunner.com",
|
140
|
+
app: "neeto-runner-web-production"
|
141
|
+
}
|
142
|
+
},
|
143
|
+
"NeetoCourse": {
|
144
|
+
"staging": {
|
145
|
+
dns: "neetocourse.net",
|
146
|
+
app: "neeto-course-web-staging"
|
147
|
+
},
|
148
|
+
"production": {
|
149
|
+
dns: "neetocourse.com",
|
150
|
+
app: "neeto-course-web-production"
|
151
|
+
}
|
152
|
+
},
|
153
|
+
"NeetoDeploy": {
|
154
|
+
"production": {
|
155
|
+
dns: "neetodeploy.com",
|
156
|
+
app: "neeto-deploy-web-production"
|
157
|
+
}
|
158
|
+
},
|
159
|
+
"NeetoCi": {
|
160
|
+
"production": {
|
161
|
+
dns: "neetoci.com",
|
162
|
+
app: "neeto-ci-web-production"
|
163
|
+
}
|
164
|
+
},
|
165
|
+
"NeetoCode": {
|
166
|
+
"staging": {
|
167
|
+
dns: "neetocode.net",
|
168
|
+
app: "neeto-code-web-staging"
|
169
|
+
},
|
170
|
+
"production": {
|
171
|
+
dns: "neetocode.com",
|
172
|
+
app: "neeto-code-web-production"
|
173
|
+
}
|
174
|
+
},
|
175
|
+
"NeetoCrm": {
|
176
|
+
"staging": {
|
177
|
+
dns: "neetocrm.net",
|
178
|
+
app: "neeto-crm-web-staging"
|
179
|
+
},
|
180
|
+
"production": {
|
181
|
+
dns: "neetocrm.com",
|
182
|
+
app: "neeto-crm-web-production"
|
183
|
+
}
|
184
|
+
},
|
185
|
+
"NeetoGit": {
|
186
|
+
"staging": {
|
187
|
+
dns: "neetogit.net",
|
188
|
+
app: "neeto-git-web-staging"
|
189
|
+
},
|
190
|
+
"production": {
|
191
|
+
dns: "neetogit.com",
|
192
|
+
app: "neeto-git-web-production"
|
193
|
+
}
|
194
|
+
},
|
195
|
+
"NeetoInvisible": {
|
196
|
+
"staging": {
|
197
|
+
dns: "neetoinvisible.net",
|
198
|
+
app: "neeto-invisible-web-staging"
|
199
|
+
},
|
200
|
+
"production": {
|
201
|
+
dns: "neetoinvisible.com",
|
202
|
+
app: "neeto-invisible-web-production"
|
203
|
+
}
|
204
|
+
},
|
205
|
+
"NeetoPlanner": {
|
206
|
+
"staging": {
|
207
|
+
dns: "neetoplanner.net",
|
208
|
+
app: "neeto-planner-web-staging"
|
209
|
+
},
|
210
|
+
"production": {
|
211
|
+
dns: "neetoplanner.com",
|
212
|
+
app: "neeto-planner-web-production"
|
213
|
+
}
|
214
|
+
},
|
215
|
+
"NeetoPublish": {
|
216
|
+
"staging": {
|
217
|
+
dns: "neetopublish.net",
|
218
|
+
app: "neeto-publish-web-staging"
|
219
|
+
},
|
220
|
+
"production": {
|
221
|
+
dns: "neetopublish.com",
|
222
|
+
app: "neeto-publish-web-production"
|
223
|
+
}
|
224
|
+
},
|
225
|
+
"NeetoQuiz": {
|
226
|
+
"staging": {
|
227
|
+
dns: "neetoquiz.net",
|
228
|
+
app: "neeto-quiz-web-staging"
|
229
|
+
},
|
230
|
+
"production": {
|
231
|
+
dns: "neetoquiz.com",
|
232
|
+
app: "neeto-quiz-web-production"
|
233
|
+
}
|
234
|
+
},
|
235
|
+
"NeetoRecord": {
|
236
|
+
"staging": {
|
237
|
+
dns: "neetorecord.net",
|
238
|
+
app: "neeto-record-web-staging"
|
239
|
+
},
|
240
|
+
"production": {
|
241
|
+
dns: "neetorecord.com",
|
242
|
+
app: "neeto-record-web-production"
|
243
|
+
}
|
244
|
+
},
|
245
|
+
"NeetoReplay": {
|
246
|
+
"staging": {
|
247
|
+
dns: "neetoreplay.net",
|
248
|
+
app: "neeto-replay-web-staging"
|
249
|
+
},
|
250
|
+
"production": {
|
251
|
+
dns: "neetoreplay.com",
|
252
|
+
app: "neeto-replay-web-production"
|
253
|
+
}
|
254
|
+
},
|
255
|
+
"NeetoSite": {
|
256
|
+
"staging": {
|
257
|
+
dns: "neetosite.net",
|
258
|
+
app: "neeto-site-web-staging"
|
259
|
+
},
|
260
|
+
"production": {
|
261
|
+
dns: "neetosite.com",
|
262
|
+
app: "neeto-site-web-production"
|
263
|
+
}
|
264
|
+
},
|
265
|
+
"NeetoTestify": {
|
266
|
+
"staging": {
|
267
|
+
dns: "neetotestify.net",
|
268
|
+
app: "neeto-testify-web-staging"
|
269
|
+
},
|
270
|
+
"production": {
|
271
|
+
dns: "neetotestify.com",
|
272
|
+
app: "neeto-testify-web-production"
|
273
|
+
}
|
274
|
+
},
|
275
|
+
"NeetoTower": {
|
276
|
+
"staging": {
|
277
|
+
dns: "neetotower.net",
|
278
|
+
app: "neeto-tower-web-staging"
|
279
|
+
},
|
280
|
+
"production": {
|
281
|
+
dns: "neetotower.com",
|
282
|
+
app: "neeto-tower-web-production"
|
283
|
+
}
|
284
|
+
},
|
285
|
+
"NeetoWireframe": {
|
286
|
+
"staging": {
|
287
|
+
dns: "neetowireframe.net",
|
288
|
+
app: "neeto-wireframe-web-staging"
|
289
|
+
},
|
290
|
+
"production": {
|
291
|
+
dns: "neetowireframe.com",
|
292
|
+
app: "neeto-wireframe-web-production"
|
293
|
+
}
|
294
|
+
}
|
295
|
+
}
|
296
|
+
|
62
297
|
def initialize
|
63
298
|
super()
|
64
299
|
end
|
300
|
+
|
301
|
+
private
|
302
|
+
|
303
|
+
def is_heroku(app_name)
|
304
|
+
APPS_LIST[:heroku].include?(app_name)
|
305
|
+
end
|
65
306
|
end
|
66
307
|
end
|
67
308
|
end
|
@@ -17,26 +17,29 @@ module Neetob
|
|
17
17
|
"YARN_CACHE",
|
18
18
|
"YARN_PRODUCTION"
|
19
19
|
]
|
20
|
-
|
21
20
|
REQUIRED_KEYS_HEROKU = [
|
22
21
|
"HEROKU_APP_NAME"
|
23
22
|
]
|
24
|
-
|
25
23
|
REQUIRED_KEYS_NEETODEPLOY = [
|
26
|
-
"NODE_OPTIONS",
|
27
24
|
"NEETODEPLOY_APP_NAME"
|
28
25
|
]
|
26
|
+
attr_reader :app
|
29
27
|
|
30
|
-
def initialize
|
28
|
+
def initialize(app = nil)
|
31
29
|
super()
|
30
|
+
@app = app
|
32
31
|
end
|
33
32
|
|
34
33
|
def run
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
if app.nil?
|
35
|
+
APPS_LIST[:heroku].each do |app|
|
36
|
+
check_envs_heroku(app)
|
37
|
+
end
|
38
|
+
APPS_LIST[:neetodeploy].each do |app|
|
39
|
+
check_envs_neetodeploy(app)
|
40
|
+
end
|
41
|
+
else
|
42
|
+
is_heroku(app) ? check_envs_heroku(app) : check_envs_neetodeploy(app)
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Neetob
|
6
|
+
class CLI
|
7
|
+
module Sre
|
8
|
+
class Checklist < Base
|
9
|
+
attr_accessor :app, :environment
|
10
|
+
|
11
|
+
def initialize(app, environment)
|
12
|
+
super()
|
13
|
+
@app = app
|
14
|
+
@environment = environment
|
15
|
+
end
|
16
|
+
|
17
|
+
def run
|
18
|
+
raise(StandardError, "Environment should be staging or production.") unless environments.include?(environment)
|
19
|
+
|
20
|
+
app_info = RESOURCES[app.to_sym][environment.to_sym]
|
21
|
+
domain = app_info[:dns]
|
22
|
+
app_name = app_info[:app]
|
23
|
+
|
24
|
+
ui.info "Validating the SRE checklist for #{app} in the #{environment} environment..."
|
25
|
+
ui.info "SSL mode"
|
26
|
+
ui.info `neetob cloudflare ssl_mode -d #{domain} | sed 's/^/ /'`
|
27
|
+
ui.info "Validating CDN"
|
28
|
+
ui.info `neetob cloudflare ensure_cdn -a #{app_name} | sed 's/^/ /'`
|
29
|
+
ui.info "DNS Proxy status"
|
30
|
+
ui.info `neetob cloudflare dns_proxy -d #{domain} | sed 's/^/ /'`
|
31
|
+
ui.info "Minimum TLS version"
|
32
|
+
ui.info `neetob cloudflare min_tls_version -d #{domain} | sed 's/^/ /'`
|
33
|
+
ui.info "HTTPS redirect"
|
34
|
+
ui.info `neetob cloudflare always_use_https -d #{domain} | sed 's/^/ /'`
|
35
|
+
ui.info "Bot fight mode"
|
36
|
+
ui.info `neetob cloudflare bot_fight_mode -d #{domain} | sed 's/^/ /'`
|
37
|
+
if is_heroku(app_name)
|
38
|
+
ui.info "Heroku maintenance time"
|
39
|
+
ui.info `neetob heroku maintenance_window -a #{app_name} | sed 's/^/ /'`
|
40
|
+
ui.info "Heroku stack"
|
41
|
+
ui.info `neetob heroku stack -a #{app_name} | sed 's/^/ /'`
|
42
|
+
ui.info "Heroku autoscaling enabled"
|
43
|
+
ui.info `neetob heroku autoscaling_config -a #{app_name} | sed 's/^/ /'`
|
44
|
+
else
|
45
|
+
ui.info "NeetoDeploy autoscaling status"
|
46
|
+
ui.info `neetodeploy autoscaling_config list -a #{app_name} | sed 's/^/ /'`
|
47
|
+
ui.info "Scheduled exports status"
|
48
|
+
ui.info `neetodeploy addon scheduled_exports_enabled -a #{app_name} | sed 's/^/ /'`
|
49
|
+
end
|
50
|
+
ui.info "Validating essential envs"
|
51
|
+
ui.info `neetob sre check_essential_env -a #{app_name} | sed 's/^/ /'`
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def environments
|
57
|
+
["staging", "production"]
|
58
|
+
end
|
59
|
+
|
60
|
+
def pretty_print(command)
|
61
|
+
ui.info `echo #{command} | sed 's/^/ /'`
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -3,14 +3,30 @@
|
|
3
3
|
require "thor"
|
4
4
|
|
5
5
|
require_relative "check_essential_env"
|
6
|
+
require_relative "checklist"
|
7
|
+
require_relative "report"
|
6
8
|
|
7
9
|
module Neetob
|
8
10
|
class CLI
|
9
11
|
module Sre
|
10
12
|
class Commands < Thor
|
11
|
-
desc "check_essential_env", "
|
13
|
+
desc "check_essential_env", "Validate essential envs for all Neeto apps or for a single app you specify"
|
14
|
+
option :app, type: :string, aliases: :a, desc: "App name for validating essential envs for a single app, ex: neeto-deploy-web-production"
|
12
15
|
def check_essential_env
|
13
|
-
CheckEssentialEnv.new.run
|
16
|
+
CheckEssentialEnv.new(options[:app]).run
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "checklist", "Validate the Neeto SRE checklist for a single app"
|
20
|
+
option :app, type: :string, aliases: :a, desc: "App name, ex: NeetoChat", required: true
|
21
|
+
option :environment, type: :string, aliases: :e, desc: "Environment (staging/production)", required: true
|
22
|
+
def checklist
|
23
|
+
Checklist.new(options[:app], options[:environment]).run
|
24
|
+
end
|
25
|
+
|
26
|
+
desc "report", "Validate the Neeto SRE checklist for all apps"
|
27
|
+
option :environment, type: :string, aliases: :e, desc: "Environment (staging/production)", required: true
|
28
|
+
def report
|
29
|
+
Report.new(options[:environment]).run
|
14
30
|
end
|
15
31
|
end
|
16
32
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Neetob
|
6
|
+
class CLI
|
7
|
+
module Sre
|
8
|
+
class Report < Base
|
9
|
+
attr_accessor :environment
|
10
|
+
|
11
|
+
def initialize(environment)
|
12
|
+
super()
|
13
|
+
@environment = environment
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
raise(StandardError, "Environment should be staging or production.") unless environments.include?(environment)
|
18
|
+
|
19
|
+
RESOURCES.each do |product, values|
|
20
|
+
next if environment == "staging" && [:NeetoDeploy, :NeetoCi].include?(product)
|
21
|
+
|
22
|
+
ui.info "Processing for #{product}"
|
23
|
+
ui.info `neetob sre checklist -a #{product} -e #{environment}`
|
24
|
+
ui.info "\n\n"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def environments
|
31
|
+
["staging", "production"]
|
32
|
+
end
|
33
|
+
|
34
|
+
def pretty_print(command)
|
35
|
+
ui.info `echo #{command} | sed 's/^/ /'`
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
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.
|
4
|
+
version: 0.5.0
|
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-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -176,7 +176,7 @@ files:
|
|
176
176
|
- lib/neetob/cli/cloudflare/bot_fight_mode.rb
|
177
177
|
- lib/neetob/cli/cloudflare/commands.rb
|
178
178
|
- lib/neetob/cli/cloudflare/dns_proxy_status.rb
|
179
|
-
- lib/neetob/cli/cloudflare/
|
179
|
+
- lib/neetob/cli/cloudflare/ensure_cdn.rb
|
180
180
|
- lib/neetob/cli/cloudflare/min_tls_version.rb
|
181
181
|
- lib/neetob/cli/cloudflare/ssl_mode.rb
|
182
182
|
- lib/neetob/cli/code/audit.rb
|
@@ -233,7 +233,9 @@ files:
|
|
233
233
|
- lib/neetob/cli/neeto_deploy/scheduled_exports.rb
|
234
234
|
- lib/neetob/cli/sre/base.rb
|
235
235
|
- lib/neetob/cli/sre/check_essential_env.rb
|
236
|
+
- lib/neetob/cli/sre/checklist.rb
|
236
237
|
- lib/neetob/cli/sre/commands.rb
|
238
|
+
- lib/neetob/cli/sre/report.rb
|
237
239
|
- lib/neetob/cli/sub_command_base.rb
|
238
240
|
- lib/neetob/cli/ui.rb
|
239
241
|
- lib/neetob/cli/users/audit.rb
|