harmony-service 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a9f1a09d3f2d8cb45f24d0c825764a5b23631d1
4
- data.tar.gz: e6f38c4ce94e70c4874dd961fe85fad85cb8ec91
3
+ metadata.gz: a0e2e9b81534396e787c62e5ed43f2bbfe149c78
4
+ data.tar.gz: c6dba159e3c9c28cca2b1e4c7765fc3fc31df7aa
5
5
  SHA512:
6
- metadata.gz: 9c941268679edb75fdc3df9bccd1dd1b40c41422d723766239c3492f228860e0e0c42f6e0cc9497bbdfc5961c3bf0ab75137d746f107c9dfbe2983adf64d92e5
7
- data.tar.gz: 68c485584262f239749bf187a8468a7a8cdbd2809cefe42ce3fde4b3235edb7e06f5373e264ef57b3e241952efcf3af3a89358912cf1494c1f9eacdd5d6440f3
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 'Write initial secrets to encrypted file.'
12
- task :write_secrets do |t, args|
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
- `ruby -r yaml -e'puts(#{secrets}.to_yaml)' | sekrets write config/settings.yml.enc --key #{ENV['SEKRETS_KEY']}`
24
- end
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)[env]
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}"
@@ -1,6 +1,6 @@
1
1
  module Harmony
2
2
  module Service
3
- VERSION = "0.7.0"
3
+ VERSION = "0.7.1"
4
4
  end
5
5
  end
6
6
 
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.0
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-21 00:00:00.000000000 Z
11
+ date: 2017-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sneakers