Skip to content

Commit d0e03c4

Browse files
authored
Merge pull request #338 from linuxserver/master-3.20
Rebase to 3.20
2 parents ca9b10c + cdfbdac commit d0e03c4

File tree

7 files changed

+47
-61
lines changed

7 files changed

+47
-61
lines changed

.github/workflows/external_trigger.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ jobs:
2020
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_WIREGUARD_MASTER\". ****"
2121
echo "External trigger running off of master branch. To disable this trigger, set a Github secret named \`PAUSE_EXTERNAL_TRIGGER_WIREGUARD_MASTER\`" >> $GITHUB_STEP_SUMMARY
2222
echo "**** Retrieving external version ****"
23-
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/WireGuard/wireguard-tools/tags | jq -r .[0].name)
23+
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
24+
&& awk '/^P:'"wireguard-tools"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
2425
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2526
echo "**** Can't retrieve external version, exiting ****"
2627
FAILURE_REASON="Can't retrieve external version for wireguard branch master"
@@ -73,6 +74,14 @@ jobs:
7374
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
7475
echo "Version ${EXT_RELEASE} already pushed, exiting" >> $GITHUB_STEP_SUMMARY
7576
exit 0
77+
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"wireguard-tools"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
78+
echo "**** New version ${EXT_RELEASE} found; but not all arch repos updated yet; exiting ****"
79+
echo "New version ${EXT_RELEASE} found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
80+
FAILURE_REASON="New version ${EXT_RELEASE} for wireguard tag latest is detected, however not all arch repos are updated yet. Will try again later."
81+
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
82+
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
83+
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
84+
exit 0
7685
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
7786
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
7887
echo "New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY

Dockerfile

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine:3.19
3+
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
44

55
# set version label
66
ARG BUILD_DATE
@@ -11,11 +11,6 @@ LABEL maintainer="thespad"
1111

