Compare commits

...

15 Commits

Author SHA1 Message Date
DyonR
c60d7c0f48 Updated qBittorrent.conf 2022-02-16 20:08:01 +01:00
DyonR
783612ea5a Updated alpha to be more like master 2021-11-02 16:55:04 +01:00
DyonR
a5acdca41a Enabled LEGACY_IPTABLES 2021-11-02 16:50:46 +01:00
DyonR
70195d1dc6 Switch to latest libtorrent commit instead of release 2021-08-26 14:25:39 +02:00
DyonR
9bf6a096df updated readme to bullseye 2021-08-15 21:55:17 +02:00
DyonR
1f1c2666be Update to debian:bullseye repo 2021-08-15 21:44:03 +02:00
DyonR
0d2f5cdce7 Added missing libqrsql5 dependency 2021-06-17 00:18:42 +02:00
DyonR
6de733b7a9 Fixed obtaining Boost version 2021-05-04 19:02:37 +02:00
DyonR
36d1f19b6c
Fixed Boost download path 2021-05-03 23:53:24 +02:00
DyonR
e8fd7efca6 Reverted back to Debian, but 11 2021-03-25 23:43:12 +01:00
DyonR
97b9dec17f Revert "Added DEBIAN_FRONTEND env"
This reverts commit 5518dc1b27d61919d5b28ca3709951be9f65a11d.
2021-03-25 23:41:58 +01:00
DyonR
5518dc1b27 Added DEBIAN_FRONTEND env 2021-03-25 22:50:01 +01:00
DyonR
0fce293556 Switch to Ubuntu 20.04 for higher qtbase5 version
Debian 10 only provides qtbase5-dev 5.11, while 5.12 is the minimum required for compiling qBittorrent, Ubuntu 20.04 provides version 5.12.8.
2021-03-25 21:30:35 +01:00
DyonR
c0d8731946 getting cmake download url case insensitive 2021-03-11 21:06:13 +01:00
DyonR
81db5ca399
Merge pull request #34 from DyonR/dev
Sync dev with alpha
2021-01-23 19:48:15 +01:00
4 changed files with 79 additions and 62 deletions

View File

