govuk_app_config 4.7.0 → 4.9.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 +12 -0
- data/govuk_app_config.gemspec +3 -1
- data/lib/govuk_app_config/govuk_error/configuration.rb +3 -0
- data/lib/govuk_app_config/govuk_prometheus_exporter.rb +6 -1
- 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 +34 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bd7b3d518724177cecd7e83f08a93be2294cb0125ab91c70cf7dd07bf58dd48
|
4
|
+
data.tar.gz: 78debe718523a1111d55a237c718fc629449d898cc2a9de42655c7c4d1befc97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3613784ff88b23b7a5985356a7d74ac27322c14a0c2515969b0b80ae6679f422c02104b2cdd46286038fca9d9ce95a09d348c6aea231d4c3639883080bc2142a
|
7
|
+
data.tar.gz: b006723e41e94e494da94ecbc7a99a61a17e42d213715f75e8255affa54fffbb6d3384db32f20966a4013765735093dcec83eab5785676f262c14dad4638d1d2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# 4.9.0
|
2
|
+
|
3
|
+
- 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))
|
4
|
+
|
5
|
+
# 4.8.0
|
6
|
+
|
7
|
+
- Enables Sentry environment names for EKS versions of integration, staging and production.([#260](https://github.com/alphagov/govuk_app_config/pull/260))
|
8
|
+
|
9
|
+
# 4.7.1
|
10
|
+
|
11
|
+
- Fix the ability to open the Rails console (`bundle exec rails c`) when running inside a container ([#257](https://github.com/alphagov/govuk_app_config/pull/257)).
|
12
|
+
|
1
13
|
# 4.7.0
|
2
14
|
|
3
15
|
- Adds Prometheus Sidekiq monitoring ([#255](https://github.com/alphagov/govuk_app_config/pull/255))
|
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
26
|
spec.add_dependency "puma", "~> 5.6"
|
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
|
@@ -1,6 +1,11 @@
|
|
1
1
|
module GovukPrometheusExporter
|
2
2
|
def self.should_configure
|
3
|
-
|
3
|
+
if File.basename($PROGRAM_NAME) == "rake" ||
|
4
|
+
defined?(Rails) && (Rails.const_defined?("Console") || Rails.env == "test")
|
5
|
+
false
|
6
|
+
else
|
7
|
+
ENV["GOVUK_PROMETHEUS_EXPORTER"] == "true"
|
8
|
+
end
|
4
9
|
end
|
5
10
|
|
6
11
|
def self.configure
|
@@ -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.9.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-09-05 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
|
@@ -52,6 +66,20 @@ dependencies:
|
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '5.6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rack-proxy
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.7'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.7'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: sentry-rails
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +240,14 @@ dependencies:
|
|
212
240
|
requirements:
|
213
241
|
- - '='
|
214
242
|
- !ruby/object:Gem::Version
|
215
|
-
version: 4.
|
243
|
+
version: 4.7.0
|
216
244
|
type: :development
|
217
245
|
prerelease: false
|
218
246
|
version_requirements: !ruby/object:Gem::Requirement
|
219
247
|
requirements:
|
220
248
|
- - '='
|
221
249
|
- !ruby/object:Gem::Version
|
222
|
-
version: 4.
|
250
|
+
version: 4.7.0
|
223
251
|
- !ruby/object:Gem::Dependency
|
224
252
|
name: webmock
|
225
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -271,6 +299,7 @@ files:
|
|
271
299
|
- lib/govuk_app_config/govuk_i18n.rb
|
272
300
|
- lib/govuk_app_config/govuk_logging.rb
|
273
301
|
- lib/govuk_app_config/govuk_prometheus_exporter.rb
|
302
|
+
- lib/govuk_app_config/govuk_proxy/static_proxy.rb
|
274
303
|
- lib/govuk_app_config/govuk_puma.rb
|
275
304
|
- lib/govuk_app_config/govuk_statsd.rb
|
276
305
|
- lib/govuk_app_config/govuk_unicorn.rb
|
@@ -296,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
296
325
|
- !ruby/object:Gem::Version
|
297
326
|
version: '0'
|
298
327
|
requirements: []
|
299
|
-
rubygems_version: 3.3.
|
328
|
+
rubygems_version: 3.3.21
|
300
329
|
signing_key:
|
301
330
|
specification_version: 4
|
302
331
|
summary: Base configuration for GOV.UK applications
|