capistrano-one_time_key 0.0.1 → 0.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 939b2c31402865d6fc47b342b49cf2036b61a5ca
4
- data.tar.gz: 27d4763cc9247c3e5e81e669594f830c4c00dbfe
3
+ metadata.gz: 18a0f1d72bbda6095497e9e52cf7e5cd5fe6cf8a
4
+ data.tar.gz: 02c5c5582e72a125b8598551aaeb4fbc44a28d4c
5
5
  SHA512:
6
- metadata.gz: acb7cf8ed73e1ac0371ac6cb2f4d26b60d4ba2e204483448e0bd2d92a72fcee1fdc4303c3dde47ea9f3224da378ba3cd914f5db348b573643d1b668a56b587d3
7
- data.tar.gz: f9afe8d2f44bec9d273604df3bb9bf177cf950c9e122cbce0c4f76b58b3ee1d565fea947cb88f9733eff263ed4fc39542d35c7af3681aeb7825949dbaf5bb1b7
6
+ metadata.gz: '0877a5a85ebd3070e5be342cae30249c5b3686b6b678ec04ac35e2ce748cdc3d83ae3c3ad23bf5e5f365fad118ee6a67f43c10cf56adbd7070f0d08b3234bd88'
7
+ data.tar.gz: '059cd9cb9fea9c16fd7423788185ad212742fab56214e3ccc5ee8292564ac811548eb14f7cd9b32076b00c6fdf695f143c570204bcc4bebc96276da251141b93'
@@ -18,14 +18,14 @@ module Capistrano
18
18
  end
19
19
 
20
20
  def self.generate_private_key!
21
- `ssh-keygen -f #{temporary_ssh_private_key_path} -N "" -C "#{comment}"`
21
+ `ssh-keygen -m PEM -f #{temporary_ssh_private_key_path} -N "" -C "#{comment}"`
22
22
  return temporary_ssh_private_key_path
23
23
  end
24
-
24
+
25
25
  def self.generate_one_time_key!
26
-
26
+
27
27
  path = generate_private_key!
28
-
28
+
29
29
  public_key = File.read("#{path}.pub")
30
30
 
31
31
  on roles(:all) do |host|
@@ -34,11 +34,11 @@ module Capistrano
34
34
 
35
35
  at_exit do
36
36
  # remove dirname locally
37
- FileUtils.remove_entry Capistrano::OneTimeKey.temporary_ssh_private_key_path
37
+ FileUtils.remove_entry Capistrano::OneTimeKey.tmpdir
38
38
  on roles(:all) do |host|
39
39
  Capistrano::OneTimeKey.remove_key_from_host host, public_key
40
40
  end
41
- end
41
+ end
42
42
  end
43
43
 
44
44
  def self.add_key_to_host capistrano_host, public_key
@@ -50,7 +50,7 @@ module Capistrano
50
50
  end
51
51
 
52
52
  def self.remove_key_from_host capistrano_host, public_key
53
- execute_on_remote capistrano_host, "sed -i.bak -e '/#{comment}$/d' ~/.ssh/authorized_keys && rm ~/.ssh/authorized_keys.bak"
53
+ execute_on_remote capistrano_host, "sed -i.bak -e '/#{comment}$/d' -e '/^$/d' ~/.ssh/authorized_keys && rm ~/.ssh/authorized_keys.bak"
54
54
  end
55
55
 
56
56
  def self.execute_on_remote capistrano_host, command
@@ -60,4 +60,4 @@ module Capistrano
60
60
  end
61
61
 
62
62
 
63
- load File.expand_path("../one_time_key/tasks/one_time_key.rake", __FILE__)
63
+ load File.expand_path("../tasks/one_time_key.rake", __FILE__)
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module OneTimeKey
3
- VERSION = "0.0.1"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -0,0 +1,9 @@
1
+ namespace :load do
2
+ task :defaults do
3
+ set :ssh_options, {
4
+ keys: [Capistrano::OneTimeKey.temporary_ssh_private_key_path],
5
+ forward_agent: false,
6
+ auth_methods: %w(publickey password)
7
+ }
8
+ end
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-one_time_key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-16 00:00:00.000000000 Z
11
+ date: 2018-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -80,8 +80,8 @@ files:
80
80
  - Rakefile
81
81
  - capistrano-one_time_key.gemspec
82
82
  - lib/capistrano/one_time_key.rb
83
- - lib/capistrano/one_time_key/tasks/one_time_key.rake
84
83
  - lib/capistrano/one_time_key/version.rb
84
+ - lib/capistrano/tasks/one_time_key.rake
85
85
  - spec/spec_helper.rb
86
86
  homepage: ''
87
87
  licenses:
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.2.0
106
+ rubygems_version: 2.6.11
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: One time keys for capistrano
@@ -1,5 +0,0 @@
1
- set :ssh_options, {
2
- keys: [Capistrano::OneTimeKey.temporary_ssh_private_key_path],
3
- forward_agent: false,
4
- auth_methods: %w(publickey password)
5
- }