riseup_vpn 1.0.0 → 1.1.0
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 +4 -4
- data/CHANGELOG.md +8 -2
- data/README.md +12 -5
- data/Rakefile +0 -2
- data/lib/riseup_vpn/manager.rb +7 -0
- data/lib/riseup_vpn/nmcli.rb +16 -0
- data/lib/riseup_vpn/utils.rb +4 -0
- data/lib/riseup_vpn/version.rb +1 -1
- data/lib/riseup_vpn.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9fb7defcb7a949292d44dc949acfdc4524eb599a21ec1c90f5f1680c8b9d0ff
|
4
|
+
data.tar.gz: dcbb98a3d236a6bf35d3fab3f073549836e98d976a747a4dd134417f6f3ad43e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01bf804c22e6edde11abfd61073f3a9093d33b9463e05f5456aa66f7537e44e19ef37708979499ca8193b05045439acdba5b3a46337ef4edc219053e9603e373
|
7
|
+
data.tar.gz: 219ee6e1de2521e85e94a558e28dda6347b3cb74e288bb293f04a86599975f76e00f4477b1d73493562403971f2e0435ff9fb4bde77404a774a690bd489dbd7f
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [1.
|
3
|
+
## [1.1.0] - 2025-04-22
|
4
4
|
|
5
5
|
### New features
|
6
6
|
|
7
|
-
-
|
7
|
+
- add ability to import VPN client configs into Network Manager (Linux)
|
8
|
+
|
9
|
+
## [1.0.0] - 2025-04-21
|
8
10
|
|
9
11
|
### Breaking changes
|
10
12
|
|
@@ -12,6 +14,10 @@
|
|
12
14
|
- `#write_files` no longer takes an dir path arg
|
13
15
|
- All errors subclass `RiseupVPN::Error`
|
14
16
|
|
17
|
+
### New features
|
18
|
+
|
19
|
+
- upgrade TLS to 1.3, if supported by client
|
20
|
+
|
15
21
|
## [0.1.0] - 2025-04-19
|
16
22
|
|
17
23
|
- Initial release
|
data/README.md
CHANGED
@@ -28,20 +28,20 @@ gem install riseup_vpn
|
|
28
28
|
```ruby
|
29
29
|
require 'riseup_vpn'
|
30
30
|
|
31
|
-
manager = RiseupVPN::Manager.new # takes an optional positional arg for the dir path. Default is '~/.config/riseup_vpn'
|
31
|
+
@manager = RiseupVPN::Manager.new # takes an optional positional arg for the dir path. Default is '~/.config/riseup_vpn'
|
32
32
|
# => instance_of RiseupVPN::Manager
|
33
33
|
|
34
|
-
manager.ovpns
|
34
|
+
@manager.ovpns
|
35
35
|
# => {"vpn01-sea.riseup.net" => "client\ntls-client\ndev tun\nproto udp\nremote 204.13.164.252 1194 ...
|
36
36
|
|
37
|
-
manager.ovpns.size
|
37
|
+
@manager.ovpns.size
|
38
38
|
# => 21
|
39
39
|
|
40
40
|
RiseupVPN::Manager::OPTS # returns a list of valid options which maybe passed as an optional hash at initialization.
|
41
41
|
# => {proto: ["udp", "tcp"]} defaults are the first values e.g. 'udp' for :proto
|
42
42
|
# For example; RiseupVPN::Manager.new('/some/path', proto: 'tcp')
|
43
43
|
|
44
|
-
manager.write_files # (over)writes the VPN client config files to the dir path
|
44
|
+
@manager.write_files # (over)writes the VPN client config files to the dir path
|
45
45
|
```
|
46
46
|
The last command creates (or overwrites) the following files:
|
47
47
|
- an .ovpn file for each VPN gateway
|
@@ -49,9 +49,16 @@ The last command creates (or overwrites) the following files:
|
|
49
49
|
- the client private key file (client.key)
|
50
50
|
- the client cert file (client.crt)
|
51
51
|
|
52
|
-
Note: The last 2 expire after 30 days and therefore need to be updated regularly
|
52
|
+
Note: The last 2 expire after 30 days and therefore need to be updated regularly.
|
53
|
+
|
53
54
|
Also note: OpenVPN requires that cert & key files shared across .ovpn client config files are present in the same directory.
|
54
55
|
|
56
|
+
On Linux, you can do this to make Riseup's VPNs available in Network Manager. It uses `nmcli` under the hood:
|
57
|
+
```Ruby
|
58
|
+
@manager.import_ovpn_configs # writes the files and (re)imports the VPN configs into Network Manager
|
59
|
+
# the client key and cert files are updated too
|
60
|
+
```
|
61
|
+
|
55
62
|
## \_why?
|
56
63
|
|
57
64
|
I can use Riseup's white-labeled [desktop app](https://leap.se) to access Riseup's VPNs, so why the need?
|
data/Rakefile
CHANGED
data/lib/riseup_vpn/manager.rb
CHANGED
@@ -26,6 +26,13 @@ module RiseupVPN
|
|
26
26
|
raise ArgumentError, "Dir #{@dir} doesn't exist or isn't writable"
|
27
27
|
end
|
28
28
|
|
29
|
+
def import_ovpn_configs
|
30
|
+
raise NoMethodError, 'nmcli does not appear to be installed' unless Utils.nmcli?
|
31
|
+
|
32
|
+
write_files
|
33
|
+
Dir["#{@dir}/*.ovpn"].each { |f| Nmcli.import_openvpn f }
|
34
|
+
end
|
35
|
+
|
29
36
|
private
|
30
37
|
|
31
38
|
def write_ovpn_files
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'generator'
|
4
|
+
|
5
|
+
module RiseupVPN
|
6
|
+
# in the absence of an nmcli gem..
|
7
|
+
module Nmcli
|
8
|
+
def self.nmcli(command_string)
|
9
|
+
`nmcli #{command_string}`
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.import_openvpn(file)
|
13
|
+
nmcli "con import type openvpn file #{file}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/riseup_vpn/utils.rb
CHANGED
data/lib/riseup_vpn/version.rb
CHANGED
data/lib/riseup_vpn.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riseup_vpn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MatzFan
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- lib/riseup_vpn/errors.rb
|
27
27
|
- lib/riseup_vpn/generator.rb
|
28
28
|
- lib/riseup_vpn/manager.rb
|
29
|
+
- lib/riseup_vpn/nmcli.rb
|
29
30
|
- lib/riseup_vpn/template_ovpn.yml
|
30
31
|
- lib/riseup_vpn/utils.rb
|
31
32
|
- lib/riseup_vpn/version.rb
|
@@ -53,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: '0'
|
55
56
|
requirements: []
|
56
|
-
rubygems_version: 3.7
|
57
|
+
rubygems_version: 3.6.7
|
57
58
|
specification_version: 4
|
58
59
|
summary: RiseupVPN configuration
|
59
60
|
test_files: []
|