https://github.com/picandocodigo/mullvadrb
Ruby Terminal User Interface for Mullvad VPN
https://github.com/picandocodigo/mullvadrb
mullvad mullvad-vpn ruby tui
Last synced: about 2 months ago
JSON representation
Ruby Terminal User Interface for Mullvad VPN
- Host: GitHub
- URL: https://github.com/picandocodigo/mullvadrb
- Owner: picandocodigo
- License: gpl-3.0
- Created: 2024-10-15T21:13:18.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-21T22:16:44.000Z (7 months ago)
- Last Synced: 2025-04-11T12:05:10.224Z (3 months ago)
- Topics: mullvad, mullvad-vpn, ruby, tui
- Language: Ruby
- Homepage: https://rubygems.org/gems/mullvadrb
- Size: 44.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Ruby TUI for Mullvad VPN
This is a Terminal App I wrote for myself to use with Mullvad VPN on Linux. It makes it easier for me to choose servers when using Mullvad from the command line.

The app has two "backends", [Mullvad CLI](https://mullvad.net/en/help/how-use-mullvad-cli) or [WireGuard](https://mullvad.net/en/help/wireguard-and-mullvad-vpn).
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.
## Requirements
You need to have a [Mullvad VPN](https://mullvad.net) account to use the app.
> [!WARNING]
> `mullvad` uses WireGuard, so if you change backends while connected to an OpenVPN server with `wg`, `mullvad` won't be able to disconnect from the OpenVPN connection.
> In general, it's a good idea to stick to one backend, and disconnect from the VPN before switching backends.
> This might potentially be fixed in the future.### For the WireGuard backend
You need to [install WireGuard](https://www.wireguard.com/install/) and follow the instructions on [Mullvad: WireGuard on Linux terminal](https://mullvad.net/en/help/wireguard-and-mullvad-vpn). The configuration script you are asked to run in this last link will download the WireGuard configuration files needed to `/etc/wireguard`.
The app is basically a layer on top of `wg-quick`. The scripts it runs are:
```
$ wg-quick up # Connect with WireGuard
$ curl https://am.i.mullvad.net/connected # Check if you're connected to Mullvad
$ wg-quick down # Disconnect
```
It uses `sudo` to read the files on `/etc/wireguard` and execute `wg-quick` for connecting and disconnecting.### For the Mullvad CLI backend
You need to install [the Mullvad CLI](https://mullvad.net/en/download/vpn/linux) to use this backend.
On first run, you need to log in (unless you've already run `mullvad account login` on your terminal before). The servers list will be updated and will be saved to `~/.local/share/mullvadrb.dump`. You can update the server list at any time from the main menu.
## Development
Run gem from the source:
```bash
$ irb -Ilib -rmullvadrb
```