adit — several WireGuard tunnels, at once

An open-source client for WireGuard® tunnels that keeps several of them up at once, with a menu bar icon and a command line that do the same things. macOS now; Linux and Windows later.

Why it exists

The official WireGuard app for macOS keeps one tunnel up at a time and has no command line. wg-quick runs several, but asks for the administrator password on every use and does not come back after a reboot. adit covers both.

What it does

Several tunnels at once

Each routes only its own networks. A tunnel whose networks or DNS domain overlap one that is up, adit's or another program's, is refused before it connects, with the reason.

Menu bar and command line, one state

Both talk to one privileged service, aditd, so a tunnel switched in one flips in the other at once.

JSON for scripts and agents

Every command answers in plain words, or in JSON with --json, with exit codes that mean something.

Back after a reboot

The tunnels you choose come up at boot, before anyone logs in, and follow network changes.

No password for daily use

The administrator password is asked once, at install. Switching tunnels needs none.

DNS per tunnel

DNS = 10.0.0.1, corp.example sends names under corp.example to 10.0.0.1 and leaves every other name alone.

Honest status

The last handshake and the bytes each way, not just “connected”.

Plain .conf files

The same WireGuard files wg-quick and the official apps read, in and out. No lock-in.

Other tunnels, read-only

The WireGuard app's and wg-quick's tunnels are shown, with wg-quick's handshakes and counters. adit never changes them.

Install

brew install saulo-pro/tap/adit
sudo adit install

sudo adit install copies aditd to /Library/PrivilegedHelperTools/pro.saulo.adit, where only root can change it, and starts it now and at every boot. It also sets the menu bar icon to start at every login, and creates the adit group with you in it. Run it again after every brew upgrade adit.

Use

sudo adit import work.conf     # add a tunnel; hook lines are kept but never run
adit up work                   # no password
adit status                    # every tunnel, adit's and other software's
adit status work --json
adit autostart work on         # bring it up at boot
adit down work
sudo adit export work --output work.conf   # a new file, readable only by you
sudo adit remove work
sudo adit allow debora         # let another account switch tunnels
sudo adit uninstall            # removes aditd, the group and every tunnel with its keys

Exit codes: 0 done; 1 failed, with the reason; 2 wrong usage; 3 aditd not reachable; 4 not allowed; 5 no such tunnel; 6 refused because of a conflict.

Security

How it is built

PartWhat it does
aditdThe root service, started at boot by a LaunchDaemon. It runs each tunnel with wireguard-go on its own utun interface and sets addresses and routes the way wg-quick does.
aditThe command line, a client of aditd's socket.
Menu bar iconAnother client of the same socket.

Written in Go, MIT licensed.

Status

0.1.0 is the first macOS version. Full tunnels (AllowedIPs = 0.0.0.0/0) come in the next version: adit refuses them for now, saying so. Linux and Windows come after macOS.

Read the brief, which says what adit must do, and the decisions, which say why it is built this way, or the source on GitHub.