Skip to content

Generate Wireguard™ configurations for Mullvad.

License

Notifications You must be signed in to change notification settings

sandydoo/MullvadConfigs

Repository files navigation

Mullvad Configs

Generate Wireguard™ configurations for Mullvad.




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.


Disclaimer❗

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.


Usage

Configuration

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.

Building

There are no pre-built binaries, so you’ll have to build it yourself.

Build with Nix

nix-build release.nix
./result/bin/create-mullvad-configs

Or using Nix flakes:

nix build --system x86_64-darwin

Build with Stack

stack run

Build with Cabal

Cabal can’t automatically install some of the external dependencies.

If you’re using this method, make sure to install:

  • zlib
  • bzip2
cabal run

License

BSD-3-Clause © Sander Melnikov.