dizby 1.5.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.rubocop.yml +2 -47
- data/.travis.yml +7 -7
- data/.yardopts +1 -16
- data/Gemfile +2 -17
- data/Rakefile +2 -8
- data/dizby.gemspec +9 -2
- data/lib/dizby.rb +0 -1
- data/lib/dizby/access/control_list.rb +1 -2
- data/lib/dizby/access/entry.rb +1 -2
- data/lib/dizby/access/insecure.rb +4 -5
- data/lib/dizby/access/list.rb +0 -1
- data/lib/dizby/converter/simple.rb +0 -1
- data/lib/dizby/converter/timed.rb +0 -1
- data/lib/dizby/distributed/array.rb +0 -1
- data/lib/dizby/distributed/object.rb +9 -9
- data/lib/dizby/distributed/proxy.rb +7 -7
- data/lib/dizby/distributed/semi_proxy.rb +2 -2
- data/lib/dizby/distributed/undumpable.rb +1 -2
- data/lib/dizby/distributed/unknown.rb +0 -1
- data/lib/dizby/error.rb +0 -1
- data/lib/dizby/protocol/basic.rb +0 -1
- data/lib/dizby/protocol/manager.rb +17 -20
- data/lib/dizby/protocol/refined.rb +0 -1
- data/{gemfiles/Gemfile.ci → lib/dizby/protocol/structs.rb} +4 -5
- data/lib/dizby/protocols/dead.rb +3 -4
- data/lib/dizby/protocols/secure.rb +18 -12
- data/lib/dizby/protocols/tcp.rb +19 -15
- data/lib/dizby/protocols/unix.rb +15 -15
- data/lib/dizby/server/abstract.rb +7 -5
- data/lib/dizby/server/basic.rb +5 -9
- data/lib/dizby/server/registration.rb +0 -1
- data/lib/dizby/service.rb +10 -8
- data/lib/dizby/stream/client.rb +0 -1
- data/lib/dizby/stream/connection.rb +2 -3
- data/lib/dizby/stream/messenger.rb +0 -1
- data/lib/dizby/stream/query_ref.rb +0 -1
- data/lib/dizby/stream/readable.rb +5 -6
- data/lib/dizby/stream/writable.rb +0 -1
- data/lib/dizby/tunnel/abstract.rb +10 -18
- data/lib/dizby/tunnel/basic.rb +2 -3
- data/lib/dizby/tunnel/basic_spawn.rb +4 -5
- data/lib/dizby/tunnel/bidirectional_strategy.rb +0 -1
- data/lib/dizby/tunnel/factory.rb +0 -1
- data/lib/dizby/tunnel/local_strategy.rb +0 -1
- data/lib/dizby/tunnel/spawn_command.rb +0 -1
- data/lib/dizby/tunnel/spawned.rb +0 -1
- data/lib/dizby/tunnel/tunnelable_local.rb +0 -1
- data/lib/dizby/tunnel/tunnelable_remote.rb +1 -2
- data/lib/dizby/utility/configurable.rb +0 -1
- data/lib/dizby/utility/io_barrier.rb +0 -1
- data/lib/dizby/utility/log.rb +0 -1
- data/lib/dizby/utility/monitor.rb +0 -1
- data/lib/dizby/utility/self_pipe.rb +0 -1
- data/lib/dizby/utility/semi_built.rb +0 -1
- data/lib/dizby/utility/string.rb +0 -1
- data/lib/dizby/utility/timed_collection.rb +0 -1
- data/lib/dizby/utility/timed_state.rb +0 -1
- data/lib/dizby/version.rb +1 -2
- data/lib/dizby/worker/connection.rb +0 -1
- data/lib/dizby/worker/invoke_method.rb +1 -2
- data/lib/dizby/worker/server.rb +0 -1
- data/test/test_helper.rb +1 -14
- metadata +93 -19
- data/gemfiles/Gemfile.doc +0 -12
- data/lib/dizby/utility/classic_access.rb +0 -31
- data/lib/dizby/utility/delegator.rb +0 -34
- data/lib/dizby/utility/force_bind.rb +0 -27
- data/lib/dizby/utility/polymorphic_delegated.rb +0 -65
- data/tasks/ghpages.rake +0 -33
- data/tasks/rubocop.rake +0 -14
- data/tasks/test.rake +0 -25
- data/tasks/yard.rake +0 -13
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# Copyright (c) 2016 Nathan Currier
|
3
2
|
|
4
3
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
@@ -9,37 +8,30 @@ require 'net/ssh'
|
|
9
8
|
|
10
9
|
module Dizby
|
11
10
|
class AbstractTunnel
|
12
|
-
def initialize(server, strategy, user, host)
|
11
|
+
def initialize(server, strategy, user, host, **options)
|
13
12
|
@server = server
|
14
|
-
|
13
|
+
ssh_config = options[:ssh] || @server.config[:ssh] || {}
|
14
|
+
@config = [host, user, ssh_config]
|
15
15
|
@strategy = strategy
|
16
16
|
|
17
17
|
reader, writer = IO.pipe
|
18
18
|
|
19
19
|
@thread =
|
20
|
-
Thread.start do
|
21
|
-
|
20
|
+
Thread.start(Net::SSH.start(*@config)) do |ssh|
|
21
|
+
loop_ssh(ssh, writer)
|
22
22
|
writer.close
|
23
23
|
end
|
24
24
|
|
25
|
-
@thread.abort_on_exception = true
|
26
|
-
|
27
25
|
read_ports(reader)
|
28
26
|
reader.close
|
29
27
|
end
|
30
28
|
|
31
29
|
# wait(ssh) is not defined in this class
|
32
|
-
def
|
33
|
-
ssh
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
get_and_write_ports(ssh, output)
|
38
|
-
|
39
|
-
wait(ssh)
|
40
|
-
ensure
|
41
|
-
ssh.close if ssh
|
42
|
-
end
|
30
|
+
def loop_ssh(ssh, output)
|
31
|
+
get_and_write_ports(ssh, output)
|
32
|
+
wait(ssh)
|
33
|
+
ensure
|
34
|
+
ssh.close if ssh
|
43
35
|
end
|
44
36
|
|
45
37
|
def read_ports(input)
|
data/lib/dizby/tunnel/basic.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# Copyright (c) 2016 Nathan Currier
|
3
2
|
|
4
3
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
@@ -9,10 +8,10 @@ require 'dizby/tunnel/abstract'
|
|
9
8
|
|
10
9
|
module Dizby
|
11
10
|
class BasicTunnel < AbstractTunnel
|
12
|
-
def initialize(
|
11
|
+
def initialize(*abstract_args, client_args)
|
13
12
|
@working = true
|
14
13
|
|
15
|
-
super(
|
14
|
+
super(*abstract_args, **client_args.options)
|
16
15
|
end
|
17
16
|
|
18
17
|
def wait(ssh)
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# Copyright (c) 2016 Nathan Currier
|
3
2
|
|
4
3
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
@@ -10,10 +9,10 @@ require 'dizby/error'
|
|
10
9
|
|
11
10
|
module Dizby
|
12
11
|
class BasicSpawnTunnel < AbstractTunnel
|
13
|
-
def initialize(
|
14
|
-
@command = command
|
12
|
+
def initialize(*abstract_args, spawn_args)
|
13
|
+
@command = spawn_args.command
|
15
14
|
|
16
|
-
super(
|
15
|
+
super(*abstract_args, **spawn_args.options)
|
17
16
|
end
|
18
17
|
|
19
18
|
def get_and_write_ports(ssh, output)
|
@@ -22,7 +21,7 @@ module Dizby
|
|
22
21
|
@channel =
|
23
22
|
ssh.open_channel do |ch|
|
24
23
|
ch.exec @command.to_cmd do |_, success|
|
25
|
-
|
24
|
+
raise SpawnError, 'could not spawn host' unless success
|
26
25
|
|
27
26
|
# it is already triggered if the port is set
|
28
27
|
get_remote_server_port(ch) if @command.dynamic?
|
data/lib/dizby/tunnel/factory.rb
CHANGED
data/lib/dizby/tunnel/spawned.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# Copyright (c) 2016 Nathan Currier
|
3
2
|
|
4
3
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
@@ -18,7 +17,7 @@ module Dizby
|
|
18
17
|
ssh.loop { remote_tunnel_port.nil? }
|
19
18
|
|
20
19
|
if remote_tunnel_port == :error
|
21
|
-
|
20
|
+
raise Net::SSH::Exception, 'remote forwarding request failed'
|
22
21
|
end
|
23
22
|
|
24
23
|
remote_tunnel_port
|
data/lib/dizby/utility/log.rb
CHANGED
data/lib/dizby/utility/string.rb
CHANGED
data/lib/dizby/version.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# Copyright (c) 2016 Nathan Currier
|
3
2
|
|
4
3
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
@@ -6,5 +5,5 @@
|
|
6
5
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
7
6
|
|
8
7
|
module Dizby
|
9
|
-
VERSION = '
|
8
|
+
VERSION = '2.0.0'.freeze
|
10
9
|
end
|
data/lib/dizby/worker/server.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,22 +1,9 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# Copyright (c) 2016 Nathan Currier
|
3
2
|
|
4
3
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
5
4
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
6
5
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
7
6
|
|
8
|
-
require '
|
9
|
-
|
10
|
-
if ENV['COVERAGE']
|
11
|
-
require 'simplecov'
|
12
|
-
SimpleCov.start do
|
13
|
-
add_filter 'test'
|
14
|
-
end
|
15
|
-
|
16
|
-
if ENV['CI']
|
17
|
-
require 'codecov'
|
18
|
-
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
19
|
-
end
|
20
|
-
end
|
7
|
+
require 'rideliner/test_helper'
|
21
8
|
|
22
9
|
require 'dizby'
|
metadata
CHANGED
@@ -1,43 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dizby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Currier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
type: :runtime
|
15
14
|
name: net-ssh
|
16
15
|
prerelease: false
|
16
|
+
type: :runtime
|
17
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 4.0.beta
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.beta
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: poly_delegate
|
29
|
+
prerelease: false
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
17
36
|
requirement: !ruby/object:Gem::Requirement
|
18
37
|
requirements:
|
19
38
|
- - ">="
|
20
39
|
- !ruby/object:Gem::Version
|
21
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rideliner
|
43
|
+
prerelease: false
|
44
|
+
type: :development
|
22
45
|
version_requirements: !ruby/object:Gem::Requirement
|
23
46
|
requirements:
|
24
47
|
- - ">="
|
25
48
|
- !ruby/object:Gem::Version
|
26
49
|
version: '0'
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
|
-
|
29
|
-
name: bundler
|
56
|
+
name: yard_rideliner
|
30
57
|
prerelease: false
|
58
|
+
type: :development
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
31
64
|
requirement: !ruby/object:Gem::Requirement
|
32
65
|
requirements:
|
33
66
|
- - ">="
|
34
67
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: yard_dizby
|
71
|
+
prerelease: false
|
72
|
+
type: :development
|
36
73
|
version_requirements: !ruby/object:Gem::Requirement
|
37
74
|
requirements:
|
38
75
|
- - ">="
|
39
76
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
77
|
+
version: '0'
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rbnacl
|
85
|
+
prerelease: false
|
86
|
+
type: :runtime
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 3.4.0
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.4.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rbnacl-libsodium
|
99
|
+
prerelease: false
|
100
|
+
type: :runtime
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.0.10
|
106
|
+
requirement: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.0.10
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: bcrypt_pbkdf
|
113
|
+
prerelease: false
|
114
|
+
type: :runtime
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 1.0.0.alpha1
|
120
|
+
requirement: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.0.0.alpha1
|
41
125
|
description: Distributed Ruby
|
42
126
|
email:
|
43
127
|
- nathan.currier@gmail.com
|
@@ -53,8 +137,6 @@ files:
|
|
53
137
|
- LICENSE.md
|
54
138
|
- Rakefile
|
55
139
|
- dizby.gemspec
|
56
|
-
- gemfiles/Gemfile.ci
|
57
|
-
- gemfiles/Gemfile.doc
|
58
140
|
- lib/dizby.rb
|
59
141
|
- lib/dizby/access/control_list.rb
|
60
142
|
- lib/dizby/access/entry.rb
|
@@ -72,6 +154,7 @@ files:
|
|
72
154
|
- lib/dizby/protocol/basic.rb
|
73
155
|
- lib/dizby/protocol/manager.rb
|
74
156
|
- lib/dizby/protocol/refined.rb
|
157
|
+
- lib/dizby/protocol/structs.rb
|
75
158
|
- lib/dizby/protocols/dead.rb
|
76
159
|
- lib/dizby/protocols/secure.rb
|
77
160
|
- lib/dizby/protocols/tcp.rb
|
@@ -96,14 +179,10 @@ files:
|
|
96
179
|
- lib/dizby/tunnel/spawned.rb
|
97
180
|
- lib/dizby/tunnel/tunnelable_local.rb
|
98
181
|
- lib/dizby/tunnel/tunnelable_remote.rb
|
99
|
-
- lib/dizby/utility/classic_access.rb
|
100
182
|
- lib/dizby/utility/configurable.rb
|
101
|
-
- lib/dizby/utility/delegator.rb
|
102
|
-
- lib/dizby/utility/force_bind.rb
|
103
183
|
- lib/dizby/utility/io_barrier.rb
|
104
184
|
- lib/dizby/utility/log.rb
|
105
185
|
- lib/dizby/utility/monitor.rb
|
106
|
-
- lib/dizby/utility/polymorphic_delegated.rb
|
107
186
|
- lib/dizby/utility/self_pipe.rb
|
108
187
|
- lib/dizby/utility/semi_built.rb
|
109
188
|
- lib/dizby/utility/string.rb
|
@@ -113,10 +192,6 @@ files:
|
|
113
192
|
- lib/dizby/worker/connection.rb
|
114
193
|
- lib/dizby/worker/invoke_method.rb
|
115
194
|
- lib/dizby/worker/server.rb
|
116
|
-
- tasks/ghpages.rake
|
117
|
-
- tasks/rubocop.rake
|
118
|
-
- tasks/test.rake
|
119
|
-
- tasks/yard.rake
|
120
195
|
- test/test_helper.rb
|
121
196
|
homepage: https://github.com/rideliner/dizby
|
122
197
|
licenses:
|
@@ -138,10 +213,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
213
|
version: '0'
|
139
214
|
requirements: []
|
140
215
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
216
|
+
rubygems_version: 2.6.2
|
142
217
|
signing_key:
|
143
218
|
specification_version: 4
|
144
219
|
summary: Distributed Ruby
|
145
220
|
test_files:
|
146
221
|
- test/test_helper.rb
|
147
|
-
has_rdoc: yard
|