auser-poolparty 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/bin/cloud-bootstrap +1 -0
- data/bin/cloud-configure +1 -0
- data/bin/cloud-contract +1 -0
- data/bin/poolparty-setup +36 -0
- data/examples/vmware.rb +18 -0
- data/lib/cloud_providers/cloud_provider_instance.rb +1 -1
- data/lib/core/object.rb +2 -2
- data/lib/dependency_resolvers/chef.rb +2 -2
- data/lib/mixins/askable.rb +16 -7
- data/lib/poolparty/base.rb +9 -7
- data/lib/poolparty/cloud.rb +57 -2
- data/lib/poolparty/installer.rb +8 -4
- data/lib/poolparty/installers/ec2.rb +75 -5
- data/lib/poolparty/installers/vmware.rb +17 -5
- data/lib/poolparty/plugins/apache.rb +3 -2
- data/lib/poolparty/plugins/apache2/base.conf.erb +2 -2
- data/lib/poolparty/plugins/apache2/browser_fixes.conf.erb +1 -1
- data/lib/poolparty/plugins/apache2/passenger_site.rb +2 -2
- data/lib/poolparty/pool.rb +9 -2
- data/lib/poolparty/resource.rb +20 -7
- data/lib/poolparty/resources/directory.rb +5 -1
- data/lib/poolparty/resources/exec.rb +2 -2
- data/lib/poolparty/resources/file.rb +8 -2
- data/lib/poolparty/resources/gem_package.rb +2 -2
- data/lib/poolparty/resources/line.rb +23 -6
- data/lib/poolparty/resources/mount.rb +2 -2
- data/lib/poolparty/resources/package.rb +2 -2
- data/lib/poolparty/resources/service.rb +2 -2
- data/lib/poolparty/resources/user.rb +2 -2
- data/lib/poolparty.rb +2 -2
- data/test/lib/poolparty/base_test.rb +13 -0
- data/test/lib/poolparty/resources/line_test.rb +3 -3
- data/test/lib/poolparty/resources/service_test.rb +1 -1
- data/vendor/gems/net-ssh/CHANGELOG.rdoc +127 -0
- data/vendor/gems/net-ssh/Manifest +104 -0
- data/vendor/gems/net-ssh/README.rdoc +110 -0
- data/vendor/gems/net-ssh/Rakefile +26 -0
- data/vendor/gems/net-ssh/THANKS.rdoc +16 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/agent.rb +176 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/constants.rb +18 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/key_manager.rb +193 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/abstract.rb +60 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/hostbased.rb +71 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/keyboard_interactive.rb +66 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/password.rb +39 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/methods/publickey.rb +92 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/pageant.rb +183 -0
- data/vendor/gems/net-ssh/lib/net/ssh/authentication/session.rb +134 -0
- data/vendor/gems/net-ssh/lib/net/ssh/buffer.rb +340 -0
- data/vendor/gems/net-ssh/lib/net/ssh/buffered_io.rb +149 -0
- data/vendor/gems/net-ssh/lib/net/ssh/config.rb +181 -0
- data/vendor/gems/net-ssh/lib/net/ssh/connection/channel.rb +625 -0
- data/vendor/gems/net-ssh/lib/net/ssh/connection/constants.rb +33 -0
- data/vendor/gems/net-ssh/lib/net/ssh/connection/session.rb +596 -0
- data/vendor/gems/net-ssh/lib/net/ssh/connection/term.rb +178 -0
- data/vendor/gems/net-ssh/lib/net/ssh/errors.rb +85 -0
- data/vendor/gems/net-ssh/lib/net/ssh/key_factory.rb +102 -0
- data/vendor/gems/net-ssh/lib/net/ssh/known_hosts.rb +129 -0
- data/vendor/gems/net-ssh/lib/net/ssh/loggable.rb +61 -0
- data/vendor/gems/net-ssh/lib/net/ssh/packet.rb +102 -0
- data/vendor/gems/net-ssh/lib/net/ssh/prompt.rb +93 -0
- data/vendor/gems/net-ssh/lib/net/ssh/proxy/errors.rb +14 -0
- data/vendor/gems/net-ssh/lib/net/ssh/proxy/http.rb +94 -0
- data/vendor/gems/net-ssh/lib/net/ssh/proxy/socks4.rb +70 -0
- data/vendor/gems/net-ssh/lib/net/ssh/proxy/socks5.rb +129 -0
- data/vendor/gems/net-ssh/lib/net/ssh/ruby_compat.rb +7 -0
- data/vendor/gems/net-ssh/lib/net/ssh/service/forward.rb +267 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/channel.rb +129 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/extensions.rb +152 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/kex.rb +44 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/local_packet.rb +51 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/packet.rb +81 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/remote_packet.rb +38 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/script.rb +157 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test/socket.rb +59 -0
- data/vendor/gems/net-ssh/lib/net/ssh/test.rb +89 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/algorithms.rb +384 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/cipher_factory.rb +80 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/constants.rb +30 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/abstract.rb +78 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/md5.rb +12 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/none.rb +15 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/sha1.rb +13 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/hmac.rb +31 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/identity_cipher.rb +55 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +208 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +77 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/kex.rb +13 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/openssl.rb +128 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/packet_stream.rb +230 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/server_version.rb +60 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/session.rb +276 -0
- data/vendor/gems/net-ssh/lib/net/ssh/transport/state.rb +201 -0
- data/vendor/gems/net-ssh/lib/net/ssh/verifiers/lenient.rb +30 -0
- data/vendor/gems/net-ssh/lib/net/ssh/verifiers/null.rb +12 -0
- data/vendor/gems/net-ssh/lib/net/ssh/verifiers/strict.rb +53 -0
- data/vendor/gems/net-ssh/lib/net/ssh/version.rb +62 -0
- data/vendor/gems/net-ssh/lib/net/ssh.rb +215 -0
- data/vendor/gems/net-ssh/net-ssh.gemspec +33 -0
- data/vendor/gems/net-ssh/setup.rb +1585 -0
- data/vendor/gems/net-ssh/test/authentication/methods/common.rb +28 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_abstract.rb +51 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_hostbased.rb +114 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_keyboard_interactive.rb +98 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_password.rb +50 -0
- data/vendor/gems/net-ssh/test/authentication/methods/test_publickey.rb +127 -0
- data/vendor/gems/net-ssh/test/authentication/test_agent.rb +205 -0
- data/vendor/gems/net-ssh/test/authentication/test_key_manager.rb +105 -0
- data/vendor/gems/net-ssh/test/authentication/test_session.rb +93 -0
- data/vendor/gems/net-ssh/test/common.rb +106 -0
- data/vendor/gems/net-ssh/test/configs/eqsign +3 -0
- data/vendor/gems/net-ssh/test/configs/exact_match +8 -0
- data/vendor/gems/net-ssh/test/configs/wild_cards +14 -0
- data/vendor/gems/net-ssh/test/connection/test_channel.rb +452 -0
- data/vendor/gems/net-ssh/test/connection/test_session.rb +488 -0
- data/vendor/gems/net-ssh/test/test_all.rb +6 -0
- data/vendor/gems/net-ssh/test/test_buffer.rb +336 -0
- data/vendor/gems/net-ssh/test/test_buffered_io.rb +63 -0
- data/vendor/gems/net-ssh/test/test_config.rb +84 -0
- data/vendor/gems/net-ssh/test/test_key_factory.rb +67 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_md5.rb +39 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_md5_96.rb +25 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_none.rb +34 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_sha1.rb +34 -0
- data/vendor/gems/net-ssh/test/transport/hmac/test_sha1_96.rb +25 -0
- data/vendor/gems/net-ssh/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
- data/vendor/gems/net-ssh/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
- data/vendor/gems/net-ssh/test/transport/test_algorithms.rb +302 -0
- data/vendor/gems/net-ssh/test/transport/test_cipher_factory.rb +171 -0
- data/vendor/gems/net-ssh/test/transport/test_hmac.rb +34 -0
- data/vendor/gems/net-ssh/test/transport/test_identity_cipher.rb +40 -0
- data/vendor/gems/net-ssh/test/transport/test_packet_stream.rb +435 -0
- data/vendor/gems/net-ssh/test/transport/test_server_version.rb +57 -0
- data/vendor/gems/net-ssh/test/transport/test_session.rb +315 -0
- data/vendor/gems/net-ssh/test/transport/test_state.rb +173 -0
- metadata +109 -4
- data/bin/install-poolparty +0 -20
@@ -40,7 +40,7 @@ module PoolParty
|
|
40
40
|
def print_to_chef
|
41
41
|
str = <<-EOE
|
42
42
|
gem_package "<%= name %>" do
|
43
|
-
action
|
43
|
+
action <%= print_variable(action ? action : (exists ? :install : :remove)) %>
|
44
44
|
EOE
|
45
45
|
str << " options <%= print_variable(options) %>\n" if options
|
46
46
|
str << " version <%= print_variable(version) %>\n" if version
|
@@ -52,4 +52,4 @@ EOE
|
|
52
52
|
end
|
53
53
|
|
54
54
|
end
|
55
|
-
end
|
55
|
+
end
|
@@ -32,16 +32,33 @@ module PoolParty
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def after_loaded
|
35
|
-
|
36
|
-
command "grep -q \'#{line.safe_quote}\' #{filepath} || echo \'#{line.safe_quote}\' >> #{filepath}"
|
37
|
-
not_if "grep -q \'#{line.safe_quote}\' #{filepath}"
|
35
|
+
opts = if exists?
|
36
|
+
{:command => "grep -q \'#{line.safe_quote}\' #{filepath} || echo \'#{line.safe_quote}\' >> #{filepath}",
|
37
|
+
:not_if => "grep -q \'#{line.safe_quote}\' #{filepath}"}
|
38
|
+
else
|
39
|
+
{:command => "cat #{filepath} | grep -v \'#{line.safe_quote}\' > temptfile && mv tempfile #{filepath}",
|
40
|
+
:only_if => "grep -q \'#{line.safe_quote}\' #{filepath}"}
|
41
|
+
end
|
42
|
+
|
43
|
+
opts.merge!(:name => exists? ? "line in #{filepath}" : "no line in #{filepath}")
|
44
|
+
|
45
|
+
e = has_exec opts
|
46
|
+
|
47
|
+
# Not incredibly pretty.
|
48
|
+
# {:file => [["pool_name", :reload]]}
|
49
|
+
# TODO: Find an alternative
|
50
|
+
e.meta_notifies = meta_notifies if meta_notifies
|
51
|
+
e.meta_subscribes = meta_subscribes if meta_subscribes
|
52
|
+
|
53
|
+
# TODO: Figure out better solution
|
54
|
+
deps = @dependencies
|
55
|
+
e.instance_eval do
|
56
|
+
@dependencies = deps
|
38
57
|
end
|
39
58
|
end
|
40
59
|
|
41
60
|
def print_to_chef
|
42
|
-
|
43
|
-
# line in file: <%= filepath %>
|
44
|
-
EOE
|
61
|
+
:no_print
|
45
62
|
end
|
46
63
|
|
47
64
|
end
|
@@ -40,7 +40,7 @@ module PoolParty
|
|
40
40
|
def print_to_chef
|
41
41
|
str = <<-EOE
|
42
42
|
mount "<%= name %>" do
|
43
|
-
action
|
43
|
+
action <%= print_variable(action ? action : (exists ? :mount : :unmount)) %>
|
44
44
|
device_type <%= print_variable(device_type) %>
|
45
45
|
EOE
|
46
46
|
str << " device <%= print_variable(device) %>\n" if device
|
@@ -54,4 +54,4 @@ EOE
|
|
54
54
|
end
|
55
55
|
|
56
56
|
end
|
57
|
-
end
|
57
|
+
end
|
@@ -40,7 +40,7 @@ module PoolParty
|
|
40
40
|
def print_to_chef
|
41
41
|
str = <<-EOE
|
42
42
|
package "<%= name %>" do
|
43
|
-
action
|
43
|
+
action <%= print_variable(action ? action : (exists ? :install : :remove)) %>
|
44
44
|
EOE
|
45
45
|
str << " options <%= print_variable(options) %>\n" if options
|
46
46
|
str << " version <%= print_variable(version) %>\n" if version
|
@@ -52,4 +52,4 @@ EOE
|
|
52
52
|
end
|
53
53
|
|
54
54
|
end
|
55
|
-
end
|
55
|
+
end
|
@@ -39,7 +39,7 @@ module PoolParty
|
|
39
39
|
def print_to_chef
|
40
40
|
str = 'service "<%= name %>" do
|
41
41
|
pattern <%= print_variable(pattern || name) %>
|
42
|
-
action
|
42
|
+
action <%= print_variable(action ? action : (exists ? :enable : :disable)) %>
|
43
43
|
'
|
44
44
|
str << " running <%= print_variable(running) %>\n" if running
|
45
45
|
str << " start_command <%= print_variable(start_command) %>\n" if start_command
|
@@ -55,4 +55,4 @@ str = 'service "<%= name %>" do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
end
|
58
|
-
end
|
58
|
+
end
|
@@ -44,7 +44,7 @@ module PoolParty
|
|
44
44
|
|
45
45
|
def print_to_chef
|
46
46
|
str = 'user "<%= name %>" do
|
47
|
-
action
|
47
|
+
action <%= print_variable(action ? action : (exists ? :create : :remove)) %>
|
48
48
|
'
|
49
49
|
str << " comment <%= print_variable(comment) %>\n" if comment
|
50
50
|
str << " uid <%= print_variable(uid) %>\n" if uid
|
@@ -60,4 +60,4 @@ str = 'user "<%= name %>" do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
end
|
63
|
-
end
|
63
|
+
end
|
data/lib/poolparty.rb
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
3
3
|
t=Time.now
|
4
4
|
|
5
5
|
# Load system gems
|
6
|
-
%w(rubygems logger erb
|
6
|
+
%w(rubygems logger erb open-uri).each do |lib|
|
7
7
|
require lib
|
8
8
|
end
|
9
9
|
|
@@ -11,7 +11,7 @@ end
|
|
11
11
|
Dir[File.dirname(__FILE__)+"/../vendor/gems/*"].each {|lib| $LOAD_PATH.unshift(File.expand_path("#{lib}/lib")) }
|
12
12
|
|
13
13
|
# Load local gems
|
14
|
-
%w(dslify parenting json daemons).each do |dep|
|
14
|
+
%w(dslify parenting json daemons net/ssh).each do |dep|
|
15
15
|
require dep
|
16
16
|
end
|
17
17
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require "#{File.dirname(__FILE__)}/../../test_helper"
|
2
2
|
|
3
|
+
include_fixture_resources
|
4
|
+
|
3
5
|
class BaseTestClass < PoolParty::Base
|
4
6
|
default_options :a => "a", :d => "dump"
|
5
7
|
end
|
@@ -31,4 +33,15 @@ class BaseTest < Test::Unit::TestCase
|
|
31
33
|
assert_equal GRATR::Digraph, inst.resources_graph.class
|
32
34
|
end
|
33
35
|
|
36
|
+
def test_instantiation
|
37
|
+
PoolParty::Resource.define_resource_methods
|
38
|
+
assert_equal "string_name", FakeResource.new.has_tester("string_name").name
|
39
|
+
assert_equal "opts_name", FakeResource.new.has_tester(:name => "opts_name").name
|
40
|
+
i = FakeResource.new
|
41
|
+
i.has_tester do
|
42
|
+
self.name "block_name"
|
43
|
+
end
|
44
|
+
assert_equal "block_name", i.testers.first.name
|
45
|
+
end
|
46
|
+
|
34
47
|
end
|
@@ -11,10 +11,10 @@ class LineResourceTest < Test::Unit::TestCase
|
|
11
11
|
@base.compile_directory = test_dir
|
12
12
|
end
|
13
13
|
|
14
|
-
should "have the method denoted by has_method_name" do
|
15
|
-
|
14
|
+
should "have the method denoted by has_method_name (no output by :no_print)" do
|
15
|
+
assert_nil @res.compile(:chef)
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
end
|
19
19
|
|
20
20
|
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
=== 2.0.11 / 24 Feb 2009
|
2
|
+
|
3
|
+
* Add :key_data option for specifying raw private keys in PEM format [Alex Holems, Andrew Babkin]
|
4
|
+
|
5
|
+
|
6
|
+
=== 2.0.10 / 4 Feb 2009
|
7
|
+
|
8
|
+
* Added Net::SSH.configuration_for to make it easier to query the SSH configuration file(s) [Jamis Buck]
|
9
|
+
|
10
|
+
|
11
|
+
=== 2.0.9 / 1 Feb 2009
|
12
|
+
|
13
|
+
* Specifying non-nil user argument overrides user in .ssh/config [Jamis Buck]
|
14
|
+
|
15
|
+
* Ignore requests for non-existent channels (workaround ssh server bug) [Jamis Buck]
|
16
|
+
|
17
|
+
* Add terminate! method for hard shutdown scenarios [Jamis Buck]
|
18
|
+
|
19
|
+
* Revert to pre-2.0.7 key-loading behavior by default, but load private-key if public-key doesn't exist [Jamis Buck]
|
20
|
+
|
21
|
+
* Make sure :passphrase option gets passed to key manager [Bob Cotton]
|
22
|
+
|
23
|
+
|
24
|
+
=== 2.0.8 / 29 December 2008
|
25
|
+
|
26
|
+
* Fix private key change from 2.0.7 so that keys are loaded just-in-time, avoiding unecessary prompts from encrypted keys. [Jamis Buck]
|
27
|
+
|
28
|
+
|
29
|
+
=== 2.0.7 / 29 December 2008
|
30
|
+
|
31
|
+
* Make key manager use private keys instead of requiring public key to exist [arilerner@mac.com]
|
32
|
+
|
33
|
+
* Fix failing tests [arilerner@mac.com]
|
34
|
+
|
35
|
+
* Don't include pageant when running under JRuby [Angel N. Sciortino]
|
36
|
+
|
37
|
+
|
38
|
+
=== 2.0.6 / 6 December 2008
|
39
|
+
|
40
|
+
* Update the Manifest file so that the gem includes all necessary files [Jamis Buck]
|
41
|
+
|
42
|
+
|
43
|
+
=== 2.0.5 / 6 December 2008
|
44
|
+
|
45
|
+
* Make the Pageant interface comply with more of the Socket interface to avoid related errors [Jamis Buck]
|
46
|
+
|
47
|
+
* Don't busy-wait on session close for remaining channels to close [Will Bryant]
|
48
|
+
|
49
|
+
* Ruby 1.9 compatibility [Jamis Buck]
|
50
|
+
|
51
|
+
* Fix Cipher#final to correctly flag a need for a cipher reset [Jamis Buck]
|
52
|
+
|
53
|
+
|
54
|
+
=== 2.0.4 / 27 Aug 2008
|
55
|
+
|
56
|
+
* Added Connection::Session#closed? and Transport::Session#closed? [Jamis Buck]
|
57
|
+
|
58
|
+
* Numeric host names in .ssh/config are now parsed correct [Yanko Ivanov]
|
59
|
+
|
60
|
+
* Make sure the error raised when a public key file is malformed is more informative than a MethodMissing error [Jamis Buck]
|
61
|
+
|
62
|
+
* Cipher#reset is now called after Cipher#final, with the last n bytes used as the next initialization vector [Jamis Buck]
|
63
|
+
|
64
|
+
|
65
|
+
=== 2.0.3 / 27 Jun 2008
|
66
|
+
|
67
|
+
* Make Net::SSH::Version comparable [Brian Candler]
|
68
|
+
|
69
|
+
* Fix errors in port forwarding when a channel could not be opened due to a typo in the exception name [Matthew Todd]
|
70
|
+
|
71
|
+
* Use #chomp instead of #strip when cleaning the version string reported by the remote host, so that trailing whitespace is preserved (this is to play nice with servers like Mocana SSH) [Timo Gatsonides]
|
72
|
+
|
73
|
+
* Correctly parse ssh_config entries with eq-sign delimiters [Jamis Buck]
|
74
|
+
|
75
|
+
* Ignore malformed ssh_config entries [Jamis Buck]
|
76
|
+
|
77
|
+
=== 2.0.2 / 29 May 2008
|
78
|
+
|
79
|
+
* Make sure the agent client understands both RSA "identities answers" [Jamis Buck]
|
80
|
+
|
81
|
+
* Fixed key truncation bug that caused hmacs other than SHA1 to fail with "corrupt hmac" errors [Jamis Buck]
|
82
|
+
|
83
|
+
* Fix detection and loading of public keys when the keys don't actually exist [David Dollar]
|
84
|
+
|
85
|
+
|
86
|
+
=== 2.0.1 / 5 May 2008
|
87
|
+
|
88
|
+
* Teach Net::SSH about a handful of default key names [Jamis Buck]
|
89
|
+
|
90
|
+
|
91
|
+
=== 2.0.0 / 1 May 2008
|
92
|
+
|
93
|
+
* Allow the :verbose argument to accept symbols (:debug, etc.) as well as Logger level constants (Logger::DEBUG, etc.) [Jamis Buck]
|
94
|
+
|
95
|
+
|
96
|
+
=== 2.0 Preview Release 4 (1.99.3) / 19 Apr 2008
|
97
|
+
|
98
|
+
* Make sure HOME is set to something sane, even on OS's that don't set it by default [Jamis Buck]
|
99
|
+
|
100
|
+
* Add a :passphrase option to specify the passphrase to use with private keys [Francis Sullivan]
|
101
|
+
|
102
|
+
* Open a new auth agent connection for every auth-agent channel request [Jamis Buck]
|
103
|
+
|
104
|
+
|
105
|
+
=== 2.0 Preview Release 3 (1.99.2) / 10 Apr 2008
|
106
|
+
|
107
|
+
* Session properties [Jamis Buck]
|
108
|
+
|
109
|
+
* Make channel open failure work with a callback so that failures can be handled similarly to successes [Jamis Buck]
|
110
|
+
|
111
|
+
|
112
|
+
=== 2.0 Preview Release 2 (1.99.1) / 22 Mar 2008
|
113
|
+
|
114
|
+
* Partial support for ~/.ssh/config (and related) SSH configuration files [Daniel J. Berger, Jamis Buck]
|
115
|
+
|
116
|
+
* Added Net::SSH::Test to facilitate testing complex SSH state machines [Jamis Buck]
|
117
|
+
|
118
|
+
* Reworked Net::SSH::Prompt to use conditionally-selected modules [Jamis Buck, suggested by James Rosen]
|
119
|
+
|
120
|
+
* Added Channel#eof? and Channel#eof! [Jamis Buck]
|
121
|
+
|
122
|
+
* Fixed bug in strict host key verifier on cache miss [Mike Timm]
|
123
|
+
|
124
|
+
|
125
|
+
=== 2.0 Preview Release 1 (1.99.0) / 21 Aug 2007
|
126
|
+
|
127
|
+
* First preview release of Net::SSH v2
|
@@ -0,0 +1,104 @@
|
|
1
|
+
CHANGELOG.rdoc
|
2
|
+
lib/net/ssh/authentication/agent.rb
|
3
|
+
lib/net/ssh/authentication/constants.rb
|
4
|
+
lib/net/ssh/authentication/key_manager.rb
|
5
|
+
lib/net/ssh/authentication/methods/abstract.rb
|
6
|
+
lib/net/ssh/authentication/methods/hostbased.rb
|
7
|
+
lib/net/ssh/authentication/methods/keyboard_interactive.rb
|
8
|
+
lib/net/ssh/authentication/methods/password.rb
|
9
|
+
lib/net/ssh/authentication/methods/publickey.rb
|
10
|
+
lib/net/ssh/authentication/pageant.rb
|
11
|
+
lib/net/ssh/authentication/session.rb
|
12
|
+
lib/net/ssh/buffer.rb
|
13
|
+
lib/net/ssh/buffered_io.rb
|
14
|
+
lib/net/ssh/config.rb
|
15
|
+
lib/net/ssh/connection/channel.rb
|
16
|
+
lib/net/ssh/connection/constants.rb
|
17
|
+
lib/net/ssh/connection/session.rb
|
18
|
+
lib/net/ssh/connection/term.rb
|
19
|
+
lib/net/ssh/errors.rb
|
20
|
+
lib/net/ssh/key_factory.rb
|
21
|
+
lib/net/ssh/known_hosts.rb
|
22
|
+
lib/net/ssh/loggable.rb
|
23
|
+
lib/net/ssh/packet.rb
|
24
|
+
lib/net/ssh/prompt.rb
|
25
|
+
lib/net/ssh/proxy/errors.rb
|
26
|
+
lib/net/ssh/proxy/http.rb
|
27
|
+
lib/net/ssh/proxy/socks4.rb
|
28
|
+
lib/net/ssh/proxy/socks5.rb
|
29
|
+
lib/net/ssh/ruby_compat.rb
|
30
|
+
lib/net/ssh/service/forward.rb
|
31
|
+
lib/net/ssh/test/channel.rb
|
32
|
+
lib/net/ssh/test/extensions.rb
|
33
|
+
lib/net/ssh/test/kex.rb
|
34
|
+
lib/net/ssh/test/local_packet.rb
|
35
|
+
lib/net/ssh/test/packet.rb
|
36
|
+
lib/net/ssh/test/remote_packet.rb
|
37
|
+
lib/net/ssh/test/script.rb
|
38
|
+
lib/net/ssh/test/socket.rb
|
39
|
+
lib/net/ssh/test.rb
|
40
|
+
lib/net/ssh/transport/algorithms.rb
|
41
|
+
lib/net/ssh/transport/cipher_factory.rb
|
42
|
+
lib/net/ssh/transport/constants.rb
|
43
|
+
lib/net/ssh/transport/hmac/abstract.rb
|
44
|
+
lib/net/ssh/transport/hmac/md5.rb
|
45
|
+
lib/net/ssh/transport/hmac/md5_96.rb
|
46
|
+
lib/net/ssh/transport/hmac/none.rb
|
47
|
+
lib/net/ssh/transport/hmac/sha1.rb
|
48
|
+
lib/net/ssh/transport/hmac/sha1_96.rb
|
49
|
+
lib/net/ssh/transport/hmac.rb
|
50
|
+
lib/net/ssh/transport/identity_cipher.rb
|
51
|
+
lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
|
52
|
+
lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
|
53
|
+
lib/net/ssh/transport/kex.rb
|
54
|
+
lib/net/ssh/transport/openssl.rb
|
55
|
+
lib/net/ssh/transport/packet_stream.rb
|
56
|
+
lib/net/ssh/transport/server_version.rb
|
57
|
+
lib/net/ssh/transport/session.rb
|
58
|
+
lib/net/ssh/transport/state.rb
|
59
|
+
lib/net/ssh/verifiers/lenient.rb
|
60
|
+
lib/net/ssh/verifiers/null.rb
|
61
|
+
lib/net/ssh/verifiers/strict.rb
|
62
|
+
lib/net/ssh/version.rb
|
63
|
+
lib/net/ssh.rb
|
64
|
+
Manifest
|
65
|
+
net-ssh.gemspec
|
66
|
+
Rakefile
|
67
|
+
README.rdoc
|
68
|
+
setup.rb
|
69
|
+
test/authentication/methods/common.rb
|
70
|
+
test/authentication/methods/test_abstract.rb
|
71
|
+
test/authentication/methods/test_hostbased.rb
|
72
|
+
test/authentication/methods/test_keyboard_interactive.rb
|
73
|
+
test/authentication/methods/test_password.rb
|
74
|
+
test/authentication/methods/test_publickey.rb
|
75
|
+
test/authentication/test_agent.rb
|
76
|
+
test/authentication/test_key_manager.rb
|
77
|
+
test/authentication/test_session.rb
|
78
|
+
test/common.rb
|
79
|
+
test/configs/eqsign
|
80
|
+
test/configs/exact_match
|
81
|
+
test/configs/wild_cards
|
82
|
+
test/connection/test_channel.rb
|
83
|
+
test/connection/test_session.rb
|
84
|
+
test/test_all.rb
|
85
|
+
test/test_buffer.rb
|
86
|
+
test/test_buffered_io.rb
|
87
|
+
test/test_config.rb
|
88
|
+
test/test_key_factory.rb
|
89
|
+
test/transport/hmac/test_md5.rb
|
90
|
+
test/transport/hmac/test_md5_96.rb
|
91
|
+
test/transport/hmac/test_none.rb
|
92
|
+
test/transport/hmac/test_sha1.rb
|
93
|
+
test/transport/hmac/test_sha1_96.rb
|
94
|
+
test/transport/kex/test_diffie_hellman_group1_sha1.rb
|
95
|
+
test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
|
96
|
+
test/transport/test_algorithms.rb
|
97
|
+
test/transport/test_cipher_factory.rb
|
98
|
+
test/transport/test_hmac.rb
|
99
|
+
test/transport/test_identity_cipher.rb
|
100
|
+
test/transport/test_packet_stream.rb
|
101
|
+
test/transport/test_server_version.rb
|
102
|
+
test/transport/test_session.rb
|
103
|
+
test/transport/test_state.rb
|
104
|
+
THANKS.rdoc
|
@@ -0,0 +1,110 @@
|
|
1
|
+
= Net::SSH
|
2
|
+
|
3
|
+
* http://net-ssh.rubyforge.org/ssh
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.
|
8
|
+
|
9
|
+
== FEATURES:
|
10
|
+
|
11
|
+
* Execute processes on remote servers and capture their output
|
12
|
+
* Run multiple processes in parallel over a single SSH connection
|
13
|
+
* Support for SSH subsystems
|
14
|
+
* Forward local and remote ports via an SSH connection
|
15
|
+
|
16
|
+
== SYNOPSIS:
|
17
|
+
|
18
|
+
In a nutshell:
|
19
|
+
|
20
|
+
require 'net/ssh'
|
21
|
+
|
22
|
+
Net::SSH.start('host', 'user', :password => "password") do |ssh|
|
23
|
+
# capture all stderr and stdout output from a remote process
|
24
|
+
output = ssh.exec!("hostname")
|
25
|
+
|
26
|
+
# capture only stdout matching a particular pattern
|
27
|
+
stdout = ""
|
28
|
+
ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
|
29
|
+
stdout << data if stream == :stdout
|
30
|
+
end
|
31
|
+
puts stdout
|
32
|
+
|
33
|
+
# run multiple processes in parallel to completion
|
34
|
+
ssh.exec "sed ..."
|
35
|
+
ssh.exec "awk ..."
|
36
|
+
ssh.exec "rm -rf ..."
|
37
|
+
ssh.loop
|
38
|
+
|
39
|
+
# open a new channel and configure a minimal set of callbacks, then run
|
40
|
+
# the event loop until the channel finishes (closes)
|
41
|
+
channel = ssh.open_channel do |ch|
|
42
|
+
ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
|
43
|
+
raise "could not execute command" unless success
|
44
|
+
|
45
|
+
# "on_data" is called when the process writes something to stdout
|
46
|
+
ch.on_data do |c, data|
|
47
|
+
$STDOUT.print data
|
48
|
+
end
|
49
|
+
|
50
|
+
# "on_extended_data" is called when the process writes something to stderr
|
51
|
+
ch.on_extended_data do |c, type, data|
|
52
|
+
$STDERR.print data
|
53
|
+
end
|
54
|
+
|
55
|
+
ch.on_close { puts "done!" }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
channel.wait
|
60
|
+
|
61
|
+
# forward connections on local port 1234 to port 80 of www.capify.org
|
62
|
+
ssh.forward.local(1234, "www.capify.org", 80)
|
63
|
+
ssh.loop { true }
|
64
|
+
end
|
65
|
+
|
66
|
+
See Net::SSH for more documentation, and links to further information.
|
67
|
+
|
68
|
+
== REQUIREMENTS:
|
69
|
+
|
70
|
+
The only requirement you might be missing is the OpenSSL bindings for Ruby. These are built by default on most platforms, but you can verify that they're built and installed on your system by running the following command line:
|
71
|
+
|
72
|
+
ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
|
73
|
+
|
74
|
+
If that spits out something like "OpenSSL 0.9.8g 19 Oct 2007", then you're set. If you get an error, then you'll need to see about rebuilding ruby with OpenSSL support, or (if your platform supports it) installing the OpenSSL bindings separately.
|
75
|
+
|
76
|
+
Additionally: if you are going to be having Net::SSH prompt you for things like passwords or certificate passphrases, you'll want to have either the Highline (recommended) or Termios (unix systems only) gem installed, so that the passwords don't echo in clear text.
|
77
|
+
|
78
|
+
Lastly, if you want to run the tests or use any of the Rake tasks, you'll need:
|
79
|
+
|
80
|
+
* Echoe (for the Rakefile)
|
81
|
+
* Mocha (for the tests)
|
82
|
+
|
83
|
+
== INSTALL:
|
84
|
+
|
85
|
+
* gem install net-ssh (might need sudo privileges)
|
86
|
+
|
87
|
+
== LICENSE:
|
88
|
+
|
89
|
+
(The MIT License)
|
90
|
+
|
91
|
+
Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
|
92
|
+
|
93
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
94
|
+
a copy of this software and associated documentation files (the
|
95
|
+
'Software'), to deal in the Software without restriction, including
|
96
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
97
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
98
|
+
permit persons to whom the Software is furnished to do so, subject to
|
99
|
+
the following conditions:
|
100
|
+
|
101
|
+
The above copyright notice and this permission notice shall be
|
102
|
+
included in all copies or substantial portions of the Software.
|
103
|
+
|
104
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
105
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
106
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
107
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
108
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
109
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
110
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require './lib/net/ssh/version'
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'echoe'
|
5
|
+
rescue LoadError
|
6
|
+
abort "You'll need to have `echoe' installed to use Net::SSH's Rakefile"
|
7
|
+
end
|
8
|
+
|
9
|
+
version = Net::SSH::Version::STRING.dup
|
10
|
+
if ENV['SNAPSHOT'].to_i == 1
|
11
|
+
version << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
|
12
|
+
end
|
13
|
+
|
14
|
+
Echoe.new('net-ssh', version) do |p|
|
15
|
+
p.changelog = "CHANGELOG.rdoc"
|
16
|
+
|
17
|
+
p.author = "Jamis Buck"
|
18
|
+
p.email = "jamis@jamisbuck.org"
|
19
|
+
p.summary = "a pure-Ruby implementation of the SSH2 client protocol"
|
20
|
+
p.url = "http://net-ssh.rubyforge.org/ssh"
|
21
|
+
|
22
|
+
p.need_zip = true
|
23
|
+
p.include_rakefile = true
|
24
|
+
|
25
|
+
p.rdoc_pattern = /^(lib|README.rdoc|CHANGELOG.rdoc|THANKS.rdoc)/
|
26
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Net::SSH was originally written by Jamis Buck <jamis@37signals.com>. In
|
2
|
+
addition, the following individuals are gratefully acknowledged for their
|
3
|
+
contributions:
|
4
|
+
|
5
|
+
GOTOU Yuuzou <gotoyuzo@notwork.org>
|
6
|
+
* help and code related to OpenSSL
|
7
|
+
|
8
|
+
Guillaume Mar�ais <guillaume.marcais@free.fr>
|
9
|
+
* support for communicating with the the PuTTY "pageant" process
|
10
|
+
|
11
|
+
Daniel Berger <djberg96@yahoo.com>
|
12
|
+
* help getting unit tests in earlier Net::SSH versions to pass in Windows
|
13
|
+
* initial version of Net::SSH::Config provided inspiration and encouragement
|
14
|
+
|
15
|
+
Chris Andrews <chris@nodnol.org> and Lee Jensen <lee@outerim.com>
|
16
|
+
* support for ssh agent forwarding
|