mullvadrb 0.0.7 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d3b81115b6138a117c121c0725b47153364d8dc37f8515a3e933491360fa7d1
4
- data.tar.gz: 795ea1aced15a02a1fd3bf4f43c154e63ac424ef039db87a888fac02070a2008
3
+ metadata.gz: bcce76c77dcaec5a39bed790a1cf9e79bc70b672e3ab2554364a0966a091ee23
4
+ data.tar.gz: 70f5c5c0fef4d6f411ac64cf7c65ac2c556adae915786b0004bd1ca031e4ca32
5
5
  SHA512:
6
- metadata.gz: 8c31f37cb83e5b10c0ede4534f6ba1590f0d51671b88fd9a710e5ac3dda1a69a51c0c88b197af82b6d40a62701d69afff3ca22bdf8ad817384852811ae57c62a
7
- data.tar.gz: 7fd4c145ea2e57481a48ff103fb9703f70c353d049fee924d1917fcb606b67e47b096ec9390e849cc667e93b2ecc4028326367f35b1593ad1632474a136ba41b
6
+ metadata.gz: b21c778bd76d1ef7fe71189ba841b509aa7638f269ffbccea7378a84541cf635b6421d06571b9723d33b7a499a041c47b7a7013581f5127c40e2ac137b3b0a81
7
+ data.tar.gz: 5117e187a732d9b8d258ac463a8fcbd9b1e4ea053733b69573e5da3fbc9c86aeadc608f7619808bb9e4c884ced4061fc0e0550bd536a2a05b6f39fde7c8f2e0f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
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
+
6
+ # 0.0.8
7
+
8
+ - Better status format and message for blocked connection.
9
+ - Adds allowing LAN access through mullvad-cli.
10
+
1
11
  # 0.0.7
2
12
 
3
13
  - Fixes settings configuration, updates Settings code.
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.
@@ -7,7 +7,7 @@ en:
7
7
  change_backend: "Change backend"
8
8
  choose_country: "Choose country"
9
9
  choose_specific: "Choose specific"
10
- connected: "📡 Connected \n"
10
+ connected: "📡 ✅ Connected"
11
11
  connecting: "📞 Connecting ☎ \n"
12
12
  connecting_to: "Connecting to %{server}"
13
13
  devices: "Devices"
@@ -33,3 +33,4 @@ en:
33
33
  language_es: "Spanish"
34
34
  dns_blockers: "DNS Blockers"
35
35
  dns_blockers_menu: "DNS Blockers - Press Enter↲ to confirm:"
36
+ lan: "Enable LAN access"
@@ -7,7 +7,7 @@ es:
7
7
  change_backend: "Cambiar backend"
8
8
  choose_country: "Elegir país"
9
9
  choose_specific: "Elegir específico"
10
- connected: "📡 Conectado \n"
10
+ connected: "📡 ✅ Conectado"
11
11
  connecting: "📞 Conectando ☎ \n"
12
12
  connecting_to: "Conectándose a %{server}"
13
13
  devices: "Dispositivos"
@@ -33,3 +33,4 @@ es:
33
33
  language_es: "Español"
34
34
  dns_blockers: "Bloqueadores DNS"
35
35
  dns_blockers_menu: "Bloqueadores DNS - Presiona Enter↲ para confirmar:"
36
+ lan: "Habilitar acceso LAN"
@@ -11,6 +11,7 @@ module Mullvadrb
11
11
 
12
12
  def devices
13
13
  puts `mullvad account list-devices`
14
+ puts
14
15
  end
15
16
  end
16
17
  end
@@ -50,5 +50,10 @@ module Mullvadrb
50
50
  Mullvadrb::Connection.connect
51
51
  end
52
52
  end
53
+
54
+ def lan
55
+ puts `mullvad lan set allow`
56
+ puts
57
+ end
53
58
  end
54
59
  end
@@ -1,3 +1,5 @@
1
+ require 'countries'
2
+
1
3
  module Mullvadrb
2
4
  #
3
5
  # Manage Mullvad connect, disconnect and status
@@ -31,12 +33,17 @@ module Mullvadrb
31
33
  status.gsub!('Disconnected', I18n.t(:disconnected))
32
34
  .gsub!(/$/, "\n")
33
35
  elsif status.start_with?('Connected')
34
- status = status.split("\n")
35
- .sort
36
- .reject { |a| a == 'Connected' }
37
- .prepend(I18n.t(:connected))
36
+ status = status.split("\n").reject { |a| a == 'Connected' }
37
+ country_name = status.find { |a| a.match?('Visible location') }
38
+ .gsub(/\s+Visible\ location:\s+/, '')
39
+ .split(',')[0]
40
+ country = ISO3166::Country.find_country_by_any_name(country_name)
41
+ status = status.prepend("#{I18n.t(:connected)} to #{country.emoji_flag} #{country.common_name}\n")
38
42
  .push("\n")
39
43
  .join("\n")
44
+ # Blocked: Failure to generate tunnel parameters: Failure to select a matching tunnel relay
45
+ elsif status.start_with?('Blocked')
46
+ status.prepend("\n🚧 ").concat("\n")
40
47
  elsif status.start_with?('Connecting')
