SixFoisNeuf

Totally irregular blog on computers and security


wgmgr: a Wireguard server configuration manager

Posted on Jun 15, 2023

Hey! I have released a first version of a small program I made to scratch an itch: wgmgr. I use Wireguard as a VPN solution, but I wanted a fancier way to manage clients: manually generating keys is doable, but it becomes a pain on mobile devices for example.

I’m aware of the existence of wg-easy, wireguard-ui, and a plethora of other Wireguard interfaces. I don’t want something web-based. Ideally, what I was looking for was a simple command-line interface to generate Wiregard configs tailored to my server.

wgmgr does just that. I manages your wg0.conf file on your Wireguard server, can add / remove peers from it, and generate each peer’s configuration file for connecting to the server. Of course, this means that it knows about your clients’ private keys.

The way peers are identified is with a simple comment before each “[Peer]” stanza in the configuration file. That’s how I did it before having a script, and this removes the need from storing links between public keys and peer names in a database.

I first wrote up something hacky in Python, which worked decently well but wasn’t robust at all, and had a bunch of hardcoded stuff. Because I’m currently learning Rust, I decided to “rewrite it in Rust” before releasing it.

I consider this software feature-complete. It’s used in production by at least one (1) individual (me). It does what I need, and gets out of the way doing it.

The code’s here: https://git.sixfoisneuf.fr/wgmgr/about

There’s a precompiled Linux binary here: https://git.sixfoisneuf.fr/releases/wgmgr/latest/

I hope it will be useful to you!

Send your comment via e-mail