Skip to content

oposs/wg-wrangler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dd16dbe · Nov 25, 2022

History

39 Commits
Nov 25, 2022
May 7, 2021
Nov 25, 2022
May 7, 2021
Nov 25, 2022
Jul 18, 2021
Jul 18, 2021
Jul 18, 2021
Apr 14, 2021
May 6, 2021
Nov 25, 2022
Apr 16, 2021
Nov 25, 2022
Nov 25, 2022
Jan 12, 2021
Apr 30, 2021
Nov 25, 2022
Nov 25, 2022
Jan 12, 2021
Nov 25, 2022
Nov 25, 2022
Nov 25, 2022

Repository files navigation

WGwrangler

Version: 0.2.1 Date: 2022-11-25

WGwrangler is a web application to manage local Wireguard Configuration using wg-meta in its backend.

It comes complete with a classic "configure - make - install" setup.

Installation

Download the current release distribution

# Install os dependencies
sudo apt install libqrencode-dev

./configure --prefix=$HOME/opt/wgwrangler
make

Configure will check if all requirements are met and give hints on how to fix the situation if something is missing.

Any missing perl modules will be downloaded and built.

To install the application, just run

make install

You can now run wgwrangler in reverse proxy mode.

cd $HOME/opt/wgwrangler/bin
./wgwrangler prefork

OS Preparation (after manual installation)

Since managing wireguard using its associated wg* commands requires root privileges we suggest the following setup:

  • Create a separate user/group e.g wireguard_manager
  • Whitelist the wg commands for this group in the /etc/sudoers file:
    %wireguard_manager ALL=NOPASSWD: /usr/bin/wg*
    
  • Set wireguard_manger as group on /etc/wireguard and adjust permissions to g+rwx
  • Additionally, creating a wg-wrangler.service file may improve usability quite a bit:
    # This is to be considered as a (very) simple example of such a .service file
    [Unit]
    Description=wg-wranger wireguard manager
    
    [Service]
    Type=simple
    User=wireguard_manager
    Group=wireguard_manager
    ExecStart=/usr/bin/perl /home/wireguard_manager/opt/wgwrangler/bin/wgwrangler prefork --listen 'http://127.0.0.1:7171'
    
    [Install]
    WantedBy=multi-user.target
    

Installation (deb Package)

The steps described in the manual installation section are done automatically when you install one of the provided .deb packages. Configuration resides in /etc/opt/wg-wrangler.

Currently supported ubuntu versions:

  • 18.04 LTS
  • 20.04 LTS
  • 22.04 LTS

Development

While developing the application it is convenient to NOT have to install it before runnning. You can actually serve the Qooxdoo source directly using the built-in Mojo webserver.

./bin/wgwrangler-source-mode.sh

You can now connect to the CallBackery app with your web browser.

If you need any additional perl modules, write their names into the PERL_MODULES file and run ./bootstrap.

Honored Environment Variables

  • WGwrangler_NO_WG If defined, we do not call any wg* command from code (e.g. to generate pub/private-keys)
  • WGwrangler_CONFIG Use this variable to set the path to the main wgwrangler.yaml file, defaults to etc/wgrangler.yaml

Packaging

Before releasing, make sure to update CHANGES, VERSION and run ./bootstrap.

You can also package the application as a nice tar.gz file, it uses carton to install dependent module. If you want to make sure that your project builds with perl 5.22, make sure to set the PERL environment variable to a perl 5.22 interpreter, make sure to delete any PERL5LIB environment variable, and run make clean && make. This will cause a cpanfile-0.1.0.snapshot file to be included with your tar ball, when building the app this snapshot will be used to make sure all the right versions of the dependent modules get installed.

make dist

Build deb package locally

# To build ubuntu 22 package
cd wg-wrangler
docker run --rm -v $(pwd):/mnt -it ubuntu:22.04 /bin/bash

# inside the docker container
./build_local.sh

# copy the package
cp /src/wg-wrangler_*_amd64_*.deb /mnt

Screenshots

Enjoy!

Tobias Bossert