openvpn-status-web 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e284e2bfa9af607cc1dcf480aea291452236f17d46f651f1f4a46cbd3366815
|
4
|
+
data.tar.gz: 44f59ccf0600b94e28d4be6562aea461543246509e146e60d19f9eaa9b78cdb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2ecd99b9315c7762718f6a4c09e57eb7bd462bc567749df1b4f49098c8edb9f1d51bcd44baa80ebf4a2251902ddc0fb642a2b8168710ee8456301f86247c2a7
|
7
|
+
data.tar.gz: 53769708ca5dddde0a667a20fde4a8453fc4e93bc4a0670872826f8848665e9b8272cdc2039ee67e05787de4d909ca7c8e0732137e37310601301abed4746383
|
@@ -50,20 +50,36 @@ thead {
|
|
50
50
|
<div>
|
51
51
|
<table>
|
52
52
|
<thead>
|
53
|
-
|
54
|
-
|
55
|
-
<td class="
|
56
|
-
|
57
|
-
<td class="last">
|
53
|
+
<% status.client_list_headers.each_with_index do |header,i| %>
|
54
|
+
<% if i == 0 %>
|
55
|
+
<td class="first">
|
56
|
+
<% elsif i == status.client_list_headers.size-1 %>
|
57
|
+
<td class="last">
|
58
|
+
<% else %>
|
59
|
+
<td class="middle">
|
60
|
+
<% end %>
|
61
|
+
<%= header %></td>
|
62
|
+
<% end %>
|
58
63
|
</thead>
|
59
64
|
<tbody>
|
60
65
|
<% status.client_list.each do |client| %>
|
61
66
|
<tr>
|
62
|
-
|
63
|
-
|
64
|
-
<td class="
|
65
|
-
|
66
|
-
<td class="last"
|
67
|
+
<% status.client_list_headers.each_with_index do |header,i| %>
|
68
|
+
<% if i == 0 %>
|
69
|
+
<td class="first">
|
70
|
+
<% elsif i == status.client_list_headers.size-1 %>
|
71
|
+
<td class="last">
|
72
|
+
<% else %>
|
73
|
+
<td class="middle">
|
74
|
+
<% end %>
|
75
|
+
<% if header =~ /(Received|Sent)/ %>
|
76
|
+
<%= client[i].as_bytes %></td>
|
77
|
+
<% elsif client[i].is_a? DateTime %>
|
78
|
+
<%= client[i].strftime('%-d.%-m.%Y %H:%M:%S') %></td>
|
79
|
+
<% else %>
|
80
|
+
<%= client[i] %></td>
|
81
|
+
<% end %>
|
82
|
+
<% end %>
|
67
83
|
</tr>
|
68
84
|
<% end %>
|
69
85
|
</tbody>
|
@@ -74,18 +90,34 @@ thead {
|
|
74
90
|
<div>
|
75
91
|
<table>
|
76
92
|
<thead>
|
77
|
-
|
78
|
-
|
79
|
-
<td class="
|
80
|
-
|
93
|
+
<% status.routing_table_headers.each_with_index do |header,i| %>
|
94
|
+
<% if i == 0 %>
|
95
|
+
<td class="first">
|
96
|
+
<% elsif i == status.routing_table_headers.size-1 %>
|
97
|
+
<td class="last">
|
98
|
+
<% else %>
|
99
|
+
<td class="middle">
|
100
|
+
<% end %>
|
101
|
+
<%= header %></td>
|
102
|
+
<% end %>
|
81
103
|
</thead>
|
82
104
|
<tbody>
|
83
105
|
<% status.routing_table.each do |route| %>
|
84
106
|
<tr>
|
85
|
-
|
86
|
-
|
87
|
-
<td class="
|
88
|
-
|
107
|
+
<% status.routing_table_headers.each_with_index do |header,i| %>
|
108
|
+
<% if i == 0 %>
|
109
|
+
<td class="first">
|
110
|
+
<% elsif i == status.routing_table_headers.size-1 %>
|
111
|
+
<td class="last">
|
112
|
+
<% else %>
|
113
|
+
<td class="middle">
|
114
|
+
<% end %>
|
115
|
+
<% if route[i].is_a? DateTime %>
|
116
|
+
<%= route[i].strftime('%-d.%-m.%Y %H:%M:%S') %></td>
|
117
|
+
<% else %>
|
118
|
+
<%= route[i] %></td>
|
119
|
+
<% end %>
|
120
|
+
<% end %>
|
89
121
|
</tr>
|
90
122
|
<% end %>
|
91
123
|
</tbody>
|
@@ -11,23 +11,30 @@ module OpenVPNStatusWeb
|
|
11
11
|
|
12
12
|
text.lines.each do |line|
|
13
13
|
parts = line.strip.split(sep)
|
14
|
-
status.
|
15
|
-
status.
|
14
|
+
status.client_list_headers = parts[2..-1] if parts[0] == 'HEADER' && parts[1] == 'CLIENT_LIST'
|
15
|
+
status.client_list << parse_client(parts[1..-1], status.client_list_headers) if parts[0] == 'CLIENT_LIST'
|
16
|
+
status.routing_table_headers = parts[2..-1] if parts[0] == 'HEADER' && parts[1] == 'ROUTING_TABLE'
|
17
|
+
status.routing_table << parse_route(parts[1..-1], status.routing_table_headers) if parts[0] == 'ROUTING_TABLE'
|
16
18
|
status.global_stats << parse_global(parts[1..2]) if parts[0] == 'GLOBAL_STATS'
|
17
19
|
end
|
18
20
|
|
19
21
|
status
|
20
22
|
end
|
21
23
|
|
22
|
-
private_class_method def self.parse_client(client)
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
private_class_method def self.parse_client(client, headers)
|
25
|
+
headers.each_with_index do |header, i|
|
26
|
+
client[i] = parse_date(client[i]) if header.end_with?('Since')
|
27
|
+
client[i] = client[i].to_i if header.start_with?('Bytes')
|
28
|
+
end
|
29
|
+
|
26
30
|
client
|
27
31
|
end
|
28
32
|
|
29
|
-
private_class_method def self.parse_route(route)
|
30
|
-
|
33
|
+
private_class_method def self.parse_route(route, headers)
|
34
|
+
headers.each_with_index do |header, i|
|
35
|
+
route[i] = parse_date(route[i]) if header.end_with?('Last Ref')
|
36
|
+
end
|
37
|
+
|
31
38
|
route
|
32
39
|
end
|
33
40
|
|
@@ -35,6 +42,12 @@ module OpenVPNStatusWeb
|
|
35
42
|
global[1] = global[1].to_i
|
36
43
|
global
|
37
44
|
end
|
45
|
+
|
46
|
+
private_class_method def self.parse_date(date_string)
|
47
|
+
DateTime.strptime(date_string, '%a %b %d %k:%M:%S %Y')
|
48
|
+
rescue ArgumentError
|
49
|
+
DateTime.strptime(date_string, '%Y-%m-%d %k:%M:%S')
|
50
|
+
end
|
38
51
|
end
|
39
52
|
end
|
40
53
|
end
|
@@ -26,7 +26,9 @@ module OpenVPNStatusWeb
|
|
26
26
|
end
|
27
27
|
|
28
28
|
status = Status.new
|
29
|
+
status.client_list_headers = ['Common Name', 'Real Address', 'Data Received', 'Data Sent', 'Connected Since']
|
29
30
|
status.client_list = client_list[2..-1].map { |client| parse_client(client) }
|
31
|
+
status.routing_table_headers = ['Virtual Address', 'Common Name', 'Real Address', 'Last Ref']
|
30
32
|
status.routing_table = routing_table[1..-1].map { |route| parse_route(route) }
|
31
33
|
status.global_stats = global_stats.map { |global| parse_global(global) }
|
32
34
|
status
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openvpn-status-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Nicolai
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metriks
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.9.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.9.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rack-test
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,56 +156,56 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.24.0
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
166
|
+
version: 1.24.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rubocop-rake
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.
|
173
|
+
version: 0.6.0
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.
|
180
|
+
version: 0.6.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rubocop-rspec
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 2.
|
187
|
+
version: 2.7.0
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 2.
|
194
|
+
version: 2.7.0
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: solargraph
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.
|
201
|
+
version: 0.44.0
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.
|
208
|
+
version: 0.44.0
|
209
209
|
description: Small Rack (Ruby) application serving OpenVPN status file.
|
210
210
|
email:
|
211
211
|
executables:
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
- !ruby/object:Gem::Version
|
249
249
|
version: '0'
|
250
250
|
requirements: []
|
251
|
-
rubygems_version: 3.2.
|
251
|
+
rubygems_version: 3.2.32
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: openvpn-status-web
|