From 827f1a76612a72f58ebbc47b34bb3d9424f11faf Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 16 Aug 2020 15:28:00 +0200 Subject: [PATCH 1/6] qBittorrent Alpha branch --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 223a9dd..8a23904 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,18 +29,16 @@ RUN apt update \ qtbase5-dev \ qttools5-dev \ libqt5svg5-dev \ - && QBITTORRENT_RELEASE=$(curl -sX GET "https://api.github.com/repos/qBittorrent/qBittorrent/tags" | jq '.[0] .name' | tr -d '"') \ && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[0] .assets_url' | tr -d '"') \ && LIBTORRENT_DOWNLOAD_URL=$(curl -sX GET ${LIBTORRENT_ASSETS} | jq '.[0] .browser_download_url' | tr -d '"') \ && LIBTORRENT_NAME=$(curl -sX GET ${LIBTORRENT_ASSETS} | jq '.[0] .name' | tr -d '"') \ - && curl -o /opt/qBittorrent-${QBITTORRENT_RELEASE}.tar.gz -L https://github.com/qbittorrent/qBittorrent/archive/${QBITTORRENT_RELEASE}.tar.gz \ && curl -o /opt/${LIBTORRENT_NAME} -L ${LIBTORRENT_DOWNLOAD_URL} \ - && tar -xvzf /opt/qBittorrent-${QBITTORRENT_RELEASE}.tar.gz \ && tar -xvzf /opt/${LIBTORRENT_NAME} \ && rm /opt/*.tar.gz \ && cd /opt/libtorrent-rasterbar* \ && ./configure --disable-debug --enable-encryption && make clean && make -j$(nproc) && make install \ - && cd /opt/qBittorrent-${QBITTORRENT_RELEASE} \ + && git clone https://github.com/qbittorrent/qBittorrent.git \ + && cd /opt/qBittorrent \ && ./configure --disable-gui && make -j$(nproc) && make install \ && cd /opt \ && rm -rf /opt/* \ From af6c50f24822cff93a0f0a6a9cfc08275bd9c039 Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 16 Aug 2020 15:47:33 +0200 Subject: [PATCH 2/6] Fixed git clone folder --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8a23904..f602561 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN apt update \ && rm /opt/*.tar.gz \ && cd /opt/libtorrent-rasterbar* \ && ./configure --disable-debug --enable-encryption && make clean && make -j$(nproc) && make install \ - && git clone https://github.com/qbittorrent/qBittorrent.git \ + && git clone https://github.com/qbittorrent/qBittorrent.git /opt/qBittorrent \ && cd /opt/qBittorrent \ && ./configure --disable-gui && make -j$(nproc) && make install \ && cd /opt \ From e8a7764a841069a798a3ef3499275d8b91e27188 Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 16 Aug 2020 16:58:18 +0200 Subject: [PATCH 3/6] Alpha size --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5662041..c0f45ce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [qBittorrent](https://github.com/qbittorrent/qBittorrent), WireGuard and OpenVPN [![Docker Pulls](https://img.shields.io/docker/pulls/dyonr/qbittorrentvpn)](https://hub.docker.com/r/dyonr/qbittorrentvpn) -[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dyonr/qbittorrentvpn/latest)](https://hub.docker.com/r/dyonr/qbittorrentvpn) +[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dyonr/qbittorrentvpn/alpha)](https://hub.docker.com/r/dyonr/qbittorrentvpn) Docker container which runs the latest [qBittorrent](https://github.com/qbittorrent/qBittorrent)-nox client while connecting to WireGuard (experimental) or OpenVPN with iptables killswitch to prevent IP leakage when the tunnel goes down. From b58ac335054aeba5863eafbaa5296965ef619ea2 Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 30 Aug 2020 03:25:10 +0200 Subject: [PATCH 4/6] Added INSTALL_PYTHON3 --- README.md | 1 + openvpn/start.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index d655e12..128a562 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ $ docker run --privileged -d \ |`HEALTH_CHECK_INTERVAL`| No |This is the time in seconds that the container waits to see if the internet connection still works (check if VPN died)|`HEALTH_CHECK_INTERVAL=300`|`300`| |`HEALTH_CHECK_SILENT`| No |Set to `1` to supress the 'Network is up' message. Defaults to `1` if unset.|`HEALTH_CHECK_SILENT=1`|`1`| |`DISABLE_IPV6`\*| No |Setting the value of this to `0` will **enable** IPv6 in sysctl. `1` will disable IPv6 in sysctl.|`DISABLE_IPV6=1`|`1`| +|`INSTALL_PYTHON3`| No |Set this to `yes` to let the container install Python3.|`INSTALL_PYTHON3=yes`|`no`| |`ADDITIONAL_PORTS`| No |Adding a comma delimited list of ports will allow these ports via the iptables script.|`ADDITIONAL_PORTS=1234,8112`|| \*This option was initially added as a way to fix problems with VPN providers that support IPv6 and might not work at all. I am unable to test this since my VPN provider does not support IPv6, nor I have an IPv6 connection. diff --git a/openvpn/start.sh b/openvpn/start.sh index db9f7ed..98647c3 100644 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -13,6 +13,22 @@ if [[ ! -z "${check_network}" ]]; then exit 1 fi +export INSTALL_PYTHON3=$(echo "${INSTALL_PYTHON3,,}") +if [[ $INSTALL_PYTHON3 == "yes" ]]; then + echo "[INFO] INSTALL_PYTHON3 defined as '${INSTALL_PYTHON3}'" | ts '%Y-%m-%d %H:%M:%.S' + if [ ! -e /usr/bin/python3 ]; then + echo "[INFO] Python3 not yet installed, installing..." | ts '%Y-%m-%d %H:%M:%.S' + apt -qq update \ + && apt -qq install python3 \ + && apt-get clean \ + && apt -qq autoremove \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + fi +fi + export VPN_ENABLED=$(echo "${VPN_ENABLED}" | sed -e 's~^[ \t]*~~;s~[ \t]*$~~') if [[ ! -z "${VPN_ENABLED}" ]]; then echo "[INFO] VPN_ENABLED defined as '${VPN_ENABLED}'" | ts '%Y-%m-%d %H:%M:%.S' From ef3773228f7a6144327c3f724629863b71e49f3b Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 30 Aug 2020 03:36:08 +0200 Subject: [PATCH 5/6] Revert "Merge branch 'alpha' into dev" This reverts commit 7bfd725166c7107600612f6d0a4e41ed72e46231, reversing changes made to b58ac335054aeba5863eafbaa5296965ef619ea2. --- Dockerfile | 134 +++++++++++++++++++++++++++++++++-------------------- README.md | 2 +- 2 files changed, 85 insertions(+), 51 deletions(-) diff --git a/Dockerfile b/Dockerfile index f602561..f3f418c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,61 +7,35 @@ RUN usermod -u 99 nobody # Make directories RUN mkdir -p /downloads /config/qBittorrent /etc/openvpn /etc/qbittorrent +# Compile libtorrent-rasterbar RUN apt update \ && apt -y upgrade \ && apt -y install --no-install-recommends \ - curl \ - jq \ - build-essential \ ca-certificates \ - pkg-config \ - automake \ - libtool \ - git \ - zlib1g-dev \ - libssl-dev \ - libgeoip-dev \ - libboost-dev \ + curl \ + g++ \ + jq \ libboost-system-dev \ - libboost-chrono-dev \ - libboost-random-dev \ - python3 \ - qtbase5-dev \ - qttools5-dev \ - libqt5svg5-dev \ + libssl-dev \ + make \ && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[0] .assets_url' | tr -d '"') \ && LIBTORRENT_DOWNLOAD_URL=$(curl -sX GET ${LIBTORRENT_ASSETS} | jq '.[0] .browser_download_url' | tr -d '"') \ && LIBTORRENT_NAME=$(curl -sX GET ${LIBTORRENT_ASSETS} | jq '.[0] .name' | tr -d '"') \ && curl -o /opt/${LIBTORRENT_NAME} -L ${LIBTORRENT_DOWNLOAD_URL} \ - && tar -xvzf /opt/${LIBTORRENT_NAME} \ - && rm /opt/*.tar.gz \ + && tar -xzf /opt/${LIBTORRENT_NAME} \ + && rm /opt/${LIBTORRENT_NAME} \ && cd /opt/libtorrent-rasterbar* \ && ./configure --disable-debug --enable-encryption && make clean && make -j$(nproc) && make install \ - && git clone https://github.com/qbittorrent/qBittorrent.git /opt/qBittorrent \ - && cd /opt/qBittorrent \ - && ./configure --disable-gui && make -j$(nproc) && make install \ && cd /opt \ && rm -rf /opt/* \ && apt -y purge \ - curl \ - jq \ - build-essential \ ca-certificates \ - pkg-config \ - automake \ - libtool \ - git \ - zlib1g-dev \ - libssl-dev \ - libgeoip-dev \ - libboost-dev \ + curl \ + g++ \ + jq \ libboost-system-dev \ - libboost-chrono-dev \ - libboost-random-dev \ - python3 \ - qtbase5-dev \ - qttools5-dev \ - libqt5svg5-dev \ + libssl-dev \ + make \ && apt-get clean \ && apt -y autoremove \ && rm -rf \ @@ -69,26 +43,86 @@ RUN apt update \ /tmp/* \ /var/tmp/* +# Compile qBittorrent +RUN apt update \ + && apt -y upgrade \ + && apt -y install --no-install-recommends \ + ca-certificates \ + curl \ + g++ \ + jq \ + libboost-system-dev \ + libssl-dev \ + make \ + pkg-config \ + qtbase5-dev \ + qttools5-dev \ + zlib1g-dev \ + && QBITTORRENT_RELEASE=$(curl -sX GET "https://api.github.com/repos/qBittorrent/qBittorrent/tags" | jq '.[0] .name' | tr -d '"') \ + && curl -o /opt/qBittorrent-${QBITTORRENT_RELEASE}.tar.gz -L "https://github.com/qbittorrent/qBittorrent/archive/${QBITTORRENT_RELEASE}.tar.gz" \ + && tar -xzf /opt/qBittorrent-${QBITTORRENT_RELEASE}.tar.gz \ + && rm /opt/qBittorrent-${QBITTORRENT_RELEASE}.tar.gz \ + && cd /opt/qBittorrent-${QBITTORRENT_RELEASE} \ + && ./configure --disable-gui && make -j$(nproc) && make install \ + && cd /opt \ + && rm -rf /opt/* \ + && apt -y purge \ + ca-certificates \ + curl \ + g++ \ + jq \ + libboost-system-dev \ + libssl-dev \ + make \ + pkg-config \ + qtbase5-dev \ + qttools5-dev \ + zlib1g-dev \ + && apt-get clean \ + && apt -y autoremove \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + +# Install WireGuard, OpenVPN and other dependencies for running qbittorrent-nox and the container scripts RUN echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list \ && printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable \ && apt update \ && apt -y install --no-install-recommends \ - libboost-system1.67.0 \ - libqt5xml5 \ - libqt5network5 \ - libssl1.1 \ - kmod \ - iptables \ + ca-certificates \ + curl \ + dos2unix \ inetutils-ping \ - procps \ + ipcalc \ + iptables \ + kmod \ + libboost-system1.67.0 \ + libqt5network5 \ + libqt5xml5 \ + libssl1.1 \ moreutils \ net-tools \ - dos2unix \ - openvpn \ openresolv \ + openvpn \ + procps \ wireguard-tools \ - ipcalc \ - ca-certificates \ + && apt-get clean \ + && apt -y autoremove \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* + +RUN echo "deb http://deb.debian.org/debian/ buster non-free" > /etc/apt/sources.list.d/non-free-unrar.list \ + && printf 'Package: *\nPin: release a=non-free\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-non-free \ + && apt update \ + && apt -y upgrade \ + && apt -y install --no-install-recommends \ + unrar \ + p7zip-full \ + unzip \ + zip \ && apt-get clean \ && apt -y autoremove \ && rm -rf \ diff --git a/README.md b/README.md index 84ff304..128a562 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [qBittorrent](https://github.com/qbittorrent/qBittorrent), WireGuard and OpenVPN [![Docker Pulls](https://img.shields.io/docker/pulls/dyonr/qbittorrentvpn)](https://hub.docker.com/r/dyonr/qbittorrentvpn) -[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dyonr/qbittorrentvpn/alpha)](https://hub.docker.com/r/dyonr/qbittorrentvpn) +[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/dyonr/qbittorrentvpn/latest)](https://hub.docker.com/r/dyonr/qbittorrentvpn) Docker container which runs the latest [qBittorrent](https://github.com/qbittorrent/qBittorrent)-nox client while connecting to WireGuard (experimental) or OpenVPN with iptables killswitch to prevent IP leakage when the tunnel goes down. From 74bcb8af6c47cddcc1f3beba880bd857edcf87d0 Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 30 Aug 2020 03:41:49 +0200 Subject: [PATCH 6/6] Changed apt parameters --- openvpn/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn/start.sh b/openvpn/start.sh index 98647c3..1e7c558 100644 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -19,9 +19,9 @@ if [[ $INSTALL_PYTHON3 == "yes" ]]; then if [ ! -e /usr/bin/python3 ]; then echo "[INFO] Python3 not yet installed, installing..." | ts '%Y-%m-%d %H:%M:%.S' apt -qq update \ - && apt -qq install python3 \ + && apt -y install python3 \ && apt-get clean \ - && apt -qq autoremove \ + && apt -y autoremove \ && rm -rf \ /var/lib/apt/lists/* \ /tmp/* \