harmony-service 0.7.0 → 0.7.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/lib/harmony/service/rake_tasks.rb +16 -12
- data/lib/harmony/service/utils/secrets.rb +1 -1
- data/lib/harmony/service/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0e2e9b81534396e787c62e5ed43f2bbfe149c78
|
4
|
+
data.tar.gz: c6dba159e3c9c28cca2b1e4c7765fc3fc31df7aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ad4ca5561c19d837f9eccdd298c19a743e93016742f04bb289b096fff762ec170385498944ec53929bfea6d5d7ddad788eba456e04d44cd2ca7e628cb8653a8
|
7
|
+
data.tar.gz: 3cc272bc177e8d5396455012d0efb8bf9a83b4753397b1dcfdcc38cf9bb926d0bd6137d13d2a0f840b23e9beb39117af4b466498125955585e49bb150a387178
|
@@ -7,19 +7,23 @@ namespace :harmony do
|
|
7
7
|
task :generate_key do
|
8
8
|
puts SecureRandom.hex
|
9
9
|
end
|
10
|
-
|
11
|
-
desc '
|
12
|
-
task :write_secrets
|
13
|
-
abort "ENV['SEKRETS_KEY'] must be set." unless ENV['SEKRETS_KEY']
|
10
|
+
|
11
|
+
desc 'Generate keys and create encrypted sekret files'
|
12
|
+
task :write_secrets do |_t, _args|
|
14
13
|
abort "ENV['QUEUE_NAME'] must be set." unless ENV['QUEUE_NAME']
|
15
|
-
abort "ENV['STAGING_AMPQ_URL'] must be set." unless ENV['STAGING_AMPQ_URL']
|
16
|
-
abort "ENV['PRODUCTION_AMPQ_URL'] must be set." unless ENV['PRODUCTION_AMPQ_URL']
|
17
|
-
|
14
|
+
abort "ENV['STAGING_AMPQ_URL'] must be set." unless ENV['STAGING_AMPQ_URL']
|
15
|
+
abort "ENV['PRODUCTION_AMPQ_URL'] must be set." unless ENV['PRODUCTION_AMPQ_URL']
|
16
|
+
|
18
17
|
secrets = {
|
19
|
-
development: {harmony_queue: ENV['QUEUE_NAME'], ampq_address: ENV['STAGING_AMPQ_URL'], ampq_vhost: 'harmony-staging-queue'},
|
20
|
-
staging: {harmony_queue: ENV['QUEUE_NAME'], ampq_address: ENV['STAGING_AMPQ_URL'], ampq_vhost: 'harmony-staging-queue'},
|
21
|
-
production: {harmony_queue: ENV['QUEUE_NAME'], ampq_address: ENV['PRODUCTION_AMPQ_URL'], ampq_vhost: 'harmony'}
|
18
|
+
development: { harmony_queue: ENV['QUEUE_NAME'], ampq_address: ENV['STAGING_AMPQ_URL'], ampq_vhost: 'harmony-staging-queue' },
|
19
|
+
staging: { harmony_queue: ENV['QUEUE_NAME'], ampq_address: ENV['STAGING_AMPQ_URL'], ampq_vhost: 'harmony-staging-queue' },
|
20
|
+
production: { harmony_queue: ENV['QUEUE_NAME'], ampq_address: ENV['PRODUCTION_AMPQ_URL'], ampq_vhost: 'harmony' }
|
22
21
|
}
|
23
|
-
|
24
|
-
|
22
|
+
|
23
|
+
secrets.each do |env, data|
|
24
|
+
key = SecureRandom.hex
|
25
|
+
`ruby -r yaml -e'puts(#{data}.to_yaml)' | sekrets write config/#{env}.yml.enc --key #{key}`
|
26
|
+
puts "Created config/#{env}.yml.enc using the key #{key}. Store this key-data association in a secure place."
|
27
|
+
end
|
28
|
+
end
|
25
29
|
end
|
@@ -12,7 +12,7 @@ module Harmony
|
|
12
12
|
sekrets_file_path = "./config/#{env}.yml.enc"
|
13
13
|
if File.exist?(sekrets_file_path)
|
14
14
|
puts "Reading secrets from file: #{sekrets_file_path}"
|
15
|
-
secrets = Sekrets.settings_for(sekrets_file_path)
|
15
|
+
secrets = Sekrets.settings_for(sekrets_file_path)
|
16
16
|
secrets.each_pair{|k,v| ENV[k] = v.to_s }
|
17
17
|
else
|
18
18
|
warn "Secrets file doesn't exist: #{sekrets_file_path}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harmony-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sneakers
|