bullion 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.images/logo.png +0 -0
  4. data/.rubocop.yml +32 -0
  5. data/.travis.yml +12 -4
  6. data/Dockerfile +55 -0
  7. data/Gemfile +4 -2
  8. data/Gemfile.lock +148 -0
  9. data/LICENSE.txt +1 -1
  10. data/README.md +48 -16
  11. data/Rakefile +88 -3
  12. data/bin/console +4 -3
  13. data/bullion.gemspec +38 -15
  14. data/config.ru +22 -0
  15. data/config/puma.rb +3 -0
  16. data/db/migrate/20210104000000_create_accounts.rb +14 -0
  17. data/db/migrate/20210104060422_create_certificates.rb +18 -0
  18. data/db/migrate/20210105060406_create_orders.rb +19 -0
  19. data/db/migrate/20210106052306_create_authorizations.rb +16 -0
  20. data/db/migrate/20210106055421_create_challenges.rb +18 -0
  21. data/db/migrate/20210106060335_create_nonces.rb +12 -0
  22. data/db/schema.rb +92 -0
  23. data/lib/bullion.rb +93 -2
  24. data/lib/bullion/acme/error.rb +72 -0
  25. data/lib/bullion/challenge_client.rb +59 -0
  26. data/lib/bullion/challenge_clients/dns.rb +49 -0
  27. data/lib/bullion/challenge_clients/http.rb +33 -0
  28. data/lib/bullion/helpers/acme.rb +202 -0
  29. data/lib/bullion/helpers/service.rb +17 -0
  30. data/lib/bullion/helpers/ssl.rb +214 -0
  31. data/lib/bullion/models.rb +8 -0
  32. data/lib/bullion/models/account.rb +33 -0
  33. data/lib/bullion/models/authorization.rb +31 -0
  34. data/lib/bullion/models/certificate.rb +37 -0
  35. data/lib/bullion/models/challenge.rb +37 -0
  36. data/lib/bullion/models/nonce.rb +22 -0
  37. data/lib/bullion/models/order.rb +39 -0
  38. data/lib/bullion/service.rb +26 -0
  39. data/lib/bullion/services/ca.rb +370 -0
  40. data/lib/bullion/services/ping.rb +36 -0
  41. data/lib/bullion/version.rb +7 -1
  42. data/scripts/docker-entrypoint.sh +9 -0
  43. metadata +302 -17
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bullion
4
+ module Services
5
+ # Healthcheck service
6
+ class Ping < Sinatra::Application
7
+ configure do
8
+ set :logging, true
9
+ set :logger, Bullion::LOGGER
10
+ end
11
+
12
+ before do
13
+ content_type 'application/json'
14
+
15
+ halt 403 unless request.get? || request.options?
16
+
17
+ if request.get?
18
+ headers 'X-Frame-Options' => 'SAMEORIGIN'
19
+ headers 'X-XSS-Protection' => '1; mode=block'
20
+ end
21
+ end
22
+
23
+ after do
24
+ headers 'Access-Control-Allow-Methods' => %w[GET] if request.options?
25
+ end
26
+
27
+ get '/' do
28
+ '{ "status": "up" }'
29
+ end
30
+
31
+ options '/' do
32
+ halt 200
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,3 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bullion
2
- VERSION = "0.1.0"
4
+ VERSION = [
5
+ 0, # major
6
+ 1, # minor
7
+ 2 # patch
8
+ ].join('.')
3
9
  end
@@ -0,0 +1,9 @@
1
+ #!/bin/sh
2
+
3
+ # Starts the server
4
+ rake db:migrate
5
+ puma \
6
+ -p ${BULLION_PORT:-9292} \
7
+ -e ${RACK_ENV:-production} \
8
+ -t ${MIN_THREADS:-2}:${MAX_THREADS:-32} \
9
+ config.ru
metadata CHANGED
@@ -1,58 +1,310 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-02 00:00:00.000000000 Z
11
+ date: 2021-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.18'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.18'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jwt
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mysql2
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.5'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: openssl
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: prometheus-client
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: puma
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.12'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.12'
111
+ - !ruby/object:Gem::Dependency
112
+ name: sinatra
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.1'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.1'
125
+ - !ruby/object:Gem::Dependency
126
+ name: sinatra-activerecord
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '2.0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '2.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: sinatra-contrib
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '2.1'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '2.1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: sqlite3
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.4'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.4'
167
+ - !ruby/object:Gem::Dependency
168
+ name: acme-client
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '2.0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '2.0'
13
181
  - !ruby/object:Gem::Dependency
14
182
  name: bundler
15
183
  requirement: !ruby/object:Gem::Requirement
16
184
  requirements:
17
185
  - - "~>"
18
186
  - !ruby/object:Gem::Version
19
- version: '1.17'
187
+ version: '2.0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '2.0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: byebug
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '9'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '9'
209
+ - !ruby/object:Gem::Dependency
210
+ name: rack-test
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.8'
20
216
  type: :development
21
217
  prerelease: false
22
218
  version_requirements: !ruby/object:Gem::Requirement
23
219
  requirements:
24
220
  - - "~>"
25
221
  - !ruby/object:Gem::Version
26
- version: '1.17'
222
+ version: '0.8'
27
223
  - !ruby/object:Gem::Dependency
28
224
  name: rake
29
225
  requirement: !ruby/object:Gem::Requirement
30
226
  requirements:
31
227
  - - "~>"
