WireGuard Configuration Portal with LDAP connection

@Christoph Haas Christoph Haas authored on 27 Feb 2021
assets WIP: new user management and authentication system, use go 1.16 embed 5 years ago
cmd/ wg-portal cleanup 5 years ago
internal migrate old database format correctly, fix typo, update readme 5 years ago
scripts fix a few bugs, add instructions for raspberry pi 5 years ago
.gitignore Update .gitignore 5 years ago
.travis.yml add travis token 5 years ago
Dockerfile fix docker build 5 years ago
LICENSE.txt add README and LICENSE 5 years ago
Makefile WIP: dont use gox 5 years ago
README-RASPBERRYPI.md WIP: new user management and authentication system, use go 1.16 embed 5 years ago
README.md migrate old database format correctly, fix typo, update readme 5 years ago
docker-compose.yml user dockerhub for image building and travis-ci for testing 5 years ago
efs.go WIP: new user management and authentication system, use go 1.16 embed 5 years ago
go.mod WIP: use gox for cross platform compiling, try to enable cross platform cgo builds 5 years ago
screenshot.png add README and LICENSE 5 years ago
README.md

WireGuard Portal

Build Status
License: MIT
GitHub last commit
Go Report Card
GitHub go.mod Go version
GitHub code size in bytes
Docker Pulls

A simple, web based configuration portal for WireGuard.
The portal uses the WireGuard wgctrl library to manage the VPN
interface. This allows for seamless activation or deactivation of new users, without disturbing existing VPN
connections.

The configuration portal currently supports using SQLite, MySQL as a user source for authentication and profile data.
It also supports LDAP (Active Directory or OpenLDAP) as authentication provider.

Features

  • Self-hosted and web based
  • Automatically select IP from the network pool assigned to client
  • QR-Code for convenient mobile client configuration
  • Sent email to client with QR-code and client config
  • Enable / Disable clients seamlessly
  • Generation of wgX.conf after any modification
  • IPv6 ready
  • User authentication (SQLite/MySQL and LDAP)
  • Dockerized
  • Responsive template
  • One single binary
  • Can be used with existing WireGuard setupsScreenshot

Setup

Docker

The easiest way to run WireGuard Portal is to use the Docker image provided.

Docker Compose snippet with some sample configuration values:

version: '3.6'
services:
  wg-portal:
    image: h44z/wg-portal:latest
    container_name: wg-portal
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    network_mode: "host"
    volumes:
      - /etc/wireguard:/etc/wireguard
      - ./data:/app/data
    ports:
      - '8123:8123'
    environment:
      - EXTERNAL_URL=https://vpn.company.com
      - WEBSITE_TITLE=WireGuard VPN
      - COMPANY_NAME=Your Company Name
      - MAIL_FROM=WireGuard VPN <[email protected]>
      - [email protected]
      - ADMIN_PASS=supersecret
      - EMAIL_HOST=10.10.10.10
      - EMAIL_PORT=25
      - LDAP_ENABLED=true
      - LDAP_URL=ldap://srv-ad01.company.local:389
      - LDAP_BASEDN=DC=COMPANY,DC=LOCAL
      - [email protected]
      - LDAP_PASSWORD=supersecretldappassword
      - LDAP_ADMIN_GROUP=CN=WireGuardAdmins,OU=Users,DC=COMPANY,DC=LOCAL

Please note that mapping /etc/wireguard to /etc/wireguard inside the docker, will erase your host's current configuration.
If needed, please make sure to backup your files from /etc/wireguard.
For a full list of configuration options take a look at the source file internal/common/configuration.go.

Standalone

For a standalone application, use the Makefile provided in the repository to build the application.

make

# To build for arm architecture as well use:
make build-cross-plat

The compiled binary will be located in the dist folder.
A detailed description for using this software with a raspberry pi can be found in the README-RASPBERRYPI.md.

What is out of scope

License

This project was inspired by wg-gen-web.