orats 0.4.7 → 0.4.8

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: 4facabd4ef500af77eae28ddb61b5bf8ff6f68ab
4
- data.tar.gz: 46feaec5b6c809844a111443a839ebb8d6faa8a4
3
+ metadata.gz: f6be8354b96425f8478851e1ea045f6403e9495d
4
+ data.tar.gz: 1899d9273b725545dab8c42aa15c7b3ccef81653
5
5
  SHA512:
6
- metadata.gz: 845bb4a7b00e193d18b0351667598c08b6e7ab3caaeaaec4ac3353ff2b177b6b92f361ec05ff57be73c91c6ae8709d0b78284a01b9ad3549a70685b96dea2083
7
- data.tar.gz: 615a354c334d995466bca2fdd4ca4b41b5368576052319c8e0d89c7f8d670ada755e32fa2b6b092d9c8dbd7e24c40c590eaa94fb0f5086c9ad537413544d92a9
6
+ metadata.gz: af1717c6c523ce94d1de05ef9f3c1297ba6da8c6793f3cb5f7c0ad50495e9f3531f923131d825d456767fe4d974e84df8b407e4a99052847ddbdd2881349054b
7
+ data.tar.gz: ffafb1ff48b0d58918aa1468109d14c2c137a3f7fa2e5edda6dc958d55ff98de06b664380fc7dd0283260042570ff0f5098c005e73947ec93ff5459b36d6dce5
data/lib/orats/shell.rb CHANGED
@@ -27,8 +27,9 @@ module Orats
27
27
  def gsub_redis_info
28
28
  log_message 'root', 'Adding the redis password'
29
29
 
30
- gsub_file "#{@active_path}/config/initializers/sidekiq.rb", '//', '//:#{ENV[\'TESTPROJ_CACHE_PASSWORD\']}@'
30
+ gsub_file "#{@active_path}/config/initializers/sidekiq.rb", '//', "//:#{ENV['#{@app_name.upcase}_CACHE_PASSWORD']}@"
31
31
  gsub_file "#{@active_path}/.env", ': greatsecurity', ": #{@options[:redis_password]}"
32
+ gsub_file "#{@active_path}/config/application.rb", "# pass", "pass"
32
33
  end
33
34
 
34
35
  def gsub_project_path
@@ -140,14 +141,24 @@ module Orats
140
141
  run "mkdir #{secrets_path}"
141
142
 
142
143
  save_secret_string "#{secrets_path}/postgres_password"
143
- save_secret_string "#{secrets_path}/redis_password"
144
+
145
+ if @options[:redis_password].empty?
146
+ run "touch #{secrets_path}/redis_password"
147
+ else
148
+ save_secret_string "#{secrets_path}/redis_password"
149
+ end
150
+
144
151
  save_secret_string "#{secrets_path}/mail_password"
145
152
  save_secret_string "#{secrets_path}/rails_token"
146
153
  save_secret_string "#{secrets_path}/devise_token"
147
154
  save_secret_string "#{secrets_path}/devise_pepper_token"
148
155
 
149
156
  log_message 'shell', 'Modifying secrets path in group_vars/all.yml'
150
- update_secrets_path secrets_path
157
+ gsub_file "#{path}/inventory/group_vars/all.yml", '~/tmp/testproj/secrets/', secrets_path
158
+
159
+ log_message 'shell', 'Modifying the place holder app name in group_vars/all.yml'
160
+ gsub_file "#{path}/inventory/group_vars/all.yml", 'testproj', File.basename(path)
161
+ gsub_file "#{path}/inventory/group_vars/all.yml", 'TESTPROJ', File.basename(path).upcase
151
162
 
152
163
  log_message 'shell', 'Creating ssh keypair'
153
164
  run "ssh-keygen -t rsa -P '' -f #{secrets_path}/id_rsa"
@@ -157,7 +168,6 @@ module Orats
157
168
 
158
169
  log_message 'shell', 'Creating monit pem file'
159
170
  run "openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj '/C=US/ST=Foo/L=Bar/O=Baz/CN=qux.com' -keyout #{secrets_path}/monit.pem -out #{secrets_path}/monit.pem && openssl gendh 512 >> #{secrets_path}/monit.pem"
160
-
161
171
  end
162
172
 
163
173
  private
@@ -166,15 +176,6 @@ module Orats
166
176
  File.open(file, 'w+') { |f| f.write(SecureRandom.hex(64)) }
167
177
  end
168
178
 
169
- def update_secrets_path(secrets_path)
170
- all_yaml_path = "#{secrets_path}/../inventory/group_vars/all.yml"
171
-
172
- IO.write(all_yaml_path, File.open(all_yaml_path) do |f|
173
- f.read.gsub('~/tmp/testproj/secrets/', secrets_path)
174
- end
175
- )
176
- end
177
-
178
179
  def copy_from_includes(file, destination_root_path)
179
180
  base_path = "#{File.expand_path File.dirname(__FILE__)}/templates/includes"
180
181
 
@@ -162,7 +162,7 @@ inject_into_file 'config/application.rb', after: "automatically loaded.\n" do <<
162
162
  config.cache_store = :redis_store, { host: ENV['#{app_name_upper}_CACHE_HOST'],
163
163
  port: ENV['#{app_name_upper}_CACHE_PORT'].to_i,
164
164
  db: ENV['#{app_name_upper}_CACHE_DATABASE'].to_i,
165
- password: ENV['#{app_name_upper}_CACHE_PASSWORD'],
165
+ # password: ENV['#{app_name_upper}_CACHE_PASSWORD'].to_i,
166
166
  namespace: '#{app_name}::cache'
167
167
  }
168
168
  CODE
data/lib/orats/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Orats
2
- VERSION = '0.4.7'
2
+ VERSION = '0.4.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Janetakis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-29 00:00:00.000000000 Z
11
+ date: 2014-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor