From b0c501eaabf40afc1544d71328963e99bffaa6cf Mon Sep 17 00:00:00 2001 From: Alexandre Date: Sun, 11 Sep 2022 07:30:35 +0200 Subject: [PATCH] Config location changed --- qbittorrent/CHANGELOG.md | 5 ++++ qbittorrent/Dockerfile | 12 +++++----- .../rootfs/etc/cont-init.d/00-folders.sh | 8 ++++++- .../91-qbittorrent_configuration.sh | 23 ++++++++++--------- .../rootfs/etc/cont-init.d/93-openvpn.sh | 4 ++-- 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/qbittorrent/CHANGELOG.md b/qbittorrent/CHANGELOG.md index 507ba0507..c45dadd47 100644 --- a/qbittorrent/CHANGELOG.md +++ b/qbittorrent/CHANGELOG.md @@ -1,12 +1,17 @@ +- Config folder moved to /config/addons_config/qBittorrent ## 4.4.5-r0-ls214 (09-09-2022) + - Update to latest version from linuxserver/docker-qbittorrent ## 4.4.5-r0-ls213 (01-09-2022) + - Update to latest version from linuxserver/docker-qbittorrent ## 4.4.3.1-r1-ls211 (30-08-2022) + - Update to latest version from linuxserver/docker-qbittorrent + ## 4.4.3.1-r1-ls210 (13-08-2022) - Update to latest version from linuxserver/docker-qbittorrent diff --git a/qbittorrent/Dockerfile b/qbittorrent/Dockerfile index b849acf62..d7f3f234d 100644 --- a/qbittorrent/Dockerfile +++ b/qbittorrent/Dockerfile @@ -35,7 +35,10 @@ ENV \ PS1="$(whoami)@$(hostname):$(pwd)$ " \ S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \ S6_CMD_WAIT_FOR_SERVICES=1 \ - TERM="xterm-256color" + TERM="xterm-256color" \ + HOME="/config/addons_config" \ + XDG_CONFIG_HOME="/config/addons_config" \ + XDG_DATA_HOME="/config/addons_config" # Image specific modifications RUN \ @@ -45,13 +48,10 @@ RUN \ # 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 \ - \ - # Change location of config - && sed -i "s|/config$|/config/qBittorrent|g" "/etc/s6-overlay/s6-rc.d/init-qbittorrent/run" + && echo 'WebUI\LocalHostAuth=false' >> /defaults/qBittorrent.conf # Global LSIO modifications -ARG CONFIGLOCATION="/config" +ARG CONFIGLOCATION="/config/addons_config/qBittorrent" # hadolint ignore=SC2015, SC2013 RUN \ # Avoid custom-init.d duplications diff --git a/qbittorrent/rootfs/etc/cont-init.d/00-folders.sh b/qbittorrent/rootfs/etc/cont-init.d/00-folders.sh index 96ee7143d..14cfaa746 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/00-folders.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/00-folders.sh @@ -1,4 +1,10 @@ #!/bin/bash -mkdir -p /config/qBittorrent +mkdir -p /config/addons_config/qBittorrent +if [ -f /config/qBittorrent/qBittorrent.conf ]; then + echo "Migrating previous folder" + cp -prf /config/qBittorrent/* /config/addons_config/qBittorrent/ + rm -r /config/qBittorrent/* + echo "Files were moved to /config/addons_config/qBittorrent" > /config/qBittorrent/filesmoved +fi diff --git a/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh b/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh index 9e95883d8..2f7573bff 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/91-qbittorrent_configuration.sh @@ -6,14 +6,14 @@ ########## # Define preferences line -mkdir -p /config/qBittorrent +mkdir -p /config/addons_config/qBittorrent # copy default config -if [ ! -f /config/qBittorrent/qBittorrent.conf ]; then - cp /defaults/qBittorrent.conf /config/qBittorrent/qBittorrent.conf +if [ ! -f /config/addons_config/qBittorrent/qBittorrent.conf ]; then + cp /defaults/qBittorrent.conf /config/addons_config/qBittorrent/qBittorrent.conf fi -cd /config/qBittorrent/ || true +cd /config/addons_config/qBittorrent/ || true LINE=$(sed -n '/Preferences/=' qBittorrent.conf) LINE=$((LINE + 1)) @@ -39,11 +39,12 @@ if bashio::config.has_value 'SavePath'; then # Replace save path CURRENTSAVEPATH=$(sed -n '/Downloads\\SavePath/p' qBittorrent.conf) - sed -i "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf 2>/dev/null || true + sed -i "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf || \ + sed -i "${LINE}a Downloads\\SavePath\\$DOWNLOADS" qBittorrent.conf # Replace session save path CURRENTSAVEPATH=$(sed -n '/Session\\DefaultSavePath/p' qBittorrent.conf) - sed -i "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf 2>/dev/null || true + sed -i "s|${CURRENTSAVEPATH#*=}|$DOWNLOADS|g" qBittorrent.conf || true # Info bashio::log.info "Downloads can be found in $DOWNLOADS" @@ -100,7 +101,7 @@ fi # WHITELIST # ################ -cd /config/qBittorrent/ || true +cd /config/addons_config/qBittorrent/ || true if bashio::config.has_value 'whitelist'; then WHITELIST=$(bashio::config 'whitelist') #clean data @@ -114,7 +115,7 @@ fi # USERNAME # ############### -cd /config/qBittorrent/ || true +cd /config/addons_config/qBittorrent/ || true if bashio::config.has_value 'Username'; then USERNAME=$(bashio::config 'Username') #clean data @@ -162,8 +163,8 @@ if bashio::config.has_value 'customUI' && [ ! "$CUSTOMUI" = default ]; then rm /webui/*.zip CUSTOMUIDIR="$(dirname "$(find /webui/"$CUSTOMUI" -iname "public" -type d)")" # Set qbittorrent - sed -i "$LINE i\WebUI\\\AlternativeUIEnabled=true" /config/qBittorrent/qBittorrent.conf - sed -i "$LINE i\WebUI\\\RootFolder=$CUSTOMUIDIR" /config/qBittorrent/qBittorrent.conf + sed -i "$LINE i\WebUI\\\AlternativeUIEnabled=true" /config/addons_config/qBittorrent/qBittorrent.conf + sed -i "$LINE i\WebUI\\\RootFolder=$CUSTOMUIDIR" /config/addons_config/qBittorrent/qBittorrent.conf # Set nginx #sed -i "s=/vuetorrent/public/=$CUSTOMUIDIR/public/=g" /etc/nginx/servers/ingress.conf #sed -i "s=vue.torrent=$CUSTOMUI.torrent=g" /etc/nginx/servers/ingress.conf @@ -175,4 +176,4 @@ fi ########## bashio::log.info "Default username/password : admin/adminadmin" -bashio::log.info "Configuration can be found in /config/qBittorrent" +bashio::log.info "Configuration can be found in /config/addons_config/qBittorrent" diff --git a/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh b/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh index 199f93073..63ef97ca9 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/93-openvpn.sh @@ -6,7 +6,7 @@ declare openvpn_config declare openvpn_username declare openvpn_password -QBT_CONFIG_FILE="/config/qBittorrent/qBittorrent.conf" +QBT_CONFIG_FILE="/config/addons_config/qBittorrent/qBittorrent.conf" if bashio::config.true 'openvpn_enabled'; then @@ -69,7 +69,7 @@ if bashio::config.true 'openvpn_enabled'; then echo "Using interface binding in the qBittorrent app" # Define preferences line - cd /config/qBittorrent/ || exit 1 + cd /config/addons_config/qBittorrent/ || exit 1 LINE=$(sed -n '/Preferences/=' "$QBT_CONFIG_FILE") LINE=$((LINE + 1)) SESSION=$(sed -n '/BitTorrent/=' "$QBT_CONFIG_FILE")