From e4f0ceb2e5d3373efa18d5d14fe4c48e9eea5805 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 5 Sep 2020 10:22:49 -0400 Subject: [PATCH 01/14] Bot Updating Package Versions --- package_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_versions.txt b/package_versions.txt index 63302e5..9abb734 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -180,7 +180,7 @@ libuuid12.31.1-0.4ubuntu3.6 libwind0-heimdal7.5.0+dfsg-1 libxtables121.6.1-2ubuntu2 libzstd11.3.3+dfsg-2ubuntu1.1 -linux-libc-dev4.15.0-112.113 +linux-libc-dev4.15.0-115.116 locales2.27-3ubuntu1.2 login1:4.5-1ubuntu2 lsb-base9.20170808ubuntu1 From 6ef1d120dd42ec7aae52a33d4d8808ba9e76c354 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 12 Sep 2020 14:23:07 +0000 Subject: [PATCH 02/14] Bot Updating Package Versions --- package_versions.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package_versions.txt b/package_versions.txt index 9abb734..8baf86b 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -1,7 +1,7 @@ adduser3.116ubuntu1 apt1.6.12ubuntu0.1 apt-utils1.6.12ubuntu0.1 -base-files10.1ubuntu2.9 +base-files10.1ubuntu2.10 base-passwd3.5.44 bash4.4.18-2ubuntu1.2 bc1.07.1-2 @@ -141,10 +141,10 @@ libnghttp2-141.30.0-1ubuntu1 libnpth01.5-3 libonig46.7.0-1 libp11-kit00.23.9-2 -libpam0g1.1.8-3.6ubuntu2.18.04.1 -libpam-modules1.1.8-3.6ubuntu2.18.04.1 -libpam-modules-bin1.1.8-3.6ubuntu2.18.04.1 -libpam-runtime1.1.8-3.6ubuntu2.18.04.1 +libpam0g1.1.8-3.6ubuntu2.18.04.2 +libpam-modules1.1.8-3.6ubuntu2.18.04.2 +libpam-modules-bin1.1.8-3.6ubuntu2.18.04.2 +libpam-runtime1.1.8-3.6ubuntu2.18.04.2 libpcre32:8.39-9 libperl5.265.26.1-6ubuntu0.3 libpng16-161.6.34-1ubuntu0.18.04.2 @@ -180,7 +180,7 @@ libuuid12.31.1-0.4ubuntu3.6 libwind0-heimdal7.5.0+dfsg-1 libxtables121.6.1-2ubuntu2 libzstd11.3.3+dfsg-2ubuntu1.1 -linux-libc-dev4.15.0-115.116 +linux-libc-dev4.15.0-117.118 locales2.27-3ubuntu1.2 login1:4.5-1ubuntu2 lsb-base9.20170808ubuntu1 From c9a3a5775521702e9334ac17673c0862431cb25a Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Wed, 16 Sep 2020 11:27:20 -0400 Subject: [PATCH 03/14] Maintaining local access to attached services --- readme-vars.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/readme-vars.yml b/readme-vars.yml index 30da6ea..4f78ef8 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -84,6 +84,19 @@ app_setup_block: | This is not a Wireguard specific issue and the two generally accepted solutions are NAT reflection (setting your edge router/firewall up in such a way as it translates internal packets correctly) or split horizon DNS (setting your internal DNS to return the private rather than public IP when connecting locally). Both of these approaches have positives and negatives however their setup is out of scope for this document as everyone's network layout and equipment will be different. + + ## Maintaining local access to attached services + + When routing via Wireguard from another container using the `service` option in docker, you might lose access to the containers webUI locally. To avoid this, exclude the docker subnet from being routed via Wireguard by modifying your `wg0.conf` like so: + + ``` + [Interface] + PrivateKey = + Address = 9.8.7.6/32 + DNS = 8.8.8.8 + PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL ! -d 192.168.1.0/24 -j REJECT ! -d 172.17.0.1/16 -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT + PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL ! -d 192.168.1.0/24 -j REJECT ! -d 172.17.0.1/16 -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT + ``` # changelog changelogs: From a28d316fa89dfbf612cf6a2fb3367b316d386028 Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Wed, 16 Sep 2020 11:30:24 -0400 Subject: [PATCH 04/14] a more universal snippet for wireguard --- readme-vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme-vars.yml b/readme-vars.yml index 4f78ef8..5fb3a36 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -87,15 +87,15 @@ app_setup_block: | ## Maintaining local access to attached services - When routing via Wireguard from another container using the `service` option in docker, you might lose access to the containers webUI locally. To avoid this, exclude the docker subnet from being routed via Wireguard by modifying your `wg0.conf` like so: + When routing via Wireguard from another container using the `service` option in docker, you might lose access to the containers webUI locally. To avoid this, exclude the docker subnet from being routed via Wireguard by modifying your `wg0.conf` like so (modifying the subnets as you require): ``` [Interface] PrivateKey = Address = 9.8.7.6/32 DNS = 8.8.8.8 - PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL ! -d 192.168.1.0/24 -j REJECT ! -d 172.17.0.1/16 -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT - PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL ! -d 192.168.1.0/24 -j REJECT ! -d 172.17.0.1/16 -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT + PostUp = DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route add $HOMENET3 via $DROUTE;ip route add $HOMENET2 via $DROUTE; ip route add $HOMENET via $DROUTE;iptables -I OUTPUT -d $HOMENET -j ACCEPT;iptables -A OUTPUT -d $HOMENET2 -j ACCEPT; iptables -A OUTPUT -d $HOMENET3 -j ACCEPT; iptables -A OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT + PreDown = HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -s $HOMENET -j ACCEPT; iptables -D OUTPUT -s $HOMENET2 -j ACCEPT; iptables -D OUTPUT -s $HOMENET3 -j ACCEPT ``` # changelog From 104301dbd1604eabcfc4933a3b4e23fceb7ae72e Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Wed, 16 Sep 2020 11:33:29 -0400 Subject: [PATCH 05/14] added unsupported disclaimer --- readme-vars.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme-vars.yml b/readme-vars.yml index 5fb3a36..e510773 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -87,6 +87,8 @@ app_setup_block: | ## Maintaining local access to attached services + ** Note: This is not a supported configuration by Linuxserver.io - use at your own risk. + When routing via Wireguard from another container using the `service` option in docker, you might lose access to the containers webUI locally. To avoid this, exclude the docker subnet from being routed via Wireguard by modifying your `wg0.conf` like so (modifying the subnets as you require): ``` From d1e4f776d2fb462be3cb27c3f0458e06e899e83a Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 19 Sep 2020 10:20:39 -0400 Subject: [PATCH 06/14] Bot Updating Package Versions --- package_versions.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package_versions.txt b/package_versions.txt index 8baf86b..3e406de 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -20,7 +20,7 @@ dash0.5.8-2.10 debconf1.5.66ubuntu1 debianutils4.8.4 diffutils1:3.6-1 -dirmngr2.2.4-1ubuntu1.2 +dirmngr2.2.4-1ubuntu1.3 dkms2.3-3ubuntu9.7 dpkg1.19.0.5ubuntu2.3 dpkg-dev1.19.0.5ubuntu2.3 @@ -35,16 +35,16 @@ gcc-7-base7.5.0-3ubuntu1~18.04 gcc-8-base8.4.0-1ubuntu1~18.04 git1:2.17.1-1ubuntu0.7 git-man1:2.17.1-1ubuntu0.7 -gnupg2.2.4-1ubuntu1.2 -gnupg-l10n2.2.4-1ubuntu1.2 -gnupg-utils2.2.4-1ubuntu1.2 -gpg2.2.4-1ubuntu1.2 -gpg-agent2.2.4-1ubuntu1.2 -gpgconf2.2.4-1ubuntu1.2 -gpgsm2.2.4-1ubuntu1.2 -gpgv2.2.4-1ubuntu1.2 -gpg-wks-client2.2.4-1ubuntu1.2 -gpg-wks-server2.2.4-1ubuntu1.2 +gnupg2.2.4-1ubuntu1.3 +gnupg-l10n2.2.4-1ubuntu1.3 +gnupg-utils2.2.4-1ubuntu1.3 +gpg2.2.4-1ubuntu1.3 +gpg-agent2.2.4-1ubuntu1.3 +gpgconf2.2.4-1ubuntu1.3 +gpgsm2.2.4-1ubuntu1.3 +gpgv2.2.4-1ubuntu1.3 +gpg-wks-client2.2.4-1ubuntu1.3 +gpg-wks-server2.2.4-1ubuntu1.3 grep3.1-2build1 gzip1.6-5ubuntu1 hostname3.20 From 95c7e249606aa29a3ce80e963d0753ca0444be51 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Tue, 22 Sep 2020 10:02:11 -0400 Subject: [PATCH 07/14] Bot Updating Templated Files --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 04a6ead..b1d2379 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,21 @@ This is not a Wireguard specific issue and the two generally accepted solutions Both of these approaches have positives and negatives however their setup is out of scope for this document as everyone's network layout and equipment will be different. +## Maintaining local access to attached services + +** Note: This is not a supported configuration by Linuxserver.io - use at your own risk. + +When routing via Wireguard from another container using the `service` option in docker, you might lose access to the containers webUI locally. To avoid this, exclude the docker subnet from being routed via Wireguard by modifying your `wg0.conf` like so (modifying the subnets as you require): + + ``` + [Interface] + PrivateKey = + Address = 9.8.7.6/32 + DNS = 8.8.8.8 + PostUp = DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route add $HOMENET3 via $DROUTE;ip route add $HOMENET2 via $DROUTE; ip route add $HOMENET via $DROUTE;iptables -I OUTPUT -d $HOMENET -j ACCEPT;iptables -A OUTPUT -d $HOMENET2 -j ACCEPT; iptables -A OUTPUT -d $HOMENET3 -j ACCEPT; iptables -A OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT + PreDown = HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -s $HOMENET -j ACCEPT; iptables -D OUTPUT -s $HOMENET2 -j ACCEPT; iptables -D OUTPUT -s $HOMENET3 -j ACCEPT + ``` + ## Docker Mods [![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=mods&query=%24.mods%5B%27wireguard%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=wireguard "view available mods for this container.") From 3f058503cbb29dedf2ce84fd166e9f74114faedf Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Tue, 22 Sep 2020 15:09:29 +0100 Subject: [PATCH 08/14] Bot Updating Package Versions --- package_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_versions.txt b/package_versions.txt index 3e406de..690a8f3 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -180,7 +180,7 @@ libuuid12.31.1-0.4ubuntu3.6 libwind0-heimdal7.5.0+dfsg-1 libxtables121.6.1-2ubuntu2 libzstd11.3.3+dfsg-2ubuntu1.1 -linux-libc-dev4.15.0-117.118 +linux-libc-dev4.15.0-118.119 locales2.27-3ubuntu1.2 login1:4.5-1ubuntu2 lsb-base9.20170808ubuntu1 From 83aeadf8ded6fdd6d7180343a519e088adceba12 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 26 Sep 2020 10:24:11 -0400 Subject: [PATCH 09/14] Bot Updating Package Versions --- package_versions.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/package_versions.txt b/package_versions.txt index 690a8f3..0f45b6a 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -8,7 +8,7 @@ bc1.07.1-2 binutils2.30-21ubuntu1~18.04.4 binutils-common2.30-21ubuntu1~18.04.4 binutils-x86-64-linux-gnu2.30-21ubuntu1~18.04.4 -bsdutils1:2.31.1-0.4ubuntu3.6 +bsdutils1:2.31.1-0.4ubuntu3.7 build-essential12.4ubuntu1 bzip21.0.6-8.1ubuntu0.2 ca-certificates20190110~18.04.1 @@ -25,7 +25,7 @@ dkms2.3-3ubuntu9.7 dpkg1.19.0.5ubuntu2.3 dpkg-dev1.19.0.5ubuntu2.3 e2fsprogs1.44.1-1ubuntu1.3 -fdisk2.31.1-0.4ubuntu3.6 +fdisk2.31.1-0.4ubuntu3.7 findutils4.6.0+git+20170828-2 g++4:7.4.0-1ubuntu2.3 g++-77.5.0-3ubuntu1~18.04 @@ -67,7 +67,7 @@ libattr11:2.4.47-2build1 libaudit11:2.8.2-1ubuntu1 libaudit-common1:2.8.2-1ubuntu1 libbinutils2.30-21ubuntu1~18.04.4 -libblkid12.31.1-0.4ubuntu3.6 +libblkid12.31.1-0.4ubuntu3.7 libbz2-1.01.0.6-8.1ubuntu0.2 libc62.27-3ubuntu1.2 libc6-dev2.27-3ubuntu1.2 @@ -88,7 +88,7 @@ libelf-dev0.170-0.4ubuntu0.1 liberror-perl0.17025-1 libexpat12.2.5-3ubuntu0.2 libext2fs21.44.1-1ubuntu1.3 -libfdisk12.31.1-0.4ubuntu3.6 +libfdisk12.31.1-0.4ubuntu3.7 libffi63.2.1-8 libgcc11:8.4.0-1ubuntu1~18.04 libgcc-7-dev7.5.0-3ubuntu1~18.04 @@ -128,7 +128,7 @@ liblsan08.4.0-1ubuntu1~18.04 liblz4-10.0~r131-2ubuntu3 liblzma55.2.2-1.3 libmnl01.0.4-2 -libmount12.31.1-0.4ubuntu3.6 +libmount12.31.1-0.4ubuntu3.7 libmpc31.1.0-1 libmpfr64.0.1-1 libmpx28.4.0-1ubuntu1~18.04 @@ -163,7 +163,7 @@ libselinux12.7-2build2 libsemanage12.7-2build2 libsemanage-common2.7-2build2 libsepol12.7-1 -libsmartcols12.31.1-0.4ubuntu3.6 +libsmartcols12.31.1-0.4ubuntu3.7 libsqlite3-03.22.0-1ubuntu0.4 libss21.44.1-1ubuntu1.3 libssl1.11.1.1-1ubuntu2.1~18.04.6 @@ -176,7 +176,7 @@ libtsan08.4.0-1ubuntu1~18.04 libubsan07.5.0-3ubuntu1~18.04 libudev1237-3ubuntu10.42 libunistring20.9.9-0ubuntu2 -libuuid12.31.1-0.4ubuntu3.6 +libuuid12.31.1-0.4ubuntu3.7 libwind0-heimdal7.5.0+dfsg-1 libxtables121.6.1-2ubuntu2 libzstd11.3.3+dfsg-2ubuntu1.1 @@ -186,7 +186,7 @@ login1:4.5-1ubuntu2 lsb-base9.20170808ubuntu1 make4.1-9.1ubuntu1 mawk1.3.3-17ubuntu3 -mount2.31.1-0.4ubuntu3.6 +mount2.31.1-0.4ubuntu3.7 multiarch-support2.27-3ubuntu1.2 ncurses-base6.1-1ubuntu1.18.04 ncurses-bin6.1-1ubuntu1.18.04 @@ -209,7 +209,7 @@ sysvinit-utils2.88dsf-59.10ubuntu1 tar1.29b-2ubuntu0.1 tzdata2020a-0ubuntu0.18.04 ubuntu-keyring2018.09.18.1~18.04.0 -util-linux2.31.1-0.4ubuntu3.6 +util-linux2.31.1-0.4ubuntu3.7 xz-utils5.2.2-1.3 zlib1g1:1.2.11.dfsg-0ubuntu2 zlib1g-dev1:1.2.11.dfsg-0ubuntu2 From 695c47ebdcc51f840a1f4365db007ba8e0c2a8d4 Mon Sep 17 00:00:00 2001 From: Tokugero Date: Sun, 27 Sep 2020 15:47:15 -0700 Subject: [PATCH 10/14] Update readme-vars.yml Fixing badly matched PreDown suggestions in the readme. --- readme-vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme-vars.yml b/readme-vars.yml index e510773..de53d16 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -97,7 +97,7 @@ app_setup_block: | Address = 9.8.7.6/32 DNS = 8.8.8.8 PostUp = DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route add $HOMENET3 via $DROUTE;ip route add $HOMENET2 via $DROUTE; ip route add $HOMENET via $DROUTE;iptables -I OUTPUT -d $HOMENET -j ACCEPT;iptables -A OUTPUT -d $HOMENET2 -j ACCEPT; iptables -A OUTPUT -d $HOMENET3 -j ACCEPT; iptables -A OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT - PreDown = HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -s $HOMENET -j ACCEPT; iptables -D OUTPUT -s $HOMENET2 -j ACCEPT; iptables -D OUTPUT -s $HOMENET3 -j ACCEPT + PreDown = HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route del $HOMENET3 via $DROUTE;ip route del $HOMENET2 via $DROUTE; ip route del $HOMENET via $DROUTE; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -d $HOMENET -j ACCEPT; iptables -D OUTPUT -d $HOMENET2 -j ACCEPT; iptables -D OUTPUT -d $HOMENET3 -j ACCEPT ``` # changelog From eff304e343031f633701c2f6a0d69956228f64fd Mon Sep 17 00:00:00 2001 From: Tokugero Date: Sun, 27 Sep 2020 15:49:00 -0700 Subject: [PATCH 11/14] Update readme-vars.yml Adding changelog --- readme-vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/readme-vars.yml b/readme-vars.yml index de53d16..4c29321 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -102,6 +102,7 @@ app_setup_block: | # changelog changelogs: + - { date: "27.09.20:", desc: "Cleaning service binding example to have accurate PreDown script." } - { date: "06.08.20:", desc: "Replace resolvconf with openresolv due to dns issues when a client based on this image is connected to a server also based on this image. Add IPv6 info to readme. Display kernel version in logs." } - { date: "29.07.20:", desc: "Update Coredns config to detect dns loops (existing users need to delete `/config/coredns/Corefile` and restart)." } - { date: "27.07.20:", desc: "Update Coredns config to prevent issues with non-user-defined bridge networks (existing users need to delete `/config/coredns/Corefile` and restart)." } From 2d3af20c16dadebd4c3b677e80f98e23d1cf6c16 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sun, 27 Sep 2020 19:41:32 -0400 Subject: [PATCH 12/14] Bot Updating Templated Files --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b1d2379..6bf09fd 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ When routing via Wireguard from another container using the `service` option in Address = 9.8.7.6/32 DNS = 8.8.8.8 PostUp = DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route add $HOMENET3 via $DROUTE;ip route add $HOMENET2 via $DROUTE; ip route add $HOMENET via $DROUTE;iptables -I OUTPUT -d $HOMENET -j ACCEPT;iptables -A OUTPUT -d $HOMENET2 -j ACCEPT; iptables -A OUTPUT -d $HOMENET3 -j ACCEPT; iptables -A OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT - PreDown = HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -s $HOMENET -j ACCEPT; iptables -D OUTPUT -s $HOMENET2 -j ACCEPT; iptables -D OUTPUT -s $HOMENET3 -j ACCEPT + PreDown = HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route del $HOMENET3 via $DROUTE;ip route del $HOMENET2 via $DROUTE; ip route del $HOMENET via $DROUTE; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -d $HOMENET -j ACCEPT; iptables -D OUTPUT -d $HOMENET2 -j ACCEPT; iptables -D OUTPUT -d $HOMENET3 -j ACCEPT ``` @@ -285,6 +285,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **27.09.20:** - Cleaning service binding example to have accurate PreDown script. * **06.08.20:** - Replace resolvconf with openresolv due to dns issues when a client based on this image is connected to a server also based on this image. Add IPv6 info to readme. Display kernel version in logs. * **29.07.20:** - Update Coredns config to detect dns loops (existing users need to delete `/config/coredns/Corefile` and restart). * **27.07.20:** - Update Coredns config to prevent issues with non-user-defined bridge networks (existing users need to delete `/config/coredns/Corefile` and restart). From c8d9fd1b7a5c185a7b97a45396b3bfee24ba89ff Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 3 Oct 2020 14:17:58 +0000 Subject: [PATCH 13/14] Bot Updating Templated Files --- .github/ISSUE_TEMPLATE.md | 12 +++-- .github/PULL_REQUEST_TEMPLATE.md | 10 ++-- .github/workflows/greetings.yml | 4 +- Jenkinsfile | 28 ++++++++++- README.md | 83 +++++++++++++++++--------------- 5 files changed, 86 insertions(+), 51 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index da0c279..7d92262 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,7 +1,10 @@ [linuxserverurl]: https://linuxserver.io [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] -If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. + + + + @@ -22,9 +25,10 @@ If you are new to Docker or this application our issue tracker is **ONLY** used 4. ## Environment -**OS:** -**CPU architecture:** x86_64/arm32/arm64 -**How docker service was installed:** +**OS:** +**CPU architecture:** x86_64/arm32/arm64 +**How docker service was installed:** + ## Command used to create docker container (run/create/compose/screenshot) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 26d5031..f50314f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,11 +2,11 @@ [linuxserverurl]: https://linuxserver.io [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] - + - + @@ -21,7 +21,11 @@ ------------------------------ -We welcome all PR’s though this doesn’t guarantee it will be accepted. + - [ ] I have read the [contributing](https://github.com/linuxserver/docker-wireguard/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications + +------------------------------ + + ## Description: diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index b7f6355..f116d9f 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -8,6 +8,6 @@ jobs: steps: - uses: actions/first-interaction@v1 with: - issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-wireguard/.github/ISSUE_TEMPLATE.md)!' - pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-wireguard/.github/PULL_REQUEST_TEMPLATE.md)!' + issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-wireguard/blob/master/.github/ISSUE_TEMPLATE.md)!' + pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-wireguard/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!' repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Jenkinsfile b/Jenkinsfile index e80382b..04f48d9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,7 +55,7 @@ pipeline { env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/' env.PULL_REQUEST = env.CHANGE_ID - env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./root/donate.txt' + env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./root/donate.txt' } script{ env.LS_RELEASE_NUMBER = sh( @@ -136,6 +136,7 @@ pipeline { env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER } env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN } } } @@ -156,6 +157,7 @@ pipeline { env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA } env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/' } } @@ -176,6 +178,7 @@ pipeline { env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST } env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/' } @@ -543,8 +546,10 @@ pipeline { for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG} docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:latest + docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG} docker push ${PUSHIMAGE}:latest docker push ${PUSHIMAGE}:${META_TAG} + docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG} done ''' } @@ -552,6 +557,7 @@ pipeline { for DELETEIMAGE in "${GITHUBIMAGE}" "{GITLABIMAGE}" "${IMAGE}"; do docker rmi \ ${DELETEIMAGE}:${META_TAG} \ + ${DELETEIMAGE}:${EXT_RELEASE_TAG} \ ${DELETEIMAGE}:latest || : done ''' @@ -592,12 +598,18 @@ pipeline { docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-latest docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-latest docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-latest + docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} + docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} + docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker push ${MANIFESTIMAGE}:amd64-${META_TAG} docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG} docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG} docker push ${MANIFESTIMAGE}:amd64-latest docker push ${MANIFESTIMAGE}:arm32v7-latest docker push ${MANIFESTIMAGE}:arm64v8-latest + docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} + docker push ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} + docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker manifest push --purge ${MANIFESTIMAGE}:latest || : docker manifest create ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm32v7-latest ${MANIFESTIMAGE}:arm64v8-latest docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm32v7-latest --os linux --arch arm @@ -606,8 +618,12 @@ pipeline { docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8 + docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} + docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm + docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8 docker manifest push --purge ${MANIFESTIMAGE}:latest docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} + docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} done docker tag ${IMAGE}:amd64-${META_TAG} ${GITHUBIMAGE}:amd64-${META_TAG} docker tag ${IMAGE}:arm32v7-${META_TAG} ${GITHUBIMAGE}:arm32v7-${META_TAG} @@ -616,6 +632,10 @@ pipeline { docker tag ${GITHUBIMAGE}:amd64-${META_TAG} ${GITHUBIMAGE}:${META_TAG} docker tag ${GITHUBIMAGE}:arm32v7-${META_TAG} ${GITHUBIMAGE}:arm32v7-latest docker tag ${GITHUBIMAGE}:arm64v8-${META_TAG} ${GITHUBIMAGE}:arm64v8-latest + docker tag ${GITHUBIMAGE}:amd64-${META_TAG} ${GITHUBIMAGE}:amd64-${EXT_RELEASE_TAG} + docker tag ${GITHUBIMAGE}:amd64-${META_TAG} ${GITHUBIMAGE}:${EXT_RELEASE_TAG} + docker tag ${GITHUBIMAGE}:arm32v7-${META_TAG} ${GITHUBIMAGE}:arm32v7-${EXT_RELEASE_TAG} + docker tag ${GITHUBIMAGE}:arm64v8-${META_TAG} ${GITHUBIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker push ${GITHUBIMAGE}:amd64-${META_TAG} docker push ${GITHUBIMAGE}:arm32v7-${META_TAG} docker push ${GITHUBIMAGE}:arm64v8-${META_TAG} @@ -623,6 +643,10 @@ pipeline { docker push ${GITHUBIMAGE}:${META_TAG} docker push ${GITHUBIMAGE}:arm32v7-latest docker push ${GITHUBIMAGE}:arm64v8-latest + docker push ${GITHUBIMAGE}:${EXT_RELEASE_TAG} + docker push ${GITHUBIMAGE}:amd64-${EXT_RELEASE_TAG} + docker push ${GITHUBIMAGE}:arm32v7-${EXT_RELEASE_TAG} + docker push ${GITHUBIMAGE}:arm64v8-${EXT_RELEASE_TAG} ''' } sh '''#! /bin/bash @@ -691,7 +715,7 @@ pipeline { set -e TEMPDIR=$(mktemp -d) docker pull linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest + docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest docker pull lsiodev/readme-sync docker run --rm=true \ -e DOCKERHUB_USERNAME=$DOCKERUSER \ diff --git a/README.md b/README.md index 6bf09fd..c61f960 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ + + + [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io) [![Blog](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io "all the things you can do with our containers including How-To guides, opinions and much more!") @@ -33,7 +36,6 @@ Find us at: [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/wireguard.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/wireguard) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/wireguard.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/wireguard) [![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-wireguard%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/) -[![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Flsio-ci.ams3.digitaloceanspaces.com%2Flinuxserver%2Fwireguard%2Flatest%2Fci-status.yml)](https://lsio-ci.ams3.digitaloceanspaces.com/linuxserver/wireguard/latest/index.html) [WireGuard®](https://www.wireguard.com/) is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. Initially released for the Linux kernel, it is now cross-platform (Windows, macOS, BSD, iOS, Android) and widely deployable. It is currently under heavy development, but already it might be regarded as the most secure, easiest to use, and simplest VPN solution in the industry. @@ -58,35 +60,11 @@ The architectures supported by this image are: Here are some example snippets to help you get started creating a container. -### docker - -``` -docker create \ - --name=wireguard \ - --cap-add=NET_ADMIN \ - --cap-add=SYS_MODULE \ - -e PUID=1000 \ - -e PGID=1000 \ - -e TZ=Europe/London \ - -e SERVERURL=wireguard.domain.com `#optional` \ - -e SERVERPORT=51820 `#optional` \ - -e PEERS=1 `#optional` \ - -e PEERDNS=auto `#optional` \ - -e INTERNAL_SUBNET=10.13.13.0 `#optional` \ - -p 51820:51820/udp \ - -v /path/to/appdata/config:/config \ - -v /lib/modules:/lib/modules \ - --sysctl="net.ipv4.conf.all.src_valid_mark=1" \ - --restart unless-stopped \ - linuxserver/wireguard -``` - - -### docker-compose +### docker-compose ([recommended](https://docs.linuxserver.io/general/docker-compose)) Compatible with docker-compose v2 schemas. -``` +```yaml --- version: "2.1" services: @@ -115,6 +93,30 @@ services: restart: unless-stopped ``` +### docker cli + +``` +docker run -d \ + --name=wireguard \ + --cap-add=NET_ADMIN \ + --cap-add=SYS_MODULE \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ=Europe/London \ + -e SERVERURL=wireguard.domain.com `#optional` \ + -e SERVERPORT=51820 `#optional` \ + -e PEERS=1 `#optional` \ + -e PEERDNS=auto `#optional` \ + -e INTERNAL_SUBNET=10.13.13.0 `#optional` \ + -p 51820:51820/udp \ + -v /path/to/appdata/config:/config \ + -v /lib/modules:/lib/modules \ + --sysctl="net.ipv4.conf.all.src_valid_mark=1" \ + --restart unless-stopped \ + linuxserver/wireguard +``` + + ## Parameters Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `:` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container. @@ -216,9 +218,9 @@ When routing via Wireguard from another container using the `service` option in ## Docker Mods -[![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=mods&query=%24.mods%5B%27wireguard%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=wireguard "view available mods for this container.") +[![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=wireguard&query=%24.mods%5B%27wireguard%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=wireguard "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.") -We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) can be accessed via the dynamic badge above. +We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above. ## Support Info @@ -236,14 +238,6 @@ Most of our images are static, versioned, and require an image update and contai Below are the instructions for updating containers: -### Via Docker Run/Create -* Update the image: `docker pull linuxserver/wireguard` -* Stop the running container: `docker stop wireguard` -* Delete the container: `docker rm wireguard` -* Recreate a new container with the same docker create parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved) -* Start the new container: `docker start wireguard` -* You can also remove the old dangling images: `docker image prune` - ### Via Docker Compose * Update all images: `docker-compose pull` * or update a single image: `docker-compose pull wireguard` @@ -251,7 +245,14 @@ Below are the instructions for updating containers: * or update a single container: `docker-compose up -d wireguard` * You can also remove the old dangling images: `docker image prune` -### Via Watchtower auto-updater (especially useful if you don't remember the original parameters) +### Via Docker Run +* Update the image: `docker pull linuxserver/wireguard` +* Stop the running container: `docker stop wireguard` +* Delete the container: `docker rm wireguard` +* Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved) +* You can also remove the old dangling images: `docker image prune` + +### Via Watchtower auto-updater (only use if you don't remember the original parameters) * Pull the latest image at its tag and replace it with the same env variables in one run: ``` docker run --rm \ @@ -259,10 +260,12 @@ Below are the instructions for updating containers: containrrr/watchtower \ --run-once wireguard ``` +* You can also remove the old dangling images: `docker image prune` -**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using Docker Compose. +**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose). -* You can also remove the old dangling images: `docker image prune` +### Image Update Notifications - Diun (Docker Image Update Notifier) +* We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported. ## Building locally From 74d4bb91b11efa54493788cc47df85c11dcd9b33 Mon Sep 17 00:00:00 2001 From: LinuxServer-CI Date: Sat, 3 Oct 2020 14:19:07 +0000 Subject: [PATCH 14/14] Bot Updating Templated Files --- .github/CONTRIBUTING.md | 122 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100755 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100755 index 0000000..406c0b3 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,122 @@ +# Contributing to wireguard + +## Gotchas + +* While contributing make sure to make all your changes before creating a Pull Request, as our pipeline builds each commit after the PR is open. +* Read, and fill the Pull Request template + * If this is a fix for a typo in code or documentation in the README please file an issue + * If the PR is addressing an existing issue include, closes #\, in the body of the PR commit message +* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn) + +## Common files + +| File | Use case | +| :----: | --- | +| `Dockerfile` | Dockerfile used to build amd64 images | +| `Dockerfile.aarch64` | Dockerfile used to build 64bit ARM architectures | +| `Dockerfile.armhf` | Dockerfile used to build 32bit ARM architectures | +| `Jenkinsfile` | This file is a product of our builder and should not be edited directly. This is used to build the image | +| `jenkins-vars.yml` | This file is used to generate the `Jenkinsfile` mentioned above, it only affects the build-process | +| `package_versions.txt` | This file is generated as a part of the build-process and should not be edited directly. It lists all the installed packages and their versions | +| `README.md` | This file is a product of our builder and should not be edited directly. This displays the readme for the repository and image registries | +| `readme-vars.yml` | This file is used to generate the `README.md` | + +## Readme + +If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit. +Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-wireguard/edit/master/readme-vars.yml). + +These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play. +Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io/images/docker-wireguard) + +### Fixing typos or clarify the text in the readme + +There are variables for multiple parts of the readme, the most common ones are: + +| Variable | Description | +| :----: | --- | +| `project_blurb` | This is the short excerpt shown above the project logo. | +| `app_setup_block` | This is the text that shows up under "Application Setup" if enabled | + +### Parameters + +The compose and run examples are also generated from these variables. + +We have a [reference file](https://github.com/linuxserver/docker-jenkins-builder/blob/master/vars/_container-vars-blank) in our Jenkins Builder. + +These are prefixed with `param_` for required parameters, or `opt_param` for optional parameters, except for `cap_add`. +Remember to enable param, if currently disabled. This differs between parameters, and can be seen in the reference file. + +Devices, environment variables, ports and volumes expects its variables in a certain way. + +### Devices + +```yml +param_devices: + - { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" } +opt_param_devices: + - { device_path: "/dev/dri", device_host_path: "/dev/dri", desc: "For hardware transcoding" } +``` + +### Environment variables + +```yml +param_env_vars: + - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London." } +opt_param_env_vars: + - { env_var: "VERSION", env_value: "latest", desc: "Supported values are LATEST, PLEXPASS or a specific version number." } +``` + +### Ports + +```yml +param_ports: + - { external_port: "80", internal_port: "80", port_desc: "Application WebUI" } +opt_param_ports: + - { external_port: "80", internal_port: "80", port_desc: "Application WebUI" } +``` + +### Volumes + +```yml +param_volumes: + - { vol_path: "/config", vol_host_path: "", desc: "Configuration files." } +opt_param_volumes: + - { vol_path: "/config", vol_host_path: "", desc: "Configuration files." } +``` + +### Testing template changes + +After you make any changes to the templates, you can use our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) to have the files updated from the modified templates. Please use the command found under `Running Locally` [on this page](https://github.com/linuxserver/docker-jenkins-builder/blob/master/README.md) to generate them prior to submitting a PR. + +## Dockerfiles + +We use multiple Dockerfiles in our repos, this is because sometimes some CPU architectures needs different packages to work. +If you are proposing additional packages to be added, ensure that you added the packages to all the Dockerfiles in alphabetical order. + +### Testing your changes + +``` +git clone https://github.com/linuxserver/docker-wireguard.git +cd docker-wireguard +docker build \ + --no-cache \ + --pull \ + -t linuxserver/wireguard:latest . +``` + +The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static` +``` +docker run --rm --privileged multiarch/qemu-user-static:register --reset +``` + +Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`. + +## Update the chagelog + +If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-wireguard/tree/master/root), add an entry to the changelog + +```yml +changelogs: + - { date: "DD.MM.YY:", desc: "Added some love to templates" } +```