rye 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGES.txt +44 -38
- data/README.rdoc +44 -30
- data/Rakefile +41 -82
- data/VERSION +1 -0
- data/gem-public_cert.pem +20 -0
- data/lib/rye.rb +74 -52
- data/lib/rye/box.rb +7 -4
- data/lib/rye/dsl.rb +100 -0
- data/rye.gemspec +95 -55
- data/try/10_basic_tryouts.rb +44 -0
- data/try/12_batch_tryouts.rb +26 -0
- data/try/13_set_tryouts.rb +42 -0
- data/try/14_auth_methods_tryouts.rb +28 -0
- data/try/15_file_tryouts.rb +12 -0
- data/try/20_file_transfer_tryouts.rb +46 -0
- data/try/25_template_upload.rb +37 -0
- data/try/30_safemode_tryouts.rb +85 -0
- data/try/35_basics_with_hop.rb +36 -0
- data/try/70_rye_cli_tryouts.rb +0 -0
- data/try/copying.rb +18 -0
- data/try/keys.rb +141 -0
- data/tst/10-key1 +27 -0
- data/tst/10-key1.pub +1 -0
- data/tst/10-key2 +30 -0
- data/tst/10-key2.pub +1 -0
- data/tst/10_keys_test.rb +88 -0
- data/tst/50_rset_test.rb +54 -0
- data/tst/60-file.mp3 +0 -0
- data/tst/60_rbox_transfer_test.rb +53 -0
- data/tst/65_rbox_file_append_test.rb +53 -0
- data/tst/70_rbox_env_test.rb +19 -0
- data/tst/dsl_example.rb +80 -0
- data/tst/rye.rb +13 -0
- data/tst/shell.rb +280 -0
- data/tst/shell2.rb +278 -0
- data/tst/shell3.rb +280 -0
- data/tst/test_hop.rb +25 -0
- metadata +86 -25
- metadata.gz.sig +0 -0
- data/bin/try +0 -246
data.tar.gz.sig
ADDED
Binary file
|
data/CHANGES.txt
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
RYE, CHANGES
|
2
2
|
|
3
|
+
#### 0.9.8 (2013-02-06) #############################
|
4
|
+
|
5
|
+
* ADDED: Rudimentary DSL (see tst/dsl_example.rb) [Randy D. Wallace Jr]
|
6
|
+
* CHANGE: All releases will now be signed. See "Installation" in the readme.
|
7
|
+
|
8
|
+
|
3
9
|
#### 0.9.7 (2012-07-06) #############################
|
4
10
|
|
5
11
|
* FIXED: STDERR output was printing to STDOUT in one case (Thanks rrepen)
|
@@ -21,7 +27,7 @@ RYE, CHANGES
|
|
21
27
|
|
22
28
|
#### 0.9.3 (2011-01-29) #############################
|
23
29
|
|
24
|
-
* ADDED: Rye::Hop for gateway support.
|
30
|
+
* ADDED: Rye::Hop for gateway support.
|
25
31
|
(https://github.com/delano/rye/issues/closed#issue/10)
|
26
32
|
* CHANGE: Don't overwrite :paranoid option
|
27
33
|
|
@@ -39,7 +45,7 @@ RYE, CHANGES
|
|
39
45
|
|
40
46
|
#### 0.9.0 (2010-08-19) #############################
|
41
47
|
|
42
|
-
* FIXED: Pubkeys correctly added for first connection.
|
48
|
+
* FIXED: Pubkeys correctly added for first connection.
|
43
49
|
(NOTE: some state seems to be maintained by ssh-agent)
|
44
50
|
* ADDED: Interactive and non-interactive shell support (via Net::SSH)
|
45
51
|
* ADDED: Basic readline support for interactive mode
|
@@ -55,7 +61,7 @@ RYE, CHANGES
|
|
55
61
|
#### 0.8.19 (2010-06-28) #############################
|
56
62
|
|
57
63
|
* ADDED: Rye::Box#root?
|
58
|
-
* ADDED: Better sudo handling.
|
64
|
+
* ADDED: Better sudo handling.
|
59
65
|
|
60
66
|
|
61
67
|
#### 0.8.18 (2010-06-19) #############################
|
@@ -91,7 +97,7 @@ RYE, CHANGES
|
|
91
97
|
#### 0.8.12 (2010-01-16) #############################
|
92
98
|
|
93
99
|
* FIXED: Removed dependency on ssh-agent. Also fixes starting
|
94
|
-
many instances of said executable.
|
100
|
+
many instances of said executable.
|
95
101
|
* FIXED: file_append was overwriting when supplied a String (!)
|
96
102
|
* ADDED: Use SSH config file by default [Justin Case]
|
97
103
|
|
@@ -102,7 +108,7 @@ RYE, CHANGES
|
|
102
108
|
|
103
109
|
#### 0.8.10 (2009-10-07) #############################
|
104
110
|
|
105
|
-
* CHANGE: Improved startup time.
|
111
|
+
* CHANGE: Improved startup time.
|
106
112
|
|
107
113
|
#### 0.8.9 (2009-08-26) #############################
|
108
114
|
|
@@ -118,7 +124,7 @@ RYE, CHANGES
|
|
118
124
|
|
119
125
|
#### 0.8.7 (2009-08-11) #############################
|
120
126
|
|
121
|
-
* FIXED: Rye::Box info level output is cleaner
|
127
|
+
* FIXED: Rye::Box info level output is cleaner
|
122
128
|
* FIXED: file_upload / download now expanding local tildas when safemode is disabled
|
123
129
|
* ADDED: Interactive handling for removing gems
|
124
130
|
* ADDED: dir_upload and dir_download
|
@@ -132,11 +138,11 @@ RYE, CHANGES
|
|
132
138
|
#### 0.8.5 (2009-07-14) #############################
|
133
139
|
|
134
140
|
* CHANGE: Rye::Box#getenv now accepts an option key name
|
135
|
-
* CHANGE: When not in safe mode, method missing will execute a
|
141
|
+
* CHANGE: When not in safe mode, method missing will execute a
|
136
142
|
method name as a shell command
|
137
|
-
* ADDED: Rye::Box#execute for running arbitrary commands when
|
143
|
+
* ADDED: Rye::Box#execute for running arbitrary commands when
|
138
144
|
not in safe mode
|
139
|
-
|
145
|
+
|
140
146
|
|
141
147
|
#### 0.8.4 (2009-06-30) #############################
|
142
148
|
|
@@ -180,24 +186,24 @@ RYE, CHANGES
|
|
180
186
|
|
181
187
|
#### 0.7.6 (2009-06-19) #############################
|
182
188
|
|
183
|
-
* FIXED: Raise Rye::NoPty exception when Net::SSH returns message
|
189
|
+
* FIXED: Raise Rye::NoPty exception when Net::SSH returns message
|
184
190
|
"Pseudo-terminal will not be allocated because stdin is not a terminal."
|
185
|
-
* FIXED: Rye::Box#disconnect would hang in some instances. Now waits 3 seconds.
|
191
|
+
* FIXED: Rye::Box#disconnect would hang in some instances. Now waits 3 seconds.
|
186
192
|
* FIXED: Bug in net_ssh_exec which was causing it to not return an exit code
|
187
|
-
* CHANGE: All exceptions now inherit from Rye::Error (Runtimerror)
|
193
|
+
* CHANGE: All exceptions now inherit from Rye::Error (Runtimerror)
|
188
194
|
* CHANGE: A NoPassword exception is raised when a password prompt returns nil.
|
189
|
-
* CHANGE: pre_command_hook block arguments have changed:
|
195
|
+
* CHANGE: pre_command_hook block arguments have changed:
|
190
196
|
NEW: complete command, user, host, nickname
|
191
197
|
OLD: command, args, user, host, nickname
|
192
|
-
|
193
|
-
|
198
|
+
|
199
|
+
|
194
200
|
#### 0.7.5 (2009-06-13) #############################
|
195
201
|
|
196
|
-
* FIXED: Rye::Set methods were not accepting or passing blocks.
|
202
|
+
* FIXED: Rye::Set methods were not accepting or passing blocks.
|
197
203
|
* ADDED: Rye::Set#user and Rye::Set#opts methods
|
198
204
|
* ADDED: Rye::Box#nickname
|
199
205
|
* ADDED: exception hooks for Rye::Box.
|
200
|
-
* CHANGE: Rye::Set method missing now forwards to Rye::Box
|
206
|
+
* CHANGE: Rye::Set method missing now forwards to Rye::Box
|
201
207
|
methods instead of Rye::Cmd
|
202
208
|
|
203
209
|
|
@@ -217,9 +223,9 @@ RYE, CHANGES
|
|
217
223
|
* ADDED: Rye::Cmd#safely and Rye::Cmd#unsafely methods
|
218
224
|
* ADDED: Rye::Cmd#digest_md5, Rye::Cmd#digest_sha1, Rye::Cmd#digest_sha2 methods
|
219
225
|
* ADDED: Rye::Cmd#file_verified? method
|
220
|
-
* ADDED: Rye::Box#net_ssh_exec! now checks and correctly prompts for a sudo response password.
|
221
|
-
Note: this will be upgraded in for 0.8 to support any prompt.
|
222
|
-
* FIXED: Net::SSH paranoid now set to false when safe mode is disabled.
|
226
|
+
* ADDED: Rye::Box#net_ssh_exec! now checks and correctly prompts for a sudo response password.
|
227
|
+
Note: this will be upgraded in for 0.8 to support any prompt.
|
228
|
+
* FIXED: Net::SSH paranoid now set to false when safe mode is disabled.
|
223
229
|
|
224
230
|
|
225
231
|
#### 0.7.2 (2009-06-01) #############################
|
@@ -230,14 +236,14 @@ RYE, CHANGES
|
|
230
236
|
|
231
237
|
* CHANGE: Removed broken grep method from Rye::Rap
|
232
238
|
* FIXED: Bug which prevented setting relative paths in non-home directory
|
233
|
-
* ADDED: Rye::Cmd#add_command helper for adding new command methods.
|
239
|
+
* ADDED: Rye::Cmd#add_command helper for adding new command methods.
|
234
240
|
* ADDED: pre-command-hook now sends the hostname to the block
|
235
241
|
|
236
242
|
|
237
243
|
#### 0.7.0 (2009-05-30) #############################
|
238
244
|
|
239
245
|
* CHANGE: Rye::Box now uses unique instance variable names to encourage using
|
240
|
-
instance variables in batch command blocks.
|
246
|
+
instance variables in batch command blocks.
|
241
247
|
* ADDED: Rye::Box#file_append
|
242
248
|
|
243
249
|
#### 0.6.6 (2009-05-21) #############################
|
@@ -253,7 +259,7 @@ RYE, CHANGES
|
|
253
259
|
|
254
260
|
#### 0.6.4 (2009-05-04) #############################
|
255
261
|
|
256
|
-
* FIXED: authorize_remote was not returning to the directory it started with.
|
262
|
+
* FIXED: authorize_remote was not returning to the directory it started with.
|
257
263
|
* ADDED: pre and post command hooks to Rye::Box
|
258
264
|
* ADDED: Rye::Box.batch
|
259
265
|
* ADDED: Support for OS X for Rye::Box.guess_user_home
|
@@ -283,13 +289,13 @@ RYE, CHANGES
|
|
283
289
|
* FIXED: handling of Process::Status ($?) in Rye.shell
|
284
290
|
* FIXED: Removed reference to Rudy::Error in bin/rye
|
285
291
|
* ADDED: Rye::Box.getenv
|
286
|
-
* ADDED: Rye::Box.can?
|
292
|
+
* ADDED: Rye::Box.can?
|
287
293
|
* ADDED: Rye::Box.umask= (a similar work around as cd / [])
|
288
294
|
* ADDED: Rye::Box.file_exists?
|
289
295
|
* ADDED: Rye::Box.authorize_keys_remote can now authorize for a different user
|
290
296
|
* ADDED: Rye::Box.upload and Rye::Box.download
|
291
297
|
* ADDED: Rye::SystemInfo.tmpdir
|
292
|
-
* CHANGE: Rye::Box.prep_args doesn't treat multicharacter Symbols as
|
298
|
+
* CHANGE: Rye::Box.prep_args doesn't treat multicharacter Symbols as
|
293
299
|
command-line options any more (single character ones are still converted)
|
294
300
|
* CHANGE: Renamed Rye::Box.add_env to Rye::Box.setenv
|
295
301
|
* CHANGE: rm and kill are available in Rye::Cmd by default
|
@@ -310,9 +316,9 @@ Rye.shell and Rye::Box.run_command (SSH) commands.
|
|
310
316
|
#### 0.5.3 (2009-04-20) #############################
|
311
317
|
|
312
318
|
* FIXED: Rye::Box.connect raises exceptions instead of exits
|
313
|
-
* ADDED: Rye::Box.connect now rescues HostKeyMismatch exceptions and
|
314
|
-
prompts for a response.
|
315
|
-
|
319
|
+
* ADDED: Rye::Box.connect now rescues HostKeyMismatch exceptions and
|
320
|
+
prompts for a response.
|
321
|
+
|
316
322
|
#### 0.5.2 (2009-04-19) #############################
|
317
323
|
|
318
324
|
* FIXED: authorize-local command attempted to connect via SSH before authorizing.
|
@@ -336,21 +342,21 @@ Rye.shell and Rye::Box.run_command (SSH) commands.
|
|
336
342
|
|
337
343
|
* ADDED: More helpful debug output
|
338
344
|
* ADDED: hostname command to Rye::Cmd
|
339
|
-
* ADDED: Rye::Box.connect now supports multiple password attempts if STDIN.tty returns true
|
345
|
+
* ADDED: Rye::Box.connect now supports multiple password attempts if STDIN.tty returns true
|
340
346
|
* ADDED: Rye::Box.interactive_ssh for opening an SSH session to the given box.
|
341
|
-
* CHANGE: Using OpenSSH's ssh-agent but also let's Net::SSH handle the ssh keys.
|
347
|
+
* CHANGE: Using OpenSSH's ssh-agent but also let's Net::SSH handle the ssh keys.
|
342
348
|
|
343
349
|
|
344
350
|
#### 0.4.1 (2009-04-06) #############################
|
345
351
|
|
346
352
|
* FIXED: Rye::Box.authorize_keys_remote was not disabling safe mode properly
|
347
|
-
* FIXED: Disabled debug mode.
|
348
|
-
* ADDED: "rye authorize" now specifically enforces the auth method order
|
353
|
+
* FIXED: Disabled debug mode.
|
354
|
+
* ADDED: "rye authorize" now specifically enforces the auth method order
|
349
355
|
|
350
356
|
|
351
357
|
#### 0.4.0 (2009-04-06) #############################
|
352
358
|
|
353
|
-
* FIXED: Box.run_command was parsing arguments incorrectly
|
359
|
+
* FIXED: Box.run_command was parsing arguments incorrectly
|
354
360
|
* FIXED: Box.net_ssh_exec was working on nil stderr
|
355
361
|
* FIXED: bin/try handles the new command exceptions
|
356
362
|
* ADDED: to_s and inspect methods for cleaner debugging output
|
@@ -359,8 +365,8 @@ Rye.shell and Rye::Box.run_command (SSH) commands.
|
|
359
365
|
* ADDED: Command switches can now be sent as Symbols (rbox.ls(:h))
|
360
366
|
* ADDED: Rye.host_keys
|
361
367
|
* ADDED: bin/rye
|
362
|
-
* ADDED: commands now raise a Rye::Err exception
|
363
|
-
when the command returns an exit code greater than 0.
|
368
|
+
* ADDED: commands now raise a Rye::Err exception
|
369
|
+
when the command returns an exit code greater than 0.
|
364
370
|
* CHANGE: Box.add_command renamed to Box.run_command
|
365
371
|
|
366
372
|
|
@@ -375,9 +381,9 @@ Rye.shell and Rye::Box.run_command (SSH) commands.
|
|
375
381
|
|
376
382
|
* FIXED: Rye::Box wasn't properly adding keypairs to SSH Agent
|
377
383
|
* FIXED: Rye::Box.method_missing Symbol/String ambiguity
|
378
|
-
* ADDED: Rye::Set supports executing commands parallel
|
384
|
+
* ADDED: Rye::Set supports executing commands parallel
|
379
385
|
* ADDED: Rye::Rap now contains STDERR output from command
|
380
|
-
* ADDED: Supports all options provided by Net::SSH#start. This
|
386
|
+
* ADDED: Supports all options provided by Net::SSH#start. This
|
381
387
|
includes support for password logins and proxies.
|
382
388
|
* ADDED: Safe mode can now be disabled (to allow file globs
|
383
389
|
and environment variable access).
|
@@ -398,5 +404,5 @@ Initial public release
|
|
398
404
|
|
399
405
|
#### TODO ###########################################
|
400
406
|
|
401
|
-
* Re-implement Rye::Rap as an Observable StringIO object for dynamic printing of output.
|
407
|
+
* Re-implement Rye::Rap as an Observable StringIO object for dynamic printing of output.
|
402
408
|
* Fingerprints: ssh-keygen -l -f id_rsa_repos.pub
|
data/README.rdoc
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
= Rye - v0.9
|
2
2
|
|
3
|
-
<
|
3
|
+
<strong>Safely run SSH commands on a bunch of machines at the same time (from Ruby)</stong>.
|
4
4
|
|
5
5
|
Inspired by Rush[http://rush.heroku.com] and compatible with Ruby 1.8, 1.9, and JRuby 1.3+!
|
6
6
|
|
7
|
+
<em>As of 0.9.8, all gem releases are signed. See Installation.</em>
|
7
8
|
|
8
9
|
== Overview
|
9
10
|
|
@@ -14,14 +15,14 @@ Rye does not require anything to be installed on the server side (other than an
|
|
14
15
|
|
15
16
|
== Example 1 -- Execute commands on a remote machine
|
16
17
|
|
17
|
-
Shell commands are executed by calling methods on a Rye::Box object.
|
18
|
-
|
18
|
+
Shell commands are executed by calling methods on a Rye::Box object.
|
19
|
+
|
19
20
|
rbox = Rye::Box.new('hostname')
|
20
21
|
rbox.pwd # => "/home/rye"
|
21
22
|
rbox.uname :a # => "Darwin rye-stage 9.7.0 ..."
|
22
23
|
|
23
24
|
Method arguments are sent directly as arguments to the shell command. Single-character Symbols are assumed to be single-character switches. <em>e.g. <tt>rbox.uname :a</tt> becomes <tt>uname -a</tt>.</em>
|
24
|
-
|
25
|
+
|
25
26
|
The return value for a command is a modified Array containing the contents of STDOUT split by line. It also gives access to STDERR and the exit code
|
26
27
|
|
27
28
|
ret = rbox.uptime # => "11:02 up 16:01, 3 users"
|
@@ -41,12 +42,12 @@ You can change directories.
|
|
41
42
|
rbox['/etc'].ls # => ['apache', 'init.d', ...]
|
42
43
|
rbox.pwd # => '/etc'
|
43
44
|
rbox.cd # => '/home/rye'
|
44
|
-
|
45
|
+
|
45
46
|
You can specify environment variables.
|
46
47
|
|
47
48
|
rbox.setenv('TIPPLE', "Forty Creek")
|
48
|
-
rbox.getenv 'TIPPLE' # => "Forty Creek"
|
49
|
-
|
49
|
+
rbox.getenv 'TIPPLE' # => "Forty Creek"
|
50
|
+
|
50
51
|
|
51
52
|
== Example 3 -- Adding and removing commands
|
52
53
|
|
@@ -54,7 +55,7 @@ You can add and remove commands to the whitelist.
|
|
54
55
|
|
55
56
|
Rye::Cmd.add_command :anything, '/usr/bin/uptime'
|
56
57
|
rbox = Rye::Box.new
|
57
|
-
rbox.anything
|
58
|
+
rbox.anything
|
58
59
|
Rye::Cmd.remove_command :anything
|
59
60
|
rbox.anything # => Rye::CommandNotFound exception
|
60
61
|
|
@@ -66,18 +67,18 @@ Safe mode can be disabled on one of the following ways.
|
|
66
67
|
rbox = Rye::Box.new 'HOST', :safe => false
|
67
68
|
OR
|
68
69
|
rbox.disable_safe_mode
|
69
|
-
|
70
|
+
|
70
71
|
When safe-mode is disabled, you can run any command (regardless of what is defined in the whitelist) with any valid arguments (fileglobs, tildas, etc...).
|
71
72
|
|
72
73
|
rbox.kill '-SIGHUP', 1928111
|
73
74
|
rbox.rm 'path/2/*'
|
74
|
-
|
75
|
+
|
75
76
|
You can also execute any valid shell command.
|
76
77
|
|
77
78
|
rbox.execute 'ps aux | grep ruby > /tmp/ruby-process-list'
|
78
79
|
|
79
80
|
See the "About Safe Mode" section below for more information.
|
80
|
-
|
81
|
+
|
81
82
|
|
82
83
|
== Example 5a -- Accessing Multiple Machines
|
83
84
|
|
@@ -86,26 +87,26 @@ Shell commands can be executed on multiple machines using a Rye::Set object. Cre
|
|
86
87
|
rbox = Rye::Box.new 'HOST1'
|
87
88
|
rset = Rye::Set.new
|
88
89
|
rset.add_boxes rbox, 'HOST2' # Add boxes as hostnames or objects
|
89
|
-
|
90
|
+
|
90
91
|
Then call methods just like with Rye::Box, except now the return value is an Array of Arrays. The order of return values matches the order the machines were added to the set.
|
91
|
-
|
92
|
+
|
92
93
|
rset.hostname # => [["HOST1"], ["HOST2"]]
|
93
94
|
rset.uname # => [["Darwin"], ["Linux"]]
|
94
|
-
|
95
|
+
|
95
96
|
== Example 5b -- Accessing Multiple Machines in Parallel
|
96
|
-
|
97
|
+
|
97
98
|
By default, Rye::Set connects to each machine sequentially in the order they were added to the set. Commands can also be run in parallel.
|
98
99
|
|
99
100
|
rset = Rye::Set.new "SETNAME", :parallel => true
|
100
101
|
OR
|
101
102
|
rset.parallel = true
|
102
|
-
|
103
|
-
|
103
|
+
|
104
|
+
|
104
105
|
== Example 6 -- File Transfers
|
105
106
|
|
106
107
|
rbox = Rye::Box.new "localhost"
|
107
108
|
|
108
|
-
rbox.file_upload "README.rdoc", "/tmp"
|
109
|
+
rbox.file_upload "README.rdoc", "/tmp"
|
109
110
|
|
110
111
|
applejack = StringIO.new "Some in-memory content"
|
111
112
|
rbox.file_upload applejack, "/tmp/applejack.txt"
|
@@ -152,7 +153,7 @@ When working with machines that are behind another host (assuming that you have
|
|
152
153
|
|
153
154
|
rbox = Rye::Box.new('filibuster', :via => 'firewall.lan')
|
154
155
|
|
155
|
-
The information for the Rye::Box is then relative from the position of the firewall.
|
156
|
+
The information for the Rye::Box is then relative from the position of the firewall.
|
156
157
|
So, the hostname 'filibuster' is used from 'firewall.lan'
|
157
158
|
|
158
159
|
== Example 8b -- Hopping Firewalls, in groups
|
@@ -165,6 +166,12 @@ So, the hostname 'filibuster' is used from 'firewall.lan'
|
|
165
166
|
rset.uptime
|
166
167
|
# => [[17:17:44 up 548 days, 13:37, 20 users, load average: 0.12, 0.07, 0.06], [01:17:49 up 6 days, 1:39, 9 users, load average: 0.13, 0.09, 0.09]]
|
167
168
|
|
169
|
+
== Example 9 -- Disable password prompt
|
170
|
+
|
171
|
+
If you're running in a terminal but you want <tt>Net::SSH::AuthenticationFailed</tt> to be raised instead of getting a password prompt when authentication fails, set <tt>:password_prompt</tt> option to false:
|
172
|
+
|
173
|
+
rbox = Rye::Box.new("foo.com", :user => "dan", :password => "inkorrect", :password_prompt => false)
|
174
|
+
rbox.uptime # => raises Net::SSH::AuthenticationFailed
|
168
175
|
|
169
176
|
== About Safe-Mode
|
170
177
|
|
@@ -175,7 +182,7 @@ In safe-mode:
|
|
175
182
|
* Pipes and operators don't work: <tt>|, &&, >, <, ||, ~</tt>, etc...
|
176
183
|
* Backticks don't work either: <tt>procs=`ps aux`</tt>
|
177
184
|
|
178
|
-
Why? In safe-mode, all command arguments are escaped which turns all arguments into their literal values.
|
185
|
+
Why? In safe-mode, all command arguments are escaped which turns all arguments into their literal values.
|
179
186
|
|
180
187
|
Using a Ruby interface to execute shell commands is pretty awesome, particularly to run them on several machines simultaneously. That's a lot of power and it's potentially very dangerous. That's why Rye disables this stuff by default. There's probably a way to do it safely but it's not obvious yet (to me). If you have any ideas, I'd love to hear them!
|
181
188
|
|
@@ -198,43 +205,50 @@ Rye permits only a limited number of system commands to be run. This default whi
|
|
198
205
|
|
199
206
|
== Installation
|
200
207
|
|
201
|
-
Via Rubygems
|
208
|
+
Via Rubygems:
|
202
209
|
|
203
210
|
$ gem install rye
|
204
211
|
|
212
|
+
However, in order to be sure the code you're install is the code I wrote, I recommended that you verify the signiture[http://docs.rubygems.org/read/chapter/21]. To do this
|
213
|
+
|
214
|
+
# Add the public key as a trusted certificate
|
215
|
+
# (You only need to do this once)
|
216
|
+
$ curl -O https://raw.github.com/delano/rye/master/gem-public_cert.pem
|
217
|
+
$ gem cert --add gem-public_cert.pem
|
218
|
+
|
219
|
+
$ gem install rye -P HighSecurity
|
220
|
+
|
221
|
+
If you don't add the public key, you'll see an error like "Couldn't verify data signature". If you're still having trouble let me know and I'll give you a hand.
|
222
|
+
|
205
223
|
or via download:
|
206
224
|
|
207
225
|
* rye-latest.tar.gz[http://github.com/delano/rye/tarball/latest]
|
208
226
|
* rye-latest.zip[http://github.com/delano/rye/zipball/latest]
|
209
227
|
|
210
|
-
== Known Issues
|
211
|
-
|
212
|
-
* Rye doesn't read the ~/.ssh/config file yet
|
213
|
-
* No support for STDIN for commands.
|
214
|
-
* Limited support for interactive shells.
|
215
228
|
|
216
|
-
|
229
|
+
== Contributing
|
217
230
|
|
231
|
+
The easiest way to contribute is to open an issue[https://github.com/delano/rye/issues] for bugs and feature requests. I'm also very open to thoughtful and interesting pull[https://github.com/delano/rye/pulls] requests[https://github.com/delano/rye/pulls. Fork and be merry.
|
218
232
|
|
219
233
|
== Thanks
|
220
234
|
|
221
235
|
* Kalin Harvey (http://rely.ca)
|
222
236
|
* Rush[http://github.com/adamwiggins/rush] and Capistrano[http://github.com/jamis/capistrano/blob/master/lib/capistrano/shell.rb] for the inspiration.
|
223
|
-
* Mike Cline for giving the okay to use the Rye name.
|
237
|
+
* Mike Cline for giving the okay to use the Rye name.
|
224
238
|
* Justin Case (http://github.com/justincase/) for fixes
|
225
239
|
* Vincent Batts (http://hashbangbash.com/) for Rye::Hop
|
226
240
|
|
227
241
|
|
228
242
|
== More Info
|
229
243
|
|
230
|
-
* Codes[
|
244
|
+
* Codes[https://github.com/delano/rye]
|
231
245
|
* Rdocs[http://delano.github.com/rye]
|
232
246
|
* Inspiration[http://www.youtube.com/watch?v=_StUVh6ENuw]
|
233
247
|
|
234
248
|
|
235
249
|
== Related Projects
|
236
250
|
|
237
|
-
* Rush[
|
251
|
+
* Rush[https://github.com/adamwiggins/rush]
|
238
252
|
|
239
253
|
|
240
254
|
== Credits
|
data/Rakefile
CHANGED
@@ -1,90 +1,49 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
include FileUtils
|
6
|
-
|
7
|
-
begin
|
8
|
-
require 'hanna/rdoctask'
|
9
|
-
rescue LoadError
|
10
|
-
require 'rake/rdoctask'
|
11
|
-
end
|
12
|
-
|
13
|
-
|
14
|
-
task :default => :package
|
15
|
-
|
16
|
-
# CONFIG =============================================================
|
17
|
-
|
18
|
-
# Change the following according to your needs
|
19
|
-
README = "README.rdoc"
|
20
|
-
CHANGES = "CHANGES.txt"
|
21
|
-
LICENSE = "LICENSE.txt"
|
22
|
-
|
23
|
-
# Files and directories to be deleted when you run "rake clean"
|
24
|
-
CLEAN.include [ 'doc', 'pkg', '*.gem', '.config' ]
|
25
|
-
|
26
|
-
# Virginia assumes your project and gemspec have the same name
|
27
|
-
name = (Dir.glob('*.gemspec') || ['rye']).first.split('.').first
|
28
|
-
load "#{name}.gemspec"
|
29
|
-
version = @spec.version
|
1
|
+
require "rubygems"
|
2
|
+
require "rake"
|
3
|
+
require "rake/clean"
|
4
|
+
require "rdoc/task"
|
30
5
|
|
31
|
-
|
32
|
-
|
6
|
+
task :default => ["build"]
|
7
|
+
CLEAN.include [ 'pkg', 'rdoc' ]
|
8
|
+
name = "rye"
|
33
9
|
|
10
|
+
$:.unshift File.join(File.dirname(__FILE__), 'lib')
|
11
|
+
require name
|
12
|
+
version = Rye::VERSION.to_s
|
34
13
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
# RUBYFORGE RELEASE / PUBLISH TASKS ==================================
|
56
|
-
|
57
|
-
if @spec.rubyforge_project
|
58
|
-
desc 'Publish website to rubyforge'
|
59
|
-
task 'publish:rdoc' => 'doc/index.html' do
|
60
|
-
sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/"
|
61
|
-
end
|
62
|
-
|
63
|
-
desc 'Public release to rubyforge'
|
64
|
-
task 'publish:gem' => [:package] do |t|
|
65
|
-
sh <<-end
|
66
|
-
rubyforge add_release -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
|
67
|
-
rubyforge add_file -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
|
68
|
-
end
|
14
|
+
begin
|
15
|
+
require "jeweler"
|
16
|
+
Jeweler::Tasks.new do |s|
|
17
|
+
s.version = version
|
18
|
+
s.name = name
|
19
|
+
s.rubyforge_project = s.name
|
20
|
+
s.summary = "Run SSH commands on a bunch of machines at the same time (from Ruby)."
|
21
|
+
s.description = "Run SSH commands on a bunch of machines at the same time (from Ruby)."
|
22
|
+
s.email = "delano@solutious.com"
|
23
|
+
s.homepage = "https://github.com/delano/rye"
|
24
|
+
s.authors = ["Delano Mandelbaum"]
|
25
|
+
s.add_dependency 'annoy'
|
26
|
+
s.add_dependency 'sysinfo', '>= 0.7.3'
|
27
|
+
s.add_dependency 'highline', '>= 1.5.1'
|
28
|
+
s.add_dependency 'net-ssh', '>= 2.0.13'
|
29
|
+
s.add_dependency 'net-scp', '>= 1.0.2'
|
30
|
+
s.add_dependency 'docile', '>= 1.0.1'
|
31
|
+
|
32
|
+
s.signing_key = File.join('/mnt/gem/', 'gem-private_key.pem')
|
33
|
+
s.cert_chain = ['gem-public_cert.pem']
|
69
34
|
end
|
35
|
+
Jeweler::GemcutterTasks.new
|
36
|
+
rescue LoadError
|
37
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
70
38
|
end
|
71
39
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
t.options << '--charset' << 'utf-8'
|
81
|
-
t.rdoc_files.include(LICENSE)
|
82
|
-
t.rdoc_files.include(README)
|
83
|
-
t.rdoc_files.include(CHANGES)
|
84
|
-
t.rdoc_files.include('bin/*')
|
85
|
-
t.rdoc_files.include('lib/**/*.rb')
|
40
|
+
RDoc::Task.new do |rdoc|
|
41
|
+
rdoc.rdoc_dir = "rdoc"
|
42
|
+
rdoc.title = "#{name} #{version}"
|
43
|
+
rdoc.rdoc_files.include("README*")
|
44
|
+
rdoc.rdoc_files.include("LICENSE.txt")
|
45
|
+
rdoc.rdoc_files.include("VERSION")
|
46
|
+
rdoc.rdoc_files.include("bin/*.rb")
|
47
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
86
48
|
end
|
87
49
|
|
88
|
-
|
89
|
-
|
90
|
-
|