net-scp 4.0.0 → 4.0.1.rc3
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/ci.yml +23 -0
- data/.gitignore +7 -0
- data/Gemfile +2 -2
- data/Manifest +1 -1
- data/README.md +143 -0
- data/Rakefile +89 -2
- data/SECURITY.md +4 -0
- data/lib/net/scp/version.rb +3 -3
- data/lib/net/scp/version.rb.old +68 -0
- data/lib/net/scp.rb +15 -1
- data/lib/uri/scp.rb +7 -3
- data/net-scp-public_cert.pem +19 -18
- data/net-scp.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +27 -24
- metadata.gz.sig +0 -0
- data/.travis.yml +0 -16
- data/README.rdoc +0 -124
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85938ca32f11557ce4671954e90804b552ff17c08f70b048e6dacf3f1fa19e14
|
4
|
+
data.tar.gz: c868ed5839f461ccde85599b8b8eb359f4a33206f671dd15a6ab935fa8dc2f5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc18c52990e428fb8f4dc2132d016d8817b5e47a916462f72bc4d4fe6092909abda1ba5b99c0a49cc370913c8fe7e77dc0823f322cad5ded384865b16a479749
|
7
|
+
data.tar.gz: fdef41a58bd49186406b01e4d5829c263c599a704a30023711314ecac03fa6b5112f381777941a24602074de94a532b7f6f03a120c026b59f93da95d444aa6d5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: CI
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
push: { branches: master }
|
5
|
+
permissions:
|
6
|
+
contents: read
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', 'ruby-head']
|
14
|
+
continue-on-error: ${{ matrix.ruby-version == 'ruby-head' }}
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v3
|
17
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby-version }}
|
21
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
22
|
+
- name: Run Tests
|
23
|
+
run: bundle exec rake test
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -4,8 +4,8 @@ source 'https://rubygems.org'
|
|
4
4
|
gemspec
|
5
5
|
|
6
6
|
# TODO: add to gemspec
|
7
|
-
gem "bundler", "
|
8
|
-
gem "rake", "
|
7
|
+
gem "bundler", ">= 1.11"
|
8
|
+
gem "rake", ">= 12.0"
|
9
9
|
|
10
10
|
gem 'byebug', group: %i[development test] if !Gem.win_platform? && RUBY_ENGINE == "ruby"
|
11
11
|
|
data/Manifest
CHANGED
data/README.md
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
# Net::SCP
|
2
|
+
|
3
|
+
***Please note: this project is in maintenance mode. It is not under active
|
4
|
+
development but pull requests are very much welcome. Just be sure to include
|
5
|
+
tests! -- delano***
|
6
|
+
|
7
|
+
* Docs: http://net-ssh.github.io/net-scp
|
8
|
+
* Issues: https://github.com/net-ssh/net-scp/issues
|
9
|
+
* Codes: https://github.com/net-ssh/net-scp
|
10
|
+
* Email: net-ssh@solutious.com
|
11
|
+
|
12
|
+
|
13
|
+
*As of v1.0.5, all gem releases are signed. See INSTALL.*
|
14
|
+
|
15
|
+
## DESCRIPTION:
|
16
|
+
|
17
|
+
Net::SCP is a pure-Ruby implementation of the SCP protocol. This operates over
|
18
|
+
SSH (and requires the Net::SSH library), and allows files and directory trees
|
19
|
+
to be copied to and from a remote server.
|
20
|
+
|
21
|
+
## FEATURES/PROBLEMS:
|
22
|
+
|
23
|
+
* Transfer files or entire directory trees to or from a remote host via SCP
|
24
|
+
* Can preserve file attributes across transfers
|
25
|
+
* Can download files in-memory, or direct-to-disk
|
26
|
+
* Support for SCP URI's, and OpenURI
|
27
|
+
|
28
|
+
|
29
|
+
## SYNOPSIS:
|
30
|
+
|
31
|
+
In a nutshell:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
require 'net/scp'
|
35
|
+
|
36
|
+
# upload a file to a remote server
|
37
|
+
Net::SCP.upload!("remote.host.com", "username",
|
38
|
+
"/local/path", "/remote/path",
|
39
|
+
:ssh => { :password => "password" })
|
40
|
+
|
41
|
+
# upload recursively
|
42
|
+
Net::SCP.upload!("remote.host", "username", "/path/to/local", "/path/to/remote",
|
43
|
+
:ssh => { :password => "foo" }, :recursive => true)
|
44
|
+
|
45
|
+
# download a file from a remote server
|
46
|
+
Net::SCP.download!("remote.host.com", "username",
|
47
|
+
"/remote/path", "/local/path",
|
48
|
+
:ssh => { :password => "password" })
|
49
|
+
|
50
|
+
# download a file to an in-memory buffer
|
51
|
+
data = Net::SCP::download!("remote.host.com", "username", "/remote/path")
|
52
|
+
|
53
|
+
# use a persistent connection to transfer files
|
54
|
+
Net::SCP.start("remote.host.com", "username", :password => "password") do |scp|
|
55
|
+
# upload a file to a remote server
|
56
|
+
scp.upload! "/local/path", "/remote/path"
|
57
|
+
|
58
|
+
# upload from an in-memory buffer
|
59
|
+
scp.upload! StringIO.new("some data to upload"), "/remote/path"
|
60
|
+
|
61
|
+
# run multiple downloads in parallel
|
62
|
+
d1 = scp.download("/remote/path", "/local/path")
|
63
|
+
d2 = scp.download("/remote/path2", "/local/path2")
|
64
|
+
[d1, d2].each { |d| d.wait }
|
65
|
+
end
|
66
|
+
|
67
|
+
# You can also use open-uri to grab data via scp:
|
68
|
+
require 'uri/open-scp'
|
69
|
+
data = open("scp://user@host/path/to/file.txt").read
|
70
|
+
```
|
71
|
+
|
72
|
+
For more information, see Net::SCP.
|
73
|
+
|
74
|
+
## REQUIREMENTS:
|
75
|
+
|
76
|
+
* Net::SSH 2
|
77
|
+
|
78
|
+
If you wish to run the tests, you'll also need:
|
79
|
+
|
80
|
+
* Echoe (for Rakefile use)
|
81
|
+
* Mocha (for tests)
|
82
|
+
|
83
|
+
|
84
|
+
## INSTALL:
|
85
|
+
|
86
|
+
* ```gem install net-scp (might need sudo privileges)```
|
87
|
+
|
88
|
+
|
89
|
+
However, in order to be sure the code you're installing hasn't been tampered
|
90
|
+
with, it's recommended that you verify the
|
91
|
+
[signature](http://docs.seattlerb.org/rubygems/Gem/Security.html). To do this,
|
92
|
+
you need to add my public key as a trusted certificate (you only need to do
|
93
|
+
this once):
|
94
|
+
|
95
|
+
```sh
|
96
|
+
# Add the public key as a trusted certificate
|
97
|
+
# (You only need to do this once)
|
98
|
+
$ curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
|
99
|
+
$ gem cert --add net-ssh-public_cert.pem
|
100
|
+
```
|
101
|
+
|
102
|
+
Then- when installing the gem - do so with high security:
|
103
|
+
|
104
|
+
$ gem install net-scp -P HighSecurity
|
105
|
+
|
106
|
+
If you don't add the public key, you'll see an error like "Couldn't verify
|
107
|
+
data signature". If you're still having trouble let me know and I'll give you
|
108
|
+
a hand.
|
109
|
+
|
110
|
+
Or, you can do it the hard way (without Rubygems):
|
111
|
+
|
112
|
+
* tar xzf net-scp-*.tgz
|
113
|
+
* cd net-scp-*
|
114
|
+
* ruby setup.rb config
|
115
|
+
* ruby setup.rb install (might need sudo privileges)
|
116
|
+
|
117
|
+
## Security contact information
|
118
|
+
|
119
|
+
See [SECURITY.md](SECURITY.md)
|
120
|
+
|
121
|
+
## LICENSE:
|
122
|
+
|
123
|
+
(The MIT License)
|
124
|
+
|
125
|
+
Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
|
126
|
+
|
127
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
128
|
+
of this software and associated documentation files (the 'Software'), to deal
|
129
|
+
in the Software without restriction, including without limitation the rights
|
130
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
131
|
+
copies of the Software, and to permit persons to whom the Software is
|
132
|
+
furnished to do so, subject to the following conditions:
|
133
|
+
|
134
|
+
The above copyright notice and this permission notice shall be included in all
|
135
|
+
copies or substantial portions of the Software.
|
136
|
+
|
137
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
138
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
139
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
140
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
141
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
142
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
143
|
+
SOFTWARE.
|
data/Rakefile
CHANGED
@@ -71,11 +71,98 @@ RDoc::Task.new do |rdoc|
|
|
71
71
|
rdoc.rdoc_dir = "rdoc"
|
72
72
|
rdoc.title = "#{name} #{version}"
|
73
73
|
rdoc.generator = 'hanna' # gem install hanna-nouveau
|
74
|
-
rdoc.main = 'README.
|
74
|
+
rdoc.main = 'README.md'
|
75
75
|
rdoc.rdoc_files.include("README*")
|
76
76
|
rdoc.rdoc_files.include("bin/*.rb")
|
77
77
|
rdoc.rdoc_files.include("lib/**/*.rb")
|
78
78
|
extra_files.each { |file|
|
79
|
-
rdoc.rdoc_files.include(file) if File.
|
79
|
+
rdoc.rdoc_files.include(file) if File.exist?(file)
|
80
80
|
}
|
81
81
|
end
|
82
|
+
|
83
|
+
def change_version(&block)
|
84
|
+
version_file = 'lib/net/scp/version.rb'
|
85
|
+
require_relative version_file
|
86
|
+
pre = Net::SCP::Version::PRE
|
87
|
+
tiny = Net::SCP::Version::TINY
|
88
|
+
result = block[pre: pre, tiny: Net::SCP::Version::TINY]
|
89
|
+
raise ArgumentError, "Version change logic should always return a pre" unless result.key?(:pre)
|
90
|
+
|
91
|
+
new_pre = result[:pre]
|
92
|
+
new_tiny = result[:tiny] || tiny
|
93
|
+
found = { pre: false, tiny: false }
|
94
|
+
File.open("#{version_file}.new", "w") do |f|
|
95
|
+
File.readlines(version_file).each do |line|
|
96
|
+
match =
|
97
|
+
if pre.nil?
|
98
|
+
/^(\s+PRE\s+=\s+)nil(\s*)$/.match(line)
|
99
|
+
else
|
100
|
+
/^(\s+PRE\s+=\s+")#{pre}("\s*)$/.match(line)
|
101
|
+
end
|
102
|
+
if match
|
103
|
+
prefix = match[1]
|
104
|
+
postfix = match[2]
|
105
|
+
prefix.delete_suffix!('"')
|
106
|
+
postfix.delete_prefix!('"')
|
107
|
+
new_line = "#{prefix}#{new_pre.inspect}#{postfix}"
|
108
|
+
puts "Changing:\n - #{line} + #{new_line}"
|
109
|
+
line = new_line
|
110
|
+
found[:pre] = true
|
111
|
+
end
|
112
|
+
|
113
|
+
if new_tiny != tiny
|
114
|
+
match = /^(\s+TINY\s+=\s+)#{tiny}(\s*)$/.match(line)
|
115
|
+
if match
|
116
|
+
prefix = match[1]
|
117
|
+
postfix = match[2]
|
118
|
+
new_line = "#{prefix}#{new_tiny}#{postfix}"
|
119
|
+
puts "Changing:\n - #{line} + #{new_line}"
|
120
|
+
line = new_line
|
121
|
+
found[:tiny] = true
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
f.write(line)
|
126
|
+
end
|
127
|
+
raise ArgumentError, "Cound not find line: PRE = \"#{pre}\" in #{version_file}" unless found[:pre]
|
128
|
+
raise ArgumentError, "Cound not find line: TINY = \"#{tiny}\" in #{version_file}" unless found[:tiny] || new_tiny == tiny
|
129
|
+
end
|
130
|
+
|
131
|
+
FileUtils.mv version_file, "#{version_file}.old"
|
132
|
+
FileUtils.mv "#{version_file}.new", version_file
|
133
|
+
end
|
134
|
+
|
135
|
+
namespace :vbump do
|
136
|
+
desc "Final release"
|
137
|
+
task :final do
|
138
|
+
change_version do |pre:, tiny:|
|
139
|
+
_ = tiny
|
140
|
+
if pre.nil?
|
141
|
+
{ tiny: tiny + 1, pre: nil }
|
142
|
+
else
|
143
|
+
raise ArgumentError, "Unexpected pre: #{pre}" if pre.nil?
|
144
|
+
|
145
|
+
{ pre: nil }
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
desc "Increment prerelease"
|
151
|
+
task :pre, [:type] do |_t, args|
|
152
|
+
change_version do |pre:, tiny:|
|
153
|
+
puts " PRE => #{pre.inspect}"
|
154
|
+
match = /^([a-z]+)(\d+)/.match(pre)
|
155
|
+
raise ArgumentError, "Unexpected pre: #{pre}" if match.nil? && args[:type].nil?
|
156
|
+
|
157
|
+
if match.nil? || (!args[:type].nil? && args[:type] != match[1])
|
158
|
+
if pre.nil?
|
159
|
+
{ pre: "#{args[:type]}1", tiny: tiny + 1 }
|
160
|
+
else
|
161
|
+
{ pre: "#{args[:type]}1" }
|
162
|
+
end
|
163
|
+
else
|
164
|
+
{ pre: "#{match[1]}#{match[2].to_i + 1}" }
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
data/SECURITY.md
ADDED
data/lib/net/scp/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Net
|
2
|
-
|
2
|
+
class SCP
|
3
3
|
# A class for describing the current version of a library. The version
|
4
4
|
# consists of three parts: the +major+ number, the +minor+ number, and the
|
5
5
|
# +tiny+ (or +patch+) number.
|
@@ -52,11 +52,11 @@ module Net
|
|
52
52
|
MINOR = 0
|
53
53
|
|
54
54
|
# The tiny component of this version of the Net::SSH library
|
55
|
-
TINY =
|
55
|
+
TINY = 1
|
56
56
|
|
57
57
|
# The prerelease component of this version of the Net::SSH library
|
58
58
|
# nil allowed
|
59
|
-
PRE =
|
59
|
+
PRE = "rc3"
|
60
60
|
|
61
61
|
# The current version of the Net::SSH library as a Version instance
|
62
62
|
CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Net
|
2
|
+
class SCP
|
3
|
+
# A class for describing the current version of a library. The version
|
4
|
+
# consists of three parts: the +major+ number, the +minor+ number, and the
|
5
|
+
# +tiny+ (or +patch+) number.
|
6
|
+
#
|
7
|
+
# Two Version instances may be compared, so that you can test that a version
|
8
|
+
# of a library is what you require:
|
9
|
+
#
|
10
|
+
# require 'net/scp/version'
|
11
|
+
#
|
12
|
+
# if Net::SCP::Version::CURRENT < Net::SCP::Version[2,1,0]
|
13
|
+
# abort "your software is too old!"
|
14
|
+
# end
|
15
|
+
class Version
|
16
|
+
include Comparable
|
17
|
+
|
18
|
+
# A convenience method for instantiating a new Version instance with the
|
19
|
+
# given +major+, +minor+, and +tiny+ components.
|
20
|
+
def self.[](major, minor, tiny, pre = nil)
|
21
|
+
new(major, minor, tiny, pre)
|
22
|
+
end
|
23
|
+
|
24
|
+
attr_reader :major, :minor, :tiny
|
25
|
+
|
26
|
+
# Create a new Version object with the given components.
|
27
|
+
def initialize(major, minor, tiny, pre = nil)
|
28
|
+
@major, @minor, @tiny, @pre = major, minor, tiny, pre
|
29
|
+
end
|
30
|
+
|
31
|
+
# Compare this version to the given +version+ object.
|
32
|
+
def <=>(version)
|
33
|
+
to_i <=> version.to_i
|
34
|
+
end
|
35
|
+
|
36
|
+
# Converts this version object to a string, where each of the three
|
37
|
+
# version components are joined by the '.' character. E.g., 2.0.0.
|
38
|
+
def to_s
|
39
|
+
@to_s ||= [@major, @minor, @tiny, @pre].compact.join(".")
|
40
|
+
end
|
41
|
+
|
42
|
+
# Converts this version to a canonical integer that may be compared
|
43
|
+
# against other version objects.
|
44
|
+
def to_i
|
45
|
+
@to_i ||= @major * 1_000_000 + @minor * 1_000 + @tiny
|
46
|
+
end
|
47
|
+
|
48
|
+
# The major component of this version of the Net::SSH library
|
49
|
+
MAJOR = 4
|
50
|
+
|
51
|
+
# The minor component of this version of the Net::SSH library
|
52
|
+
MINOR = 0
|
53
|
+
|
54
|
+
# The tiny component of this version of the Net::SSH library
|
55
|
+
TINY = 1
|
56
|
+
|
57
|
+
# The prerelease component of this version of the Net::SSH library
|
58
|
+
# nil allowed
|
59
|
+
PRE = "rc2"
|
60
|
+
|
61
|
+
# The current version of the Net::SSH library as a Version instance
|
62
|
+
CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
|
63
|
+
|
64
|
+
# The current version of the Net::SSH library as a String
|
65
|
+
STRING = CURRENT.to_s
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/lib/net/scp.rb
CHANGED
@@ -362,7 +362,21 @@ module Net
|
|
362
362
|
channel[:stack ] = []
|
363
363
|
channel[:error_string] = ''
|
364
364
|
|
365
|
-
channel.on_close
|
365
|
+
channel.on_close do
|
366
|
+
# If we got an exit-status and it is not 0, something went wrong
|
367
|
+
if !channel[:exit].nil? && channel[:exit] != 0
|
368
|
+
raise Net::SCP::Error, 'SCP did not finish successfully ' \
|
369
|
+
"(#{channel[:exit]}): #{channel[:error_string]}"
|
370
|
+
end
|
371
|
+
# We may get no exit-status at all as returning a status is only RECOMENDED
|
372
|
+
# in RFC4254. But if our state is not :finish, something went wrong
|
373
|
+
if channel[:exit].nil? && channel[:state] != :finish
|
374
|
+
raise Net::SCP::Error, 'SCP did not finish successfully ' \
|
375
|
+
'(channel closed before end of transmission)'
|
376
|
+
end
|
377
|
+
# At this point, :state can be :finish or :next_item
|
378
|
+
send("#{channel[:state]}_state", channel)
|
379
|
+
end
|
366
380
|
channel.on_data { |ch2, data| channel[:buffer].append(data) }
|
367
381
|
channel.on_extended_data { |ch2, type, data| debug { data.chomp } }
|
368
382
|
channel.on_request("exit-status") { |ch2, data| channel[:exit] = data.read_long }
|
data/lib/uri/scp.rb
CHANGED
@@ -8,7 +8,7 @@ module URI
|
|
8
8
|
:scheme,
|
9
9
|
:userinfo,
|
10
10
|
:host, :port, :path,
|
11
|
-
:query
|
11
|
+
:query
|
12
12
|
].freeze
|
13
13
|
|
14
14
|
attr_reader :options
|
@@ -31,5 +31,9 @@ module URI
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
if respond_to? :register_scheme
|
35
|
+
register_scheme "SCP", SCP
|
36
|
+
else
|
37
|
+
@@schemes["SCP"] = SCP
|
38
|
+
end
|
39
|
+
end
|
data/net-scp-public_cert.pem
CHANGED
@@ -1,20 +1,21 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
/
|
18
|
-
|
19
|
-
|
2
|
+
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMQ8wDQYDVQQDDAZuZXRz
|
3
|
+
c2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZFgNj
|
4
|
+
b20wHhcNMjQxMjI1MTEzNDQ3WhcNMjUxMjI1MTEzNDQ3WjBBMQ8wDQYDVQQDDAZu
|
5
|
+
ZXRzc2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZ
|
6
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJ4TbZ9H+qZ08
|
7
|
+
pQfJhPJTHaDCyQvCsKTFrL5O9z3tllQ7B/zksMMM+qFBpNYu9HCcg4yBATacE/PB
|
8
|
+
qVVyUrpr6lbH/XwoN5ljXm+bdCfmnjZvTCL2FTE6o+bcnaF0IsJyC0Q2B1fbWdXN
|
9
|
+
6Off1ZWoUk6We2BIM1bn6QJLxBpGyYhvOPXsYoqSuzDf2SJDDsWFZ8kV5ON13Ohm
|
10
|
+
JbBzn0oD8HF8FuYOewwsC0C1q4w7E5GtvHcQ5juweS7+RKsyDcVcVrLuNzoGRttS
|
11
|
+
KP4yMn+TzaXijyjRg7gECfJr3TGASaA4bQsILFGG5dAWcwO4OMrZedR7SHj/o0Kf
|
12
|
+
3gL7P0axAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
13
|
+
BBQF8qLA7Z4zg0SJGtUbv3eoQ8tjIzAfBgNVHREEGDAWgRRuZXRzc2hAc29sdXRp
|
14
|
+
b3VzLmNvbTAfBgNVHRIEGDAWgRRuZXRzc2hAc29sdXRpb3VzLmNvbTANBgkqhkiG
|
15
|
+
9w0BAQsFAAOCAQEAOEVGPubOS9dBQmiJYIZHOXe2Q50iQgxKa7hyEJcyA7q69Q5h
|
16
|
+
Ha5r4WpZyW0Dkr0+jIkT8GS7hO0XnUZdOiuNFQrx30jfRSVT7680dF6wAHEQZJqC
|
17
|
+
ZmYFthhR/mtzi7bA+Ubd0PyBNivqt3WhWP+Z19j1bVWIwzczUcFFao+FBjXptI0m
|
18
|
+
VGRPnRIzATA2qQUuKGkwrNFSHD9tDIHXSvwJ62U9ahoMKfMoDP0WHdPIpFCB8bPg
|
19
|
+
wxMvGTA/RH93o6dL09sq7rVtsS9NNFmBGJWLZWWPfcspNBUXS0HTWXsWS9XTm2bm
|
20
|
+
bbXS+I4xE1yFIPs39ej57LGJDMgMhWTyJF2zVg==
|
20
21
|
-----END CERTIFICATE-----
|
data/net-scp.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-scp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -12,26 +12,27 @@ bindir: bin
|
|
12
12
|
cert_chain:
|
13
13
|
- |
|
14
14
|
-----BEGIN CERTIFICATE-----
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
/
|
31
|
-
|
32
|
-
|
15
|
+
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMQ8wDQYDVQQDDAZuZXRz
|
16
|
+
c2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZFgNj
|
17
|
+
b20wHhcNMjQxMjI1MTEzNDQ3WhcNMjUxMjI1MTEzNDQ3WjBBMQ8wDQYDVQQDDAZu
|
18
|
+
ZXRzc2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZ
|
19
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJ4TbZ9H+qZ08
|
20
|
+
pQfJhPJTHaDCyQvCsKTFrL5O9z3tllQ7B/zksMMM+qFBpNYu9HCcg4yBATacE/PB
|
21
|
+
qVVyUrpr6lbH/XwoN5ljXm+bdCfmnjZvTCL2FTE6o+bcnaF0IsJyC0Q2B1fbWdXN
|
22
|
+
6Off1ZWoUk6We2BIM1bn6QJLxBpGyYhvOPXsYoqSuzDf2SJDDsWFZ8kV5ON13Ohm
|
23
|
+
JbBzn0oD8HF8FuYOewwsC0C1q4w7E5GtvHcQ5juweS7+RKsyDcVcVrLuNzoGRttS
|
24
|
+
KP4yMn+TzaXijyjRg7gECfJr3TGASaA4bQsILFGG5dAWcwO4OMrZedR7SHj/o0Kf
|
25
|
+
3gL7P0axAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
26
|
+
BBQF8qLA7Z4zg0SJGtUbv3eoQ8tjIzAfBgNVHREEGDAWgRRuZXRzc2hAc29sdXRp
|
27
|
+
b3VzLmNvbTAfBgNVHRIEGDAWgRRuZXRzc2hAc29sdXRpb3VzLmNvbTANBgkqhkiG
|
28
|
+
9w0BAQsFAAOCAQEAOEVGPubOS9dBQmiJYIZHOXe2Q50iQgxKa7hyEJcyA7q69Q5h
|
29
|
+
Ha5r4WpZyW0Dkr0+jIkT8GS7hO0XnUZdOiuNFQrx30jfRSVT7680dF6wAHEQZJqC
|
30
|
+
ZmYFthhR/mtzi7bA+Ubd0PyBNivqt3WhWP+Z19j1bVWIwzczUcFFao+FBjXptI0m
|
31
|
+
VGRPnRIzATA2qQUuKGkwrNFSHD9tDIHXSvwJ62U9ahoMKfMoDP0WHdPIpFCB8bPg
|
32
|
+
wxMvGTA/RH93o6dL09sq7rVtsS9NNFmBGJWLZWWPfcspNBUXS0HTWXsWS9XTm2bm
|
33
|
+
bbXS+I4xE1yFIPs39ej57LGJDMgMhWTyJF2zVg==
|
33
34
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
35
|
+
date: 2024-12-25 00:00:00.000000000 Z
|
35
36
|
dependencies:
|
36
37
|
- !ruby/object:Gem::Dependency
|
37
38
|
name: net-ssh
|
@@ -88,21 +89,23 @@ executables: []
|
|
88
89
|
extensions: []
|
89
90
|
extra_rdoc_files:
|
90
91
|
- LICENSE.txt
|
91
|
-
- README.
|
92
|
+
- README.md
|
92
93
|
files:
|
94
|
+
- ".github/workflows/ci.yml"
|
93
95
|
- ".gitignore"
|
94
|
-
- ".travis.yml"
|
95
96
|
- CHANGES.txt
|
96
97
|
- Gemfile
|
97
98
|
- LICENSE.txt
|
98
99
|
- Manifest
|
99
|
-
- README.
|
100
|
+
- README.md
|
100
101
|
- Rakefile
|
102
|
+
- SECURITY.md
|
101
103
|
- lib/net/scp.rb
|
102
104
|
- lib/net/scp/download.rb
|
103
105
|
- lib/net/scp/errors.rb
|
104
106
|
- lib/net/scp/upload.rb
|
105
107
|
- lib/net/scp/version.rb
|
108
|
+
- lib/net/scp/version.rb.old
|
106
109
|
- lib/uri/open-scp.rb
|
107
110
|
- lib/uri/scp.rb
|
108
111
|
- net-scp-public_cert.pem
|
@@ -128,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
131
|
- !ruby/object:Gem::Version
|
129
132
|
version: '0'
|
130
133
|
requirements: []
|
131
|
-
rubygems_version: 3.
|
134
|
+
rubygems_version: 3.3.3
|
132
135
|
signing_key:
|
133
136
|
specification_version: 3
|
134
137
|
summary: A pure Ruby implementation of the SCP client protocol.
|
metadata.gz.sig
CHANGED
Binary file
|
data/.travis.yml
DELETED
data/README.rdoc
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
= Net::SCP
|
2
|
-
|
3
|
-
<em><b>Please note: this project is in maintenance mode. It is not under active development but pull requests are very much welcome. Just be sure to include tests! -- delano</b></em>
|
4
|
-
|
5
|
-
|
6
|
-
* Docs: http://net-ssh.github.com/net-scp
|
7
|
-
* Issues: https://github.com/net-ssh/net-scp/issues
|
8
|
-
* Codes: https://github.com/net-ssh/net-scp
|
9
|
-
* Email: net-ssh@solutious.com
|
10
|
-
|
11
|
-
<em>As of v1.0.5, all gem releases are signed. See INSTALL.</em>
|
12
|
-
|
13
|
-
|
14
|
-
== DESCRIPTION:
|
15
|
-
|
16
|
-
Net::SCP is a pure-Ruby implementation of the SCP protocol. This operates over SSH (and requires the Net::SSH library), and allows files and directory trees to be copied to and from a remote server.
|
17
|
-
|
18
|
-
== FEATURES/PROBLEMS:
|
19
|
-
|
20
|
-
* Transfer files or entire directory trees to or from a remote host via SCP
|
21
|
-
* Can preserve file attributes across transfers
|
22
|
-
* Can download files in-memory, or direct-to-disk
|
23
|
-
* Support for SCP URI's, and OpenURI
|
24
|
-
|
25
|
-
== SYNOPSIS:
|
26
|
-
|
27
|
-
In a nutshell:
|
28
|
-
|
29
|
-
require 'net/scp'
|
30
|
-
|
31
|
-
# upload a file to a remote server
|
32
|
-
Net::SCP.upload!("remote.host.com", "username",
|
33
|
-
"/local/path", "/remote/path",
|
34
|
-
:ssh => { :password => "password" })
|
35
|
-
|
36
|
-
# upload recursively
|
37
|
-
Net::SCP.upload!("remote.host", "username", "/path/to/local", "/path/to/remote",
|
38
|
-
:ssh => { :password => "foo" }, :recursive => true)
|
39
|
-
|
40
|
-
# download a file from a remote server
|
41
|
-
Net::SCP.download!("remote.host.com", "username",
|
42
|
-
"/remote/path", "/local/path",
|
43
|
-
:ssh => { :password => "password" })
|
44
|
-
|
45
|
-
# download a file to an in-memory buffer
|
46
|
-
data = Net::SCP::download!("remote.host.com", "username", "/remote/path")
|
47
|
-
|
48
|
-
# use a persistent connection to transfer files
|
49
|
-
Net::SCP.start("remote.host.com", "username", :password => "password") do |scp|
|
50
|
-
# upload a file to a remote server
|
51
|
-
scp.upload! "/local/path", "/remote/path"
|
52
|
-
|
53
|
-
# upload from an in-memory buffer
|
54
|
-
scp.upload! StringIO.new("some data to upload"), "/remote/path"
|
55
|
-
|
56
|
-
# run multiple downloads in parallel
|
57
|
-
d1 = scp.download("/remote/path", "/local/path")
|
58
|
-
d2 = scp.download("/remote/path2", "/local/path2")
|
59
|
-
[d1, d2].each { |d| d.wait }
|
60
|
-
end
|
61
|
-
|
62
|
-
# You can also use open-uri to grab data via scp:
|
63
|
-
require 'uri/open-scp'
|
64
|
-
data = open("scp://user@host/path/to/file.txt").read
|
65
|
-
|
66
|
-
For more information, see Net::SCP.
|
67
|
-
|
68
|
-
== REQUIREMENTS:
|
69
|
-
|
70
|
-
* Net::SSH 2
|
71
|
-
|
72
|
-
If you wish to run the tests, you'll also need:
|
73
|
-
|
74
|
-
* Echoe (for Rakefile use)
|
75
|
-
* Mocha (for tests)
|
76
|
-
|
77
|
-
== INSTALL:
|
78
|
-
|
79
|
-
* gem install net-scp (might need sudo privileges)
|
80
|
-
|
81
|
-
However, in order to be sure the code you're installing hasn't been tampered with, it's recommended that you verify the signature[http://docs.seattlerb.org/rubygems/Gem/Security.html]. To do this, you need to add my public key as a trusted certificate (you only need to do this once):
|
82
|
-
|
83
|
-
# Add the public key as a trusted certificate
|
84
|
-
# (You only need to do this once)
|
85
|
-
$ curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
|
86
|
-
$ gem cert --add net-ssh-public_cert.pem
|
87
|
-
|
88
|
-
Then- when installing the gem - do so with high security:
|
89
|
-
|
90
|
-
$ gem install net-scp -P HighSecurity
|
91
|
-
|
92
|
-
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.
|
93
|
-
|
94
|
-
Or, you can do it the hard way (without Rubygems):
|
95
|
-
|
96
|
-
* tar xzf net-scp-*.tgz
|
97
|
-
* cd net-scp-*
|
98
|
-
* ruby setup.rb config
|
99
|
-
* ruby setup.rb install (might need sudo privileges)
|
100
|
-
|
101
|
-
== LICENSE:
|
102
|
-
|
103
|
-
(The MIT License)
|
104
|
-
|
105
|
-
Copyright (c) 2008 Jamis Buck <jamis@37signals.com>
|
106
|
-
|
107
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
108
|
-
a copy of this software and associated documentation files (the
|
109
|
-
'Software'), to deal in the Software without restriction, including
|
110
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
111
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
112
|
-
permit persons to whom the Software is furnished to do so, subject to
|
113
|
-
the following conditions:
|
114
|
-
|
115
|
-
The above copyright notice and this permission notice shall be
|
116
|
-
included in all copies or substantial portions of the Software.
|
117
|
-
|
118
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
119
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
120
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
121
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
122
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
123
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
124
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|