vtacfriendly 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/vtac-ui +3 -1
- data/lib/vtac_friendly/system_tab.rb +8 -1
- data/lib/vtac_friendly/vtac_client.rb +18 -2
- data/lib/vtac_friendly/vtac_packet.rb +1 -1
- data/lib/vtac_friendly.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feb1ec849f39686daecf874719aa75f5f6e74adfe13a865962668c6cafc0bab6
|
4
|
+
data.tar.gz: 0bbd46b063bff1441110bb9496917a6fe0104b02371db0a79cfff3b47dcfdee2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29a2db0516d05387fd291844d3da62f9a94edad4de47119e18ecf9c5d2ac7a13959454556f8e850b2182a0a3d0b303a041a5d2f601370b4b77c6a935df835023
|
7
|
+
data.tar.gz: b4c61186e221ff215cbc695cfdca896a576bb2ac4b7ef0636b7bf39e2a7783b9337b43170e6fb61ba25252c8023ed10e35cbde8ac2e0de303cae96c46d61da9c
|
data/bin/vtac-ui
CHANGED
@@ -16,6 +16,8 @@ args = ArgsParser::Args.new(switches: switches, options: options)
|
|
16
16
|
srv = VtacFriendly::Client.connect(args.data[0], args.switches[:p] ? args.switches[:p].to_i : 5582)
|
17
17
|
server = srv[0]
|
18
18
|
server_name = srv[1]
|
19
|
+
server_version = srv[2]
|
20
|
+
auth_required = srv[3]
|
19
21
|
sock_domain, remote_port, remote_hostname, remote_ip = server.peeraddr
|
20
22
|
|
21
23
|
bb = (R::C.color :blue) + (R::F.bold)
|
@@ -48,7 +50,7 @@ loop do
|
|
48
50
|
print " "*(R::S.width-R::Cr.pos[0])
|
49
51
|
elsif ctab == :system
|
50
52
|
puts "_.cb:gray._AnalyticsConfig_.f:bold.__.cb:black._System".to_ftext
|
51
|
-
VtacFriendly::SystemTab.show remote_ip, server_name
|
53
|
+
VtacFriendly::SystemTab.show remote_ip, server_name, server_version, auth_required
|
52
54
|
|
53
55
|
R::Cr.go_to_pos(0, R::S.height)
|
54
56
|
R::C.color :gray, type: :bg, mode: :set
|
@@ -1,9 +1,11 @@
|
|
1
1
|
module VtacFriendly
|
2
2
|
module SystemTab
|
3
|
-
def show(ip, name)
|
3
|
+
def show(ip, name, version, password)
|
4
4
|
puts "
|
5
5
|
#{R::C.color :blue}#{R::F.bold}IP#{R::F.reset} #{ip}
|
6
6
|
#{R::C.color :blue}#{R::F.bold}Server name#{R::F.reset} #{name}
|
7
|
+
#{R::C.color :blue}#{R::F.bold}Version#{R::F.reset} #{version}
|
8
|
+
#{R::C.color :blue}#{R::F.bold}Authentication#{R::F.reset} #{password ? "enabled" : "disabled"}
|
7
9
|
"
|
8
10
|
end
|
9
11
|
|
@@ -22,6 +24,11 @@ module VtacFriendly
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def update(server)
|
27
|
+
R::Cr.go_to_pos(0, R::S.height-1)
|
28
|
+
R::C.color :gray, type: :bg, mode: :set
|
29
|
+
print "Updating..."
|
30
|
+
R::C.color :reset, type: :bg, mode: :set
|
31
|
+
|
25
32
|
server.puts VtacPacket.new(:command, "update")
|
26
33
|
VtacPacket.new(from_packet: server.gets)[:contents]
|
27
34
|
end
|
@@ -4,11 +4,27 @@ module VtacFriendly
|
|
4
4
|
server = TCPSocket.open(host, port)
|
5
5
|
|
6
6
|
init_pack = VtacPacket.new(from_packet: server.gets)
|
7
|
-
|
7
|
+
server_id = init_pack[:contents].split("~")
|
8
|
+
|
9
|
+
server_name = server_id[0]
|
10
|
+
server_version = server_id[1]
|
11
|
+
auth_required = server_id[2] ? true : false
|
8
12
|
|
9
13
|
server.puts VtacPacket.new(:id_client, "vtac_client")
|
10
14
|
|
11
|
-
|
15
|
+
if auth_required
|
16
|
+
print "Password: "
|
17
|
+
server.puts VtacPacket.new(:password, STDIN.gets.chomp)
|
18
|
+
|
19
|
+
response = VtacPacket.new(from_packet: server.gets)
|
20
|
+
|
21
|
+
if response[:type] == "error"
|
22
|
+
STDERR.puts "ERROR: " + response[:contents]
|
23
|
+
exit 1
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
return [server, server_name, server_version, auth_required]
|
12
28
|
end
|
13
29
|
|
14
30
|
module_function :connect
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module VtacFriendly
|
2
2
|
class VtacPacket
|
3
|
-
@@allowed_types = [:command, :response, :id_server, :id_client, :error, :disconnect]
|
3
|
+
@@allowed_types = [:command, :response, :id_server, :id_client, :error, :disconnect, :password]
|
4
4
|
|
5
5
|
def initialize(type=:response, contents="", from_packet:nil)
|
6
6
|
if !from_packet
|
data/lib/vtac_friendly.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vtacfriendly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: argparse
|