sshkit-sudo-next 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eaf0ceec3960adf1b245082ce6c353db05abf9e5a8941ed267454eb0a6b9683f
4
- data.tar.gz: 64d65fd50dc8624827c2479c898f4c4a294bbb26814c204c613dfe5fb5d2d9cf
3
+ metadata.gz: 181f2203af922818343e500e41fe93db675a129e9787b744de995372a3f8e74d
4
+ data.tar.gz: 55cbbd308a8f2c4619352f9f7ace1a7907415e87b73a1e976532eaabbbb64269
5
5
  SHA512:
6
- metadata.gz: 061ddb73088198fd52acabba6a3db5d66ee7d965f8d34eaf1aef29af62e45bc41ef41a10565dca26cf85d132112da400534c22c507764f0dd315626190f6cf5f
7
- data.tar.gz: a09448741593b69288b0f32cb1428eafd25e009063f651f8759f8614eb31b1ddd3b0267aa21a5cdd4a119bac250e75e5a28b463ec584fd44944faecf4b16056f
6
+ metadata.gz: 5e3918d965d6c90338729af6f3be9c75863210bfeadfb5944751e1184b57f4a3ce16bdfec38e22f3203a9810bea63c4430ed1d21f5a0f3f5ccac66e7fddf4d1d
7
+ data.tar.gz: 2a805e292020d45b90cd57aa5acffa770f1120b637b67f4476580423494d7310af8f37ff76aee6b111b171a753585aa06faf5b9184fdd17331e0fce3799026c0
data/README.md CHANGED
@@ -2,9 +2,4 @@
2
2
 
3
3
  Fork of the [SSHKit::Sudo](https://github.com/kentaroi/sshkit-sudo.git) project, with significant cleanups and some improvements.
4
4
 
5
- As the original project, this gem allows:
6
-
7
- - sudo commands with password support;
8
- - perform all the tasks of a given session (eg. a whole deploy) as a specified user.
9
-
10
- We're in the process of preparing and releasing thorough documentation (estimated time: beginning of May/2021).
5
+ This gem provides sudo password handling for SSHKit: when a remote command emits a `[sudo] password for <user>:` prompt, the configured password is sent automatically, so commands invoking `sudo` (whether via `as :root do … end` blocks or by literally including `sudo` in the command) don't require interactive password entry.
@@ -69,27 +69,21 @@ module SSHKit
69
69
 
70
70
  env = (@env || {})
71
71
 
72
- user = @user || self.class.config.owner
73
-
74
- # As general Linux practice, switching user is not enough - some variables need to be updated
75
- # as well.
76
- # For an explanation, see https://saveriomiroddi.github.io/Chef-properly-run-a-resource-as-alternate-user.
77
- #
78
- user_home = user == 'root' ? '/root' : "/home/#{user}"
79
- env = env.merge(user: user, home: user_home)
80
-
81
- # Sshkit::Command#user runs commands in a non-login shell, so that variables are not inherited.
82
- # We can workaround this by setting them in the env, which is `export`ed, however, only the
83
- # specified ones are. Since `RAILS_ENV` is common, we pass it.
84
- #
85
- env = env.merge(rails_env: fetch(:rails_env))
72
+ if @user
73
+ # As general Linux practice, switching user is not enough - some variables need to be updated
74
+ # as well.
75
+ # For an explanation, see https://saveriomiroddi.github.io/Chef-properly-run-a-resource-as-alternate-user.
76
+ #
77
+ user_home = @user == 'root' ? '/root' : "/home/#{@user}"
78
+ env = env.merge(user: @user, home: user_home, rails_env: fetch(:rails_env))
79
+ end
86
80
 
87
81
  SSHKit::Command.new(*args, options.merge(
88
82
  {
89
83
  in: pwd_path,
90
84
  env: env,
91
85
  host: @host,
92
- user: user,
86
+ user: @user,
93
87
  group: @group,
94
88
  }
95
89
  ))
@@ -1,5 +1,5 @@
1
1
  module SSHKit
2
2
  module Sudo
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -6,6 +6,7 @@ require 'sshkit/sudo/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "sshkit-sudo-next"
8
8
  spec.version = SSHKit::Sudo::VERSION
9
+ spec.date = "2026-06-11"
9
10
  spec.authors = ["Saverio Miroddi"]
10
11
  spec.email = ["saverio.pub2@gmail.com"]
11
12
  spec.summary = %q{SSHKit extension, for sudo operation with password input.}
@@ -20,7 +21,7 @@ Gem::Specification.new do |spec|
20
21
 
21
22
  spec.required_ruby_version = ">= 1.9.3"
22
23
 
23
- spec.add_dependency "sshkit", "~> 1.20.0"
24
+ spec.add_dependency "sshkit", "~> 1.25.0"
24
25
  spec.add_development_dependency "bundler", "~> 1.7"
25
26
  spec.add_development_dependency "rake", "~> 10.0"
26
27
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshkit-sudo-next
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-04-22 00:00:00.000000000 Z
10
+ date: 2026-06-11 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: sshkit
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 1.20.0
18
+ version: 1.25.0
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 1.20.0
25
+ version: 1.25.0
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: bundler
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +73,6 @@ homepage: ''
74
73
  licenses:
75
74
  - MIT
76
75
  metadata: {}
77
- post_install_message:
78
76
  rdoc_options: []
79
77
  require_paths:
80
78
  - lib
@@ -89,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
87
  - !ruby/object:Gem::Version
90
88
  version: '0'
91
89
  requirements: []
92
- rubygems_version: 3.1.4
93
- signing_key:
90
+ rubygems_version: 4.0.7
94
91
  specification_version: 4
95
92
  summary: SSHKit extension, for sudo operation with password input.
96
93
  test_files: []