Skip to content

Commit

Permalink
Merge pull request #398 from veqryn/fixes
Browse files Browse the repository at this point in the history
Fixes for iptables, nordvpn.sock, and nordvpn settings
  • Loading branch information
Julio Gutierrez authored Apr 30, 2023
2 parents 585e9a0 + e565ced commit ccad404
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions rootfs/etc/cont-init.d/00-firewall
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

iptables -P OUTPUT DROP
iptables -P INPUT DROP
iptables -P FORWARD DROP
Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/services.d/nordvpn/run
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ if [[ ! -d /run/nordvpn ]]; then
mkdir -m 0770 /run/nordvpn
fi

exec s6-notifyoncheck -d /usr/sbin/nordvpnd > /dev/null
exec s6-notifyoncheck -n 60 -d /usr/sbin/nordvpnd > /dev/null
3 changes: 2 additions & 1 deletion rootfs/usr/bin/nord_config
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/with-contenv bash

nordvpn set technology ${TECHNOLOGY:-NordLynx}

[[ -n ${DNS} ]] && nordvpn set dns ${DNS//[;,]/ }

[[ -n ${CYBER_SEC} ]] && nordvpn set cybersec ${CYBER_SEC}
Expand All @@ -8,7 +10,6 @@
#[[ -n ${KILLSWITCH} ]] && nordvpn set killswitch ${KILLSWITCH} Killswitch is enabled by default using iptables

[[ -n ${PROTOCOL} ]] && nordvpn set protocol ${PROTOCOL}
nordvpn set technology ${TECHNOLOGY:-NordLynx}

[[ -n ${PORTS} ]] && for port in ${PORTS//[;,]/ }; do nordvpn whitelist add port "${port}"; done
[[ -n ${PORT_RANGE} ]] && nordvpn whitelist add ports ${PORT_RANGE}
Expand Down
5 changes: 4 additions & 1 deletion rootfs/usr/bin/nord_login
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ if ! iptables -L > /dev/null 2>&1; then
sleep 3600
done
fi
sleep 5

while [ ! -S /run/nordvpn/nordvpnd.sock ] ; do
sleep 1
done

[[ -z "${PASS}" ]] && [[ -f "${PASSFILE}" ]] && PASS="$(head -n 1 "${PASSFILE}")"
nordvpn logout --persist-token > /dev/null
Expand Down

0 comments on commit ccad404

Please sign in to comment.