From 7d9a377d6cb897475328e81557314b8ac5cbac72 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Thu, 9 Nov 2023 11:19:00 +0100 Subject: [PATCH] remove unneeded code to prevent errors, add readme --- README.md | 5 +++++ data/start.sh | 28 ---------------------------- 2 files changed, 5 insertions(+), 28 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..35a7c1b --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# qBittorrent-natpmp +I forked the original project to make it compatible with the [linuxserver/docker-wireguard](https://github.com/linuxserver/docker-wireguard) container. + +## Not using gluetun +Since I only use wireguard (a silent protocol) forced health checks on the wireguard container are pointless. On top of this I've had problems with the firewalling done by the gluetun container. Rather than troubleshooting that I just deleted a bunch of code from soxfor's container to make it compatible with my preferred vpn container. diff --git a/data/start.sh b/data/start.sh index 1933a32..0b5461e 100755 --- a/data/start.sh +++ b/data/start.sh @@ -43,27 +43,6 @@ qbt_isreachable() { nc -4 -vw 5 ${QBITTORRENT_SERVER} ${QBITTORRENT_PORT} &>/dev/null 2>&1 } -fw_delrule() { - if (docker exec "${VPN_CT_NAME}" /sbin/iptables -L INPUT -n | grep -qP "^ACCEPT.*${configured_port}.*"); then - # shellcheck disable=SC2086 - docker exec "${VPN_CT_NAME}" /sbin/iptables -D INPUT -i "${VPN_IF_NAME}" -p tcp --dport ${configured_port} -j ACCEPT - # shellcheck disable=SC2086 - docker exec "${VPN_CT_NAME}" /sbin/iptables -D INPUT -i "${VPN_IF_NAME}" -p udp --dport ${configured_port} -j ACCEPT - fi -} - -fw_addrule() { - if ! (docker exec "${VPN_CT_NAME}" /sbin/iptables -L INPUT -n | grep -qP "^ACCEPT.*${active_port}.*"); then - # shellcheck disable=SC2086 - docker exec "${VPN_CT_NAME}" /sbin/iptables -A INPUT -i "${VPN_IF_NAME}" -p tcp --dport ${active_port} -j ACCEPT - # shellcheck disable=SC2086 - docker exec "${VPN_CT_NAME}" /sbin/iptables -A INPUT -i "${VPN_IF_NAME}" -p udp --dport ${active_port} -j ACCEPT - return 0 - else - return 1 - fi -} - get_portmap() { res=0 public_ip=$(getpublicip) @@ -88,9 +67,6 @@ get_portmap() { # shellcheck disable=SC2086 if [ ${configured_port} != ${active_port} ]; then if qbt_changeport "${qbt_sid}" ${active_port}; then - if fw_delrule; then - echo "$(timestamp) | IPTables rule deleted for port ${configured_port} on ${VPN_CT_NAME} container" - fi echo "$(timestamp) | Port Changed to: $(findconfiguredport ${qbt_sid})" else echo "$(timestamp) | Port Change failed." @@ -100,10 +76,6 @@ get_portmap() { echo "$(timestamp) | Port OK (Act: ${active_port} Cfg: ${configured_port})" fi - if fw_addrule; then - echo "$(timestamp) | IPTables rule added for port ${active_port} on ${VPN_CT_NAME} container" - fi - return $res }