Skip to main content

Manage WireGuard peers on a Debian VPS

Project description

wgpeer

Manage WireGuard peers on a Debian 12 VPS.

Installation

uv tool install wgpeer

Or run without installing:

uvx wgpeer --help

Usage

Must be run as root with WireGuard installed.

On first use, run init to create the config file:

sudo wgpeer init

This detects your server's public IP from ip a and writes /etc/wgpeer/config.toml. You'll be prompted to confirm or enter the IP manually if none is detected.

sudo wgpeer add <name>     # Add a new peer (auto-assigns IP, shows QR code)
sudo wgpeer remove <name>  # Remove an existing peer
sudo wgpeer list           # List all peers with IPs and public keys
sudo wgpeer qr <name>      # Display QR code for an existing peer

Configuration

Server settings are stored in /etc/wgpeer/config.toml (created by wgpeer init). All fields except server_ip have defaults:

server_ip = "1.2.3.4"
server_port = 51820
wg_interface = "wg0"
wg_dir = "/etc/wireguard"
subnet = "10.0.0.0/24"
dns = "10.0.0.1"
keepalive = 25

Template Override

To customise the client config template, place a Jinja2 template at /etc/wgpeer/client.conf.j2. Available variables: private_key, ip, dns, server_pub, server_ip, port, keepalive.

Building and Publishing

uv build
uv publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wgpeer-0.3.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wgpeer-0.3.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file wgpeer-0.3.0.tar.gz.

File metadata

  • Download URL: wgpeer-0.3.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wgpeer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d3b62becaebd5f3d03ae7fac486cf31f4975121af8c0222cd6c265e015fdf226
MD5 e3a77e556d6f90b8cac9618b65790c5f
BLAKE2b-256 486031b4565d415412686aa926b3c7048ca1cad22bcef4b4d56a18d96dfbbf8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for wgpeer-0.3.0.tar.gz:

Publisher: publish.yml on danohn/wgpeer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wgpeer-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: wgpeer-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wgpeer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f53185346e2347413c73d8b21a35a2a1e1adf1df98b6cdfdeb750e3b2c92e6d4
MD5 d76f3326a4556c17a1b0e99ab2081251
BLAKE2b-256 1bc886d416226d8e4dbe5bbe93325b1a9f352b62fb65c9e9b9589a355d2830e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for wgpeer-0.3.0-py3-none-any.whl:

Publisher: publish.yml on danohn/wgpeer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page