Skip to content

Commit

Permalink
Added ubuntu 22 build target, updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtoobii committed Nov 25, 2022
1 parent efcf655 commit ea1622b
Show file tree
Hide file tree
Showing 19 changed files with 167 additions and 29 deletions.
5 changes: 3 additions & 2 deletions .github/actions/build-release-action/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
ARG IMAGE_VERSION_TAG
ARG NODE_VERSION

FROM ubuntu:$IMAGE_VERSION_TAG

LABEL maintainer="oetiker" \
description="WG-wrangler builder"


ENV DEBIAN_FRONTEND noninteractive

ARG NODE_VERSION
RUN apt-get -y update && \
apt-get -y install apt-utils curl && \
curl https://deb.nodesource.com/setup_12.x | bash && \
curl https://deb.nodesource.com/setup_$NODE_VERSION | bash && \
apt-get -u update && \
apt-get -y install perl \
make \
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/build-release-action/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: Tag which is prepended on the FROM directive
required: false
default: latest
node_version:
description: Node version for building the debian package
required: false
default: 18.x

outputs:
package_name:
Expand All @@ -23,6 +27,7 @@ runs:
run: |
docker build \
--build-arg IMAGE_VERSION_TAG=${{inputs.image_version_tag}} \
--build-arg NODE_VERSION=${{inputs.node_version}} \
-f $(pwd)/.github/actions/build-release-action/${{inputs.docker_file}} \
$(pwd)/.github/actions/build-release-action/ \
-t deb_builder:latest
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ jobs:
- ubuntu: 18.04
docker_file: Dockerfile
image_version_tag: '18.04'
node_version: 16.x
- ubuntu: 20.04
docker_file: Dockerfile
image_version_tag: '20.04'
node_version: 18.x
- ubuntu: 22.04
docker_file: Dockerfile
image_version_tag: '22.04'
node_version: 18.x

