From 7c81ba47f839e7dcbc2d5ab88a008d32d08f5cde Mon Sep 17 00:00:00 2001 From: John Date: Thu, 10 Oct 2024 21:40:55 +0800 Subject: [PATCH] qBittorrent:5.0.0 qee:4.6.7.10 --- .github/workflows/qBittorrent.yml | 4 +-- qBittorrent/Dockerfile | 36 ++++++++++++++++++- qBittorrent/README.md | 4 ++- .../root/etc/services.d/qBittorrent/run | 12 +++++-- 4 files changed, 50 insertions(+), 6 deletions(-) diff --git a/.github/workflows/qBittorrent.yml b/.github/workflows/qBittorrent.yml index 1d0c93df..1fd678e6 100644 --- a/.github/workflows/qBittorrent.yml +++ b/.github/workflows/qBittorrent.yml @@ -17,8 +17,8 @@ jobs: - name: 'Set env' run: | - echo "QBITTORRENT_VER=$(echo `grep -n "QBITTORRENT_VER=" qBittorrent/Dockerfile`|awk -F= '{print $2}')" >> $GITHUB_ENV - echo "QBITTORRENT_EE_VER=$(echo `grep -n "QBITTORRENT_EE_VER=" qBittorrent/Dockerfile`|awk -F= '{print $2}')" >> $GITHUB_ENV + echo "QBITTORRENT_VER=$(echo `grep -n "QBITTORRENT_VER=" qBittorrent/Dockerfile`|awk -F= '{print $3}')" >> $GITHUB_ENV + echo "QBITTORRENT_EE_VER=$(echo `grep -n "QBITTORRENT_EE_VER=" qBittorrent/Dockerfile`|awk -F= '{print $3}')" >> $GITHUB_ENV - name: Set up QEMU id: qemu diff --git a/qBittorrent/Dockerfile b/qBittorrent/Dockerfile index 9d475607..7870f7e7 100644 --- a/qBittorrent/Dockerfile +++ b/qBittorrent/Dockerfile @@ -1,7 +1,7 @@ #compiling qB FROM ghcr.io/gshang2017/libtorrent:1 as compilingqB -ARG QBITTORRENT_VER=4.6.7 +ARG QBITTORRENT_VER=5.0.0 ARG QBITTORRENT_EE_VER=4.6.7.10 RUN apk add --no-cache ca-certificates cmake build-base boost-dev wget samurai qt6-qttools-dev \ @@ -29,6 +29,38 @@ RUN apk add --no-cache ca-certificates cmake build-base boost-dev wget samurai q && if [ -e /usr/lib/libtorrent-rasterbar.so.2.0 ];then cp --parents /usr/lib/libtorrent-rasterbar.so.2.0 /qbittorrent; fi \ && if [ -e /usr/lib/libtorrent-rasterbar.so.10 ];then cp --parents /usr/lib/libtorrent-rasterbar.so.10 /qbittorrent; fi +#compiling qB2 +FROM ghcr.io/gshang2017/libtorrent:2 as compilingqB2 + +ARG QBITTORRENT_VER=5.0.0 +ARG QBITTORRENT_EE_VER=4.6.7.10 + +RUN apk add --no-cache ca-certificates cmake build-base boost-dev wget samurai qt6-qttools-dev \ +#qBittorrent-Enhanced-Edition +&& mkdir -p /tmp/qbbuild \ +&& wget -P /tmp/qbbuild https://github.com/c0re100/qBittorrent-Enhanced-Edition/archive/release-${QBITTORRENT_EE_VER}.zip \ +&& unzip -q /tmp/qbbuild/release-${QBITTORRENT_EE_VER}.zip -d /tmp/qbbuild \ +&& cd /tmp/qbbuild/qBittorrent-Enhanced-Edition-release-${QBITTORRENT_EE_VER} \ +&& cmake -B build-nox -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTACKTRACE=OFF -DQT6=ON -DGUI=OFF \ +&& cmake --build build-nox -j $(nproc) \ +&& cmake --install build-nox \ +&& strip /usr/local/bin/qbittorrent-nox \ +&& mv /usr/local/bin/qbittorrent-nox /usr/local/bin/qbittorrentee2-nox \ +#qBittorrent +&& wget -P /tmp/qbbuild https://github.com/qbittorrent/qBittorrent/archive/release-${QBITTORRENT_VER}.zip \ +&& unzip -q /tmp/qbbuild/release-${QBITTORRENT_VER}.zip -d /tmp/qbbuild \ +&& cd /tmp/qbbuild/qBittorrent-release-${QBITTORRENT_VER} \ +&& cmake -B build-nox -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTACKTRACE=OFF -DQT6=ON -DGUI=OFF \ +&& cmake --build build-nox -j $(nproc) \ +&& cmake --install build-nox \ +&& strip /usr/local/bin/qbittorrent-nox \ +&& mkdir /qbittorrent \ +&& mv /usr/local/bin/qbittorrent-nox /usr/local/bin/qbittorrent2-nox \ +&& cp --parents /usr/local/bin/qbittorrent2-nox /qbittorrent \ +&& cp --parents /usr/local/bin/qbittorrentee2-nox /qbittorrent \ +&& if [ -e /usr/lib/libtorrent-rasterbar.so.2.0 ];then cp --parents /usr/lib/libtorrent-rasterbar.so.2.0 /qbittorrent; fi \ +&& if [ -e /usr/lib/libtorrent-rasterbar.so.10 ];then cp --parents /usr/lib/libtorrent-rasterbar.so.10 /qbittorrent; fi + # docker qB FROM alpine:3.20 @@ -40,6 +72,7 @@ ENV UMASK=022 ENV TZ=Asia/Shanghai ENV QB_WEBUI_PORT=8989 ENV QB_EE_BIN=false +ENV LIBTORRENT2=false ENV QB_TRACKERS_UPDATE_AUTO=true ENV QB_TRACKERS_LIST_URL=https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt ENV ENABLE_CHOWN_DOWNLOADS=true @@ -49,6 +82,7 @@ ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 COPY --chmod=755 root / COPY --from=compilingqB --chmod=755 /qbittorrent / +COPY --from=compilingqB2 --chmod=755 /qbittorrent / #install bash curl tzdata python3 shadow qt6 RUN apk add --no-cache bash curl ca-certificates tzdata python3 shadow qt6-qtbase-sqlite qt6-qtbase wget \ diff --git a/qBittorrent/README.md b/qBittorrent/README.md index b2a127a8..e50dc231 100644 --- a/qBittorrent/README.md +++ b/qBittorrent/README.md @@ -14,7 +14,7 @@ |名称|版本|说明| |:-|:-|:-| -|qBittorrent-qBittorrentEE|4.6.7-4.6.7.10|(amd64;arm64v8;arm32v7) 集成Trackers自动更新| +|qBittorrent-qBittorrentEE|5.0.0-4.6.7.10|(amd64;arm64v8;arm32v7) 集成Trackers自动更新| #### 版本升级注意: @@ -86,6 +86,7 @@ | `-e TZ=Asia/Shanghai` |系统时区设置,默认为Asia/Shanghai| | `-e QB_WEBUI_PORT=8989` |web访问端口环境变量| | `-e QB_EE_BIN=false` |(true\|false)设置使用qBittorrent-EE,默认不使用| +| `-e LIBTORRENT2=false` |(true\|false)设置使用libtorrent2.0编译版,默认不使用| | `-e QB_TRACKERS_UPDATE_AUTO=true` |(true\|false)自动更新qBittorrent的trackers,默认开启| | `-e QB_TRACKERS_LIST_URL=` |trackers更新地址设置,仅支持ngosang格式,默认为
https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt | | `-e ENABLE_CHOWN_DOWNLOADS=true` |(true\|false)设定修复Downloads文件夹拥有者,默认开启| @@ -119,6 +120,7 @@ | `TZ=Asia/Shanghai` |系统时区设置,默认为Asia/Shanghai| | `QB_WEBUI_PORT=8989` |web访问端口环境变量| | `QB_EE_BIN=false` |(true\|false)设置使用qBittorrent-EE,默认不使用| +| `LIBTORRENT2=false` |(true\|false)设置使用libtorrent2.0编译版,默认不使用| | `QB_TRACKERS_UPDATE_AUTO=true` |(true\|false)自动更新qBittorrent的trackers,默认开启| | `QB_TRACKERS_LIST_URL=` |trackers更新地址设置,仅支持ngosang格式,默认为
https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt | | `ENABLE_CHOWN_DOWNLOADS=true` |(true\|false)设定修复Downloads文件夹拥有者,默认开启| diff --git a/qBittorrent/root/etc/services.d/qBittorrent/run b/qBittorrent/root/etc/services.d/qBittorrent/run index 5ab957d9..5d52ce42 100644 --- a/qBittorrent/root/etc/services.d/qBittorrent/run +++ b/qBittorrent/root/etc/services.d/qBittorrent/run @@ -5,7 +5,15 @@ umask "$UMASK" # 启动qBittorrent if [ "$QB_EE_BIN" == "true" ]; then - exec s6-setuidgid qbittorrent qbittorrentee-nox --webui-port=$QB_WEBUI_PORT --profile=/config + if [ "$LIBTORRENT2" == "true" ]; then + exec s6-setuidgid qbittorrent qbittorrentee2-nox --webui-port=$QB_WEBUI_PORT --profile=/config + else + exec s6-setuidgid qbittorrent qbittorrentee-nox --webui-port=$QB_WEBUI_PORT --profile=/config + fi else - exec s6-setuidgid qbittorrent qbittorrent-nox --webui-port=$QB_WEBUI_PORT --profile=/config + if [ "$LIBTORRENT2" == "true" ]; then + exec s6-setuidgid qbittorrent qbittorrent2-nox --webui-port=$QB_WEBUI_PORT --profile=/config + else + exec s6-setuidgid qbittorrent qbittorrent-nox --webui-port=$QB_WEBUI_PORT --profile=/config + fi fi