@ -1,4 +1,5 @@
FROM debian:10-slim
# qBittorrent, OpenVPN and WireGuard, qbittorrentvpn
FROM debian:bullseye-slim
WORKDIR /opt
@ -9,28 +10,28 @@ RUN mkdir -p /downloads /config/qBittorrent /etc/openvpn /etc/qbittorrent
# Install boost
RUN apt update \
&& apt -y upgrade \
&& apt -y install --no-install-recommends \
&& apt upgrade -y \
&& apt install -y --no-install-recommends \
curl \
ca-certificates \
g++ \
libxml2-utils \
&& BOOST_VERSION_DOT=$(curl -sX GET "https://www.boost.org/feed/news.rss" | xmllint --xpath '//rss/channel/item/title/text()' - | awk -F 'Version' '{print $2 FS}' - | sed -e 's/Version//g;s/\ //g' | awk 'NR==1{print $1}' -) \
&& BOOST_VERSION_DOT=$(curl -sX GET "https://www.boost.org/feed/news.rss" | xmllint --xpath '//rss/channel/item/title/text()' - | awk -F 'Version' '{print $2 FS}' - | sed -e 's/Version//g;s/\ //g' | xargs | awk 'NR==1{print $1}' -) \
&& BOOST_VERSION=$(echo ${BOOST_VERSION_DOT} | head -n 1 | sed -e 's/\./_/g') \
&& curl -o /opt/boost_${BOOST_VERSION}.tar.gz -L https://dl.bintray.com/boostorg/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.gz \
&& curl -o /opt/boost_${BOOST_VERSION}.tar.gz -L https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.gz \
&& tar -xzf /opt/boost_${BOOST_VERSION}.tar.gz -C /opt \
&& cd /opt/boost_${BOOST_VERSION} \
&& ./bootstrap.sh --prefix=/usr \
&& ./b2 --prefix=/usr install \
&& cd /opt \
&& rm -rf /opt/* \
&& apt -y purge \
&& apt purge -y \
curl \
ca-certificates \
g++ \
libxml2-utils \
&& apt-get clean \
&& apt -y autoremove \
&& apt autoremove -y --purge \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
@ -45,7 +46,7 @@ RUN apt update \
jq \
unzip \
&& NINJA_ASSETS=$(curl -sX GET "https://api.github.com/repos/ninja-build/ninja/releases" | jq '.[] | select(.prerelease==false) | .assets_url' | head -n 1 | tr -d '"') \
&& NINJA_DOWNLOAD_URL=$(curl -sX GET ${NINJA_ASSETS} | jq '.[] | select(.name | contains("ninja-linux")) .browser_download_url' | tr -d '"') \
&& NINJA_DOWNLOAD_URL=$(curl -sX GET ${NINJA_ASSETS} | jq '.[] | select(.name | match("ninja-linux";"i")) .browser_download_url' | tr -d '"') \
&& curl -o /opt/ninja-linux.zip -L ${NINJA_DOWNLOAD_URL} \
&& unzip /opt/ninja-linux.zip -d /opt \
&& mv /opt/ninja /usr/local/bin/ninja \
@ -57,7 +58,7 @@ RUN apt update \
jq \
unzip \
&& apt-get clean \
&& apt autoremove -y \
&& apt autoremove -y --purge \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
@ -66,12 +67,12 @@ RUN apt update \
# Install cmake
RUN apt update \
&& apt upgrade -y \
&& apt install -y --no-install-recommends \
&& apt install -y --no-install-recommends \
ca-certificates \
curl \
jq \
&& CMAKE_ASSETS=$(curl -sX GET "https://api.github.com/repos/Kitware/CMake/releases" | jq '.[] | select(.prerelease==false) | .assets_url' | head -n 1 | tr -d '"') \
&& CMAKE_DOWNLOAD_URL=$(curl -sX GET ${CMAKE_ASSETS} | jq '.[] | select(.name | contains("Linux-x86_64.sh")) .browser_download_url' | tr -d '"') \
&& CMAKE_DOWNLOAD_URL=$(curl -sX GET ${CMAKE_ASSETS} | jq '.[] | select(.name | match("Linux-x86_64.sh";"i")) .browser_download_url' | tr -d '"') \
&& curl -o /opt/cmake.sh -L ${CMAKE_DOWNLOAD_URL} \
&& chmod +x /opt/cmake.sh \
&& /bin/bash /opt/cmake.sh --skip-license --prefix=/usr \
@ -81,7 +82,7 @@ RUN apt update \
curl \
jq \
&& apt-get clean \
&& apt autoremove -y \
&& apt autoremove -y --purge \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
@ -93,16 +94,9 @@ RUN apt update \
&& apt install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
jq \
libssl-dev \
&& LIBTORRENT_ASSETS=$(curl -sX GET "https://api.github.com/repos/arvidn/libtorrent/releases" | jq '.[] | select(.prerelease==false) | select(.target_commitish=="RC_2_0") | .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} \
&& tar -xzf /opt/${LIBTORRENT_NAME} \
&& rm /opt/${LIBTORRENT_NAME} \
&& cd /opt/libtorrent-rasterbar* \
git \
&& git clone --recursive https://github.com/arvidn/libtorrent.git \
&& cd /opt/libtorrent \
&& cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_CXX_STANDARD=17 \
&& cmake --build build --parallel $(nproc) \
&& cmake --install build \
@ -111,11 +105,9 @@ RUN apt update \
&& apt purge -y \
build-essential \
ca-certificates \
curl \
jq \
libssl-dev \
git \
&& apt-get clean \
&& apt autoremove -y \
&& apt autoremove -y --purge \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
@ -152,7 +144,7 @@ RUN apt update \
qttools5-dev \
zlib1g-dev \
&& apt-get clean \
&& apt autoremove -y \
&& apt autoremove -y --purge \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
@ -170,6 +162,7 @@ RUN echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.li
iptables \
kmod \
libqt5network5 \
libqt5sql5 \
libqt5xml5 \
libssl1.1 \
moreutils \
@ -179,29 +172,32 @@ RUN echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.li
procps \
wireguard-tools \
&& apt-get clean \
&& apt autoremove -y \
&& apt autoremove -y --purge \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
# Install (un)compressing tools like unrar, 7z, unzip and zip
RUN echo "deb http://deb.debian.org/debian/ buster non-free" > /etc/apt/sources.list.d/non-free-unrar.list \
RUN echo "deb http://deb.debian.org/debian/ bullseye 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 \
&& apt install -y --no-install-recommends \
unrar \
p7zip-full \
unzip \
zip \
&& apt-get clean \
&& apt -y autoremove \
&& apt autoremove -y --purge \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
# Remove src_valid_mark from wg-quick
RUN sed -i /net\.ipv4\.conf\.all\.src_valid_mark/d `which wg-quick`
VOLUME /config /downloads
ADD openvpn/ /etc/openvpn/
@ -212,4 +208,4 @@ RUN chmod +x /etc/qbittorrent/*.sh /etc/qbittorrent/*.init /etc/openvpn/*.sh
EXPOSE 8080
EXPOSE 8999
EXPOSE 8999/udp
CMD ["/bin/bash", "/etc/openvpn/start.sh"]
CMD ["/bin/bash", "/etc/openvpn/start.sh"]

View File

@ -7,8 +7,8 @@ Docker container which runs the latest [qBittorrent](https://github.com/qbittorr
[preview]: https://raw.githubusercontent.com/DyonR/docker-templates/master/Screenshots/qbittorrentvpn/qbittorrentvpn-webui.png "qBittorrent WebUI"
![alt text][preview]
## Docker Features
* Base: Debian 10-slim
# Docker Features
* Base: Debian bullseye-slim
* [qBittorrent](https://github.com/qbittorrent/qBittorrent) compiled from source
* [libtorrent](https://github.com/arvidn/libtorrent) compiled from source
* Compiled with the latest version of [Boost](https://www.boost.org/)
@ -19,22 +19,34 @@ Docker container which runs the latest [qBittorrent](https://github.com/qbittorr
* Created with [Unraid](https://unraid.net/) in mind
* BitTorrent port 8999 exposed by default
# Run container from Docker registry
## Run container from Docker registry
The container is available from the Docker registry and this is the simplest way to get it
To run the container use this command, with additional parameters, please refer to the Variables, Volumes, and Ports section:
```
$ docker run --privileged -d \
$ docker run -d \
-v /your/config/path/:/config \
-v /your/downloads/path/:/downloads \
-e "VPN_ENABLED=yes" \
-e "VPN_TYPE=wireguard" \
-e "LAN_NETWORK=192.168.0.0/24" \
-p 8080:8080 \
--cap-add NET_ADMIN \
--sysctl "net.ipv4.conf.all.src_valid_mark=1" \
--restart unless-stopped \
dyonr/qbittorrentvpn
```
## Docker Tags
| Tag | Description |
|----------|----------|
| `dyonr/qbittorrentvpn:latest` | The latest version of qBittorrent with libtorrent 1_x_x |
| `dyonr/qbittorrentvpn:rc_2_0` | The latest version of qBittorrent with libtorrent 2_x_x |
| `dyonr/qbittorrentvpn:legacy_iptables` | The latest version of qBittorrent, libtorrent 1_x_x and an experimental feature to fix problems with QNAP NAS systems, [Issue #25](https://github.com/DyonR/docker-qbittorrentvpn/issues/25) |
| `dyonr/qbittorrentvpn:alpha` | The latest alpha version of qBittorrent with libtorrent 2_0, incase you feel like testing new features |
| `dyonr/qbittorrentvpn:dev` | This branch is used for testing new Docker features or improvements before merging it to the main branch |
| `dyonr/qbittorrentvpn:v4_2_x` | (Legacy) qBittorrent version 4.2.x with libtorrent 1_x_x |
# Variables, Volumes, and Ports
## Environment Variables
| Variable | Required | Function | Example | Default |
@ -44,6 +56,7 @@ $ docker run --privileged -d \
|`VPN_USERNAME`| No | If username and password provided, configures ovpn file automatically |`VPN_USERNAME=ad8f64c02a2de`||
|`VPN_PASSWORD`| No | If username and password provided, configures ovpn file automatically |`VPN_PASSWORD=ac98df79ed7fb`||
|`LAN_NETWORK`| Yes (atleast one) | Comma delimited local Network's with CIDR notation |`LAN_NETWORK=192.168.0.0/24,10.10.0.0/24`||
|`LEGACY_IPTABLES`| No | Use `iptables (legacy)` instead of `iptables (nf_tables)` |`LEGACY_IPTABLES=yes`||
|`ENABLE_SSL`| No | Let the container handle SSL (yes/no)? |`ENABLE_SSL=yes`|`yes`|
|`NAME_SERVERS`| No | Comma delimited name servers |`NAME_SERVERS=1.1.1.1,1.0.0.1`|`1.1.1.1,1.0.0.1`|
|`PUID`| No | UID applied to /config files and /downloads |`PUID=99`|`99`|
@ -79,10 +92,18 @@ Access https://IPADDRESS:PORT from a browser on the same network. (for example:
|`password`| `adminadmin` |
# How to use WireGuard
The container will fail to boot if `VPN_ENABLED` is set and there is no valid .conf file present in the /config/wireguard directory. Drop a .conf file from your VPN provider into /config/wireguard and start the container again. The file must have the name `wg0.conf`.
The container will fail to boot if `VPN_ENABLED` is set and there is no valid .conf file present in the /config/wireguard directory. Drop a .conf file from your VPN provider into /config/wireguard and start the container again. The file must have the name `wg0.conf`, or it will fail to start.
## WireGuard IPv6 issues
If you use WireGuard and also have IPv6 enabled, it is necessary to add the IPv6 range to the `LAN_NETWORK` environment variable.
Additionally the parameter `--sysctl net.ipv6.conf.all.disable_ipv6=0` also must be added to the `docker run` command, or to the "Extra Parameters" in Unraid.
The full Unraid `Extra Parameters` would be: `--restart unless-stopped --sysctl net.ipv6.conf.all.disable_ipv6=0"`
If you do not do this, the container will keep on stopping with the error `RTNETLINK answers permission denied`.
Since I do not have IPv6, I am did not test.
Thanks to [mchangrh](https://github.com/mchangrh) / [Issue #49](https://github.com/DyonR/docker-qbittorrentvpn/issues/49)
# How to use OpenVPN
The container will fail to boot if `VPN_ENABLED` is set and there is no valid .ovpn file present in the /config/openvpn directory. Drop a .ovpn file from your VPN provider into /config/openvpn and start the container again. You may need to edit the ovpn configuration file to load your VPN credentials from a file by setting `auth-user-pass`.
The container will fail to boot if `VPN_ENABLED` is set and there is no valid .ovpn file present in the /config/openvpn directory. Drop a .ovpn file from your VPN provider into /config/openvpn (if necessary with additional files like certificates) and start the container again. You may need to edit the ovpn configuration file to load your VPN credentials from a file by setting `auth-user-pass`.
**Note:** The script will use the first ovpn file it finds in the /config/openvpn directory. Adding multiple ovpn files will not start multiple VPN connections.
@ -103,11 +124,11 @@ id <username>
```
# Issues
If you are having issues with this container please submit an issue on GitHub.
Please provide logs, docker version and other information that can simplify reproducing the issue.
Using the latest stable verison of Docker is always recommended. Support for older version is on a best-effort basis.
If you are having issues with this container please submit an issue on GitHub.
Please provide logs, Docker version and other information that can simplify reproducing the issue.
If possible, always use the most up to date version of Docker, you operating system, kernel and the container itself. Support is always a best-effort basis.
### Credits:
### Credits:
[MarkusMcNugen/docker-qBittorrentvpn](https://github.com/MarkusMcNugen/docker-qBittorrentvpn)
[DyonR/jackettvpn](https://github.com/DyonR/jackettvpn)
This projects originates from MarkusMcNugen/docker-qBittorrentvpn, but forking was not possible since DyonR/jackettvpn uses the fork already.

View File

@ -13,7 +13,7 @@ if [[ ! -z "${check_network}" ]]; then
exit 1
fi
export VPN_ENABLED=$(echo "${VPN_ENABLED}" | sed -e 's~^[ \t]*~~;s~[ \t]*$~~')
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'
else
@ -21,20 +21,20 @@ else
export VPN_ENABLED="yes"
fi
# export LEGACY_IPTABLES=$(echo "${LEGACY_IPTABLES,,}")
# echo "[INFO] LEGACY_IPTABLES is set to '${LEGACY_IPTABLES}'" | ts '%Y-%m-%d %H:%M:%.S'
# if [[ $LEGACY_IPTABLES == "1" || $LEGACY_IPTABLES == "true" || $LEGACY_IPTABLES == "yes" ]]; then
# echo "[INFO] Linking /usr/sbin/iptables-legacy to /usr/sbin/iptables" | ts '%Y-%m-%d %H:%M:%.S'
# ln -sf /usr/sbin/iptables-legacy /usr/sbin/iptables > /dev/null 2>&1
# echo "[INFO] Linking /usr/sbin/iptables-legacy-save to /usr/sbin/iptables-save" | ts '%Y-%m-%d %H:%M:%.S'
# ln -sf /usr/sbin/iptables-legacy-save /usr/sbin/iptables-save > /dev/null 2>&1
# echo "[INFO] Linking /usr/sbin/iptables-legacy-restore to /usr/sbin/iptables-restore" | ts '%Y-%m-%d %H:%M:%.S'
# ln -sf /usr/sbin/iptables-legacy-restore /usr/sbin/iptables-restore > /dev/null 2>&1
# else
# echo "[INFO] Not making any changes to iptables" | ts '%Y-%m-%d %H:%M:%.S'
# fi
export LEGACY_IPTABLES=$(echo "${LEGACY_IPTABLES,,}")
iptables_version=$(iptables -V)
echo "[INFO] The container is currently running ${iptables_version}." | ts '%Y-%m-%d %H:%M:%.S'
echo "[INFO] LEGACY_IPTABLES is set to '${LEGACY_IPTABLES}'" | ts '%Y-%m-%d %H:%M:%.S'
if [[ $LEGACY_IPTABLES == "1" || $LEGACY_IPTABLES == "true" || $LEGACY_IPTABLES == "yes" ]]; then
echo "[INFO] Setting iptables to iptables (legacy)" | ts '%Y-%m-%d %H:%M:%.S'
update-alternatives --set iptables /usr/sbin/iptables-legacy
iptables_version=$(iptables -V)
echo "[INFO] The container is now running ${iptables_version}." | ts '%Y-%m-%d %H:%M:%.S'
else
echo "[INFO] Not making any changes to iptables version" | ts '%Y-%m-%d %H:%M:%.S'
fi
if [[ $VPN_ENABLED == "yes" ]]; then
if [[ $VPN_ENABLED == "1" || $VPN_ENABLED == "true" || $VPN_ENABLED == "yes" ]]; then
# Check if VPN_TYPE is set.
if [[ -z "${VPN_TYPE}" ]]; then
echo "[WARNING] VPN_TYPE not set, defaulting to OpenVPN." | ts '%Y-%m-%d %H:%M:%.S'
@ -231,7 +231,7 @@ if [[ $VPN_ENABLED == "yes" ]]; then
fi
fi
elif [[ $VPN_ENABLED == "no" ]]; then
else
echo "[WARNING] !!IMPORTANT!! You have set the VPN to disabled, your connection will NOT be secure!" | ts '%Y-%m-%d %H:%M:%.S'
fi

View File

@ -1,12 +1,12 @@
[BitTorrent]
Session\BTProtocol=Both
Session\DefaultSavePath=/downloads
Session\TempPath=/downloads/temp
Session\TempPathEnabled=true
Session\UseRandomPort=true
Session\Port=8999
[Preferences]
Connection\PortRangeMin=8999
Downloads\SavePath=/downloads/
Downloads\TempPath=/downloads/temp/
Downloads\TempPathEnabled=true
General\UseRandomPort=false
WebUI\Username=admin
WebUI\Port=8080
WebUI\HostHeaderValidation=false