govuk_app_config 4.8.0 → 4.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/govuk_app_config.gemspec +4 -2
- data/lib/govuk_app_config/govuk_error.rb +2 -0
- data/lib/govuk_app_config/govuk_proxy/static_proxy.rb +19 -0
- data/lib/govuk_app_config/railtie.rb +9 -0
- data/lib/govuk_app_config/version.rb +1 -1
- data/lib/govuk_app_config.rb +1 -0
- metadata +42 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f29dd29e2aa59d60c6c4139cd3194303a3e485fc81c3ff0cc4b541015ae2f6c
|
4
|
+
data.tar.gz: 294a43ae30bca8b61a75de8a7e49d4b9162acf608b79431860765039d0ebeb82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3597f2f8cc645bf1888d14708918b5c9d87bb4d9f2fbade1393ad37880ab277dc0f94321e4da0b9c0fdf58dc841eff218c93a26abf53cf9b59d9028085416d9
|
7
|
+
data.tar.gz: 66a1bb4da547d49e496caca8770c5aa9b93b8d965276fcb16943f5d4c796679a60b1f685e8ff3417eb2389de102429befc351d13fb4388c8f15aab2f8763f18e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 4.10.0
|
2
|
+
|
3
|
+
- Reduce log level for the Sentry gem from `INFO` to `WARN` to avoid polluting logs with uninformative messages. This only affects log messages from the Sentry gem itself, which go to `stdout`.
|
4
|
+
|
5
|
+
# 4.9.0
|
6
|
+
|
7
|
+
- Add GovukProxy::StaticProxy to forward Static asset requests by setting `GOVUK_PROXY_STATIC_ENABLED=true`.([#261](https://github.com/alphagov/govuk_app_config/pull/261))
|
8
|
+
|
1
9
|
# 4.8.0
|
2
10
|
|
3
11
|
- Enables Sentry environment names for EKS versions of integration, staging and production.([#260](https://github.com/alphagov/govuk_app_config/pull/260))
|
data/govuk_app_config.gemspec
CHANGED
@@ -21,8 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = %w[lib]
|
22
22
|
|
23
23
|
spec.add_dependency "logstasher", "~> 2.1"
|
24
|
+
spec.add_dependency "plek", "~> 4"
|
24
25
|
spec.add_dependency "prometheus_exporter", "~> 2.0"
|
25
|
-
spec.add_dependency "puma", "
|
26
|
+
spec.add_dependency "puma", ">= 5.6", "< 7.0"
|
27
|
+
spec.add_dependency "rack-proxy", "~> 0.7"
|
26
28
|
spec.add_dependency "sentry-rails", "~> 5.3"
|
27
29
|
spec.add_dependency "sentry-ruby", "~> 5.3"
|
28
30
|
spec.add_dependency "statsd-ruby", "~> 1.5"
|
@@ -35,6 +37,6 @@ Gem::Specification.new do |spec|
|
|
35
37
|
spec.add_development_dependency "rake", "~> 13.0"
|
36
38
|
spec.add_development_dependency "rspec", "~> 3.10"
|
37
39
|
spec.add_development_dependency "rspec-its", "~> 1.3"
|
38
|
-
spec.add_development_dependency "rubocop-govuk", "4.
|
40
|
+
spec.add_development_dependency "rubocop-govuk", "4.7.0"
|
39
41
|
spec.add_development_dependency "webmock"
|
40
42
|
end
|
@@ -40,6 +40,8 @@ module GovukError
|
|
40
40
|
|
41
41
|
Sentry.init do |sentry_config|
|
42
42
|
config = Configuration.new(sentry_config)
|
43
|
+
# Avoid "Sending envelope with items ... to Sentry" logspew on stdout.
|
44
|
+
config.logger.level = Sentry::Logger::WARN
|
43
45
|
yield config if block_given?
|
44
46
|
end
|
45
47
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "rack-proxy"
|
2
|
+
|
3
|
+
module GovukProxy
|
4
|
+
class StaticProxy < Rack::Proxy
|
5
|
+
def perform_request(env)
|
6
|
+
request = Rack::Request.new(env)
|
7
|
+
|
8
|
+
# use rack proxy to forward any requests for /assets/static/*
|
9
|
+
# this regex needs to match the path set for `Rails.application.config.assets.prefix` in Static
|
10
|
+
# https://github.com/alphagov/static/blob/main/config/initializers/assets.rb
|
11
|
+
if request.path =~ %r{^/assets/static/}
|
12
|
+
env["HTTP_HOST"] = @backend.host
|
13
|
+
super(env)
|
14
|
+
else
|
15
|
+
@app.call(env)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,5 +1,14 @@
|
|
1
|
+
require "plek"
|
2
|
+
|
1
3
|
module GovukAppConfig
|
2
4
|
class Railtie < Rails::Railtie
|
5
|
+
initializer "govuk_app_config.configure_govuk_proxy" do |app|
|
6
|
+
if ENV["GOVUK_PROXY_STATIC_ENABLED"] == "true"
|
7
|
+
static_url = Plek.new.find("static")
|
8
|
+
app.middleware.use GovukProxy::StaticProxy, backend: static_url
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
3
12
|
config.before_initialize do
|
4
13
|
GovukLogging.configure if Rails.env.production?
|
5
14
|
end
|
data/lib/govuk_app_config.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "govuk_app_config/version"
|
2
2
|
require "govuk_app_config/govuk_statsd"
|
3
3
|
require "govuk_app_config/govuk_error"
|
4
|
+
require "govuk_app_config/govuk_proxy/static_proxy"
|
4
5
|
require "govuk_app_config/govuk_healthcheck"
|
5
6
|
require "govuk_app_config/govuk_i18n"
|
6
7
|
# This require is deprecated and should be removed on next major version bump
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_app_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstasher
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: plek
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: prometheus_exporter
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,16 +56,36 @@ dependencies:
|
|
42
56
|
name: puma
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.6'
|
62
|
+
- - "<"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '7.0'
|
65
|
+
type: :runtime
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
46
70
|
- !ruby/object:Gem::Version
|
47
71
|
version: '5.6'
|
72
|
+
- - "<"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '7.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rack-proxy
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0.7'
|
48
82
|
type: :runtime
|
49
83
|
prerelease: false
|
50
84
|
version_requirements: !ruby/object:Gem::Requirement
|
51
85
|
requirements:
|
52
86
|
- - "~>"
|
53
87
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
88
|
+
version: '0.7'
|
55
89
|
- !ruby/object:Gem::Dependency
|
56
90
|
name: sentry-rails
|
57
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +246,14 @@ dependencies:
|
|
212
246
|
requirements:
|
213
247
|
- - '='
|
214
248
|
- !ruby/object:Gem::Version
|
215
|
-
version: 4.
|
249
|
+
version: 4.7.0
|
216
250
|
type: :development
|
217
251
|
prerelease: false
|
218
252
|
version_requirements: !ruby/object:Gem::Requirement
|
219
253
|
requirements:
|
220
254
|
- - '='
|
221
255
|
- !ruby/object:Gem::Version
|
222
|
-
version: 4.
|
256
|
+
version: 4.7.0
|
223
257
|
- !ruby/object:Gem::Dependency
|
224
258
|
name: webmock
|
225
259
|
requirement: !ruby/object:Gem::Requirement
|
@@ -271,6 +305,7 @@ files:
|
|
271
305
|
- lib/govuk_app_config/govuk_i18n.rb
|
272
306
|
- lib/govuk_app_config/govuk_logging.rb
|
273
307
|
- lib/govuk_app_config/govuk_prometheus_exporter.rb
|
308
|
+
- lib/govuk_app_config/govuk_proxy/static_proxy.rb
|
274
309
|
- lib/govuk_app_config/govuk_puma.rb
|
275
310
|
- lib/govuk_app_config/govuk_statsd.rb
|
276
311
|
- lib/govuk_app_config/govuk_unicorn.rb
|
@@ -296,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
296
331
|
- !ruby/object:Gem::Version
|
297
332
|
version: '0'
|
298
333
|
requirements: []
|
299
|
-
rubygems_version: 3.3.
|
334
|
+
rubygems_version: 3.3.24
|
300
335
|
signing_key:
|
301
336
|
specification_version: 4
|
302
337
|
summary: Base configuration for GOV.UK applications
|