runs-on: ubuntu-latest
name: Build package defined in ${{ matrix.docker_file }} for tag ${{ matrix.image_version_tag }}
Expand All @@ -33,4 +39,4 @@ jobs:
with:
files: ${{ github.workspace }}/${{ steps.build_package.outputs.package_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ conftools
etc/wgwrangler.yaml
etc/wgwrangler.yaml.secret
node_modules
node_modules/
9 changes: 9 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
wg-wrangler (0.2.1) unstable; urgency=medium

* updated: Build dependency node.js to 18 LTS (ubuntu 20+22) 16LTS (ubuntu 18)
* updated: Callbackery to 0.42.4
* updated: Added Ubuntu 22 as build target

-- Tobias Bossert <bossert@oetiker.ch> Fri, 25 Jul 2022 14:08:01 +0100


wg-wrangler (0.2.0) unstable; urgency=medium

* fixed: Validation on hidden field when adding a new peer
Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
WGwrangler
a cool web app with Mojolicious backend

Copyright (c) 2021 Tobias Bossert and the other people listed in the
Copyright (c) 2022 Tobias Bossert and the other people listed in the
AUTHORS file.

All rights reserved.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ cd $HOME/opt/wgwrangler/bin
./wgwrangler prefork
```

OS Preparation
OS Preparation (Manual installation)
-------------

Since managing wireguard using its associated `wg*` commands requires root privileges we suggest the following
Expand Down Expand Up @@ -90,6 +90,18 @@ setup:
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

Packaging
---------

Expand All @@ -104,10 +116,27 @@ interpreter, make sure to delete any `PERL5LIB` environment variable, and run
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
```shell
make dist
```

Build deb package locally
-------------------------

```shell

# 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
-----------

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
0.2.1
40 changes: 40 additions & 0 deletions build_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

apt -y update && \
apt-get -y install apt-utils curl && \
curl https://deb.nodesource.com/setup_16.x | bash && \
apt-get -u update && \
apt-get -y install perl \
make \
gcc \
devscripts \
openssl \
pkg-config \
libssl-dev \
debhelper \
automake \
nodejs \
libkrb5-dev \
libqrencode-dev \
g++ \
zlib1g-dev

# copy entire source tree
mkdir /src
cp -r . /src

cd /src

# workaround for debhelper bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897569
mkdir -p deb_build_home
ls | grep -v deb_build_home | xargs mv -t deb_build_home # move everything except deb_build_home
cd deb_build_home

dh_clean
dpkg-buildpackage -us -uc -nc

# set filename
release_code_name=$(lsb_release --codename | sed 's/Codename:\s*//')
package_name=$(basename ../*.deb | sed 's/.deb$//')_$release_code_name.deb
mv ../*.deb ../$package_name

32 changes: 21 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ AC_PATH_PROG(NPX, npx, npx-not-found)
AC_PATH_PROG(XGETTEXT, xgettext, xgettext-not-found)
AC_PATH_PROG(MSGMERGE, msgmerge, msgmerge-not-found)

AC_ARG_ENABLE([deb_build],
[ --enable-deb_build Enable debian package build specifics],
[case "${enableval}" in
yes) deb_build=true ;;
no) deb_build=false ;;
*) AC_MSG_ERROR([bad value ${deb_build} for --enable-deb_build]) ;;
esac],[deb_build=false])

AM_CONDITIONAL([DEB_BUILD], [test x$deb_build = xtrue])


AC_ARG_VAR(DEBIAN_BUILD, [Is this a debian package build run, default no])


URL_CAT="neither curl nor wget found"

Expand Down Expand Up @@ -59,22 +72,19 @@ else
AC_MSG_ERROR(could not find perl)
fi

ac_node_version="10"
ac_node_version="14"

if test -x "$NODE"; then
AC_MSG_CHECKING(make sure we have at least node ${ac_node_version})
case `$NODE --version` in
v10*)
AC_MSG_RESULT(ok v10)
;;
v11*)
AC_MSG_RESULT(ok v11)
v14*)
AC_MSG_RESULT(ok v14)
;;
v12*)
AC_MSG_RESULT(ok v12)
v16*)
AC_MSG_RESULT(ok v16)
;;
v13*)
AC_MSG_RESULT(ok v13)
v18*)
AC_MSG_RESULT(ok v18)
;;
*)
AC_MSG_RESULT(no);
Expand Down Expand Up @@ -178,7 +188,7 @@ cat <<NOTES

** WARNING ***********************************************

To run the qooxdoo compiler, at least node v10 is required.
To run the qooxdoo compiler, at least node v14 is required.
Use nvm to setup your local, up to date copy of node.
Go to https://github.com/nvm-sh/nvm for futher information

Expand Down
6 changes: 3 additions & 3 deletions cpanfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
requires 'CallBackery', '>= 0.38.0';
requires 'CallBackery', '>= 0.42.4';
requires 'Mojo::SQLite';
requires 'Wireguard::WGmeta', '>= 0.3.0';
requires 'Wireguard::WGmeta', '>= 0.3.2';
requires 'Net::IP', '>=1.26';
requires 'Email::MIME';
requires 'Email::Sender';
requires 'Text::QRCode';
requires 'YAML::XS';
requires 'SVG::Barcode';
requires 'SVG::Barcode::QRCode';
requires 'YAML::PP';
requires 'YAML::PP';
9 changes: 9 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
wg-wrangler (0.2.1) unstable; urgency=medium

* updated: Build dependency node.js to 18 LTS (ubuntu 20+22) 16LTS (ubuntu 18)
* updated: Callbackery to 0.42.4
* updated: Added Ubuntu 22 as build target

-- Tobias Bossert <bossert@oetiker.ch> Fri, 25 Jul 2022 14:08:01 +0100


wg-wrangler (0.2.0) unstable; urgency=medium

* fixed: Validation on hidden field when adding a new peer
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Build-Depends: build-essential, debhelper (>= 9)
Package: wg-wrangler
Architecture: any
Depends: ${shlibs:Depends}, perl, wireguard, sudo
Recommends: git
Description: An web-frontend for managing wireguard peer configuration
8 changes: 7 additions & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ USERNAME=wg-wrangler_manager
GROUPNAME=wg-wrangler_manager

# Create user and group
adduser --system --group --no-create-home $USERNAME
adduser --system --group --home /opt/wg-wrangler/home $USERNAME

# make sure /etc/wireguard is considered as safe by git
echo "[safe]
directory = /etc/wireguard
" > /opt/wg-wrangler/home/.gitconfig

# set permissions and group membership on /etc/wireguard
chgrp --silent --recursive $GROUPNAME /etc/wireguard/
Expand All @@ -25,3 +30,4 @@ chown --silent --recursive $USERNAME /var/opt/$PKGNAME
# Whitelist wg* commands for us
echo "%$GROUPNAME ALL=NOPASSWD: /usr/bin/wg*" >> /etc/sudoers.d/$PKGNAME


2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export DH_ALWAYS_EXCLUDE=CVS:.svn:.git:

override_dh_auto_configure:
./bootstrap
./configure --prefix=/opt/wg-wrangler --sysconfdir=/etc/opt/wg-wrangler --localstatedir=/var/opt/wg-wrangler
./configure --prefix=/opt/wg-wrangler --sysconfdir=/etc/opt/wg-wrangler --localstatedir=/var/opt/wg-wrangler --enable-deb_build

%:
dh $@
15 changes: 13 additions & 2 deletions frontend/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

AUTOMAKE_OPTIONS=foreign

EXTRA_DIST = compile.js compile.json Manifest.json package.json package-lock.json $(shell find source -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -not -name "Makefile*" -a -type f -print )
EXTRA_DIST = compile.js compile.json Manifest.json package.json package-lock.json $(shell find source -not -name ".*" -a -not -name "*~" -a -not -name "*.tmp" -a -not -name "Makefile*" -a -type f -print )

if BUILD_QOOXDOO_APP

Expand All @@ -19,10 +18,22 @@ source: node_modules compiled/source/.built
source-watch: node_modules
CALLBACKERY_QX=$(CALLBACKERY_QX) $(NPX) qx compile --watch --feedback=false --erase --update-po-files

YEAR := $(shell date +%Y)
DATE := $(shell date +%Y-%m-%d)

if DEB_BUILD
build: ../public/.built
echo "DIST_distdir"$(distdir)
echo "DIST_pwd"$(shell pwd)
$(PERL) -i -p -e 's/#VERSION#/$(PACKAGE_VERSION)/g;s/#YEAR#/$(YEAR)/g;s/#DATE#/$(DATE)/g;' ../public/$(QX_CLASS)/*.js
else
build: ../public/.built
endif

dist-hook:
$(PERL) -i -p -e 's/#VERSION#/$(PACKAGE_VERSION)/g;s/#YEAR#/$(YEAR)/g;s/#DATE#/$(DATE)/g;' $(distdir)/../public/$(QX_CLASS)/*.js



clean: node_modules
$(NPX) qx clean
Expand Down
3 changes: 1 addition & 2 deletions frontend/Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"translation" : "source/translation"
},
"requires": {
"@qooxdoo/framework": "^6.0.0-beta",
"@qooxdoo/compiler" : "^1.0.0-beta"
"@qooxdoo/framework": "^7.3.1"
}
}
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"devDependencies": {
"@qooxdoo/compiler": "^1.0.0-beta"
"@qooxdoo/framework": "^7.2.1"
}
}
13 changes: 13 additions & 0 deletions frontend/qx-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"libraries": [
{
"library_name": "deprecated.qx.io.remote",
"library_version": "1.0.2",
"path": "qx_packages/qooxdoo_deprecated_qx_io_remote_v1_0_2",
"uri": "qooxdoo/deprecated.qx.io.remote",
"repo_name": "qooxdoo/deprecated.qx.io.remote",
"repo_tag": "v1.0.2"
}
],
"version": "2.1.0"
}

0 comments on commit ea1622b

Please sign in to comment.