From f3db0807805704fd0bdc08bdb6821504eee3dfd8 Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 30 Aug 2020 20:50:17 +0200 Subject: [PATCH 1/4] Moved the Python installation to separate script --- openvpn/start.sh | 16 ---------------- qbittorrent/install-python3.sh | 14 ++++++++++++++ qbittorrent/start.sh | 5 +++++ 3 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 qbittorrent/install-python3.sh diff --git a/openvpn/start.sh b/openvpn/start.sh index 1e7c558..db9f7ed 100644 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -13,22 +13,6 @@ 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 -y install python3 \ - && apt-get clean \ - && apt -y 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' diff --git a/qbittorrent/install-python3.sh b/qbittorrent/install-python3.sh new file mode 100644 index 0000000..1591b02 --- /dev/null +++ b/qbittorrent/install-python3.sh @@ -0,0 +1,14 @@ +#!/bin/bash +if [ ! -e /usr/bin/python3 ]; then + echo "[INFO] Python3 not yet installed, installing..." | ts '%Y-%m-%d %H:%M:%.S' + apt -qq update \ + && apt -y install python3 \ + && apt-get clean \ + && apt -y autoremove \ + && rm -rf \ + /var/lib/apt/lists/* \ + /tmp/* \ + /var/tmp/* +else + echo "[INFO] Python3 is already installed, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' +fi \ No newline at end of file diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 3e6836f..86bccf7 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -17,6 +17,11 @@ if [ ! -e /config/qBittorrent/config/qBittorrent.conf ]; then chown ${PUID}:${PGID} /config/qBittorrent/config/qBittorrent.conf fi +export INSTALL_PYTHON3=$(echo "${INSTALL_PYTHON3,,}") +if [[ $INSTALL_PYTHON3 == "yes" ]]; then + /bin/bash /etc/qbittorrent/install-python3.sh +fi + # The mess down here checks if SSL is enabled. export ENABLE_SSL=$(echo "${ENABLE_SSL,,}") if [[ ${ENABLE_SSL} == 'yes' ]]; then From 0144b34250fae89719b3a98de33c7d79d842dfa6 Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 30 Aug 2020 21:00:47 +0200 Subject: [PATCH 2/4] Do not use pre-releases of libtorrent for compiling --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f3f418c..5d5115e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt update \ libboost-system-dev \ libssl-dev \ make \ - && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[0] .assets_url' | tr -d '"') \ + && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[] | select(.prerelease==false) | .assets_url' | head -n 1 | 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} \ From 1285981db07d69688c788b602cf569b55530466b Mon Sep 17 00:00:00 2001 From: DyonR Date: Sun, 30 Aug 2020 21:07:01 +0200 Subject: [PATCH 3/4] Only use the RC_1_2 branch This is the only branch that I test with and can confirm works. If libtorrent 2.0 would be released soon, compiling may break. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5d5115e..f82c435 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt update \ libboost-system-dev \ libssl-dev \ make \ - && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[] | select(.prerelease==false) | .assets_url' | head -n 1 | tr -d '"') \ + && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[] | select(.prerelease==false) | select(.target_commitish=="RC_1_2") | .assets_url' | head -n 1 | 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} \ From 11404ae043d04eeffbd83473f467221f53537ee9 Mon Sep 17 00:00:00 2001 From: DyonR Date: Mon, 31 Aug 2020 03:52:02 +0200 Subject: [PATCH 4/4] Switched to libtorrent-1.2.8, compining issues with 1.2.9 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f82c435..07777d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt update \ libboost-system-dev \ libssl-dev \ make \ - && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[] | select(.prerelease==false) | select(.target_commitish=="RC_1_2") | .assets_url' | head -n 1 | tr -d '"') \ + && LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[] | select(.prerelease==false) | select(.name=="libtorrent-1.2.8") | .assets_url' | head -n 1 | 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} \