File tree Expand file tree Collapse file tree 6 files changed +19
-11
lines changed Expand file tree Collapse file tree 6 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ### 2.0.2 - Added multi-instance support
4+
5+ - Added ` TUNNEL_INTERFACE ` to set interface name (in case of multiple containers)
6+ - Some fixes for general user
7+
38### 2.0.1 - Fix service start
49
510- Fixed command for starting service
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ ENV EASYRSA=/usr/share/easy-rsa \
4343 EASYRSA_VARS_FILE=/config/ssl/vars \
4444 # EASYRSA_SSL_CONF=/config/ssl/openssl-easyrsa.cnf \
4545 EASYRSA_SAFE_CONF=/config/ssl/safessl-easyrsa.cnf \
46- EASYRSA_TEMP_FILE=/config/tmp/temp
46+ EASYRSA_TEMP_FILE=/config/tmp/temp \
47+ TUNNEL_INTERFACE="tun0"
4748
4849# Install packages
4950RUN apk add --no-cache \
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ ENV EASYRSA=/usr/share/easy-rsa \
4343 EASYRSA_VARS_FILE=/config/ssl/vars \
4444 #EASYRSA_SSL_CONF=/config/ssl/openssl-easyrsa.cnf \
4545 EASYRSA_SAFE_CONF=/config/ssl/safessl-easyrsa.cnf \
46- EASYRSA_TEMP_FILE=/config/tmp/temp
46+ EASYRSA_TEMP_FILE=/config/tmp/temp \
47+ TUNNEL_INTERFACE="tun0"
4748
4849# Install packages
4950RUN apk add --no-cache \
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ services:
7070| ` -e PUID=1000 ` | for UserID - see below for explanation|
7171| ` -e PGID=1000 ` | for GroupID - see below for explanation|
7272| ` -e PERSISTENT_INTERFACE=true ` | Enable persistent TUN interface|
73+ | ` -e TUNNEL_INTERFACE="tun0" ` | Tunnel interface name (default: tun0)|
7374| ` -e USE_FIREWALL=false ` | Disable any firewall related rules to be created, modified ... (must be implemented in example)|
7475| ` -v /config ` | All the config files including OpenVPNs reside here|
7576| ` -v /log ` | Log files reside here|
Original file line number Diff line number Diff line change 55#
66
77# Delete tunnel interface (if not persistant)
8- if [ -n " $( cat /proc/net/dev | grep tun0 ) " ] && { [ -z " $PERSISTENT_INTERFACE " ] || [ " $PERSISTENT_INTERFACE " != " true" ]; }; then
9- echo " Removing tun0 interface"
10- openvpn --rmtun --dev tun0
8+ if [ -n " $( cat /proc/net/dev | grep $TUNNEL_INTERFACE ) " ] && { [ -z " $PERSISTENT_INTERFACE " ] || [ " $PERSISTENT_INTERFACE " != " true" ]; }; then
9+ echo " Removing $TUNNEL_INTERFACE interface"
10+ openvpn --rmtun --dev $TUNNEL_INTERFACE
1111fi
Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ if [ ! -c "/dev/net/tun" ]; then
1919fi
2020
2121# Remove existing interface if not persistent interface selected
22- if [ -n " $( cat /proc/net/dev | grep tun0 ) " ] && { [ -z " $PERSISTENT_INTERFACE " ] || [ " $PERSISTENT_INTERFACE " != " true" ]; }; then
23- echo " Removing tun0 interface"
24- openvpn --rmtun --dev tun0
22+ if [ -n " $( cat /proc/net/dev | grep $TUNNEL_INTERFACE ) " ] && { [ -z " $PERSISTENT_INTERFACE " ] || [ " $PERSISTENT_INTERFACE " != " true" ]; }; then
23+ echo " Removing $TUNNEL_INTERFACE interface"
24+ openvpn --rmtun --dev $TUNNEL_INTERFACE
2525fi
2626
2727# Create tunnel interface
28- if [ -z " $( cat /proc/net/dev | grep tun0 ) " ]; then
29- echo " Creating tun0 interface"
30- openvpn --mktun --dev tun0 --dev-type tun --user abc --group abc
28+ if [ -z " $( cat /proc/net/dev | grep $TUNNEL_INTERFACE ) " ]; then
29+ echo " Creating $TUNNEL_INTERFACE interface"
30+ openvpn --mktun --dev $TUNNEL_INTERFACE --dev-type tun --user $CONTAINER_USER --group $CONTAINER_USER
3131fi
You can’t perform that action at this time.
0 commit comments