-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
267 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
ARG IMAGE_VERSION_TAG | ||
|
||
FROM ubuntu:$IMAGE_VERSION_TAG | ||
|
||
LABEL maintainer="oetiker" \ | ||
description="WG-wrangler builder" | ||
|
||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
RUN apt-get -y update && \ | ||
apt-get -y install apt-utils curl && \ | ||
curl https://deb.nodesource.com/setup_12.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++ | ||
|
||
COPY make-deb.sh /make-deb.sh | ||
|
||
RUN chmod 777 /make-deb.sh | ||
|
||
ENTRYPOINT ["/make-deb.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: 'Docker release builder' | ||
description: 'Build release packages using a docker image' | ||
|
||
inputs: | ||
docker_file: | ||
description: Target Docker file to build package | ||
required: true | ||
image_version_tag: | ||
description: Tag which is prepended on the FROM directive | ||
required: false | ||
default: latest | ||
|
||
outputs: | ||
package_name: | ||
description: name of the generated package | ||
value: ${{ steps.run.outputs.package_name }} | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- id: build | ||
name: Build Docker Image | ||
run: | | ||
docker build \ | ||
--build-arg IMAGE_VERSION_TAG=${{inputs.image_version_tag}} \ | ||
-f $(pwd)/.github/actions/build-release-action/${{inputs.docker_file}} \ | ||
$(pwd)/.github/actions/build-release-action/ \ | ||
-t deb_builder:latest | ||
shell: bash | ||
- id: run | ||
name: Run Docker Image | ||
run: docker run -v $(pwd):/github/workspace --workdir /github/workspace deb_builder:latest | ||
shell: bash | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
set -ex | ||
cd /github/workspace/ | ||
dh_clean | ||
dpkg-buildpackage -us -uc -nc | ||
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 | ||
echo "::set-output name=package_name::$package_name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: 'Build release' | ||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
build_deb: | ||
strategy: | ||
matrix: | ||
RELEASE: | ||
- Ubuntu: | ||
docker_file: Dockerfile | ||
image_version_tag: '18.04' | ||
- Ubuntu: | ||
docker_file: Dockerfile | ||
image_version_tag: '20.04' | ||
|
||
runs-on: ubuntu-latest | ||
name: Build package defined in ${{ matrix.RELEASE.docker_file }} for tag {{$matrix.RELEASE.image_version_tag}} | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Run docker build | ||
id: build_package | ||
uses: ./.github/actions/build-release-action | ||
with: | ||
docker_file: ${{ matrix.RELEASE.docker_file }} | ||
image_version_tag: ${{ matrix.RELEASE.image_version_tag }} | ||
|
||
- name: Release deb files | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ github.workspace }}/${{ steps.build_package.outputs.package_name }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
0.1.0 2021-04-16 Tobias Bossert (bossert _at_ oetiker _this_is_a_dot_ ch) | ||
- Initial release | ||
wg-wrangler (0.1.1) unstable; urgency=medium | ||
|
||
* Initial deb release | ||
|
||
-- Tobias Bossert <bossert@oetiker.ch> Thu, 30 Apr 2021 11:02:58 +0200 | ||
|
||
wg-wrangler (0.1.0) unstable; urgency=medium | ||
|
||
* Initial release | ||
|
||
-- Tobias Bossert <bossert@oetiker.ch> Thu, 16 Apr 2021 09:02:58 +0200 | ||
|
||
0.0.0 2021-01-12 Tobias Bossert (bossert _at_ oetiker _this_is_a_dot_ ch) | ||
- started project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.0 | ||
0.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
changelog: ../CHANGES: | ||
cp ../CHANGES changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
wg-wrangler (0.1.1) unstable; urgency=medium | ||
|
||
* Initial deb release | ||
|
||
-- Tobias Bossert <bossert@oetiker.ch> Thu, 30 Apr 2021 11:02:58 +0200 | ||
|
||
wg-wrangler (0.1.0) unstable; urgency=medium | ||
|
||
* Initial release | ||
|
||
-- Tobias Bossert <bossert@oetiker.ch> Thu, 16 Apr 2021 09:02:58 +0200 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Source: wg-wrangler | ||
Section: system | ||
Priority: optional | ||
Maintainer: Tobias Bossert <bossert@oetiker.ch> | ||
Build-Depends: build-essential, debhelper (>= 9) | ||
|
||
Package: wg-wrangler | ||
Architecture: any | ||
Depends: ${shlibs:Depends}, perl, wireguard, sudo | ||
Description: An web-frontend for managing wireguard peer configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
PKGNAME=wg-wrangler | ||
USERNAME=wg-wrangler_manager | ||
GROUPNAME=wg-wrangler_manager | ||
|
||
# Create user and group | ||
adduser --system --group --no-create-home $USERNAME | ||
|
||
# set permissions and group membership on /etc/wireguard | ||
chgrp --silent --recursive $GROUPNAME /etc/wireguard/ | ||
|
||
# set group permissions | ||
chmod -R g+rw /etc/wireguard | ||
|
||
# Whitelist wg* commands for us | ||
echo "%$GROUPNAME ALL=NOPASSWD: /usr/bin/wg*" >> /etc/sudoers.d/wg-wrangler | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
USERNAME=wg-wrangler_manager | ||
|
||
# Revert group of /etc/wireguard | ||
chgrp --silent --recursive root /etc/wireguard/ | ||
|
||
# remove sudoers entry | ||
if [ ! -f /etc/sudoers.d/wg-wrangler ] | ||
then | ||
echo "File does not exist. Skipping..." | ||
else | ||
rm /etc/sudoers.d/wg-wrangler | ||
fi | ||
|
||
# and finally remove the wg-wrangler user | ||
if [ -x "$(command -v deluser)" ]; then | ||
deluser --quiet --system $USERNAME > /dev/null || true | ||
else | ||
echo >&2 "not removing $USERNAME system account because deluser command was not found" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/make -f | ||
# -*- makefile -*- | ||
|
||
# Uncomment this to turn on verbose mode. | ||
export DH_VERBOSE=1 | ||
|
||
# This has to be exported to make some magic below work. | ||
export DH_OPTIONS | ||
|
||
export DH_ALWAYS_EXCLUDE=CVS:.svn:.git: | ||
|
||
override_dh_auto_configure: | ||
./bootstrap | ||
./configure --prefix=/opt/wg-wrangler | ||
|
||
%: | ||
dh $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=wg-wranger wireguard manager | ||
|
||
[Service] | ||
Type=simple | ||
User=wg-wrangler_manager | ||
Group=wg-wrangler_manager | ||
ExecStart=/usr/bin/perl opt/wg-wrangler/bin/wgwrangler.pl prefork --listen 'http://127.0.0.1:7171' | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
BACKEND: | ||
cfg_db: /tmp/wgwrangler.db | ||
sesame_user: qfqwfeqfeqf | ||
# perl -MDigest::SHA -e 'print Digest::SHA::hmac_sha1_hex("access"),"\n"' | ||
sesame_pass: wedfwfewqf | ||
vpn_name: your_vpn_name | ||
enable_git: false | ||
no_apply: true | ||
not_applied_suffix: .not_applied | ||
wireguard_home: /dummy_home/ | ||
wg_apply_command: sudo -n wg-quick strip %interface% > /tmp/wg_tmp && sudo -n wg syncconf %interface% /tmp/wg_tmp && rm /tmp/wg_tmp | ||
wg_show_command: sudo -n wg show all dump | ||
|
||
FRONTEND: | ||
# logo = ../resource/wgwrangler/logo.png | ||
# logo_small = ../resource/wgwrangler/logo-small.png | ||
title: WGwrangler | ||
initial_plugin: WireguardShow | ||
company_name: OETIKER+PARTNER AG | ||
company_url: http://www.oetiker.ch | ||
# max_width = 800 | ||
|
||
PLUGIN: | ||
- InitialUser: | ||
module: UserForm | ||
mode: init | ||
type: add | ||
tab-name: Create Initial User | ||
|
||
- WireguardShow: | ||
module: WireguardShow | ||
tab-name: Wireguard | ||
default-dns: 10.0.0.1 | ||
default-allowed-ips: 10.0.0.0/24 | ||
sender-email: support@oetiker.ch | ||
|
||
- WireguardVersions: | ||
module: WireguardVersions | ||
tab-name: Config Versions | ||
|
||
- AdminUser: | ||
module: Users | ||
tab-name: Admin User Manager |