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

Commit 206e855

Browse files
aptalcathelamer
authored andcommitted
install from repo
1 parent f8d8dd8 commit 206e855

File tree

2 files changed

+20
-35
lines changed

2 files changed

+20
-35
lines changed

Dockerfile

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,25 @@ ARG BUILD_DATE
55
ARG VERSION
66
ARG OPENVPNAS_VERSION
77
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
8-
LABEL maintainer="sparklyballs,aptalca"
8+
LABEL maintainer="aptalca"
99

1010
# environment settings
1111
ARG DEBIAN_FRONTEND="noninteractive"
1212

1313
RUN \
14-
echo "**** install packages ****" && \
14+
echo "**** install dependencies ****" && \
1515
apt-get update && \
1616
apt-get install -y \
17-
bridge-utils \
18-
iproute2 \
19-
iptables \
20-
liblzo2-2 \
21-
libmariadbclient18 \
22-
libmysqlclient-dev \
23-
net-tools \
24-
python \
25-
python-mysqldb \
26-
python-pkg-resources \
27-
python-pyrad \
28-
python-serial \
29-
rsync \
30-
sqlite3 \
31-
ucarp && \
32-
echo "**** download openvpn-as ****" && \
17+
gnupg \
18+
net-tools && \
19+
echo "**** add openvpn-as repo ****" && \
20+
curl -s https://as-repository.openvpn.net/as-repo-public.gpg | apt-key add - && \
21+
echo "deb http://as-repository.openvpn.net/as/debian bionic main">/etc/apt/sources.list.d/openvpn-as-repo.list && \
3322
if [ -z ${OPENVPNAS_VERSION+x} ]; then \
34-
OPENVPNAS_VERSION=$(curl -w "%{url_effective}" -ILsS -o /dev/null \
35-
https://openvpn.net/downloads/openvpn-as-latest-ubuntu18.amd_64.deb \
36-
| awk -F '(openvpn-as-|-Ubuntu18)' '{print $2}'); \
23+
OPENVPNAS_VERSION=$(curl -sX GET http://as-repository.openvpn.net/as/debian/dists/bionic/main/binary-amd64/Packages.gz | gunzip -c \
24+
|grep -A 7 -m 1 "Package: openvpn-as" | awk -F ": " '/Version/{print $2;exit}');\
3725
fi && \
38-
mkdir /openvpn && \
39-
curl -o \
40-
/openvpn/openvpn.deb -L \
41-
"https://swupdate.openvpn.org/as/openvpn-as-${OPENVPNAS_VERSION}-Ubuntu18.amd64.deb" && \
42-
curl -o \
43-
/openvpn/openvpn-clients.deb -L \
44-
"https://openvpn.net/downloads/openvpn-as-bundled-clients-latest.deb" && \
26+
echo "$OPENVPNAS_VERSION" > /version.txt && \
4527
echo "**** ensure home folder for abc user set to /config ****" && \
4628
usermod -d /config abc && \
4729
echo "**** create admin user and set default password for it ****" && \

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ fi
1010

1111
shopt -s extglob
1212
# install or update openvpn-as
13-
if [ -f /openvpn/openvpn.deb ]; then
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
19+
apt-get update && \
20+
apt-get install -y \
21+
openvpn-as=$OPENVPNAS_VERSION
2022
echo "Stopping openvpn-as now; will start again later after configuring"
2123
kill `cat /var/run/openvpnas.pid`
22-
rm /openvpn/openvpn.deb
24+
rm /version.txt
2325
sed -i \
2426
-e 's#=openvpn_as#=abc#g' \
2527
-e 's#~/tmp#/openvpn/tmp#g' \
@@ -39,11 +41,12 @@ if [ -f /openvpn/openvpn.deb ]; then
3941
cp /config/etc/as.conf /config/backup/as.conf
4042
cd /config || exit
4143
rm -rf !("backup"|"log")
42-
dpkg -i /openvpn/openvpn-clients.deb
43-
dpkg -i /openvpn/openvpn.deb
44+
apt-get update && \
45+
apt-get install -y \
46+
openvpn-as=$OPENVPNAS_VERSION
4447
echo "Stopping openvpn-as now; will start again later after configuring"
4548
kill `cat /var/run/openvpnas.pid`
46-
rm /openvpn/openvpn.deb
49+
rm /version.txt
4750
sed -i \
4851
-e 's#=openvpn_as#=abc#g' \
4952
-e 's#~/tmp#/openvpn/tmp#g' \

0 commit comments

Comments
 (0)