Skip to content
This repository was archived by the owner on Jun 15, 2021. It is now read-only.

Commit 4a52a73

Browse files
authored
Merge pull request #111 from linuxserver/xenial-repo
install openvpn-as from repo
2 parents 9576124 + 9a9895a commit 4a52a73

File tree

6 files changed

+30
-25
lines changed

6 files changed

+30
-25
lines changed

Dockerfile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ RUN \
1515
apt-get update && \
1616
apt-get install -y \
1717
bridge-utils \
18+
gnupg \
1819
iproute2 \
1920
iptables \
2021
liblzo2-2 \
@@ -28,19 +29,14 @@ RUN \
2829
rsync \
2930
sqlite3 \
3031
ucarp && \
31-
echo "**** download openvpn-as ****" && \
32+
echo "**** add openvpn-as repo ****" && \
33+
curl -s https://as-repository.openvpn.net/as-repo-public.gpg | apt-key add - && \
34+
echo "deb http://as-repository.openvpn.net/as/debian xenial main">/etc/apt/sources.list.d/openvpn-as-repo.list && \
3235
if [ -z ${OPENVPNAS_VERSION+x} ]; then \
33-
OPENVPNAS_VERSION=$(curl -w "%{url_effective}" -ILsS -o /dev/null \
34-
https://openvpn.net/downloads/openvpn-as-latest-ubuntu16.amd_64.deb \
35-
| awk -F '(openvpn-as-|-Ubuntu16)' '{print $2}'); \
36+
OPENVPNAS_VERSION=$(curl -sX GET http://as-repository.openvpn.net/as/debian/dists/xenial/main/binary-amd64/Packages.gz | gunzip -c \
37+
|grep -A 7 -m 1 "Package: openvpn-as" | awk -F ": " '/Version/{print $2;exit}');\
3638
fi && \
37-
mkdir /openvpn && \
38-
curl -o \
39-
/openvpn/openvpn.deb -L \
40-
"https://swupdate.openvpn.org/as/openvpn-as-${OPENVPNAS_VERSION}-Ubuntu16.amd64.deb" && \
41-
curl -o \
42-
/openvpn/openvpn-clients.deb -L \
43-
"https://openvpn.net/downloads/openvpn-as-bundled-clients-latest.deb" && \
39+
echo "$OPENVPNAS_VERSION" > /version.txt && \
4440
echo "**** ensure home folder for abc user set to /config ****" && \
4541
usermod -d /config abc && \
4642
echo "**** create admin user and set default password for it ****" && \

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pipeline {
103103
steps{
104104
script{
105105
env.EXT_RELEASE = sh(
106-
script: ''' curl -w '%{url_effective}' -ILsS https://openvpn.net/downloads/openvpn-as-latest-ubuntu16.amd_64.deb -o /dev/null | awk -F '(openvpn-as-|-Ubuntu16)' '{print $2}' ''',
106+
script: ''' curl -sX GET http://as-repository.openvpn.net/as/debian/dists/xenial/main/binary-amd64/Packages.gz | gunzip -c |grep -A 7 -m 1 'Package: openvpn-as' | awk -F ': ' '/Version/{print $2;exit}' ''',
107107
returnStdout: true).trim()
108108
env.RELEASE_LINK = 'custom_command'
109109
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
231231

232232
## Versions
233233

234+
* **26.03.20:** - Switch to using the openvpn-as repo for packages.
234235
* **27.08.19:** - Add new clients package to install and upgrade process.
235236
* **25.07.19:** - Create a xenial branch and rebase master to bionic.
236237
* **07.04.19:** - Fix first time config.

jenkins-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# jenkins variables
44
project_name: docker-openvpn-as
55
external_type: na
6-
custom_version_command: "curl -w '%{url_effective}' -ILsS https://openvpn.net/downloads/openvpn-as-latest-ubuntu16.amd_64.deb -o /dev/null | awk -F '(openvpn-as-|-Ubuntu16)' '{print $2}'"
6+
custom_version_command: "curl -sX GET http://as-repository.openvpn.net/as/debian/dists/xenial/main/binary-amd64/Packages.gz | gunzip -c |grep -A 7 -m 1 'Package: openvpn-as' | awk -F ': ' '/Version/{print $2;exit}'"
77
release_type: prerelease
88
release_tag: xenial
99
ls_branch: xenial

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ app_setup_block: |
6363
6464
# changelog
6565
changelogs:
66+
- { date: "26.03.20:", desc: "Switch to using the openvpn-as repo for packages." }
6667
- { date: "27.08.19:", desc: "Add new clients package to install and upgrade process." }
6768
- { date: "25.07.19:", desc: "Create a xenial branch and rebase master to bionic." }
6869
- { date: "07.04.19:", desc: "Fix first time config." }

root/etc/cont-init.d/30-config

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

3-
# make folders
3+
# make folders
44
mkdir -p /openvpn{/pid,/sock,/tmp} /dev/net /config/log /config/etc/tmp
55

66
# create tun device
@@ -9,15 +9,19 @@ if [ ! -c /dev/net/tun ]; then
99
fi
1010

1111
shopt -s extglob
12-
# install or update openvpn-as
13-
if [ -f /openvpn/openvpn.deb ]; then
12+
# install or update openvpn-as
13+
if [ -f /version.txt ]; then
14+
OPENVPNAS_VERSION=$(cat /version.txt)
1415
rm -rf /usr/local/openvpn_as
1516
ln -s /config /usr/local/openvpn_as
1617
if [ ! -f /config/etc/as.conf ]; then
1718
echo "installing openvpn-as for the first time"
18-
dpkg -i /openvpn/openvpn-clients.deb
19-
dpkg -i /openvpn/openvpn.deb
20-
rm /openvpn/openvpn.deb
19+
apt-get update && \
20+
apt-get install -y \
21+
openvpn-as=$OPENVPNAS_VERSION
22+
echo "Stopping openvpn-as now; will start again later after configuring"
23+
kill `cat /var/run/openvpnas.pid`
24+
rm /version.txt
2125
sed -i \
2226
-e 's#=openvpn_as#=abc#g' \
2327
-e 's#~/tmp#/openvpn/tmp#g' \
@@ -37,9 +41,12 @@ if [ -f /openvpn/openvpn.deb ]; then
3741
cp /config/etc/as.conf /config/backup/as.conf
3842
cd /config || exit
3943
rm -rf !("backup"|"log")
40-
dpkg -i /openvpn/openvpn-clients.deb
41-
dpkg -i /openvpn/openvpn.deb
42-
rm /openvpn/openvpn.deb
44+
apt-get update && \
45+
apt-get install -y \
46+
openvpn-as=$OPENVPNAS_VERSION
47+
echo "Stopping openvpn-as now; will start again later after configuring"
48+
kill `cat /var/run/openvpnas.pid`
49+
rm /version.txt
4350
sed -i \
4451
-e 's#=openvpn_as#=abc#g' \
4552
-e 's#~/tmp#/openvpn/tmp#g' \
@@ -61,15 +68,15 @@ if [ -f /openvpn/openvpn.deb ]; then
6168
fi
6269
shopt -u extglob
6370

64-
# clear old sock files
71+
# clear old sock files
6572
for file in /openvpn/sock/*
6673
do
6774
if [ -e "$file" ]; then
6875
rm -rf "$file"
6976
fi
7077
done
7178

72-
# clear old pid files
79+
# clear old pid files
7380
for file in /openvpn/pid/*
7481
do
7582
if [ -e "$file" ]; then
@@ -78,6 +85,6 @@ for file in /openvpn/pid/*
7885
done
7986

8087

81-
# permissions
88+
# permissions
8289
chown abc:abc /config/log /config/etc/tmp
8390
chmod -R 755 /openvpn

0 commit comments

Comments
 (0)