container_config 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +12 -12
- data/README.md +3 -3
- data/container_config.gemspec +2 -1
- data/lib/container_config.rb +1 -1
- data/lib/container_config/provider/rails_credential.rb +1 -1
- data/lib/container_config/redis.rb +2 -0
- data/lib/container_config/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e3fa143d884c4e9e718054a02b5964a50f33b8bf8b20412d019f1f823b55bd4
|
4
|
+
data.tar.gz: f59be34caf1427460dcacc5a9155a930b90ac8f795fc9cca526072381708255a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 105ba644ae63e6408ae1cb158916f85ff845a1997c29bbedce410afaf2d7f76e96e81a8080982127c245db7ac8e0b0bddc3a3a7c6db34ca18ece64e2c2a92692
|
7
|
+
data.tar.gz: 4180e29ad6571020d5e5720fefa06ccb1ae9ba71860ad1ed45018bd58314b2f0f013bc2bd5272b7f457b7b10b9bd2188e43b3d45c17207fe85ac48253d6b6967
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.0] - 2021-07-20
|
4
|
+
|
5
|
+
- Added `db` key to Redis config
|
6
|
+
|
7
|
+
## [0.1.3] - 2021-06-18
|
8
|
+
|
9
|
+
- Demoted `Could not find value for key` log message to debug level
|
10
|
+
|
11
|
+
## [0.1.2] - 2021-05-01
|
12
|
+
|
13
|
+
- Resolve rexml vulnerability CVE-2021-28965
|
14
|
+
|
15
|
+
## [0.1.1] - 2021-03-15
|
16
|
+
|
17
|
+
- Handle `nil` `Rails.application`
|
18
|
+
|
3
19
|
## [0.1.0] - 2021-03-05
|
4
20
|
|
5
21
|
- Initial release
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
container_config (0.
|
4
|
+
container_config (0.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -9,12 +9,12 @@ GEM
|
|
9
9
|
ast (2.4.2)
|
10
10
|
diff-lcs (1.4.4)
|
11
11
|
parallel (1.20.1)
|
12
|
-
parser (3.0.
|
12
|
+
parser (3.0.2.0)
|
13
13
|
ast (~> 2.4.1)
|
14
14
|
rainbow (3.0.0)
|
15
|
-
rake (13.0.
|
15
|
+
rake (13.0.6)
|
16
16
|
regexp_parser (2.1.1)
|
17
|
-
rexml (3.2.
|
17
|
+
rexml (3.2.5)
|
18
18
|
rspec (3.10.0)
|
19
19
|
rspec-core (~> 3.10.0)
|
20
20
|
rspec-expectations (~> 3.10.0)
|
@@ -28,20 +28,20 @@ GEM
|
|
28
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
29
|
rspec-support (~> 3.10.0)
|
30
30
|
rspec-support (3.10.2)
|
31
|
-
rubocop (1.
|
31
|
+
rubocop (1.18.3)
|
32
32
|
parallel (~> 1.10)
|
33
33
|
parser (>= 3.0.0.0)
|
34
34
|
rainbow (>= 2.2.2, < 4.0)
|
35
35
|
regexp_parser (>= 1.8, < 3.0)
|
36
36
|
rexml
|
37
|
-
rubocop-ast (>= 1.
|
37
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
38
38
|
ruby-progressbar (~> 1.7)
|
39
39
|
unicode-display_width (>= 1.4.0, < 3.0)
|
40
|
-
rubocop-ast (1.
|
41
|
-
parser (>=
|
42
|
-
rubocop-rake (0.
|
43
|
-
rubocop
|
44
|
-
rubocop-rspec (2.
|
40
|
+
rubocop-ast (1.8.0)
|
41
|
+
parser (>= 3.0.1.1)
|
42
|
+
rubocop-rake (0.6.0)
|
43
|
+
rubocop (~> 1.0)
|
44
|
+
rubocop-rspec (2.4.0)
|
45
45
|
rubocop (~> 1.0)
|
46
46
|
rubocop-ast (>= 1.1.0)
|
47
47
|
ruby-progressbar (1.11.0)
|
@@ -61,4 +61,4 @@ DEPENDENCIES
|
|
61
61
|
yard (~> 0.9)
|
62
62
|
|
63
63
|
BUNDLED WITH
|
64
|
-
2.2.
|
64
|
+
2.2.16
|
data/README.md
CHANGED
@@ -22,13 +22,13 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
```ruby
|
24
24
|
# Retrieve the value of the POSTGRES_USER environment variable, secret mount, or Rails credential
|
25
|
-
|
25
|
+
ContainerConfig.load("POSTGRES_USER")
|
26
26
|
|
27
27
|
# Retrieve the value of the POSTGRES_PORT environment variable, secret mount, or Rails credential as an integer with a default value of 5432
|
28
|
-
|
28
|
+
ContainerConfig.load("POSTGRES_PORT", type: :integer, default: 5432)
|
29
29
|
|
30
30
|
# Retrieve the value of the POSTGRES_PASSWORD environment variable, secret mount, or Rails credential and raise an exception if it cannot be found
|
31
|
-
|
31
|
+
ContainerConfig.load("POSTGRES_PASSWORD", required: true)
|
32
32
|
```
|
33
33
|
|
34
34
|
Full documentation is available in the [ContainerConfig GitHub Pages](https://wheatevo.github.io/container_config/).
|
data/container_config.gemspec
CHANGED
@@ -12,10 +12,11 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = "Loads container configuration values from environment variables, secrets, and credentials."
|
13
13
|
spec.homepage = "https://github.com/wheatevo/container_config"
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/wheatevo/container_config"
|
19
|
+
spec.metadata["documentation_uri"] = "https://wheatevo.github.io/container_config/"
|
19
20
|
spec.metadata["changelog_uri"] = "https://github.com/wheatevo/container_config/blob/master/CHANGELOG.md"
|
20
21
|
|
21
22
|
# Specify which files should be added to the gem when it is released.
|
data/lib/container_config.rb
CHANGED
@@ -154,7 +154,7 @@ module ContainerConfig
|
|
154
154
|
def handle_empty_value(config_value, key, **options)
|
155
155
|
if config_value.nil? || config_value.to_s.empty?
|
156
156
|
provider_list = providers.map(&:name).join(", ")
|
157
|
-
logger.
|
157
|
+
logger.debug { "Could not find value for #{key} in providers: #{provider_list}" }
|
158
158
|
raise MissingRequiredValue, "Could not find value for #{key} in providers: #{provider_list}!" if options[:required]
|
159
159
|
else
|
160
160
|
logger.debug { "Configuration value for #{key} loaded" }
|
@@ -23,12 +23,14 @@ module ContainerConfig
|
|
23
23
|
url = ContainerConfig.load("#{key}_URL", **options, default: "redis://#{host}:#{port}")
|
24
24
|
sentinels = sentinel_info(key, **options)
|
25
25
|
password = ContainerConfig.load("#{key}_PASSWORD", **options)
|
26
|
+
db = ContainerConfig.load("#{key}_DB", **options, type: :integer, coerce_nil: false)
|
26
27
|
|
27
28
|
# Ensure we never pass an empty string to Redis since it will be passed to the Redis AUTH
|
28
29
|
# command as-is and will cause an exception
|
29
30
|
password = nil if password.to_s.strip.empty?
|
30
31
|
|
31
32
|
redis_config = { url: url, password: password }
|
33
|
+
redis_config[:db] = db if db
|
32
34
|
redis_config[:sentinels] = sentinels unless sentinels.empty?
|
33
35
|
|
34
36
|
# Add SSL configuration
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: container_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Newell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -143,6 +143,7 @@ licenses:
|
|
143
143
|
metadata:
|
144
144
|
homepage_uri: https://github.com/wheatevo/container_config
|
145
145
|
source_code_uri: https://github.com/wheatevo/container_config
|
146
|
+
documentation_uri: https://wheatevo.github.io/container_config/
|
146
147
|
changelog_uri: https://github.com/wheatevo/container_config/blob/master/CHANGELOG.md
|
147
148
|
post_install_message:
|
148
149
|
rdoc_options: []
|
@@ -152,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
152
153
|
requirements:
|
153
154
|
- - ">="
|
154
155
|
- !ruby/object:Gem::Version
|
155
|
-
version: 2.
|
156
|
+
version: 2.5.0
|
156
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
158
|
requirements:
|
158
159
|
- - ">="
|