smartvpn-http-hooks 1.0.8 → 1.0.9

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
  SHA1:
3
- metadata.gz: eca1a1784ca0a4e66a794d3f0a92e64c8aff85d6
4
- data.tar.gz: 45a1a65ccb3d4172ca450e19f21dd0bf50485f05
3
+ metadata.gz: adbca499440e873ba306b23d15700c510aa66736
4
+ data.tar.gz: beffd5f61de8b1915eeaf58ad01a3e1d612237a6
5
5
  SHA512:
6
- metadata.gz: b7f2f48d7cb72eeb27223d4541563fec09df50857e5bc7fa947a9df2e5ae564050b305c637d6fdb778ea2a3d3ce48ef2edec11382e197d13c3d49c509c2c451a
7
- data.tar.gz: '0886876bd100b98ca3549fba05b93e79a6b884e4136e252d298526328a27a1f3af66709efabd977bbd44cef6ae1b9e8b01d7b1864be1b212634c4dc9bfd27f82'
6
+ metadata.gz: '0649906a93e371782375c1000605026943272a1a3db47b7e3aacd9718b876b559bf63a936e6f053f2c1f6827975e7351d196fcbcca5e55ff5374132f12264e26'
7
+ data.tar.gz: 467cb4e9e95d09ceb0a77e93445ecaeabe155a0d296001bc0e03e91bcc870a0c4061125f104e1afd9055ad458f0b9702278ed36fa338333de14766fb910d687f
data/.env CHANGED
@@ -1,3 +1,3 @@
1
1
  API_HOST=api.smartvpn.biz
2
- API_INITIALIZATION_KEY=secret
3
2
  HOSTNAME=test.smartvpn.biz
3
+ SECRET_TOKEN=secret
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smartvpn-http-hooks (1.0.7)
4
+ smartvpn-http-hooks (1.0.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -10,17 +10,12 @@ The main purpose of this gem - is to interact with remote API, located at billin
10
10
 
11
11
  This allows to authenticate user, track his connects/disconnects, apply hooks on connect/disconnect.
12
12
 
13
- ### Hooks
13
+ ## Installation
14
14
 
15
- Built-in hooks allow to implement following features for specific user:
15
+ It is assumed, that the gem is installed directly to VPS/docker image with OpenVPN server. So the preferred solution is to install it directly to the system, without `bundler` tool usage.
16
16
 
17
- * Automatic routing of I2P sites through I2P router
18
- * Automatic routing of TOR sites through TOR router
19
- * Applying selected proxy for all HTTP traffic of specific user
17
+ `gem install smartvpn-http-hooks`
20
18
 
21
- ### Disclaimer
22
-
23
- This is OpenSource, Free software. You may use it anyway you want. It is provided AS IS.
24
-
25
- Check out LICENSE file for more info.
19
+ ## Usage
26
20
 
21
+ TBD
@@ -40,13 +40,11 @@ module Api
40
40
 
41
41
  def data
42
42
  {
43
- # TODO: we should subscribe initial activation with secret key
44
- # instead of relying on node IP
45
- # secret_key: ENV['SECRET_KEY'],
46
- hostname: hostname,
47
- server_crt: server_crt,
48
- client_crt: client_crt,
49
- client_key: client_key
43
+ secret_token: secret_token,
44
+ hostname: hostname,
45
+ server_crt: server_crt,
46
+ client_crt: client_crt,
47
+ client_key: client_key
50
48
  }
51
49
  end
52
50
 
@@ -66,6 +64,10 @@ module Api
66
64
  "activate"
67
65
  end
68
66
 
67
+ def secret_token
68
+ ENV['SECRET_TOKEN']
69
+ end
70
+
69
71
  def read_pki(file)
70
72
  File.read("#{PKI_PATH}/#{file}")
71
73
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'smartvpn-http-hooks'
3
- s.version = '1.0.8'
3
+ s.version = '1.0.9'
4
4
  s.date = '2019-01-22'
5
5
  s.summary = "HTTP hooks for OpenVPN server"
6
6
  s.description = "Trigger on openvpn events and notify HTTP API"
@@ -24,10 +24,11 @@ describe Api::Activation do
24
24
  before do
25
25
  stub_request(:post, 'api.smartvpn.biz/api/activate')
26
26
  .with(body: {
27
- hostname: ENV['HOSTNAME'],
28
- server_crt: 'crt content',
29
- client_crt: 'client crt content',
30
- client_key: 'client key content'
27
+ secret_token: ENV['SECRET_TOKEN'],
28
+ hostname: ENV['HOSTNAME'],
29
+ server_crt: 'crt content',
30
+ client_crt: 'client crt content',
31
+ client_key: 'client key content'
31
32
  }
32
33
  )
33
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartvpn-http-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav Mekhonoshin