You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Khanh Ngo e74a3a808f
Dynamic year in footer page (#126)
2 weeks ago
.github chore: update stale.yml 2 weeks ago
custom/js chore: update buttons 2 weeks ago
db Add empty db directory in vcs 2 years ago
emailer Fixes security issue & Adds support to sent configuration via email (#83) 4 months ago
handler Update healthcheck (#124) 2 weeks ago
model Added UseServerDNS option for clients who do not have to use the DNS specified in the server configuration. (#79) 4 months ago
router Abstracts database storage & Status page UI (#88) 3 months ago
store Abstracts database storage & Status page UI (#88) 3 months ago
templates Dynamic year in footer page (#126) 2 weeks ago
util Make MTU and PersistentKeepalive optional (#123) 2 weeks ago
.dockerignore Single binary build (#10) 2 years ago
.gitignore Single binary build (#10) 2 years ago
Dockerfile Update healthcheck (#124) 2 weeks ago
LICENSE Create LICENSE 2 years ago
README.md Fixed typo (#113) 3 weeks ago
docker-compose.yaml Fixed typo (#113) 3 weeks ago
go.mod Abstracts database storage & Status page UI (#88) 3 months ago
go.sum Abstracts database storage & Status page UI (#88) 3 months ago
main.go Update healthcheck (#124) 2 weeks ago
package.json Add docker build 2 years ago
prepare_assets.sh Edit wireguard client (#19) 2 years ago
yarn.lock Bump ssri from 8.0.0 to 8.0.1 (#51) 8 months ago

README.md

wireguard-ui

A web user interface to manage your WireGuard setup.

Features

  • Friendly UI
  • Authentication
  • Manage extra client's information (name, email, etc)
  • Retrieve configs using QR code / file

Run WireGuard-UI

Default username and password are admin.

Using docker compose

You can take a look at this example of docker-compose.yml. Please adjust volume mount points to work with your setup. Then run it like below:

docker-compose up

Note:

There is a Status option that needs docker to be able to access the network of the host in order to read the wireguard interface stats. See the cap_add and network_mode options on the docker-compose.yaml

Environment Variables

Set the SESSION_SECRET environment variable to a random value.

In order to sent the wireguard configuration to clients via email (using sendgrid api) set the following environment variables

SENDGRID_API_KEY: Your sendgrid api key
EMAIL_FROM_ADDRESS: the email address you registered on sendgrid
EMAIL_FROM_NAME: the sender's email address

Using binary file

Download the binary file from the release and run it with command:

./wireguard-ui

Auto restart WireGuard daemon

WireGuard-UI only takes care of configuration generation. You can use systemd to watch for the changes and restart the service. Following is an example:

systemd

Create /etc/systemd/system/wgui.service

[Unit]
Description=Restart WireGuard
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart wg-quick@wg0.service

[Install]
RequiredBy=wgui.path

Create /etc/systemd/system/wgui.path

[Unit]
Description=Watch /etc/wireguard/wg0.conf for changes

[Path]
PathModified=/etc/wireguard/wg0.conf

[Install]
WantedBy=multi-user.target

Apply it

systemctl enable wgui.{path,service}
systemctl start wgui.{path,service}

openrc

Create and chmod +x /usr/local/bin/wgui

#!/bin/sh
wg-quick down wg0
wg-quick up wg0

Create and chmod +x /etc/init.d/wgui

#!/sbin/openrc-run

command=/sbin/inotifyd
command_args="/usr/local/bin/wgui /etc/wireguard/wg0.conf:w"
pidfile=/run/${RC_SVCNAME}.pid
command_background=yes

Apply it

rc-service wgui start
rc-update add wgui default

Build

Build docker image

Go to the project root directory and run the following command:

docker build -t wireguard-ui .

Build binary file

Prepare the assets directory

./prepare_assets.sh

Then you can embed resources by generating Go source code

rice embed-go
go build -o wireguard-ui

Or, append resources to executable as zip file

go build -o wireguard-ui
rice append --exec wireguard-ui

Screenshot

wireguard-ui

License

MIT. See LICENSE.

Support

If you like the project and want to support it, you can buy me a coffee

Buy Me A Coffee