Skip to content

Commit

Permalink
Merge pull request #1 from oposs/CRUD_version
Browse files Browse the repository at this point in the history
CRUD-functionality implemented
  • Loading branch information
sirtoobii authored Apr 21, 2021
2 parents e48961c + 3079323 commit f31545e
Show file tree
Hide file tree
Showing 46 changed files with 4,508 additions and 1,796 deletions.
Binary file added .github/img/create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/img/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
- '5.30'
node:
# - '10.x'
- '13.x'
# - '13.x'
- '12.x'
# exclude:
#- os: ubuntu-16.04
# perl: '5.26'
Expand Down Expand Up @@ -76,9 +77,9 @@ jobs:
key: ${{ matrix.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ matrix.os }}-node-${{ matrix.node }}-
- name: Install Gettext
run: sudo apt-get install gettext
- name: Install OS dependencies
run: sudo apt install libqrencode-dev pkg-config gettext


- name: Bootstrap
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ etc/*.cfg
*~
/.vscode/perl-lang/
.idea
_Deparsed_XSubs.pm
conftools
etc/wgwrangler.yaml
etc/wgwrangler.yaml.secret
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Tobias Bossert <tobias.bossert@fastpath.ch>
Tobias Bossert <bossert _at_ oetiker _this_is_a_dot_ ch>
4 changes: 3 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.0.0 2021-01-12 Tobias Bossert (tobias.bossert@fastpath.ch)
0.1.0 2021-04-16 Tobias Bossert (bossert _at_ oetiker _this_is_a_dot_ ch)
- Initial release

0.0.0 2021-01-12 Tobias Bossert (bossert _at_ oetiker _this_is_a_dot_ ch)
- started project
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SHARE := $(shell test -d share && find -L share -type d -name ".??*" -prune -o -
PERLTESTS := $(shell find -L t -name "*.t")
PM := $(shell find -L lib -name "*.pm")

EXTRA_DIST = VERSION cpanfile COPYRIGHT LICENSE CHANGES AUTHORS bootstrap $(PUB) $(wildcard t/*.t) $(POD) $(TEMPL) $(PERLTESTS) $(SHARE)
EXTRA_DIST = VERSION cpanfile COPYRIGHT LICENSE README.md CHANGES AUTHORS bootstrap $(PUB) $(wildcard t/*.t) $(POD) $(TEMPL) $(PERLTESTS) $(SHARE)

YEAR := $(shell date +%Y)
DATE := $(shell date +%Y-%m-%d)
Expand Down
54 changes: 49 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
WGwrangler
===========
Version: #VERSION#
Date: #DATE#
Version: 0.1.0
Date: 2021-04-16

WGwrangler is a cool web application.
WGwrangler is a web application to manage local Wireguard Configuration using
[wg-meta](https://metacpan.org/release/Wireguard-WGmeta) in its backend.

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

Expand All @@ -12,6 +13,9 @@ Setup
In your app source directory and start building.

```console
# Install os dependencies
sudo apt install libqrencode-dev

./configure --prefix=$HOME/opt/wgwrangler
make
```
Expand All @@ -34,6 +38,8 @@ using the built-in Mojo webserver.

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.

Expand All @@ -53,6 +59,34 @@ cd $HOME/opt/wgwrangler/bin
./wgwrangler.pl prefork
```

OS Preparation
-------------

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:
```text
%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:
```text
# 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.pl prefork --listen 'http://0.1.0.1:7171'
[Install]
WantedBy=multi-user.target
```

Packaging
---------

Expand All @@ -63,14 +97,24 @@ 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-5.22.1.snapshot` file to be included
`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.

```console
make dist
```

Screenshots
-----------

![](.github/img/overview.png)

![](.github/img/create.png)

![](.github/img/email.png)


Enjoy!

Tobias Bossert <tobias.bossert@fastpath.ch>
Tobias Bossert <bossert _at_ oetiker _this_is_a_dot_ ch>
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.0
0.1.0
2 changes: 1 addition & 1 deletion bin/wgwrangler-source-mode.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
export MOJO_MODE=development
export MOJO_LOG_LEVEL=debug
exec `dirname $0`/wgwrangler.pl prefork --listen 'http://*:7192'
exec $(dirname $0)/wgwrangler.pl prefork --listen 'http://*:7192'
1 change: 1 addition & 0 deletions bin/wgwrangler.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# having a non-C locale for number will wreck all sorts of havoc
# when things get converted to string and back
use POSIX qw(locale_h);

setlocale(LC_NUMERIC, "C");use strict;
use Mojolicious::Commands;

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2021 Tobias Bossert

AC_INIT([wgwrangler],m4_esyscmd([tr -d '\n' < VERSION]),[tobias.bossert@fastpath.ch])
AC_INIT([wgwrangler],m4_esyscmd([tr -d '\n' < VERSION]),[bossert _at_ oetiker _this_is_a_dot_ ch])
AC_PREREQ([2.59])
AC_CONFIG_AUX_DIR(conftools)

Expand Down
Loading

0 comments on commit f31545e

Please sign in to comment.