1212
RUN \
1313
echo "**** install dependencies ****" && \
14-
apk add --no-cache --virtual=build-dependencies \
15-
build-base \
16-
elfutils-dev \
17-
git \
18-
linux-headers && \
1914
apk add --no-cache \
2015
bc \
2116
coredns \
@@ -28,7 +23,8 @@ RUN \
2823
libcap-utils \
2924
libqrencode-tools \
3025
net-tools \
31-
openresolv && \
26+
openresolv \
27+
wireguard-tools && \
3228
echo "wireguard" >> /etc/modules && \
3329
cd /sbin && \
3430
for i in ! !-save !-restore; do \
@@ -37,22 +33,11 @@ RUN \
3733
ln -s iptables-legacy$(echo "${i}" | cut -c2-) iptables$(echo "${i}" | cut -c2-) && \
3834
ln -s ip6tables-legacy$(echo "${i}" | cut -c2-) ip6tables$(echo "${i}" | cut -c2-); \
3935
done && \
40-
echo "**** install wireguard-tools ****" && \
41-
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
42-
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
43-
| jq -r .[0].name); \
44-
fi && \
45-
cd /app && \
46-
git clone https://git.zx2c4.com/wireguard-tools && \
47-
cd wireguard-tools && \
48-
git checkout "${WIREGUARD_RELEASE}" && \
49-
sed -i 's|\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1|[[ $proto == -4 ]] \&\& [[ $(sysctl -n net.ipv4.conf.all.src_valid_mark) != 1 ]] \&\& cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1|' src/wg-quick/linux.bash && \
50-
make -C src -j$(nproc) && \
51-
make -C src install && \
36+
sed -i 's|\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1|[[ $proto == -4 ]] \&\& [[ $(sysctl -n net.ipv4.conf.all.src_valid_mark) != 1 ]] \&\& cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1|' /usr/bin/wg-quick && \
5237
rm -rf /etc/wireguard && \
5338
ln -s /config/wg_confs /etc/wireguard && \
39+
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
5440
echo "**** clean up ****" && \
55-
apk del --no-network build-dependencies && \
5641
rm -rf \
5742
/tmp/*
5843

Dockerfile.aarch64

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.19
3+
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20
44

55
# set version label
66
ARG BUILD_DATE
@@ -11,11 +11,6 @@ LABEL maintainer="thespad"
1111

1212
RUN \
1313
echo "**** install dependencies ****" && \
14-
apk add --no-cache --virtual=build-dependencies \
15-
build-base \
16-
elfutils-dev \
17-
git \
18-
linux-headers && \
1914
apk add --no-cache \
2015
bc \
2116
coredns \
@@ -28,7 +23,8 @@ RUN \
2823
libcap-utils \
2924
libqrencode-tools \
3025
net-tools \
31-
openresolv && \
26+
openresolv \
27+
wireguard-tools && \
3228
echo "wireguard" >> /etc/modules && \
3329
cd /sbin && \
3430
for i in ! !-save !-restore; do \
@@ -37,22 +33,11 @@ RUN \
3733
ln -s iptables-legacy$(echo "${i}" | cut -c2-) iptables$(echo "${i}" | cut -c2-) && \
3834
ln -s ip6tables-legacy$(echo "${i}" | cut -c2-) ip6tables$(echo "${i}" | cut -c2-); \
3935
done && \
40-
echo "**** install wireguard-tools ****" && \
41-
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
42-
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
43-
| jq -r .[0].name); \
44-
fi && \
45-
cd /app && \
46-
git clone https://git.zx2c4.com/wireguard-tools && \
47-
cd wireguard-tools && \
48-
git checkout "${WIREGUARD_RELEASE}" && \
49-
sed -i 's|\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1|[[ $proto == -4 ]] \&\& [[ $(sysctl -n net.ipv4.conf.all.src_valid_mark) != 1 ]] \&\& cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1|' src/wg-quick/linux.bash && \
50-
make -C src -j$(nproc) && \
51-
make -C src install && \
36+
sed -i 's|\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1|[[ $proto == -4 ]] \&\& [[ $(sysctl -n net.ipv4.conf.all.src_valid_mark) != 1 ]] \&\& cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1|' /usr/bin/wg-quick && \
5237
rm -rf /etc/wireguard && \
5338
ln -s /config/wg_confs /etc/wireguard && \
39+
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
5440
echo "**** clean up ****" && \
55-
apk del --no-network build-dependencies && \
5641
rm -rf \
5742
/tmp/*
5843

Jenkinsfile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ pipeline {
2525
DEV_DOCKERHUB_IMAGE = 'lsiodev/wireguard'
2626
PR_DOCKERHUB_IMAGE = 'lspipepr/wireguard'
2727
DIST_IMAGE = 'alpine'
28+
DIST_TAG = '3.20'
29+
DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.20/main/'
30+
DIST_REPO_PACKAGES = 'wireguard-tools'
2831
MULTIARCH='true'
2932
CI='false'
3033
CI_WEB='false'
3134
CI_PORT='8080'
3235
CI_SSL='false'
33-
CI_DELAY='120'
34-
CI_DOCKERENV='TZ=US/Pacific'
35-
CI_AUTH='user:password'
36+
CI_DELAY='60'
37+
CI_DOCKERENV=''
38+
CI_AUTH=''
3639
CI_WEBPATH=''
3740
}
3841
stages {
@@ -110,14 +113,15 @@ pipeline {
110113
/* ########################
111114
External Release Tagging
112115
######################## */
113-
// If this is a custom command to determine version use that command
114-
stage("Set tag custom bash"){
116+
// If this is an alpine repo change for external version determine an md5 from the version string
117+
stage("Set tag Alpine Repo"){
115118
steps{
116119
script{
117120
env.EXT_RELEASE = sh(
118-
script: ''' curl -sX GET https://api.github.com/repos/WireGuard/wireguard-tools/tags | jq -r .[0].name ''',
121+
script: '''curl -sL "${DIST_REPO}x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
122+
&& awk '/^P:'"${DIST_REPO_PACKAGES}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://' ''',
119123
returnStdout: true).trim()
120-
env.RELEASE_LINK = 'custom_command'
124+
env.RELEASE_LINK = 'alpine_repo'
121125
}
122126
}
123127
}
@@ -852,11 +856,11 @@ pipeline {
852856
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
853857
echo "Pushing New release for Tag"
854858
sh '''#! /bin/bash
855-
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
859+
echo "Updating external repo packages to ${EXT_RELEASE_CLEAN}" > releasebody.json
856860
echo '{"tag_name":"'${META_TAG}'",\
857861
"target_commitish": "master",\
858862
"name": "'${META_TAG}'",\
859-
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Remote Changes:**\\n\\n' > start
863+
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Repo Changes:**\\n\\n' > start
860864
printf '","draft": false,"prerelease": false}' >> releasebody.json
861865
paste -d'\\0' start releasebody.json > releasebody.json.done
862866
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ services:
160160
- PERSISTENTKEEPALIVE_PEERS= #optional
161161
- LOG_CONFS=true #optional
162162
volumes:
163-
- /path/to/appdata/config:/config
163+
- /path/to/wireguard/config:/config
164164
- /lib/modules:/lib/modules #optional
165165
ports:
166166
- 51820:51820/udp
@@ -188,7 +188,7 @@ docker run -d \
188188
-e PERSISTENTKEEPALIVE_PEERS= `#optional` \
189189
-e LOG_CONFS=true `#optional` \
190190
-p 51820:51820/udp \
191-
-v /path/to/appdata/config:/config \
191+
-v /path/to/wireguard/config:/config \
192192
-v /lib/modules:/lib/modules `#optional` \
193193
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
194194
--restart unless-stopped \
@@ -382,6 +382,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
382382

383383
## Versions
384384

385+
* **24.05.24:** - Rebase to Alpine 3.20, install wireguard-tools from Alpine repo.
385386
* **10.03.24:** - Use iptables-legacy on Alpine 3.19.
386387
* **05.03.24:** - Rebase master to Alpine 3.19.
387388
* **03.10.23:** - **Potentially Breaking Change:** Support for multiple interfaces added. Wireguard confs moved to `/config/wg_confs/`. Any file with a `.conf` extension in that folder will be treated as a live tunnel config and will be attempted to start. If any of the tunnels fail, all tunnels will be stopped. Tunnels are started in alphabetical order. Managed server conf will continue to be hardcoded to `wg0.conf`.

jenkins-vars.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
# jenkins variables
44
project_name: docker-wireguard
5-
external_type: na
6-
custom_version_command: "curl -sX GET https://api.github.com/repos/WireGuard/wireguard-tools/tags | jq -r .[0].name"
5+
external_type: alpine_repo
76
release_type: stable
87
release_tag: latest
98
ls_branch: master
10-
build_armhf: false
119
repo_vars:
1210
- CONTAINER_NAME = 'wireguard'
1311
- BUILD_VERSION_ARG = 'WIREGUARD_VERSION'
@@ -17,14 +15,17 @@ repo_vars:
1715
- DEV_DOCKERHUB_IMAGE = 'lsiodev/wireguard'
1816
- PR_DOCKERHUB_IMAGE = 'lspipepr/wireguard'
1917
- DIST_IMAGE = 'alpine'
18+
- DIST_TAG = '3.20'
19+
- DIST_REPO = 'http://dl-cdn.alpinelinux.org/alpine/v3.20/main/'
20+
- DIST_REPO_PACKAGES = 'wireguard-tools'
2021
- MULTIARCH='true'
2122
- CI='false'
2223
- CI_WEB='false'
2324
- CI_PORT='8080'
2425
- CI_SSL='false'
25-
- CI_DELAY='120'
26-
- CI_DOCKERENV='TZ=US/Pacific'
27-
- CI_AUTH='user:password'
26+
- CI_DELAY='60'
27+
- CI_DOCKERENV=''
28+
- CI_AUTH=''
2829
- CI_WEBPATH=''
2930
sponsor_links:
3031
- { name: "WireGuard", url: "https://www.wireguard.com/donations/" }

readme-vars.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ common_param_env_vars_enabled: true
2323
param_container_name: "{{ project_name }}"
2424
param_usage_include_vols: true
2525
param_volumes:
26-
- { vol_path: "/config", vol_host_path: "/path/to/appdata/config", desc: "Contains all relevant configuration files." }
26+
- { vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Contains all relevant configuration files." }
2727
opt_param_usage_include_vols: true
2828
opt_param_volumes:
2929
- { vol_path: "/lib/modules", vol_host_path: "/lib/modules", desc: "Host kernel modules for situations where they're not already loaded." }
@@ -118,16 +118,17 @@ app_setup_block: |
118118
Site-to-site VPN in server mode requires customizing the `AllowedIPs` statement for a specific peer in `wg0.conf`. Since `wg0.conf` is autogenerated when server vars are changed, it is not recommended to edit it manually.
119119
120120
In order to customize the `AllowedIPs` statement for a specific peer in `wg0.conf`, you can set an env var `SERVER_ALLOWEDIPS_PEER_<peer name or number>` to the additional subnets you'd like to add, comma separated and excluding the peer IP (ie. `"192.168.1.0/24,192.168.2.0/24"`). Replace `<peer name or number>` with either the name or number of a peer (whichever is used in the `PEERS` var).
121-
121+
122122
For instance `SERVER_ALLOWEDIPS_PEER_laptop="192.168.1.0/24,192.168.2.0/24"` will result in the wg0.conf entry `AllowedIPs = 10.13.13.2,192.168.1.0/24,192.168.2.0/24` for the peer named `laptop`.
123-
123+
124124
Keep in mind that this var will only be considered when the confs are regenerated. Adding this var for an existing peer won't force a regeneration. You can delete wg0.conf and restart the container to force regeneration if necessary.
125125
126126
Don't forget to set the necessary POSTUP and POSTDOWN rules in your client's peer conf for lan access.
127127
128128
129129
# changelog
130130
changelogs:
131+
- { date: "24.05.24:", desc: "Rebase to Alpine 3.20, install wireguard-tools from Alpine repo." }
131132
- { date: "10.03.24:", desc: "Use iptables-legacy on Alpine 3.19." }
132133
- { date: "05.03.24:", desc: "Rebase master to Alpine 3.19." }
133134
- { date: "03.10.23:", desc: "**Potentially Breaking Change:** Support for multiple interfaces added. Wireguard confs moved to `/config/wg_confs/`. Any file with a `.conf` extension in that folder will be treated as a live tunnel config and will be attempted to start. If any of the tunnels fail, all tunnels will be stopped. Tunnels are started in alphabetical order. Managed server conf will continue to be hardcoded to `wg0.conf`." }

0 commit comments

Comments
 (0)