From 96ae89779782b1f710f53a52a2d1ece67e6ce3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Antu=C3=B1a=20D=C3=ADez?= Date: Sat, 10 Nov 2018 18:38:03 +0100 Subject: [PATCH 1/2] Hotfix to avoid pluto restart problem Prevent the pluto process from getting stuck when it needs to be restarted --- build/src/init.sh | 2 +- build/src/ipsec | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/build/src/init.sh b/build/src/init.sh index 419a738d..954a6c09 100644 --- a/build/src/init.sh +++ b/build/src/init.sh @@ -142,7 +142,7 @@ modprobe af_key # Start services mkdir -p /var/run/pluto /var/run/xl2tpd -rm -f /var/run/pluto/pluto.pid /var/run/xl2tpd.pid +rm -f /var/run/xl2tpd.pid touch /var/run/dnp_vpn diff --git a/build/src/ipsec b/build/src/ipsec index c7c1ba28..3ca10f13 100755 --- a/build/src/ipsec +++ b/build/src/ipsec @@ -37,15 +37,20 @@ start() { } stop() { - if [ "${RC_CMD}" = "restart" ] ; then - checkconfig || return 1 + if [ "${RC_CMD}" = "restart" ] ; then + checkconfig || return 1 + fi + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --pidfile "${PLUTO_PIDFILE}" + RETVAL=$? + if [ $RETVAL -ne 0 ]; then + ebegin "Stopping (killing it)" + start-stop-daemon --stop -s SIGKILL --pidfile "${PLUTO_PIDFILE}" fi - ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop --pidfile "${PLUTO_PIDFILE}" - RETVAL=$? ${IPSEC_BINARY} _stackmanager stop ${IPSEC_BINARY} --stopnflog - eend $RETVAL + eend $? + } reload() { From de4e9af11137b69a28148f4daa207fbd40da1438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Antu=C3=B1a=20D=C3=ADez?= Date: Sat, 10 Nov 2018 19:07:00 +0100 Subject: [PATCH 2/2] Version updated --- dappnode_package.json | 7 +++--- docker-compose-vpn.yml | 56 ++++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/dappnode_package.json b/dappnode_package.json index e0d67bbe..fc4db213 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -1,6 +1,6 @@ { "name": "vpn.dnp.dappnode.eth", - "version": "0.1.15", + "version": "0.1.18", "description": "Dappnode package responsible for providing the VPN (L2TP/IPSec) connection", "avatar": "/ipfs/QmWwMb3XhuCH6JnCF6m6EQzA4mW9pHHtg7rqAfhDr2ofi8", "type": "dncore", @@ -24,8 +24,9 @@ "subnet": "172.33.0.0/16", "ipv4_address": "172.33.1.4" }, - "author": "Eduardo Antuña (https://github.com/eduadiez)", + "author": "DAppNode Association (https://github.com/dappnode)", "contributors": [ + "Eduardo Antuña (https://github.com/eduadiez)", "DAppLion (https://github.com/dapplion)", "Alex Floyd (https://github.com/mex20)" ], @@ -37,7 +38,7 @@ ], "homepage": { "userui": "https://dappnode.github.io/DAppNode_OTP", - "homepage": "https://github.com/dappnode/DNP_BIND#readme" + "homepage": "https://github.com/dappnode/DNP_VPN#readme" }, "repository": { "type": "git", diff --git a/docker-compose-vpn.yml b/docker-compose-vpn.yml index 51563cca..18355c29 100644 --- a/docker-compose-vpn.yml +++ b/docker-compose-vpn.yml @@ -1,32 +1,30 @@ -version: "3.4" - +version: '3.4' networks: - network: - driver: bridge - ipam: - config: - - subnet: 172.33.0.0/16 - + network: + driver: bridge + ipam: + config: + - + subnet: 172.33.0.0/16 volumes: - vpndnpdappnodeeth_data: {} - + vpndnpdappnodeeth_data: {} services: - vpn.dnp.dappnode.eth: - build: ./build - image: vpn.dnp.dappnode.eth:0.1.15 - container_name: DAppNodeCore-vpn.dnp.dappnode.eth - privileged: true - restart: always - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - /etc/hostname:/etc/vpnname:ro - - /usr/src/dappnode/config:/usr/src/app/config:ro - - /lib/modules:/lib/modules:ro - - vpndnpdappnodeeth_data:/usr/src/app/secrets - ports: - - 4500:4500/udp - - 500:500/udp - dns: 172.33.1.2 - networks: - network: - ipv4_address: 172.33.1.4 + vpn.dnp.dappnode.eth: + build: ./build + image: 'vpn.dnp.dappnode.eth:0.1.18' + container_name: DAppNodeCore-vpn.dnp.dappnode.eth + privileged: true + restart: always + volumes: + - '/var/run/docker.sock:/var/run/docker.sock' + - '/etc/hostname:/etc/vpnname:ro' + - '/usr/src/dappnode/config:/usr/src/app/config:ro' + - '/lib/modules:/lib/modules:ro' + - 'vpndnpdappnodeeth_data:/usr/src/app/secrets' + ports: + - '4500:4500/udp' + - '500:500/udp' + dns: 172.33.1.2 + networks: + network: + ipv4_address: 172.33.1.4