ocean-rails 7.2.0 → 7.2.1
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/config/initializers/_aws_config.rb +27 -48
- data/lib/ocean/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acf56cf8bce9166dcc5a120e197bbdcd615f5c79baec5c99fe9b672fc07f1852
|
4
|
+
data.tar.gz: 27f9e22eab32031c503ac330fbe664c2e2fefd6bf9f3c235889a47a5442d1b10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95889ce4e8ebb8aaf40c42f868e0c219a29617e17ccd2433f440cb137ee0df6b5a2fef9e84058322028479fe306388be394638a6f10ac4d1caa9573d10adffa0
|
7
|
+
data.tar.gz: a3a08fc01c54b7a59391329f02cc641f0bb2454aa70310bddba99a59bef7a27931ae1d5e37c2143a777b726b1cf1037b83f3bcd3f4c9260d02b5cd1d9d0a59f2
|
@@ -4,53 +4,32 @@ if (ENV['AWS_ACCESS_KEY_ID'].present? &&
|
|
4
4
|
ENV['AWS_REGION'].present?)
|
5
5
|
Aws.config
|
6
6
|
else
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
# Configure Aws with a massaged version of the cfg data
|
35
|
-
config = { region: ENV['AWS_REGION'],
|
36
|
-
credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
|
37
|
-
}
|
38
|
-
config[:endpoint] = cfg["endpoint"] if cfg["endpoint"]
|
39
|
-
Aws.config.update(config)
|
40
|
-
else
|
41
|
-
# Otherwise print an error message and exit with an error.
|
42
|
-
puts
|
43
|
-
puts "-----------------------------------------------------------------------"
|
44
|
-
puts "AWS config file missing. Please copy config/aws.yml.example"
|
45
|
-
puts "to config/aws.yml and tailor its contents to suit your dev setup."
|
46
|
-
puts "Alternatively export environment variables AWS_ACCESS_KEY_ID,"
|
47
|
-
puts "AWS_SECRET_ACCESS_KEY, and AWS_REGION."
|
48
|
-
puts
|
49
|
-
puts "NB: aws.yml is excluded from git version control as it will contain"
|
50
|
-
puts " data private to your Ocean system."
|
51
|
-
puts "-----------------------------------------------------------------------"
|
52
|
-
puts
|
53
|
-
exit 1
|
54
|
-
end
|
7
|
+
f = File.join(Rails.root, "config/aws.yml")
|
8
|
+
if f
|
9
|
+
template = ERB.new(File.read(f))
|
10
|
+
processed = YAML.load(template.result(binding))
|
11
|
+
cfg = processed[Rails.env]
|
12
|
+
# Set the ENV variables
|
13
|
+
ENV['AWS_ACCESS_KEY_ID'] = cfg[:access_key_id] || cfg['access_key_id']
|
14
|
+
ENV['AWS_SECRET_ACCESS_KEY'] = cfg[:secret_access_key] || cfg['secret_access_key']
|
15
|
+
ENV['AWS_REGION'] ||= cfg[:region] || cfg['region']
|
16
|
+
# Configure AWS with the raw cfg data
|
17
|
+
AWS.config(cfg)
|
18
|
+
# Configure Aws with a massaged version of the cfg data
|
19
|
+
config = { region: ENV['AWS_REGION'],
|
20
|
+
credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
|
21
|
+
}
|
22
|
+
config[:endpoint] = cfg["endpoint"] if cfg["endpoint"]
|
23
|
+
Aws.config.update(config)
|
24
|
+
else
|
25
|
+
# Otherwise print an error message and exit with an error.
|
26
|
+
puts
|
27
|
+
puts "-----------------------------------------------------------------------"
|
28
|
+
puts "AWS config file missing. Please copy config/aws.yml from the ocean-rails"
|
29
|
+
puts "gem. Alternatively export environment variables AWS_ACCESS_KEY_ID,"
|
30
|
+
puts "AWS_SECRET_ACCESS_KEY, and AWS_REGION."
|
31
|
+
puts "-----------------------------------------------------------------------"
|
32
|
+
puts
|
33
|
+
exit 1
|
55
34
|
end
|
56
35
|
end
|
data/lib/ocean/version.rb
CHANGED