From 80f1a0639fc001b9f84b478ca3dfce5fa5d48969 Mon Sep 17 00:00:00 2001 From: DyonR Date: Tue, 18 Aug 2020 21:19:24 +0200 Subject: [PATCH 1/8] Added option to generate SSL in the script --- qbittorrent/start.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 7d41992..0a845c2 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -17,6 +17,47 @@ if [ ! -e /config/qBittorrent/config/qBittorrent.conf ]; then chown ${PUID}:${PGID} /config/qBittorrent/config/qBittorrent.conf fi +export ENABLE_SSL=$(echo "${ENABLE_SSL,,}") +if [[ ${ENABLE_SSL} == 'yes' ]]; then + echo "[INFO] ENABLE_SSL is set to ${ENABLE_SSL}" | ts '%Y-%m-%d %H:%M:%.S' + if [ ! -e /config/qBittorrent/config/WebUICertificate.crt ]; then + echo "[INFO] WebUI Certificate is missing, generating a new Certificate and Key" | ts '%Y-%m-%d %H:%M:%.S' + openssl req -new -x509 -nodes -out /config/qBittorrent/config/WebUICertificate.crt -keyout /config/qBittorrent/config/WebUIKey.key -subj "/C=NL/ST=localhost/L=localhost/O=/OU=/CN=" + chown -R ${PUID}:${PGID} /config/qBittorrent/config + elif [ ! -e /config/qBittorrent/config/WebUIKey.crt ]; then + echo "[INFO] WebUI Key is missing, generating a new Certificate and Key" | ts '%Y-%m-%d %H:%M:%.S' + openssl req -new -x509 -nodes -out /config/qBittorrent/config/WebUICertificate.crt -keyout /config/qBittorrent/config/WebUIKey.key -subj "/C=NL/ST=localhost/L=localhost/O=/OU=/CN=" + chown -R ${PUID}:${PGID} /config/qBittorrent/config + fi + if grep -Fxq 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUICertificate.crt' "/config/qBittorrent/config/qBittorrent.conf" + then + echo "/config/qBittorrent/config/qBittorrent.conf already has the line WebUICertificate.crt loaded, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' + else + echo "/config/qBittorrent/config/qBittorrent.conf doesn't have the WebUICertificate.crt loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' + echo 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUICertificate.crt' >> "/config/qBittorrent/config/qBittorrent.conf" + fi + if grep -Fxq 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUIKey.key' "/config/qBittorrent/config/qBittorrent.conf" + then + echo "/config/qBittorrent/config/qBittorrent.conf already has the line WebUIKey.key loaded, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' + else + echo "/config/qBittorrent/config/qBittorrent.conf doesn't have the WebUIKey.key loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' + echo 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUIKey.key' >> "/config/qBittorrent/config/qBittorrent.conf" + fi + if grep -xq 'WebUI\\HTTPS\\Enabled=true\|WebUI\\HTTPS\\Enabled=false' "/config/qBittorrent/config/qBittorrent.conf" + then + if grep -xq 'WebUI\\HTTPS\\Enabled=false' "/config/qBittorrent/config/qBittorrent.conf" + then + echo "/config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled set to false, changing it to true." | ts '%Y-%m-%d %H:%M:%.S' + sed -i 's/WebUI\\HTTPS\\Enabled=false/WebUI\\HTTPS\\Enabled=true/g' "/config/qBittorrent/config/qBittorrent.conf" + else + echo "/config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled already set to true." | ts '%Y-%m-%d %H:%M:%.S' + fi + else + echo "/config/qBittorrent/config/qBittorrent.conf doesn't have the WebUI\HTTPS\Enabled loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' + echo 'WebUI\HTTPS\Enabled=true' >> "/config/qBittorrent/config/qBittorrent.conf" + fi +fi + # Check if the PGID exists, if not create the group with the name 'qbittorent' grep $"${PGID}:" /etc/group > /dev/null 2>&1 if [ $? -eq 0 ]; then From d49824e8f262b15c402f26c3537e1bd2c289a7b5 Mon Sep 17 00:00:00 2001 From: DyonR Date: Tue, 18 Aug 2020 21:34:51 +0200 Subject: [PATCH 2/8] Fixed CertificatePath to KeyPath --- qbittorrent/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 0a845c2..812c392 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -36,12 +36,12 @@ if [[ ${ENABLE_SSL} == 'yes' ]]; then echo "/config/qBittorrent/config/qBittorrent.conf doesn't have the WebUICertificate.crt loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' echo 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUICertificate.crt' >> "/config/qBittorrent/config/qBittorrent.conf" fi - if grep -Fxq 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUIKey.key' "/config/qBittorrent/config/qBittorrent.conf" + if grep -Fxq 'WebUI\HTTPS\KeyPath=/config/qBittorrent/config/WebUIKey.key' "/config/qBittorrent/config/qBittorrent.conf" then echo "/config/qBittorrent/config/qBittorrent.conf already has the line WebUIKey.key loaded, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' else echo "/config/qBittorrent/config/qBittorrent.conf doesn't have the WebUIKey.key loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' - echo 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUIKey.key' >> "/config/qBittorrent/config/qBittorrent.conf" + echo 'WebUI\HTTPS\KeyPath=/config/qBittorrent/config/WebUIKey.key' >> "/config/qBittorrent/config/qBittorrent.conf" fi if grep -xq 'WebUI\\HTTPS\\Enabled=true\|WebUI\\HTTPS\\Enabled=false' "/config/qBittorrent/config/qBittorrent.conf" then From c6cb6915257964653f9080ba148603a2e9b7cabb Mon Sep 17 00:00:00 2001 From: DyonR Date: Tue, 18 Aug 2020 21:49:41 +0200 Subject: [PATCH 3/8] Added info INFO and WARNINGS --- qbittorrent/start.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 812c392..7fbc920 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -17,6 +17,7 @@ if [ ! -e /config/qBittorrent/config/qBittorrent.conf ]; then chown ${PUID}:${PGID} /config/qBittorrent/config/qBittorrent.conf fi +# The mess down here checks if SSL is enabled. export ENABLE_SSL=$(echo "${ENABLE_SSL,,}") if [[ ${ENABLE_SSL} == 'yes' ]]; then echo "[INFO] ENABLE_SSL is set to ${ENABLE_SSL}" | ts '%Y-%m-%d %H:%M:%.S' @@ -31,31 +32,35 @@ if [[ ${ENABLE_SSL} == 'yes' ]]; then fi if grep -Fxq 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUICertificate.crt' "/config/qBittorrent/config/qBittorrent.conf" then - echo "/config/qBittorrent/config/qBittorrent.conf already has the line WebUICertificate.crt loaded, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' + echo "[INFO] /config/qBittorrent/config/qBittorrent.conf already has the line WebUICertificate.crt loaded, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' else - echo "/config/qBittorrent/config/qBittorrent.conf doesn't have the WebUICertificate.crt loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] /config/qBittorrent/config/qBittorrent.conf doesn't have the WebUICertificate.crt loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' echo 'WebUI\HTTPS\CertificatePath=/config/qBittorrent/config/WebUICertificate.crt' >> "/config/qBittorrent/config/qBittorrent.conf" fi if grep -Fxq 'WebUI\HTTPS\KeyPath=/config/qBittorrent/config/WebUIKey.key' "/config/qBittorrent/config/qBittorrent.conf" then - echo "/config/qBittorrent/config/qBittorrent.conf already has the line WebUIKey.key loaded, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' + echo "[INFO] /config/qBittorrent/config/qBittorrent.conf already has the line WebUIKey.key loaded, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' else - echo "/config/qBittorrent/config/qBittorrent.conf doesn't have the WebUIKey.key loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] /config/qBittorrent/config/qBittorrent.conf doesn't have the WebUIKey.key loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' echo 'WebUI\HTTPS\KeyPath=/config/qBittorrent/config/WebUIKey.key' >> "/config/qBittorrent/config/qBittorrent.conf" fi if grep -xq 'WebUI\\HTTPS\\Enabled=true\|WebUI\\HTTPS\\Enabled=false' "/config/qBittorrent/config/qBittorrent.conf" then if grep -xq 'WebUI\\HTTPS\\Enabled=false' "/config/qBittorrent/config/qBittorrent.conf" then - echo "/config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled set to false, changing it to true." | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] /config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled set to false, changing it to true." | ts '%Y-%m-%d %H:%M:%.S' sed -i 's/WebUI\\HTTPS\\Enabled=false/WebUI\\HTTPS\\Enabled=true/g' "/config/qBittorrent/config/qBittorrent.conf" else - echo "/config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled already set to true." | ts '%Y-%m-%d %H:%M:%.S' + echo "[INFO] /config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled already set to true." | ts '%Y-%m-%d %H:%M:%.S' fi else - echo "/config/qBittorrent/config/qBittorrent.conf doesn't have the WebUI\HTTPS\Enabled loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] /config/qBittorrent/config/qBittorrent.conf doesn't have the WebUI\HTTPS\Enabled loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' echo 'WebUI\HTTPS\Enabled=true' >> "/config/qBittorrent/config/qBittorrent.conf" fi + else + echo "[WARNING] ENABLE_SSL is set to ${ENABLE_SSL}, SSL is not enabled. This could cause issues with logging if other apps use the same Cookie name (SID)." | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] If you manage the SSL config yourself, you can ignore this." | ts '%Y-%m-%d %H:%M:%.S' + fi fi # Check if the PGID exists, if not create the group with the name 'qbittorent' From 40f00a4e3229bfddea7b9ec17ec2e552029c053d Mon Sep 17 00:00:00 2001 From: DyonR Date: Tue, 18 Aug 2020 22:00:13 +0200 Subject: [PATCH 4/8] Fixed wrong fi statement --- qbittorrent/start.sh | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 7fbc920..09a8d1d 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -45,22 +45,21 @@ if [[ ${ENABLE_SSL} == 'yes' ]]; then echo 'WebUI\HTTPS\KeyPath=/config/qBittorrent/config/WebUIKey.key' >> "/config/qBittorrent/config/qBittorrent.conf" fi if grep -xq 'WebUI\\HTTPS\\Enabled=true\|WebUI\\HTTPS\\Enabled=false' "/config/qBittorrent/config/qBittorrent.conf" - then - if grep -xq 'WebUI\\HTTPS\\Enabled=false' "/config/qBittorrent/config/qBittorrent.conf" - then - echo "[WARNING] /config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled set to false, changing it to true." | ts '%Y-%m-%d %H:%M:%.S' - sed -i 's/WebUI\\HTTPS\\Enabled=false/WebUI\\HTTPS\\Enabled=true/g' "/config/qBittorrent/config/qBittorrent.conf" - else - echo "[INFO] /config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled already set to true." | ts '%Y-%m-%d %H:%M:%.S' + then + if grep -xq 'WebUI\\HTTPS\\Enabled=false' "/config/qBittorrent/config/qBittorrent.conf" + then + echo "[WARNING] /config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled set to false, changing it to true." | ts '%Y-%m-%d %H:%M:%.S' + sed -i 's/WebUI\\HTTPS\\Enabled=false/WebUI\\HTTPS\\Enabled=true/g' "/config/qBittorrent/config/qBittorrent.conf" + else + echo "[INFO] /config/qBittorrent/config/qBittorrent.conf does have the WebUI\HTTPS\Enabled already set to true." | ts '%Y-%m-%d %H:%M:%.S' + fi + else + echo "[WARNING] /config/qBittorrent/config/qBittorrent.conf doesn't have the WebUI\HTTPS\Enabled loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' + echo 'WebUI\HTTPS\Enabled=true' >> "/config/qBittorrent/config/qBittorrent.conf" fi - else - echo "[WARNING] /config/qBittorrent/config/qBittorrent.conf doesn't have the WebUI\HTTPS\Enabled loaded. Added it to the config." | ts '%Y-%m-%d %H:%M:%.S' - echo 'WebUI\HTTPS\Enabled=true' >> "/config/qBittorrent/config/qBittorrent.conf" - fi - else - echo "[WARNING] ENABLE_SSL is set to ${ENABLE_SSL}, SSL is not enabled. This could cause issues with logging if other apps use the same Cookie name (SID)." | ts '%Y-%m-%d %H:%M:%.S' - echo "[WARNING] If you manage the SSL config yourself, you can ignore this." | ts '%Y-%m-%d %H:%M:%.S' - fi + else + echo "[WARNING] ENABLE_SSL is set to ${ENABLE_SSL}, SSL is not enabled. This could cause issues with logging if other apps use the same Cookie name (SID)." | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] If you manage the SSL config yourself, you can ignore this." | ts '%Y-%m-%d %H:%M:%.S' fi # Check if the PGID exists, if not create the group with the name 'qbittorent' From a6f068dc867091e8704479936da05772d2da4c28 Mon Sep 17 00:00:00 2001 From: DyonR Date: Tue, 18 Aug 2020 22:07:33 +0200 Subject: [PATCH 5/8] Fixed typo in user/group --- qbittorrent/start.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 09a8d1d..422f59f 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -62,22 +62,22 @@ if [[ ${ENABLE_SSL} == 'yes' ]]; then echo "[WARNING] If you manage the SSL config yourself, you can ignore this." | ts '%Y-%m-%d %H:%M:%.S' fi -# Check if the PGID exists, if not create the group with the name 'qbittorent' +# Check if the PGID exists, if not create the group with the name 'qbittorrent' grep $"${PGID}:" /etc/group > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "[INFO] A group with PGID $PGID already exists in /etc/group, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' else - echo "[INFO] A group with PGID $PGID does not exist, adding a group called 'qbittorent' with PGID $PGID" | ts '%Y-%m-%d %H:%M:%.S' - groupadd -g $PGID qbittorent + echo "[INFO] A group with PGID $PGID does not exist, adding a group called 'qbittorrent' with PGID $PGID" | ts '%Y-%m-%d %H:%M:%.S' + groupadd -g $PGID qbittorrent fi -# Check if the PUID exists, if not create the user with the name 'qbittorent', with the correct group +# Check if the PUID exists, if not create the user with the name 'qbittorrent', with the correct group grep $"${PUID}:" /etc/passwd > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "[INFO] An user with PUID $PUID already exists in /etc/passwd, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' else - echo "[INFO] An user with PUID $PUID does not exist, adding an user called 'qbittorent user' with PUID $PUID" | ts '%Y-%m-%d %H:%M:%.S' - useradd -c "qbittorent user" -g $PGID -u $PUID qbittorent + echo "[INFO] An user with PUID $PUID does not exist, adding an user called 'qbittorrent user' with PUID $PUID" | ts '%Y-%m-%d %H:%M:%.S' + useradd -c "qbittorrent user" -g $PGID -u $PUID qbittorrent fi # Set the umask From f0f618cd21745f621b0e8b0dcb705429af5efa65 Mon Sep 17 00:00:00 2001 From: DyonR Date: Tue, 18 Aug 2020 22:34:37 +0200 Subject: [PATCH 6/8] INFO -> WARNING --- qbittorrent/start.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 422f59f..cfbcc52 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -11,7 +11,7 @@ chown -R ${PUID}:${PGID} /downloads # Check if ServerConfig.json exists, if not, copy the template over if [ ! -e /config/qBittorrent/config/qBittorrent.conf ]; then - echo "[INFO] qBittorrent.conf is missing, this is normal for the first launch! Copying template" | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] qBittorrent.conf is missing, this is normal for the first launch! Copying template." | ts '%Y-%m-%d %H:%M:%.S' cp /etc/qbittorrent/qBittorrent.conf /config/qBittorrent/config/qBittorrent.conf chmod 755 /config/qBittorrent/config/qBittorrent.conf chown ${PUID}:${PGID} /config/qBittorrent/config/qBittorrent.conf @@ -22,11 +22,11 @@ export ENABLE_SSL=$(echo "${ENABLE_SSL,,}") if [[ ${ENABLE_SSL} == 'yes' ]]; then echo "[INFO] ENABLE_SSL is set to ${ENABLE_SSL}" | ts '%Y-%m-%d %H:%M:%.S' if [ ! -e /config/qBittorrent/config/WebUICertificate.crt ]; then - echo "[INFO] WebUI Certificate is missing, generating a new Certificate and Key" | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] WebUI Certificate is missing, generating a new Certificate and Key" | ts '%Y-%m-%d %H:%M:%.S' openssl req -new -x509 -nodes -out /config/qBittorrent/config/WebUICertificate.crt -keyout /config/qBittorrent/config/WebUIKey.key -subj "/C=NL/ST=localhost/L=localhost/O=/OU=/CN=" chown -R ${PUID}:${PGID} /config/qBittorrent/config elif [ ! -e /config/qBittorrent/config/WebUIKey.crt ]; then - echo "[INFO] WebUI Key is missing, generating a new Certificate and Key" | ts '%Y-%m-%d %H:%M:%.S' + echo "[WARNING] WebUI Key is missing, generating a new Certificate and Key" | ts '%Y-%m-%d %H:%M:%.S' openssl req -new -x509 -nodes -out /config/qBittorrent/config/WebUICertificate.crt -keyout /config/qBittorrent/config/WebUIKey.key -subj "/C=NL/ST=localhost/L=localhost/O=/OU=/CN=" chown -R ${PUID}:${PGID} /config/qBittorrent/config fi From 38b00aba988cb2f43cfb627477367572960474af Mon Sep 17 00:00:00 2001 From: DyonR Date: Tue, 18 Aug 2020 23:03:46 +0200 Subject: [PATCH 7/8] Added ENABLE_SSL --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5662041..f00bb13 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,12 @@ $ docker run --privileged -d \ ## Environment Variables | Variable | Required | Function | Example | Default | |----------|----------|----------|----------|----------| -|`VPN_ENABLED`| Yes | Enable VPN? (yes/no)|`VPN_ENABLED=yes`|`yes`| -|`VPN_TYPE`| Yes | WireGuard or OpenVPN? (wireguard/openvpn)|`VPN_TYPE=wireguard`|`openvpn`| +|`VPN_ENABLED`| Yes | Enable VPN (yes/no)?|`VPN_ENABLED=yes`|`yes`| +|`VPN_TYPE`| Yes | WireGuard or OpenVPN (wireguard/openvpn)?|`VPN_TYPE=wireguard`|`openvpn`| |`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`|| +|`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 blackhole |`PUID=99`|`99`| |`PGID`| No | GID applied to config files and blackhole |`PGID=100`|`100`| From 541c299503aed8bfa5a9d99e12b95974a2df8d09 Mon Sep 17 00:00:00 2001 From: DyonR Date: Tue, 18 Aug 2020 23:08:25 +0200 Subject: [PATCH 8/8] Added info about how to access https --- qbittorrent/start.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index cfbcc52..37df4e7 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -21,6 +21,8 @@ fi export ENABLE_SSL=$(echo "${ENABLE_SSL,,}") if [[ ${ENABLE_SSL} == 'yes' ]]; then echo "[INFO] ENABLE_SSL is set to ${ENABLE_SSL}" | ts '%Y-%m-%d %H:%M:%.S' + echo "[SYSTEM] If you use Unraid, and get something like a 'ERR_EMPTY_RESPONSE' in your browser, add https:// to the front of the IP, and/or do this:" | ts '%Y-%m-%d %H:%M:%.S' + echo "[SYSTEM] Edit this Docker, change the slider in the top right to 'advanced view' and change http to https at the WebUI setting." | ts '%Y-%m-%d %H:%M:%.S' if [ ! -e /config/qBittorrent/config/WebUICertificate.crt ]; then echo "[WARNING] WebUI Certificate is missing, generating a new Certificate and Key" | ts '%Y-%m-%d %H:%M:%.S' openssl req -new -x509 -nodes -out /config/qBittorrent/config/WebUICertificate.crt -keyout /config/qBittorrent/config/WebUIKey.key -subj "/C=NL/ST=localhost/L=localhost/O=/OU=/CN="