41
48
  status = status.split("\n")
42
49
  .sort
@@ -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 = data.split("\n").compact.reject(&:empty?).map do |s|
13
- if s.start_with?("\t\t")
14
- info = s.gsub("\t\t", '')
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 s.start_with?("\t")
17
- city = s.gsub("\t", '').split("(").first.strip
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 = s.match(regexp)[1]
22
- .upcase
23
- .codepoints
24
- .map { |c| (c + 127397).chr('utf-8') }.join
25
- country = s.gsub(regexp, '').strip
23
+ flag = line.match(regexp)[1]
24
+ .upcase
25
+ .codepoints
26
+ .map { |c| (c + 127_397).chr('utf-8') }.join
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(I18n.t(:select_country), countries(servers), cycle: true, per_page: 10, filter: true, symbols: { marker: '🛫' })
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
@@ -30,7 +30,13 @@ module Mullvadrb
30
30
  def specific
31
31
  connections = CONNECTIONS.map { |c| { name: "#{c[:value]} #{c[:name]}", value: c[:value] } }
32
32
  connect(
33
- TTY::Prompt.new.select('Select configuration file', connections, cycle: true, per_page: 30, filter: true)
33
+ TTY::Prompt.new.select(
34
+ 'Select configuration file',
35
+ connections,
36
+ cycle: true,
37
+ per_page: 30,
38
+ filter: true
39
+ )
34
40
  )
35
41
  end
36
42
 
data/lib/mullvadrb.rb CHANGED
@@ -46,7 +46,8 @@ module Mullvadrb
46
46
  "🔌 #{I18n.t(:disconnect)}" => 'disconnect',
47
47
  "⚙ #{I18n.t(:change_backend)}" => 'backend',
48
48
  "🗣 #{I18n.t(:languages)}" => 'languages',
49
- "📟 #{I18n.t(:dns_blockers)}" => 'dns_blockers'
49
+ "📟 #{I18n.t(:dns_blockers)}" => 'dns_blockers',
50
+ "📞 #{I18n.t(:lan)}" => 'lan'
50
51
  }
51
52
  end
52
53
 
@@ -66,7 +67,7 @@ module Mullvadrb
66
67
  exit if selection == 'exit'
67
68
 
68
69
  case selection
69
- when 'status', 'disconnect', 'country', 'specific', 'random'
70
+ when 'status', 'disconnect', 'country', 'specific', 'random', 'lan'
70
71
  send(selection)
71
72
  when 'backend'
72
73
  ask_backend
data/mullvadrb.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mullvadrb'
3
- s.version = '0.0.7'
3
+ s.version = '0.0.9'
4
4
  s.summary = 'A TUI to use with Mullvad VPN'
5
5
  s.description = 'A Terminal User Interface to use with Mullvad VPN'
6
6
  s.authors = ['Fernando Briano']
@@ -11,10 +11,11 @@ Gem::Specification.new do |s|
11
11
  s.license = 'GPL-3.0-only'
12
12
  s.required_ruby_version = '>= 3.0'
13
13
  s.executables << 'mullvadrb'
14
- s.add_dependency 'countries'
14
+ s.add_dependency 'countries', '~> 7'
15
15
  s.add_dependency 'i18n', '~> 1'
16
- s.add_dependency 'tty-prompt'
16
+ s.add_dependency 'tty-prompt', '~> 0.23'
17
17
  s.metadata = {
18
+ 'homepage_uri' => 'https://github.com/picandocodigo/mullvadrb/',
18
19
  'bug_tracker_uri' => 'https://github.com/picandocodigo/mullvadrb/issues',
19
20
  'changelog_uri' => 'https://github.com/picandocodigo/mullvadrb/blob/master/CHANGELOG.md',
20
21
  'source_code_uri' => 'https://github.com/picandocodigo/mullvadrb'
metadata CHANGED
@@ -1,28 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mullvadrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
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: 2025-05-13 00:00:00.000000000 Z
10
+ date: 2026-01-05 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: countries
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ">="
16
+ - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '0'
18
+ version: '7'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - ">="
23
+ - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '0'
25
+ version: '7'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: i18n
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -41,16 +41,16 @@ dependencies:
41
41
  name: tty-prompt
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: '0.23'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: '0.23'
54
54
  description: A Terminal User Interface to use with Mullvad VPN
55
55
  email: fernando@picandocodigo.net
56
56
  executables:
@@ -79,6 +79,7 @@ homepage: https://github.com/picandocodigo/mullvad-ruby
79
79
  licenses:
80
80
  - GPL-3.0-only
81
81
  metadata:
82
+ homepage_uri: https://github.com/picandocodigo/mullvadrb/
82
83
  bug_tracker_uri: https://github.com/picandocodigo/mullvadrb/issues
83
84
  changelog_uri: https://github.com/picandocodigo/mullvadrb/blob/master/CHANGELOG.md
84
85
  source_code_uri: https://github.com/picandocodigo/mullvadrb