deploy_mate 0.18.3 → 0.18.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -1
- data/deploy-mate.gemspec +1 -1
- data/lib/capistrano/tasks/machine.rake +14 -12
- data/lib/deploy_mate/templates/deploy.rb.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 221d9dcd04b1b34307ac5f64f794acac59350c48
|
4
|
+
data.tar.gz: 54a6b901d5cac8605209b3a4a85d00833685a031
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df7304f62064c6722b1b02c6b918ed1388b92d784509c10597269adf6d2b6c50dd478af477077172a1af95a34e4f4bbe2d1735e3533963f8b61346e9474088b4
|
7
|
+
data.tar.gz: 8aa0a62a0c22561f2f04ed8b630f926bd4cd6bde4d3d22234c5c4efc618b659c7b0ad19ab0c1ba1fe8a17b7e45d9eabc9b6d684f0de06fa8010a5d4fb36145d2
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ It uses the following Capistrano-roles to divide the installed components:
|
|
29
29
|
- **cronjobs**: [OPTIONAL] For environments where `whenever` should manage/run cronjobs
|
30
30
|
|
31
31
|
## Changelog
|
32
|
-
* **0.18.
|
32
|
+
* **0.18.4 (2016-03-22)**: Added mandatory task to install `ssh_key`s
|
33
33
|
* **0.18.2 (2016-03-08)**: Added basic DDoS and flooding-proof via nginx `req_limit` and `fail2ban`
|
34
34
|
* **0.18.1 (2016-03-01)**: Added support for memcached
|
35
35
|
* **0.18 (2016-02-25)**: Added support for capistrano 3.4, Ask before overwriting existing config-files
|
@@ -91,3 +91,12 @@ This will bump you up to the latest repo-version.
|
|
91
91
|
3. Run `cap <your-stage> machine:init` to install the needed packages.
|
92
92
|
4. Run `cap <your-stage> machine:setup` the setup all needed configuration-files on the server
|
93
93
|
5. Run `cap <your-stage> deploy branch=optional_branch` and be done.
|
94
|
+
|
95
|
+
## Reinstalling SSH-Keys
|
96
|
+
If you need to redeploy SSH Keys to your server (e.g. somebody leaves your team), run:
|
97
|
+
|
98
|
+
```
|
99
|
+
bundle exec cap <your-stage> machine:install:ssh_keys
|
100
|
+
```
|
101
|
+
|
102
|
+
It will pull the SSH Keys from the location configured in your `deploy.rb`. You can also change it there.
|
data/deploy-mate.gemspec
CHANGED
@@ -188,24 +188,26 @@ namespace :machine do
|
|
188
188
|
desc "Installs new SSH Keys"
|
189
189
|
task :ssh_keys do
|
190
190
|
on roles(:app) do
|
191
|
-
|
191
|
+
file_patterns = fetch(:ssh_file_names)
|
192
192
|
|
193
|
-
puts "Installing SSH Keys from
|
193
|
+
puts "Installing SSH Keys from #{file_patterns.join(',')}..."
|
194
194
|
|
195
195
|
keys = []
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
196
|
+
file_patterns.each do |file_pattern|
|
197
|
+
Dir.glob(File.expand_path(file_pattern)).each do |file_name|
|
198
|
+
next if File.directory?(file_name)
|
199
|
+
key_as_string = File.read(file_name)
|
200
|
+
|
201
|
+
if key_as_string.start_with?("ssh-rsa")
|
202
|
+
keys << key_as_string
|
203
|
+
puts file_name
|
204
|
+
else
|
205
|
+
warn "#{file_name} is NO publickey"
|
206
|
+
end
|
205
207
|
end
|
206
208
|
end
|
207
209
|
|
208
|
-
fail "No ssh-keys found in #{
|
210
|
+
fail "No ssh-keys found in #{file_patterns.join(',')}." unless keys.any?
|
209
211
|
|
210
212
|
upload!(StringIO.new(keys.join("")), 'new_keys')
|
211
213
|
sudo "rm ~/.ssh/authorized_keys"
|
@@ -16,7 +16,7 @@ set :imagemagick, <%= @needs_imagemagick %>
|
|
16
16
|
set :memcached, <%= @needs_memcached %>
|
17
17
|
set :sidekiq, <%= @uses_sidekiq %>
|
18
18
|
|
19
|
-
set :ssh_file_names, '<%= @ssh_file_names %>'
|
19
|
+
set :ssh_file_names, ['<%= @ssh_file_names %>']
|
20
20
|
|
21
21
|
# Optionals
|
22
22
|
# Uncomment, if needed
|