This commit is contained in:
2021-08-24 14:35:11 +03:00
parent d8fba9335d
commit 4f37cb59b1
107 changed files with 3941 additions and 66 deletions

View File

@@ -1,4 +1,17 @@
## 14.3.7.99202108230857-7410-fefce0337ubuntu20.04.1-ls151 (24-08-2021)
- Update to latest version from linuxserver/docker-qbittorrent
## 14.3.7.99202108032349-7395-0415c0c6fubuntu20.04.1-ls149 (05-08-2021)
- Update to latest version from linuxserver/docker-qbittorrent
- Improved smb mount code
## 14.3.6.99202107121017-7389-3ac8c97e6ubuntu20.04.1-ls145 (13-07-2021)
- Update to latest version from linuxserver/docker-qbittorrent
## 14.3.6.99202107050919-7388-ede42910dubuntu20.04.1-ls143 (05-07-2021)
- Update to latest version from linuxserver/docker-qbittorrent
## 14.3.6.99202106272003-7387-ac8105c30ubuntu20.04.1-ls141 (28-06-2021)
- Update to latest version from linuxserver/docker-qbittorrent

View File

@@ -1,84 +1,86 @@
ARG BUILD_FROM
ARG BUILD_VERSION
ARG BUILD_UPSTREAM="14.3.6.99202106272003-7387-ac8105c30ubuntu20.04.1-ls141"
FROM ${BUILD_FROM}${BUILD_UPSTREAM}
FROM ${BUILD_FROM}
# Base system
ARG BASHIO_VERSION=0.13.0
ARG BASHIO_VERSION=0.13.1
ARG TEMPIO_VERSION=2021.01.0
ARG BUILD_ARCH
RUN \
####################
# AVOID NTP ISSUES #
####################
yum install -y ntp && \
service ntpd stop && \
ntpdate pool.ntp.org && \
\
################
# Install apps #
################
apt-get update && \
apt-get install -y \
apt-transport-https \
apt-get update \
&& apt-get install -y \
jq \
curl \
cifs-utils \
keyutils \
samba \
nginx \
coreutils \
openvpn \
&& apt-get clean \
\
##################
# Install tempio #
##################
curl -L -f -s -o /usr/bin/tempio \
"https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" && \
chmod a+x /usr/bin/tempio && \
&& curl -L -f -s -o /usr/bin/tempio \
"https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/tempio \
\
##############
# STATISTICS #
##############
curl -L -f -s -o /tmp/tmp \
"https://github.com/alexbelgium/downloads-tracker/archive/refs/tags/Qbittorrent.zip" && \
&& curl -L -f -s -o /tmp/tmp \
"https://github.com/alexbelgium/downloads-tracker/archive/refs/tags/Qbittorrent.zip" \
\
##################
# Install bashio #
##################
mkdir -p /tmp/bashio && \
curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" && \
| tar -xzf - --strip 1 -C /tmp/bashio && \
mv /tmp/bashio/lib /usr/lib/bashio && \
ln -s /usr/lib/bashio/bashio /usr/bin/bashio && \
rm -rf /tmp/bashio && \
&& mkdir -p /tmp/bashio \
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
| tar -xzf - --strip 1 -C /tmp/bashio \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio \
\
########################################
# Correct upstream image folders links #
########################################
\
# Allow UID and GID setting
sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser && \
sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser && \
sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser && \
&& sed -i 's/bash/bashio/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PUID:-911}/(bashio::config "PUID")/g' /etc/cont-init.d/10-adduser \
&& sed -i 's/{PGID:-911}/(bashio::config "PGID")/g' /etc/cont-init.d/10-adduser \
\
# Correct permissions
sed -i 's|/config|-R /config/qBittorrent|g' /etc/cont-init.d/10-adduser && \
sed -i 's= /config=/config/qBittorrent || true=g' /etc/cont-init.d/30-config && \
&& sed -i 's=/config=/config/qBittorrent || true=g' /etc/cont-init.d/10-adduser \
&& sed -i 's= /config=/config/qBittorrent || true=g' /etc/cont-init.d/30-config \
\
# Set download folder to /share
sed -i 's|/downloads/|/share/qBittorrent/|g' /defaults/qBittorrent.conf && \
&& sed -i 's|/downloads/|/share/qBittorrent/|g' /defaults/qBittorrent.conf \
\
# Remove fixed folders, allows connection to webUI
sed '11,13d' /defaults/qBittorrent.conf && \
echo 'WebUI\HostHeaderValidation=false' >> /defaults/qBittorrent.conf && \
echo 'WebUI\LocalHostAuth=false' >> /defaults/qBittorrent.conf
&& sed '11,13d' /defaults/qBittorrent.conf \
&& echo 'WebUI\HostHeaderValidation=false' >> /defaults/qBittorrent.conf \
&& echo 'WebUI\LocalHostAuth=false' >> /defaults/qBittorrent.conf
# Copy root filesystem
COPY rootfs /
VOLUME [ "/data" ]
# Environment variables
ENV \
DEBIAN_FRONTEND="noninteractive"\
LANG="C.UTF-8" \
PS1="$(whoami)@$(hostname):$(pwd)$ " \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_CMD_WAIT_FOR_SERVICES=1 \
TERM="xterm-256color"
### LABELS
ARG BUILD_ARCH
ARG BUILD_DATE

