Config location changed

This commit is contained in:
Alexandre
2022-09-11 07:30:35 +02:00
parent 0013016737
commit b0c501eaab
5 changed files with 32 additions and 20 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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")