File tree 2 files changed +31
-20
lines changed
2 files changed +31
-20
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,30 @@ FROM alpine:latest
4
4
LABEL maintainer=
"[email protected] " \
5
5
ai.ix.repository="ix.ai/openvpn"
6
6
7
+ ADD bin/* /usr/local/bin/
8
+
9
+ # Add support for OTP authentication using a PAM module
10
+ ADD ./otp/openvpn /etc/pam.d/
11
+
7
12
# Testing: pamtester
8
- RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
9
- apk --no-cache upgrade && \
10
- apk add --no-cache --update openvpn \
11
- dnsmasq \
12
- iptables \
13
- bash \
14
- easy-rsa \
15
- openvpn-auth-pam \
16
- google-authenticator \
17
- pamtester \
18
- libqrencode && \
19
- ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
20
- rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*
13
+ RUN set -eux; \
14
+ \
15
+ echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories; \
16
+ apk --no-cache upgrade; \
17
+ apk add --no-cache --update \
18
+ openvpn \
19
+ dnsmasq \
20
+ iptables \
21
+ bash \
22
+ easy-rsa \
23
+ openvpn-auth-pam \
24
+ google-authenticator \
25
+ pamtester \
26
+ libqrencode \
27
+ ; \
28
+ ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin; \
29
+ rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*; \
30
+ chmod a+x /usr/local/bin/*
21
31
22
32
# Needed by scripts
23
33
ENV OPENVPN /etc/openvpn
@@ -34,9 +44,3 @@ VOLUME ["/etc/openvpn"]
34
44
EXPOSE 1194/udp
35
45
36
46
CMD ["ovpn_run" ]
37
-
38
- ADD ./bin /usr/local/bin
39
- RUN chmod a+x /usr/local/bin/*
40
-
41
- # Add support for OTP authentication using a PAM module
42
- ADD ./otp/openvpn /etc/pam.d/
Original file line number Diff line number Diff line change @@ -81,7 +81,14 @@ function startDnsmasq() {
81
81
82
82
addArg " --config" " $OPENVPN /openvpn.conf"
83
83
84
- source " $OPENVPN /ovpn_env.sh"
84
+ if [ ! -f " ${OPENVPN} /ovpn_env.sh" ]; then
85
+ echo " Can't find ${OPENVPN} /ovpn_env.sh."
86
+ echo " Please make sure that OpenVPN is initialized and the proper volume is mounted!"
87
+ echo " For details see https://ix.ai/openvpn/-/blob/master/README.md#quick-start"
88
+ exit 1
89
+ fi
90
+
91
+ source " ${OPENVPN} /ovpn_env.sh"
85
92
86
93
mkdir -p /dev/net
87
94
if [ ! -c /dev/net/tun ]; then
You can’t perform that action at this time.
0 commit comments