View File

@@ -1,30 +1,39 @@
# Home assistant add-on: qBittorrent
![Supports aarch64 Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield]
![Supports smb mounts][smb-shield] ![Supports openvpn][openvpn-shield] ![Supports ingress][ingress-shield] ![Supports ssl][ssl-shield]
## About
# About
----------
[Qbittorrent](https://github.com/qbittorrent/qBittorrent) is a cross-platform free and open-source BitTorrent client.
This addon is based on the docker image from [linuxserver.io](https://www.linuxserver.io/).
qBittorrent is a bittorrent client.
This addon is based on the [docker image](https://github.com/linuxserver/qbittorrent) from linuxserver.io.
This addons has several configurable options :
- allowing to mount local external drive, or smb share from the addon
- [alternative webUI](https://github.com/qbittorrent/qBittorrent/wiki/List-of-known-alternate-WebUIs)
- usage of ssl
- ingress
- optional openvpn support
- allow setting specific DNS servers
## Installation
# Installation
----------
The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on.
The installation of this add-on is pretty straightforward and not different in
comparison to installing any other Hass.io add-on.
1. [Add my Hass.io add-ons repository][repository] to your Hass.io instance.
1. Add my add-ons repository to your home assistant instance (in supervisor addons store at top right, or click button below if you have configured my HA)
[![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Falexbelgium%2Fhassio-addons)
1. Install this add-on.
1. Click the `Save` button to store your configuration.
1. Set the add-on options to your preferences
1. Start the add-on.
1. Check the logs of the add-on to see if everything went well.
1. Carefully configure the add-on to your preferences, see the official documentation for for that.
1. Open the webUI and adapt the software options
## Configuration
Webui can be found at <http://your-ip:8081>. The default username/password : described in the startup log. Configurations can be done through the app, except for the following options.
# Configuration
--------------
Webui can be found at <http://your-ip:8080>, or in your sidebar using Ingress.
The default username/password : described in the startup log.
Configurations can be done through the app webUI, except for the following options
Network disk is mounted to /mnt/storagename
OpenVPN must be enabled from within qBittorrent options
Network disk is mounted to /mnt/share name
```yaml
GUID: user
@@ -35,21 +44,29 @@ keyfile: privkey.pem #sslkeyfile
whitelist: "localhost,192.168.0.0/16" # list ip subnets that won't need a password (optional)
Username: "admin" #username to access webui. Please change it as the default is admin for all installations.
customUI: selection from list # alternative webUI can be set here. Latest version set at each addon start.
SavePath: "/share/qbittorrent" # Define the download directory
DNS_servers : 8.8.8.8,1.1.1.1 # Keep blank to use routers DNS, or set custom DNS to avoid spamming in case of local DNS ad-remover
SavePath: "/share/qbittorrent" # Define the download directory
networkdisks: "//SERVER/SHARE" # optional, list of smb servers to mount, separated by commas
cifsusername: "username" # optional, smb username, same for all smb shares
cifspassword: "password" # optional, smb password, same for all smb shares)
openvpn_enabled: yes/no
cifspassword: "password" # optional, smb password
cifsdomain: "domain" # optional, allow setting the domain for the smb share
password, same for all smb shares
openvpn_enabled: true/false # is openvpn required to start qbittorrent
openvpn_alternative_mode: true/false # if enabled, will tunnel only qbittorrent and not webui through vpn. Allows webui connection from external networks, but risk of decreased stability.
openvpn_config: must reference an openvpn config files stored in /config/openvpn
openvpn_username: openvpn username
openvpn_password": openvpn password
openvpn_config": For example "config.ovpn" # name of the file located in /config/openvpn.
openvpn_username": USERNAME
openvpn_password: YOURPASSWORD
```
# Integration with HA
Use the [qBittorrent integration](https://www.home-assistant.io/integrations/qbittorrent/)
## Support
Create an issue on github, or ask on the [home assistant thread](https://community.home-assistant.io/t/home-assistant-addon-qbittorrent/279247)
# Illustration (vuetorrent webui)
--------------
![illustration](https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/qbittorrent/illustration.png)
[repository]: https://github.com/alexbelgium/hassio-addons
[smb-shield]: https://img.shields.io/badge/smb-yes-green.svg
[openvpn-shield]: https://img.shields.io/badge/openvpn-yes-green.svg
@@ -59,3 +76,4 @@ Create an issue on github, or ask on the [home assistant thread](https://communi
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg

View File

@@ -10,12 +10,15 @@ profile db21ed7f_qbittorrent flags=(attach_disconnected,mediate_deleted) {
remount,
capability setgid,
capability chown,
capability setuid,
capability sys_admin,
capability dac_read_search,
capability net_admin,
capability dac_override,
# capability sys_rawio,
capability net_bind_service,
capability net_broadcast,
capability sys_rawio,
# S6-Overlay
/bin/** ix,

View File

@@ -1,8 +1,8 @@
{
"build_from": {
"armv7": "linuxserver/qbittorrent:arm32v7-",
"armhf": "linuxserver/qbittorrent:arm32v7-",
"aarch64": "linuxserver/qbittorrent:arm64v8-",
"amd64": "linuxserver/qbittorrent:amd64-"
"armv7": "linuxserver/qbittorrent:arm32v7-latest",
"armhf": "linuxserver/qbittorrent:arm32v7-latest",
"aarch64": "linuxserver/qbittorrent:arm64v8-latest",
"amd64": "linuxserver/qbittorrent:amd64-latest"
}
}

View File

@@ -1,7 +1,7 @@
{
"name": "Qbittorrent",
"version": "14.3.6.99202106272003-7387-ac8105c30ubuntu20.04.1-ls141",
"upstream": "14.3.6.99202106272003-7387-ac8105c30ubuntu20.04.1-ls141",
"version": "14.3.7.99202108230857-7410-fefce0337ubuntu20.04.1-ls151",
"upstream": "14.3.7.99202108230857-7410-fefce0337ubuntu20.04.1-ls151",
"slug": "qbittorrent",
"description": "qBittorrent is a bittorrent client",
"url": "https://github.com/alexbelgium/hassio-addons",
@@ -14,6 +14,9 @@
"ingress": true,
"ingress_port": 8099,
"panel_icon": "mdi:progress-download",
"hassio_api": true,
"hassio_role": "homeassistant",
"homeassistant_api": true,
"ports": {
"8080/tcp": 8081,
"6881/tcp": 6881,

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

View File

@@ -31,8 +31,8 @@ fi
# Correct Port #
################
sed -i '/PortRangeMin/d' qBittorrent.conf
sed -i "$LINE i\Connection\\\PortRangeMin=6881" qBittorrent.conf
# sed -i '/PortRangeMin/d' qBittorrent.conf
# sed -i "$LINE i\Connection\\\PortRangeMin=6881" qBittorrent.conf
################
# SSL CONFIG #

View File

@@ -39,14 +39,20 @@ if bashio::config.has_value 'networkdisks'; then
if [ $MOUNTED = false ]; then
for SMBVERS in ",vers=3" ",vers=1.0" ",vers=2.1" ",vers=3.0" ",nodfs" ",uid=0,gid=0,forceuid,forcegid" ",noforceuid,noforcegid" ",${DOMAIN}"
do
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5"
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS $disk /mnt/$diskname 2>/dev/null && MOUNTED=true && break || MOUNTED=false
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5" ",iocharset=utf8"
do
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false
mount -t cifs -o rw,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$SMBVERS$SECVERS $disk /mnt/$disk name 2>/dev/null && MOUNTED=true && break 2 && break || MOUNTED=false
done
done
fi
# Test smbclient if not mounted yet
if [ $MOUNTED = false ]; then
smbclient -L $disk -U $CIFS_USERNAME%$CIFS_PASSWORD --option="client min protocol"="NT1" && \
bashio::log.info "Mounted with smbclient"
fi
# Messages
if [ $MOUNTED = true ]; then
#Test write permissions