Project

mullvadrb

0.0
The project is in a healthy, maintained state
A Terminal User Interface to use with Mullvad VPN
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 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.

mullvad

The app has two "backends", Mullvad CLI or WireGuard.

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 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 and follow the instructions on Mullvad: WireGuard on Linux terminal. 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 <connected server (e.g. uy-mma-wg-001)> # Connect with WireGuard
$ curl https://am.i.mullvad.net/connected # Check if you're connected to Mullvad
$ wg-quick down <connected server> # 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 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:

$ irb -Ilib -rmullvadrb