Skip to main content

wgfrontend

A simple web frontend for configuring peers within a WireGuard configuration file to thus administer road warrior clients.

There are already a lot of user interfaces for administering WireGuard configuration files available. However, many of them have a bunch of dependencies, require root privileges to operate, or are a hassle to set up. "wgfrontend" provides a user interface that can be easily installed by just installing a package from Python's package repository PyPi (i.e. using pip).

This little tool is independent of the Towalink site connectivity solution (see https://towalink.readthedocs.io).


Features

  • Web frontend for adding, modifying, and deleting WireGuard peers
  • Config files for WireGuard peers can be downloaded
  • Config files for WireGuard peers are shown as QR Code
  • Assistant for initial set-up
  • Web frontend has responsive design
  • Web frontend does not run with root privileges
  • Simple installation

Installation

Install using PyPi:

pip3 install wgfrontend

Note: In the case you get an error regarding the imaging library needed for generating QR Codes, try to install it via the operating system packages:

# For Alpine:
apk add py3-pillow
# For Debian:
apt install python3-pil

Quickstart

After installing "wgfrontend" as shown above, just execute the tool with root permissions to get started:

wgfrontend

An interactive set-up assistant queries for the needed configuration data and sets up the environment. Once everything is configured, "wgfrontend" drops root privileges and runs a small web server on port 8080 to serve the web frontend.


Screenshots

screenshot: show a client config

See additional screenshots in the "screenshots" folder.


Details

The wgfrontend configuration file

The interactive set-up assistant creates a configuration file with the desired information. It is located at "/etc/wgfrontend/wgfrontend.conf".

Here is an example:

### Config file of the Towalink WireGuard Frontend ###
[general]
# The WireGuard config file to read and write
wg_configfile = /etc/wireguard/wg_rw.conf

# The command to be executed when the WireGuard config has changed
on_change_command = "sudo /etc/init.d/wgfrontend_interface restart"

# The interface to bind to for the web server
socket_host = 0.0.0.0

# The port to bind to for the web server
socket_port = 8080

# The system user to be used for the frontend
user = wgfrontend

[users]
admin = dc524e423d9762830649d4d9e18f4b47a56c92f96646104dd06c71b26b54f732e8318d5b60a6b2b01b4f269407771496e879c9bf65ca9ef4f55a243ff358fc8dfea0bd9d30d766320857093eb95022822f71b098215f26f6d2644033d956bfdd

Add an additional frontend user

Create a password hash using the following command:

wgfrontend-password

Using this, you can add another user to the [users] section in the wgfrontend configuration file.

A note on security

Don't expose the web frontend to the Internet without another layer of protection.

The wgfrontend web server does not run with root permissions. That's a start and better than many other WireGuard frontends. But the web server user has the permission to write to a WireGuard configuration file. This file may reference scripts that are run with root permissions when wg-quick is run. In case of a vulnerability in wgfrontend, this can be abused for privilege escalation. Thus add an additional safeguard layer of protection.


Reporting bugs

In case you encounter any bugs, please report the expected behavior and the actual behavior so that the issue can be reproduced and fixed.


Developers

Clone repository

Clone this repo to your local machine using https://github.com/towalink/wgfrontend.git

Install the module temporarily to make it available in your Python installation:

pip3 install -e <path to directory with setup.py>

License

License

Download files

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

Source Distribution

wgfrontend-0.9.0.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

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

wgfrontend-0.9.0-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

Details for the file wgfrontend-0.9.0.tar.gz.

File metadata

  • Download URL: wgfrontend-0.9.0.tar.gz
  • Upload date:
  • Size: 36.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for wgfrontend-0.9.0.tar.gz
Algorithm Hash digest
SHA256 785321389e7b5a930dd17bbf238f7d9f5a28104f7197852c66afc3ef100e1bb3
MD5 b457bd9eb20a8678ee9888d00852aadb
BLAKE2b-256 ea5ba81b78c5f567a31cac4ba39d4ba6ed971bb9bc1ab5696c3471f1f6ce0dee

See more details on using hashes here.

File details

Details for the file wgfrontend-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: wgfrontend-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 40.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for wgfrontend-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b34f349df0bcbd019e239f62b1fac02e28a859e47ff632227208c891edb8330d
MD5 d8232afe15d9a33b8b56b7fe2db4242d
BLAKE2b-256 b805673d78e0f4d2f567ff3b8ace6ff1d03c076f46c244bfcec0d1f77578c636

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.1

2 files

1.0.0

2 files

0.9.2

2 files

0.9.1

2 files

This release

0.9.0 This release

2 files

0.7.0

2 files

0.6.0

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page