sshkit 1.18.0 → 1.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.docker/Dockerfile +6 -0
- data/.docker/ubuntu_setup.sh +22 -0
- data/.github/dependabot.yml +16 -0
- data/.github/release-drafter.yml +25 -0
- data/.github/workflows/ci.yml +98 -0
- data/.github/workflows/push.yml +12 -0
- data/.gitignore +0 -1
- data/.rubocop.yml +63 -0
- data/.rubocop_todo.yml +630 -0
- data/CHANGELOG.md +1 -769
- data/CONTRIBUTING.md +2 -2
- data/Dangerfile +1 -1
- data/EXAMPLES.md +35 -13
- data/Gemfile +0 -12
- data/README.md +35 -17
- data/RELEASING.md +4 -5
- data/Rakefile +3 -10
- data/docker-compose.yml +8 -0
- data/examples/simple_connection.rb +9 -0
- data/lib/sshkit/backends/abstract.rb +9 -6
- data/lib/sshkit/backends/connection_pool/cache.rb +12 -5
- data/lib/sshkit/backends/connection_pool.rb +8 -4
- data/lib/sshkit/backends/netssh/known_hosts.rb +8 -8
- data/lib/sshkit/backends/netssh/scp_transfer.rb +26 -0
- data/lib/sshkit/backends/netssh/sftp_transfer.rb +46 -0
- data/lib/sshkit/backends/netssh.rb +38 -8
- data/lib/sshkit/command.rb +18 -13
- data/lib/sshkit/deprecation_logger.rb +2 -0
- data/lib/sshkit/host.rb +31 -4
- data/lib/sshkit/version.rb +1 -1
- data/sshkit.gemspec +6 -1
- data/test/functional/backends/netssh_transfer_tests.rb +83 -0
- data/test/functional/backends/test_local.rb +18 -0
- data/test/functional/backends/test_netssh.rb +24 -79
- data/test/functional/backends/test_netssh_scp.rb +23 -0
- data/test/functional/backends/test_netssh_sftp.rb +23 -0
- data/test/helper.rb +5 -43
- data/test/support/docker_wrapper.rb +71 -0
- data/test/unit/backends/test_abstract.rb +13 -1
- data/test/unit/backends/test_netssh.rb +55 -0
- data/test/unit/formatters/test_pretty.rb +1 -1
- data/test/unit/test_command.rb +32 -7
- data/test/unit/test_command_map.rb +8 -8
- data/test/unit/test_deprecation_logger.rb +1 -1
- data/test/unit/test_host.rb +44 -0
- metadata +58 -18
- data/.travis.yml +0 -14
- data/Vagrantfile +0 -15
- data/test/boxes.json +0 -17
- data/test/functional/test_ssh_server_comes_up_for_functional_tests.rb +0 -24
- data/test/support/vagrant_wrapper.rb +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f40ad7a1382ef707a259094c945692f08c44392e0bba7c37fe4099e748301a5e
|
4
|
+
data.tar.gz: 72f3fea395eaaa0036dd701c04692e75c379867465cffaa4ac6cdf1c4f647813
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab28074eba7cb9bdbfcbca9857f5e74fc89ed06acdf872148fcb7329b45754a714c658dacd879fead076de3bbd2541d84bcfd8ef66369007a1444b3edc2b3ac3
|
7
|
+
data.tar.gz: a6d0deb01db101ba2a41dcfcd861a10c7604b17ebe5e25981eebe6d74a0b5c9a9ea345d2dcbb45a4ba30952b571b6736f3bdcd7721d7d8fe684db772cc723700
|
data/.docker/Dockerfile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
|
5
|
+
export DEBIAN_FRONTEND=noninteractive
|
6
|
+
apt -y update
|
7
|
+
|
8
|
+
# Create `deployer` user that can sudo without a password
|
9
|
+
apt-get -y install sudo
|
10
|
+
adduser --disabled-password deployer < /dev/null
|
11
|
+
echo "deployer:topsecret" | chpasswd
|
12
|
+
echo "deployer ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
13
|
+
|
14
|
+
# Install and configure sshd
|
15
|
+
apt-get -y install openssh-server
|
16
|
+
{
|
17
|
+
echo "Port 22"
|
18
|
+
echo "PasswordAuthentication yes"
|
19
|
+
echo "ChallengeResponseAuthentication no"
|
20
|
+
} >> /etc/ssh/sshd_config
|
21
|
+
mkdir /var/run/sshd
|
22
|
+
chmod 0755 /var/run/sshd
|
@@ -0,0 +1,16 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: monthly
|
7
|
+
open-pull-requests-limit: 10
|
8
|
+
ignore:
|
9
|
+
- dependency-name: rubocop
|
10
|
+
versions:
|
11
|
+
- "> 0.49.1"
|
12
|
+
- package-ecosystem: "github-actions"
|
13
|
+
directory: "/"
|
14
|
+
schedule:
|
15
|
+
interval: monthly
|
16
|
+
open-pull-requests-limit: 10
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name-template: "$RESOLVED_VERSION"
|
2
|
+
tag-template: "v$RESOLVED_VERSION"
|
3
|
+
categories:
|
4
|
+
- title: "⚠️ Breaking Changes"
|
5
|
+
label: "⚠️ Breaking"
|
6
|
+
- title: "✨ New Features"
|
7
|
+
label: "✨ Feature"
|
8
|
+
- title: "🐛 Bug Fixes"
|
9
|
+
label: "🐛 Bug Fix"
|
10
|
+
- title: "📚 Documentation"
|
11
|
+
label: "📚 Docs"
|
12
|
+
- title: "🏠 Housekeeping"
|
13
|
+
label: "🏠 Housekeeping"
|
14
|
+
version-resolver:
|
15
|
+
minor:
|
16
|
+
labels:
|
17
|
+
- "⚠️ Breaking"
|
18
|
+
- "✨ Feature"
|
19
|
+
default: patch
|
20
|
+
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
|
21
|
+
no-changes-template: "- No changes"
|
22
|
+
template: |
|
23
|
+
$CHANGES
|
24
|
+
|
25
|
+
**Full Changelog:** https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
|
@@ -0,0 +1,98 @@
|
|
1
|
+
name: test on CI
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches: [master]
|
5
|
+
pull_request:
|
6
|
+
jobs:
|
7
|
+
test:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby:
|
12
|
+
[
|
13
|
+
"2.3",
|
14
|
+
"2.4",
|
15
|
+
"2.5",
|
16
|
+
"2.6",
|
17
|
+
"2.7",
|
18
|
+
"3.0",
|
19
|
+
"3.1",
|
20
|
+
"3.2",
|
21
|
+
"3.3",
|
22
|
+
"head",
|
23
|
+
]
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v4
|
26
|
+
- name: Set up Ruby
|
27
|
+
uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
30
|
+
bundler-cache: true
|
31
|
+
- name: Run tests
|
32
|
+
run: bundle exec rake test:units
|
33
|
+
|
34
|
+
test-legacy:
|
35
|
+
runs-on: ubuntu-20.04
|
36
|
+
strategy:
|
37
|
+
matrix:
|
38
|
+
ruby: ["2.0", "2.1", "2.2"]
|
39
|
+
steps:
|
40
|
+
- uses: actions/checkout@v4
|
41
|
+
- name: Set up Ruby
|
42
|
+
uses: ruby/setup-ruby@v1
|
43
|
+
with:
|
44
|
+
ruby-version: ${{ matrix.ruby }}
|
45
|
+
bundler-cache: true
|
46
|
+
- name: Run tests
|
47
|
+
run: bundle exec rake test:units
|
48
|
+
|
49
|
+
test-all:
|
50
|
+
runs-on: ubuntu-latest
|
51
|
+
needs: [test, test-legacy]
|
52
|
+
if: always()
|
53
|
+
steps:
|
54
|
+
- name: All tests ok
|
55
|
+
if: ${{ !(contains(needs.*.result, 'failure')) }}
|
56
|
+
run: exit 0
|
57
|
+
- name: Some tests failed
|
58
|
+
if: ${{ contains(needs.*.result, 'failure') }}
|
59
|
+
run: exit 1
|
60
|
+
|
61
|
+
rubocop:
|
62
|
+
runs-on: ubuntu-latest
|
63
|
+
steps:
|
64
|
+
- uses: actions/checkout@v4
|
65
|
+
- name: Set up Ruby
|
66
|
+
uses: ruby/setup-ruby@v1
|
67
|
+
with:
|
68
|
+
ruby-version: "2.7"
|
69
|
+
bundler-cache: true
|
70
|
+
- name: Run rubocop
|
71
|
+
run: bundle exec rake lint
|
72
|
+
|
73
|
+
functional:
|
74
|
+
runs-on: ubuntu-latest
|
75
|
+
strategy:
|
76
|
+
matrix:
|
77
|
+
ruby: ["2.0", "ruby"]
|
78
|
+
steps:
|
79
|
+
- uses: actions/checkout@v4
|
80
|
+
- name: Set up Ruby
|
81
|
+
uses: ruby/setup-ruby@v1
|
82
|
+
with:
|
83
|
+
ruby-version: ${{ matrix.ruby }}
|
84
|
+
bundler-cache: true
|
85
|
+
- name: Run functional tests
|
86
|
+
run: bundle exec rake test:functional
|
87
|
+
|
88
|
+
functional-all:
|
89
|
+
runs-on: ubuntu-latest
|
90
|
+
needs: [functional]
|
91
|
+
if: always()
|
92
|
+
steps:
|
93
|
+
- name: All tests ok
|
94
|
+
if: ${{ !(contains(needs.*.result, 'failure')) }}
|
95
|
+
run: exit 0
|
96
|
+
- name: Some tests failed
|
97
|
+
if: ${{ contains(needs.*.result, 'failure') }}
|
98
|
+
run: exit 1
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
DisplayCopNames: true
|
5
|
+
DisplayStyleGuide: true
|
6
|
+
TargetRubyVersion: 2.0
|
7
|
+
|
8
|
+
Lint/AmbiguousBlockAssociation:
|
9
|
+
Enabled: false
|
10
|
+
Metrics/BlockLength:
|
11
|
+
Exclude:
|
12
|
+
- "sshkit.gemspec"
|
13
|
+
- "spec/**/*"
|
14
|
+
- "lib/**/*.rake"
|
15
|
+
Style/BarePercentLiterals:
|
16
|
+
EnforcedStyle: percent_q
|
17
|
+
Style/ClassAndModuleChildren:
|
18
|
+
Enabled: false
|
19
|
+
Style/DoubleNegation:
|
20
|
+
Enabled: false
|
21
|
+
Style/FileName:
|
22
|
+
Exclude:
|
23
|
+
- "Dangerfile"
|
24
|
+
Style/IndentHeredoc:
|
25
|
+
Enabled: false
|
26
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
27
|
+
EnforcedStyle: no_space
|
28
|
+
Style/StringLiterals:
|
29
|
+
EnforcedStyle: double_quotes
|
30
|
+
Style/TrivialAccessors:
|
31
|
+
AllowPredicates: true
|
32
|
+
Style/PercentLiteralDelimiters:
|
33
|
+
Enabled: false
|
34
|
+
Style/SingleLineBlockParams:
|
35
|
+
Enabled: false
|
36
|
+
Style/ModuleFunction:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
# Enable someday
|
40
|
+
Style/Documentation:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
# Needs refactors
|
44
|
+
Metrics/PerceivedComplexity:
|
45
|
+
Enabled: false
|
46
|
+
Metrics/CyclomaticComplexity:
|
47
|
+
Enabled: false
|
48
|
+
Metrics/MethodLength:
|
49
|
+
Enabled: false
|
50
|
+
Style/PredicateName:
|
51
|
+
Enabled: false
|
52
|
+
Metrics/LineLength:
|
53
|
+
Enabled: false
|
54
|
+
Metrics/AbcSize:
|
55
|
+
Enabled: false
|
56
|
+
Style/PerlBackrefs:
|
57
|
+
Enabled: false
|
58
|
+
Metrics/ClassLength:
|
59
|
+
Enabled: false
|
60
|
+
Metrics/ModuleLength:
|
61
|
+
Enabled: false
|
62
|
+
Style/AccessorMethodName:
|
63
|
+
Enabled: false
|