From d2b5e1694e9a8789a4776439cd02998ca3cc7205 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 9 Feb 2021 20:59:20 +0100 Subject: [PATCH] Update 91-configuration.sh --- .../etc/cont-init.d/91-configuration.sh | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/qbittorrent/rootfs/etc/cont-init.d/91-configuration.sh b/qbittorrent/rootfs/etc/cont-init.d/91-configuration.sh index b982b08d7..8e49db3e1 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/91-configuration.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/91-configuration.sh @@ -1,14 +1,17 @@ #!/usr/bin/with-contenv bashio +# Define preferences line cd /config/qBittorrent/ - -# Clean HTTPS data -sed -i '/HTTPS/d' qBittorrent.conf - -# Define preferences line LINE=$(sed -n '/Preferences/=' qBittorrent.conf) LINE=$[LINE + 1] +################ +# SSL CONFIG # +################ + +# Clean data +sed -i '/HTTPS/d' qBittorrent.conf + bashio::config.require.ssl if bashio::config.true 'ssl'; then bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths" @@ -20,7 +23,24 @@ if bashio::config.true 'ssl'; then sed -i "$LINE i\WebUI\\\HTTPS\\\KeyPath=/ssl/$KEYFILE" qBittorrent.conf fi -bashio::log.info "Default username/password : admin/adminadmin" +################ +# Alternate UI # +################ + +#clean data +sed -i '/AlternativeUIEnabled/d' qBittorrent.conf + +if bashio::config.has_value 'customUI'; then +bashio::log.info "Alternate UI enabled. If webui don't work, disable this option" +CUSTOMUI=$(bashio::config 'customUI') +CUSTOMUI="/data/$CUSTOMUI" +sed -i "$LINE i\WebUI\\\AlternativeUIEnabled=true" qBittorrent.conf +sed -i "$LINE i\WebUI\\\RootFolder=$CUSTOMUI" qBittorrent.conf +fi + +################ +# WHITELIST # +################ if bashio::config.has_value 'whitelist'; then WHITELIST=$(bashio::config 'whitelist') @@ -31,4 +51,5 @@ sed -i "$LINE i\WebUI\\\AuthSubnetWhitelist=$WHITELIST" qBittorrent.conf bashio::log.info "Whitelisted subsets will not require a password : $WHITELIST" fi +bashio::log.info "Default username/password : admin/adminadmin" bashio::log.info "Configuration can be found in /config/qBittorrent"