openvpn-status-web 3.2.1 → 3.3.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: 43df4db93196fada6047a63bfa0862c769f0bdff920526b9e3bb7d2b79afb64a
|
4
|
+
data.tar.gz: b27c4d5ae1e0f708c46aa57696f5e1ce2ac8fc62a7890642dc19e888d237f277
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dac1602a2f5426fa5a7cbb38bf422da51ba32f37a53fed82e949144b9d06c22e0bfe6b2fb8831bf03f14502547b2ef3caef4d8bde359a9dde3202eaf377d778
|
7
|
+
data.tar.gz: b769a52aa4b5c835b3e0c01038f73285dca49d2ee6ad48362720d9a6393b7626a38b8733e55c5ee80e8051c203102c8f76e897968c971e90e944bdca3ab6815c
|
@@ -13,10 +13,10 @@ module OpenVPNStatusWeb
|
|
13
13
|
|
14
14
|
text.lines.each do |line|
|
15
15
|
parts = line.strip.split(sep)
|
16
|
-
status.client_list_headers = parts[2
|
17
|
-
status.client_list << parse_client(parts[1
|
18
|
-
status.routing_table_headers = parts[2
|
19
|
-
status.routing_table << parse_route(parts[1
|
16
|
+
status.client_list_headers = parts[2..] if parts[0] == 'HEADER' && parts[1] == 'CLIENT_LIST'
|
17
|
+
status.client_list << parse_client(parts[1..], status.client_list_headers) if parts[0] == 'CLIENT_LIST'
|
18
|
+
status.routing_table_headers = parts[2..] if parts[0] == 'HEADER' && parts[1] == 'ROUTING_TABLE'
|
19
|
+
status.routing_table << parse_route(parts[1..], status.routing_table_headers) if parts[0] == 'ROUTING_TABLE'
|
20
20
|
status.global_stats << parse_global(parts[1..2]) if parts[0] == 'GLOBAL_STATS'
|
21
21
|
end
|
22
22
|
|
@@ -27,9 +27,9 @@ module OpenVPNStatusWeb
|
|
27
27
|
|
28
28
|
status = Status.new
|
29
29
|
status.client_list_headers = ['Common Name', 'Real Address', 'Data Received', 'Data Sent', 'Connected Since']
|
30
|
-
status.client_list = client_list[2
|
30
|
+
status.client_list = client_list[2..].map { |client| parse_client(client) }
|
31
31
|
status.routing_table_headers = ['Virtual Address', 'Common Name', 'Real Address', 'Last Ref']
|
32
|
-
status.routing_table = routing_table[1
|
32
|
+
status.routing_table = routing_table[1..].map { |route| parse_route(route) }
|
33
33
|
status.global_stats = global_stats.map { |global| parse_global(global) }
|
34
34
|
status
|
35
35
|
end
|
data/lib/openvpn-status-web.rb
CHANGED
@@ -7,9 +7,10 @@ require 'logger'
|
|
7
7
|
require 'ipaddr'
|
8
8
|
require 'yaml'
|
9
9
|
require 'rack'
|
10
|
+
require 'rackup'
|
10
11
|
require 'erb'
|
11
12
|
require 'metriks'
|
12
|
-
require 'better_errors' if ENV
|
13
|
+
require 'better_errors' if ENV.fetch('RACK_ENV', nil) == 'development'
|
13
14
|
|
14
15
|
require 'openvpn-status-web/status'
|
15
16
|
require 'openvpn-status-web/parser/v1'
|
@@ -128,21 +129,21 @@ module OpenVPNStatusWeb
|
|
128
129
|
|
129
130
|
# configure rack
|
130
131
|
app = Daemon.new(config['vpns'])
|
131
|
-
if ENV
|
132
|
+
if ENV.fetch('RACK_ENV', nil) == 'development'
|
132
133
|
app = BetterErrors::Middleware.new(app)
|
133
134
|
BetterErrors.application_root = File.expand_path(__dir__)
|
134
135
|
end
|
135
136
|
|
136
137
|
Signal.trap('INT') do
|
137
138
|
OpenVPNStatusWeb.logger.info 'Quitting...'
|
138
|
-
|
139
|
+
Rackup::Handler::WEBrick.shutdown
|
139
140
|
end
|
140
141
|
Signal.trap('TERM') do
|
141
142
|
OpenVPNStatusWeb.logger.info 'Quitting...'
|
142
|
-
|
143
|
+
Rackup::Handler::WEBrick.shutdown
|
143
144
|
end
|
144
145
|
|
145
|
-
|
146
|
+
Rackup::Handler::WEBrick.run app, Host: config['host'], Port: config['port']
|
146
147
|
end
|
147
148
|
end
|
148
149
|
end
|
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.3.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: 2022-
|
11
|
+
date: 2022-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metriks
|
@@ -30,14 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '3.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rackup
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: webrick
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +170,14 @@ dependencies:
|
|
156
170
|
requirements:
|
157
171
|
- - "~>"
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
173
|
+
version: 1.36.0
|
160
174
|
type: :development
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - "~>"
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
180
|
+
version: 1.36.0
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: rubocop-rake
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,28 +198,28 @@ dependencies:
|
|
184
198
|
requirements:
|
185
199
|
- - "~>"
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version: 2.
|
201
|
+
version: 2.13.1
|
188
202
|
type: :development
|
189
203
|
prerelease: false
|
190
204
|
version_requirements: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
206
|
- - "~>"
|
193
207
|
- !ruby/object:Gem::Version
|
194
|
-
version: 2.
|
208
|
+
version: 2.13.1
|
195
209
|
- !ruby/object:Gem::Dependency
|
196
210
|
name: solargraph
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
213
|
- - "~>"
|
200
214
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.
|
215
|
+
version: 0.46.0
|
202
216
|
type: :development
|
203
217
|
prerelease: false
|
204
218
|
version_requirements: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
220
|
- - "~>"
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.
|
222
|
+
version: 0.46.0
|
209
223
|
description: Small Rack (Ruby) application serving OpenVPN status file.
|
210
224
|
email:
|
211
225
|
executables:
|
@@ -241,14 +255,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
241
255
|
requirements:
|
242
256
|
- - ">="
|
243
257
|
- !ruby/object:Gem::Version
|
244
|
-
version: '2.
|
258
|
+
version: '2.7'
|
245
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
246
260
|
requirements:
|
247
261
|
- - ">="
|
248
262
|
- !ruby/object:Gem::Version
|
249
263
|
version: '0'
|
250
264
|
requirements: []
|
251
|
-
rubygems_version: 3.
|
265
|
+
rubygems_version: 3.3.7
|
252
266
|
signing_key:
|
253
267
|
specification_version: 4
|
254
268
|
summary: openvpn-status-web
|