Mullvad’s list of available servers is constantly changing. That’s fine if you’re using their own client, but with a third-party client, like Wireguard’s own clients, it becomes a nuisance. Is my network down or is the server I’m connecting to down for maintenance? Who knows!
This Haskell program downloads the current server list, generates the configuration files, and outputs a ZIP archive.
I created this for personal use, without any intention of supporting end-users.
I am releasing this code for educational purposes, specifically because it’s written in Haskell and nobody writes mundane stuff like this in Haskell.
Create a JSON file called .peers.json
in the same directory following this format:
[
{
"name": "<Device name>",
"public_key": "<Public key>",
"private_key": "<Private key>",
"ipv4_address": "<IPv4 address>",
"ipv6_address": "<IPv6 address>",
"ports": [
"<Open ports>"
]
},
]
The IP addresses are specific to your peer. The easiest way to find out yours is by looking at the configuration generated on the Mullvad website.
There are no pre-built binaries, so you’ll have to build it yourself.
nix-build release.nix
./result/bin/create-mullvad-configs
Or using Nix flakes:
nix build --system x86_64-darwin
stack run
Cabal can’t automatically install some of the external dependencies.
If you’re using this method, make sure to install:
- zlib
- bzip2
cabal run