diff --git a/Dockerfile b/Dockerfile index 9546abe..dca46d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:focal +FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy # set version label ARG BUILD_DATE @@ -27,6 +27,7 @@ RUN \ libc6 \ libelf-dev \ net-tools \ + netcat \ openresolv \ perl \ pkg-config \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 1862848..717455f 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-focal +FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy # set version label ARG BUILD_DATE @@ -27,6 +27,7 @@ RUN \ libc6 \ libelf-dev \ net-tools \ + netcat \ openresolv \ perl \ pkg-config \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 6cf259e..783f66c 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-focal +FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-jammy # set version label ARG BUILD_DATE @@ -27,6 +27,7 @@ RUN \ libc6 \ libelf-dev \ net-tools \ + netcat \ openresolv \ perl \ pkg-config \ diff --git a/README.md b/README.md index 5089e25..3eef17e 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **04.10.22:** - Rebase to Jammy. Upgrade to s6v3. * **16.05.22:** - Improve NAT handling in server mode when multiple ethernet devices are present. * **23.04.22:** - Add pre-shared key support. Automatically added to all new peer confs generated, existing ones are left without to ensure no breaking changes. * **10.04.22:** - Rebase to Ubuntu Focal. Add `LOG_CONFS` env var. Remove deprecated `add-peer` command. diff --git a/readme-vars.yml b/readme-vars.yml index 8e7a72b..195997d 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -121,6 +121,7 @@ app_setup_block: | # changelog changelogs: + - { date: "04.10.22:", desc: "Rebase to Jammy. Upgrade to s6v3." } - { date: "16.05.22:", desc: "Improve NAT handling in server mode when multiple ethernet devices are present." } - { date: "23.04.22:", desc: "Add pre-shared key support. Automatically added to all new peer confs generated, existing ones are left without to ensure no breaking changes." } - { date: "10.04.22:", desc: "Rebase to Ubuntu Focal. Add `LOG_CONFS` env var. Remove deprecated `add-peer` command." } diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-wireguard-confs b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-wireguard-confs new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/dependencies.d/init-wireguard-module b/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/dependencies.d/init-wireguard-module new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/40-confs b/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/run old mode 100644 new mode 100755 similarity index 99% rename from root/etc/cont-init.d/40-confs rename to root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/run index a3df72d..214fcec --- a/root/etc/cont-init.d/40-confs +++ b/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/run @@ -172,4 +172,4 @@ fi # permissions chown -R abc:abc \ - /config \ No newline at end of file + /config diff --git a/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/type b/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/up b/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/up new file mode 100644 index 0000000..0f3fa81 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-wireguard-confs/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-wireguard-confs/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/30-module b/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/run old mode 100644 new mode 100755 similarity index 79% rename from root/etc/cont-init.d/30-module rename to root/etc/s6-overlay/s6-rc.d/init-wireguard-module/run index 0e2099f..2e4d435 --- a/root/etc/cont-init.d/30-module +++ b/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/run @@ -30,31 +30,39 @@ if [ "$SKIP_COMPILE" != "true" ] && [ ! -e /lib/modules/$(uname -r)/build ]; the apt-get install -y \ raspberrypi-kernel-headers elif uname -v | grep -q 'Ubuntu'; then - echo "**** Ubuntu kernel detected, but likely not Focal. ****" - echo "**** Attempting to install kernel headers from Ubuntu Bionic repo ****" + echo "**** Ubuntu kernel detected, but likely not Jammy. ****" + echo "**** Attempting to install kernel headers from Ubuntu Focal repo ****" if uname -m | grep -q 'x86_64'; then echo -e \ - "deb http://archive.ubuntu.com/ubuntu/ bionic main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted\n\ndeb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted" \ - > /etc/apt/sources.list.d/xenial-bionic.list + "deb http://archive.ubuntu.com/ubuntu/ focal main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ focal main restricted\n\ndeb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted\ndeb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted" \ + > /etc/apt/sources.list.d/xenial-bionic-focal.list else echo -e \ - "deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted\ndeb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted\n\ndeb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted\ndeb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted" \ - > /etc/apt/sources.list.d/xenial-bionic.list + "deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted\ndeb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted\n\ndeb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted\ndeb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted" \ + > /etc/apt/sources.list.d/xenial-bionic-focal.list fi apt-get update if apt-cache show linux-headers-$(uname -r) 2&>1 >/dev/null; then apt-get install -y \ linux-headers-$(uname -r) else - echo "**** No kernel headers found in the Ubuntu Bionic repo!! Trying Ubuntu Xenial. ****" - sed -i 's/bionic/xenial/g' /etc/apt/sources.list.d/xenial-bionic.list + echo "**** No kernel headers found in the Ubuntu Focal repo!! Trying Ubuntu Bionic. ****" + sed -i 's/focal/bionic/g' /etc/apt/sources.list.d/xenial-bionic-focal.list apt-get update if apt-cache show linux-headers-$(uname -r) 2&>1 >/dev/null; then apt-get install -y \ linux-headers-$(uname -r) else - echo "**** No kernel headers found in the Ubuntu repos!! Will try the headers from host (if mapped), may or may not work ****" - rm -rf /etc/apt/sources.list.d/xenial-bionic.list + echo "**** No kernel headers found in the Ubuntu Bionic repo!! Trying Ubuntu Xenial. ****" + sed -i 's/bionic/xenial/g' /etc/apt/sources.list.d/xenial-bionic-focal.list + apt-get update + if apt-cache show linux-headers-$(uname -r) 2&>1 >/dev/null; then + apt-get install -y \ + linux-headers-$(uname -r) + else + echo "**** No kernel headers found in the Ubuntu repos!! Will try the headers from host (if mapped), may or may not work ****" + rm -rf /etc/apt/sources.list.d/xenial-bionic-focal.list + fi fi fi elif uname -v | grep -q 'Debian'; then @@ -150,4 +158,3 @@ DUDE sleep infinity fi fi - diff --git a/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/type b/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/up b/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/up new file mode 100644 index 0000000..86cfd76 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-wireguard-module/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-wireguard-module/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/svc-coredns/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-coredns/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-coredns/notification-fd b/root/etc/s6-overlay/s6-rc.d/svc-coredns/notification-fd new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-coredns/notification-fd @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/root/etc/services.d/coredns/run b/root/etc/s6-overlay/s6-rc.d/svc-coredns/run old mode 100644 new mode 100755 similarity index 54% rename from root/etc/services.d/coredns/run rename to root/etc/s6-overlay/s6-rc.d/svc-coredns/run index 5448654..4206c53 --- a/root/etc/services.d/coredns/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-coredns/run @@ -1,11 +1,11 @@ #!/usr/bin/with-contenv bash -cd /config/coredns - if netstat -apn | grep -q ":53 "; then echo "Another service is using port 53, disabling CoreDNS" sleep infinity else exec \ - /app/coredns -dns.port=53 -fi \ No newline at end of file + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z -u 127.0.0.1 53" \ + cd /config/coredns \ + /app/coredns -dns.port=53 +fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-coredns/type b/root/etc/s6-overlay/s6-rc.d/svc-coredns/type new file mode 100644 index 0000000..1780f9f --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-coredns/type @@ -0,0 +1 @@ +longrun \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/svc-wireguard/dependencies.d/svc-coredns b/root/etc/s6-overlay/s6-rc.d/svc-wireguard/dependencies.d/svc-coredns new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/wireguard/run b/root/etc/s6-overlay/s6-rc.d/svc-wireguard/run old mode 100644 new mode 100755 similarity index 100% rename from root/etc/services.d/wireguard/run rename to root/etc/s6-overlay/s6-rc.d/svc-wireguard/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-wireguard/type b/root/etc/s6-overlay/s6-rc.d/svc-wireguard/type new file mode 100644 index 0000000..1780f9f --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-wireguard/type @@ -0,0 +1 @@ +longrun \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-wireguard-confs b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-wireguard-confs new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-wireguard-module b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-wireguard-module new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-coredns b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-coredns new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-wireguard b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-wireguard new file mode 100644 index 0000000..e69de29