mullvadrb 0.0.8 → 0.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -0
- data/lib/mullvadrb/connection.rb +3 -1
- data/lib/mullvadrb/servers.rb +17 -8
- data/mullvadrb.gemspec +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: bcce76c77dcaec5a39bed790a1cf9e79bc70b672e3ab2554364a0966a091ee23
|
|
4
|
+
data.tar.gz: 70f5c5c0fef4d6f411ac64cf7c65ac2c556adae915786b0004bd1ca031e4ca32
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b21c778bd76d1ef7fe71189ba841b509aa7638f269ffbccea7378a84541cf635b6421d06571b9723d33b7a499a041c47b7a7013581f5127c40e2ac137b3b0a81
|
|
7
|
+
data.tar.gz: 5117e187a732d9b8d258ac463a8fcbd9b1e4ea053733b69573e5da3fbc9c86aeadc608f7619808bb9e4c884ced4061fc0e0550bd536a2a05b6f39fde7c8f2e0f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# 0.0.9
|
|
2
|
+
|
|
3
|
+
- Refactors server update, removes OpenVPN options. OpenVPN support is being removed on January 15th, 2026: https://mullvad.net/en/blog/final-reminder-for-openvpn-removal
|
|
4
|
+
- Refactors country code, fixes an issue with space in names.
|
|
5
|
+
|
|
1
6
|
# 0.0.8
|
|
2
7
|
|
|
3
8
|
- Better status format and message for blocked connection.
|
data/README.md
CHANGED
|
@@ -8,6 +8,8 @@ The app has two "backends", [Mullvad CLI](https://mullvad.net/en/help/how-use-mu
|
|
|
8
8
|
|
|
9
9
|
Most of the basic functionality is available for either backend: Select a server (random, by country, specific server), connect, disconnect and show the current status. You can use either backend. The first time you run the app, it's going to ask you which one you want to use, and save your preference in `~/.local/share/mullvadrb/mullvardrb.yml`. You can switch backends from the Main Menu on the app at any time.
|
|
10
10
|
|
|
11
|
+
Also on [Codeberg](https://codeberg.org/picandocodigo/mullvadrb)
|
|
12
|
+
|
|
11
13
|
## Requirements
|
|
12
14
|
|
|
13
15
|
You need to have a [Mullvad VPN](https://mullvad.net) account to use the app.
|
data/lib/mullvadrb/connection.rb
CHANGED
|
@@ -34,7 +34,9 @@ module Mullvadrb
|
|
|
34
34
|
.gsub!(/$/, "\n")
|
|
35
35
|
elsif status.start_with?('Connected')
|
|
36
36
|
status = status.split("\n").reject { |a| a == 'Connected' }
|
|
37
|
-
country_name = status.find { |a| a.match?('Visible location') }
|
|
37
|
+
country_name = status.find { |a| a.match?('Visible location') }
|
|
38
|
+
.gsub(/\s+Visible\ location:\s+/, '')
|
|
39
|
+
.split(',')[0]
|
|
38
40
|
country = ISO3166::Country.find_country_by_any_name(country_name)
|
|
39
41
|
status = status.prepend("#{I18n.t(:connected)} to #{country.emoji_flag} #{country.common_name}\n")
|
|
40
42
|
.push("\n")
|
data/lib/mullvadrb/servers.rb
CHANGED
|
@@ -8,21 +8,23 @@ module Mullvadrb
|
|
|
8
8
|
data = `mullvad relay list`
|
|
9
9
|
country, city, info, flag = nil
|
|
10
10
|
|
|
11
|
+
# Remove empty lines, and OpenVPN lines
|
|
12
|
+
server_data = data.split("\n").compact.reject(&:empty?)
|
|
11
13
|
# Each line is either a country, a city or a server
|
|
12
|
-
servers =
|
|
13
|
-
if
|
|
14
|
-
info =
|
|
14
|
+
servers = server_data.reject { |a| a.include?('ovpn') }.map do |line|
|
|
15
|
+
if line.start_with?("\t\t")
|
|
16
|
+
info = line.gsub("\t\t", '')
|
|
15
17
|
{ country: country, city: city, info: info, flag: flag, value: info.split(' ').first }
|
|
16
|
-
elsif
|
|
17
|
-
city =
|
|
18
|
+
elsif line.start_with?("\t")
|
|
19
|
+
city = line.gsub("\t", '').split('(').first.strip
|
|
18
20
|
next
|
|
19
21
|
else
|
|
20
22
|
regexp = /\(([a-z]{2})\)/ # Country (xx) - Country name + code and group code
|
|
21
|
-
flag =
|
|
23
|
+
flag = line.match(regexp)[1]
|
|
22
24
|
.upcase
|
|
23
25
|
.codepoints
|
|
24
26
|
.map { |c| (c + 127_397).chr('utf-8') }.join
|
|
25
|
-
country =
|
|
27
|
+
country = line.gsub(regexp, '').strip
|
|
26
28
|
next
|
|
27
29
|
end
|
|
28
30
|
end.compact
|
|
@@ -34,7 +36,14 @@ module Mullvadrb
|
|
|
34
36
|
|
|
35
37
|
def select_country
|
|
36
38
|
servers = @servers
|
|
37
|
-
country = TTY::Prompt.new.select(
|
|
39
|
+
country = TTY::Prompt.new.select(
|
|
40
|
+
I18n.t(:select_country),
|
|
41
|
+
countries(servers),
|
|
42
|
+
cycle: true,
|
|
43
|
+
per_page: 10,
|
|
44
|
+
filter: true,
|
|
45
|
+
symbols: { marker: '🛫' }
|
|
46
|
+
)
|
|
38
47
|
connection = servers.select do |s|
|
|
39
48
|
s[:country] == country
|
|
40
49
|
end.sample
|
data/mullvadrb.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mullvadrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fernando Briano
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-01-05 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: countries
|