From 1a4d12e5661ccd7555c529ad7fc55de86ca7e51e Mon Sep 17 00:00:00 2001 From: KemoNine Date: Tue, 4 Aug 2020 20:59:30 +0000 Subject: [PATCH] Move piframefleet dispatcher wireguard config to /opt/wireguard --- piframefleet/Dockerfile | 1 + piframefleet/root/etc/cont-init.d/30-config | 3 +++ piframefleet/root/etc/services.d/wireguard/run | 4 ++-- piframefleet_run.sh | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/piframefleet/Dockerfile b/piframefleet/Dockerfile index 3a5395e..e66e431 100644 --- a/piframefleet/Dockerfile +++ b/piframefleet/Dockerfile @@ -60,6 +60,7 @@ VOLUME /opt/ansible ENV ENABLE_WIREGUARD=false EXPOSE 51820/udp VOLUME /lib/modules +VOLUME /opt/wireguard # SyncThing related 'stuff' ENV ENABLE_SYNCTHING=false diff --git a/piframefleet/root/etc/cont-init.d/30-config b/piframefleet/root/etc/cont-init.d/30-config index 7385a4f..149f2ff 100755 --- a/piframefleet/root/etc/cont-init.d/30-config +++ b/piframefleet/root/etc/cont-init.d/30-config @@ -43,6 +43,9 @@ if [ "$ENABLE_WIREGUARD" = true ] ; then else echo "**** The wireguard module is not active, please install wireguard on the host and activate the 'wg' kernel module ****" fi + if [ ! -d "/opt/wireguard" ] ; then + mkdir /opt/wireguard + fi fi #################### diff --git a/piframefleet/root/etc/services.d/wireguard/run b/piframefleet/root/etc/services.d/wireguard/run index 285d3d0..6191c19 100755 --- a/piframefleet/root/etc/services.d/wireguard/run +++ b/piframefleet/root/etc/services.d/wireguard/run @@ -8,12 +8,12 @@ fi _term() { echo "Caught SIGTERM signal!" - wg-quick down wg0 + wg-quick down /opt/wireguard/wg0 } trap _term SIGTERM -wg-quick up wg0 +wg-quick up /opt/wireguard/wg0 sleep infinity & diff --git a/piframefleet_run.sh b/piframefleet_run.sh index 7d9037f..f0de8dd 100755 --- a/piframefleet_run.sh +++ b/piframefleet_run.sh @@ -23,6 +23,7 @@ sudo docker run -it \ -v /lib/modules:/lib/modules:ro \ -v /var/piframefleet/syncthing:/opt/syncthing \ -v /var/piframefleet/filebrowser:/opt/filebrowser \ + -v /var/piframefleet/wireguard:/var/wireguard \ -v /var/piframefleet/ansible:/opt/ansible \ -v /var/piframefleet/pictures:/opt/pictures \ piframe/piframefleet:latest