32
228
  - !ruby/object:Gem::Version
33
- version: '10.0'
229
+ version: '12.3'
34
230
  type: :development
35
231
  prerelease: false
36
232
  version_requirements: !ruby/object:Gem::Requirement
37
233
  requirements:
38
234
  - - "~>"
39
235
  - !ruby/object:Gem::Version
40
- version: '10.0'
236
+ version: '12.3'
41
237
  - !ruby/object:Gem::Dependency
42
238
  name: rspec
43
239
  requirement: !ruby/object:Gem::Requirement
44
240
  requirements:
45
241
  - - "~>"
46
242
  - !ruby/object:Gem::Version
47
- version: '3.0'
243
+ version: '3.10'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '3.10'
251
+ - !ruby/object:Gem::Dependency
252
+ name: rubocop
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "~>"
256
+ - !ruby/object:Gem::Version
257
+ version: '0.93'
48
258
  type: :development
49
259
  prerelease: false
50
260
  version_requirements: !ruby/object:Gem::Requirement
51
261
  requirements:
52
262
  - - "~>"
53
263
  - !ruby/object:Gem::Version
54
- version: '3.0'
55
- description:
264
+ version: '0.93'
265
+ - !ruby/object:Gem::Dependency
266
+ name: simplecov
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '0.20'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - "~>"
277
+ - !ruby/object:Gem::Version
278
+ version: '0.20'
279
+ - !ruby/object:Gem::Dependency
280
+ name: simplecov-cobertura
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - "~>"
284
+ - !ruby/object:Gem::Version
285
+ version: '1.4'
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - "~>"
291
+ - !ruby/object:Gem::Version
292
+ version: '1.4'
293
+ - !ruby/object:Gem::Dependency
294
+ name: yard
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - "~>"
298
+ - !ruby/object:Gem::Version
299
+ version: '0.9'
300
+ type: :development
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - "~>"
305
+ - !ruby/object:Gem::Version
306
+ version: '0.9'
307
+ description:
56
308
  email:
57
309
  - jonathan.gnagy@gmail.com
58
310
  executables: []
@@ -60,39 +312,72 @@ extensions: []
60
312
  extra_rdoc_files: []
61
313
  files:
62
314
  - ".gitignore"
315
+ - ".images/logo.png"
63
316
  - ".rspec"
317
+ - ".rubocop.yml"
64
318
  - ".travis.yml"
65
319
  - CODE_OF_CONDUCT.md
320
+ - Dockerfile
66
321
  - Gemfile
322
+ - Gemfile.lock
67
323
  - LICENSE.txt
68
324
  - README.md
69
325
  - Rakefile
70
326
  - bin/console
71
327
  - bin/setup
72
328
  - bullion.gemspec
329
+ - config.ru
330
+ - config/puma.rb
331
+ - db/migrate/20210104000000_create_accounts.rb
332
+ - db/migrate/20210104060422_create_certificates.rb
333
+ - db/migrate/20210105060406_create_orders.rb
334
+ - db/migrate/20210106052306_create_authorizations.rb
335
+ - db/migrate/20210106055421_create_challenges.rb
336
+ - db/migrate/20210106060335_create_nonces.rb
337
+ - db/schema.rb
73
338
  - lib/bullion.rb
339
+ - lib/bullion/acme/error.rb
340
+ - lib/bullion/challenge_client.rb
341
+ - lib/bullion/challenge_clients/dns.rb
342
+ - lib/bullion/challenge_clients/http.rb
343
+ - lib/bullion/helpers/acme.rb
344
+ - lib/bullion/helpers/service.rb
345
+ - lib/bullion/helpers/ssl.rb
346
+ - lib/bullion/models.rb
347
+ - lib/bullion/models/account.rb
348
+ - lib/bullion/models/authorization.rb
349
+ - lib/bullion/models/certificate.rb
350
+ - lib/bullion/models/challenge.rb
351
+ - lib/bullion/models/nonce.rb
352
+ - lib/bullion/models/order.rb
353
+ - lib/bullion/service.rb
354
+ - lib/bullion/services/ca.rb
355
+ - lib/bullion/services/ping.rb
74
356
  - lib/bullion/version.rb
357
+ - scripts/docker-entrypoint.sh
75
358
  homepage: https://github.com/jgnagy/bullion
76
359
  licenses:
77
360
  - MIT
78
- metadata: {}
79
- post_install_message:
361
+ metadata:
362
+ homepage_uri: https://github.com/jgnagy/bullion
363
+ source_code_uri: https://github.com/jgnagy/bullion
364
+ post_install_message:
80
365
  rdoc_options: []
81
366
  require_paths:
82
367
  - lib
83
368
  required_ruby_version: !ruby/object:Gem::Requirement
84
369
  requirements:
85
- - - ">="
370
+ - - "~>"
86
371
  - !ruby/object:Gem::Version
87
- version: '0'
372
+ version: '2.6'
88
373
  required_rubygems_version: !ruby/object:Gem::Requirement
89
374
  requirements:
90
375
  - - ">="
91
376
  - !ruby/object:Gem::Version
92
377
  version: '0'
93
378
  requirements: []
94
- rubygems_version: 3.0.8
95
- signing_key:
379
+ rubygems_version: 3.0.3
380
+ signing_key:
96
381
  specification_version: 4
97
- summary: Ruby ACME v2 Certificate Issuer
382
+ summary: Ruby ACME v2 Certificate Authority
98
383
  test_files: []