From f135d01a0e0df9a1981583e155c63f6d31e941b5 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 26 Feb 2019 17:58:27 +0100 Subject: [PATCH 01/10] v6.22 + DietPi-Software | Deluge: Fix deluge-console login by applying users home dir system-side + DietPi-Software | Deluge: Do not install transitional/meta "deluge-webui" package, replaced even on Jessie by "deluge-web" + DietPi-Software | Deluge: Update systemd units according to official packaging sources + DietPi-Software | Deluge: Do not touch "/etc/default/deluged" which is only used by the init.d service + DietPi-Software | Deluge: Do not run deluged for config file creation since this runs as wrong user (home dir) and we download our config files anyway. + DietPi-Software | Deluge: Use "usermod" in case the user does already exist, which is the case with the APT install + DietPi-Software | Deluge: Minor coding --- dietpi/dietpi-software | 83 +++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 49 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a42f70fea4..31853c4185 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -898,7 +898,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (python)' aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p61' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=61#p61' #------------------ software_id=46 @@ -3002,11 +3002,7 @@ _EOF_ output=2 # - Bump up for x86 - if (( $G_HW_MODEL == 20 || $G_HW_MODEL == 21 )); then - - output=3 - - fi + (( $G_HW_MODEL == 20 || $G_HW_MODEL == 21 )) && output=3 #Max global connections elif (( $1 == 2 )); then @@ -4227,12 +4223,11 @@ _EOF_ fi - #DELUGE - software_id=45 + software_id=45 # Deluge if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - G_AGI deluged deluge-web deluge-webui deluge-console + G_AGI deluged deluge-web deluge-console fi @@ -9057,82 +9052,73 @@ _EOF_ fi - #Deluge - software_id=45 + software_id=45 # Deluge if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - useradd -rM deluge -G dietpi -s /usr/sbin/nologin + usercmd='useradd -r' + getent passwd deluge &> /dev/null && usercmd='usermod' + $usercmd deluge -G dietpi -d $G_FP_DIETPI_USERDATA/deluge -s /usr/sbin/nologin mkdir -p $G_FP_DIETPI_USERDATA/deluge/.config/deluge - > /var/log/deluged.log > /var/log/deluge-web.log + # https://git.deluge-torrent.org/deluge/tree/packaging/systemd/deluged.service cat << _EOF_ > /etc/systemd/system/deluged.service [Unit] -Description=Deluged (DietPi) +Description=Deluge Daemon (DietPi) +Documentation=man:deluged [Service] -Type=simple User=deluge Group=dietpi -UMask=002 -Environment=USER=deluge HOME=$G_FP_DIETPI_USERDATA/deluge +UMask=007 ExecStart=$(command -v deluged) -d -l /var/log/deluged.log -L warning +Restart=on-failure +TimeoutStopSec=300 [Install] WantedBy=multi-user.target _EOF_ + # https://git.deluge-torrent.org/deluge/tree/packaging/systemd/deluge-web.service cat << _EOF_ > /etc/systemd/system/deluge-web.service [Unit] -Description=Deluge-web (DietPi) +Description=Deluge Web UI (DietPi) +Documentation=man:deluge-web [Service] -# forking causes systemd-tty-ask-password-agent hang -Type=simple User=deluge Group=dietpi -Environment=USER=deluge HOME=$G_FP_DIETPI_USERDATA/deluge +UMask=027 ExecStart=$(command -v deluge-web) -l /var/log/deluge-web.log -L warning +Restart=on-failure [Install] WantedBy=multi-user.target _EOF_ - #Generate deluge default config - deluged - killall -w deluged - - #Copy DietPi configs - G_BACKUP_FP $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf $G_FP_DIETPI_USERDATA/deluge/.config/deluge/web.conf + # Copy DietPi configs + G_BACKUP_FP $G_FP_DIETPI_USERDATA/deluge/.config/deluge/{auth,core,web}.conf dps_index=$software_id Download_Install 'deluge.conf' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf dps_index=$software_id Download_Install 'deluge_web.conf' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/web.conf - # - Enable service run: - G_CONFIG_INJECT 'ENABLE_DELUGED=' 'ENABLE_DELUGED=1' /etc/default/deluged - - #Set remote access login details - cat << _EOF_ > $G_FP_DIETPI_USERDATA/deluge/.config/deluge/auth -root:$GLOBAL_PW:10 -_EOF_ + # Set remote access login details + echo "root:$GLOBAL_PW:10" > $G_FP_DIETPI_USERDATA/deluge/.config/deluge/auth - #Apply Optimized settings + # Apply Optimized settings # - Cache size is in steps of 16 KiB. (Cachesize * 16 = total KiB) - local deluge_cache_size=$(( $(echo -e "scale=0; $(Optimize_BitTorrent 0) * 1024 / 16" | bc -l ) )) - sed -i '/"cache_size": /c\ "cache_size": '"$deluge_cache_size"',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - - sed -i '/"max_active_limit": /c\ "max_active_limit": '"$(Optimize_BitTorrent 1)"',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_active_downloading": /c\ "max_active_downloading": '"$(Optimize_BitTorrent 1)"',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_connections_global": /c\ "max_connections_global": '"$(Optimize_BitTorrent 2)"',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_upload_slots_global": /c\ "max_upload_slots_global": '"$(Optimize_BitTorrent 3)"',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"cache_size": /c\ "cache_size": '$(( $(Optimize_BitTorrent 0) * 1024 / 16 ))',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_active_limit": /c\ "max_active_limit": '$(Optimize_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_active_downloading": /c\ "max_active_downloading": '$(Optimize_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_connections_global": /c\ "max_connections_global": '$(Optimize_BitTorrent 2)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_upload_slots_global": /c\ "max_upload_slots_global": '$(Optimize_BitTorrent 3)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf fi - #Webmin - software_id=115 + software_id=115 # Webmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -13407,12 +13393,11 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP deluged deluge-web deluge-webui deluge-console - rm /etc/systemd/system/deluged.service - rm /etc/systemd/system/deluge-web.service - rm -R $G_FP_DIETPI_USERDATA/deluge - + G_AGP deluged deluge-web deluge-console userdel -rf deluge + [[ -f /etc/systemd/system/deluged.service ]] && rm /etc/systemd/system/deluged.service + [[ -f /etc/systemd/system/deluge-web.service ]] && rm /etc/systemd/system/deluge-web.service + [[ -d $G_FP_DIETPI_USERDATA/deluge ]] && rm -R $G_FP_DIETPI_USERDATA/deluge fi From d95c2991c9f032b160e023fa19823f5eb71bac99 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 26 Feb 2019 22:52:44 +0100 Subject: [PATCH 02/10] v6.22 + DietPi-Software | Deluge: Switch to debian-deluged user, which is pre-generated by Debian APT package + DietPi-Software | Deluge: Switch to /var/log/deluged dir for logging, which is pre-generated by Debian APT package + DietPi-Software | Deluge: Add deluge-web log file to logrotate config + DietPi-Software | Deluge: Only download/edit config files, if not yet existent (fresh install) + DietPi-Software | Deluge: Delete init.d service traces, installed by Debian APT package + DietPi-Software | Kodi: Fix Buster install due to changed NFS library package: libnfs11 => libnfs12 --- dietpi/dietpi-software | 67 ++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 31853c4185..2867a2c862 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4047,7 +4047,7 @@ _EOF_ else - package_list+=' libnfs11 libcec4' + package_list+=' libnfs12 libcec4' fi @@ -9058,12 +9058,13 @@ _EOF_ Banner_Configuration usercmd='useradd -r' - getent passwd deluge &> /dev/null && usercmd='usermod' - $usercmd deluge -G dietpi -d $G_FP_DIETPI_USERDATA/deluge -s /usr/sbin/nologin + getent passwd debian-deluged &> /dev/null && usercmd='usermod' + $usercmd debian-deluged -G dietpi -d $G_FP_DIETPI_USERDATA/deluge -s /usr/sbin/nologin mkdir -p $G_FP_DIETPI_USERDATA/deluge/.config/deluge - > /var/log/deluged.log - > /var/log/deluge-web.log + chown -R debian-deluged:debian-deluged $G_FP_DIETPI_USERDATA/deluge + mkdir -p /var/log/deluged + chown -R debian-deluged /var/log/deluged # https://git.deluge-torrent.org/deluge/tree/packaging/systemd/deluged.service cat << _EOF_ > /etc/systemd/system/deluged.service @@ -9072,10 +9073,10 @@ Description=Deluge Daemon (DietPi) Documentation=man:deluged [Service] -User=deluge +User=debian-deluged Group=dietpi UMask=007 -ExecStart=$(command -v deluged) -d -l /var/log/deluged.log -L warning +ExecStart=$(command -v deluged) -d -l /var/log/deluged/daemon.log -L warning Restart=on-failure TimeoutStopSec=300 @@ -9090,31 +9091,47 @@ Description=Deluge Web UI (DietPi) Documentation=man:deluge-web [Service] -User=deluge -Group=dietpi +User=debian-deluged UMask=027 -ExecStart=$(command -v deluge-web) -l /var/log/deluge-web.log -L warning +ExecStart=$(command -v deluge-web) -l /var/log/deluged/web.log -L warning Restart=on-failure [Install] WantedBy=multi-user.target _EOF_ - # Copy DietPi configs - G_BACKUP_FP $G_FP_DIETPI_USERDATA/deluge/.config/deluge/{auth,core,web}.conf - dps_index=$software_id Download_Install 'deluge.conf' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - dps_index=$software_id Download_Install 'deluge_web.conf' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/web.conf - - # Set remote access login details - echo "root:$GLOBAL_PW:10" > $G_FP_DIETPI_USERDATA/deluge/.config/deluge/auth - - # Apply Optimized settings - # - Cache size is in steps of 16 KiB. (Cachesize * 16 = total KiB) - sed -i '/"cache_size": /c\ "cache_size": '$(( $(Optimize_BitTorrent 0) * 1024 / 16 ))',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_active_limit": /c\ "max_active_limit": '$(Optimize_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_active_downloading": /c\ "max_active_downloading": '$(Optimize_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_connections_global": /c\ "max_connections_global": '$(Optimize_BitTorrent 2)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf - sed -i '/"max_upload_slots_global": /c\ "max_upload_slots_global": '$(Optimize_BitTorrent 3)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + # Add web.log to logrotate config + if [[ -f /etc/logrotate.d/deluged ]] && ! grep -q 'web.log' /etc/logrotate.d/deluged; then + + echo -e "\n$(> /etc/logrotate.d/deluged + sed -i '1,1s/daemon.log/web.log/' /etc/logrotate.d/deluged + + fi + + # Adjust config files only, if not yet existent + if [[ ! -f $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf ]]; then + + # Copy DietPi configs + dps_index=$software_id Download_Install 'deluge.conf' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + dps_index=$software_id Download_Install 'deluge_web.conf' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/web.conf + + # Set remote access login details + echo "root:$GLOBAL_PW:10" > $G_FP_DIETPI_USERDATA/deluge/.config/deluge/auth + + # Apply optimised settings + # - Cache size is in steps of 16 KiB. (Cachesize * 16 = total KiB) + sed -i '/"cache_size": /c\ "cache_size": '$(( $(Optimize_BitTorrent 0) * 1024 / 16 ))',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_active_limit": /c\ "max_active_limit": '$(Optimize_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_active_downloading": /c\ "max_active_downloading": '$(Optimize_BitTorrent 1)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_connections_global": /c\ "max_connections_global": '$(Optimize_BitTorrent 2)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + sed -i '/"max_upload_slots_global": /c\ "max_upload_slots_global": '$(Optimize_BitTorrent 3)',' $G_FP_DIETPI_USERDATA/deluge/.config/deluge/core.conf + + fi + + # Remove init.d service leftovers, installed by Debian APT package + [[ -f /etc/init.d/deluged ]] rm /etc/init.d/deluged + [[ -f /etc/default/deluged ]] rm /etc/default/deluged + [[ -d /var/lib/deluged ]] rm -R /var/lib/deluged fi From 063b040d8ba4a403d4e2a6e7c56215fb03dda5f7 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 27 Feb 2019 00:44:13 +0100 Subject: [PATCH 03/10] v6.22 + DietPi-Set_Software | setpermissions: Update deluge permissions according to installer rewrite + DietPi-Set_Software | Minor coding --- dietpi/func/dietpi-set_software | 40 +++++++++++++++------------------ 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 6e63403cb7..760e1aab8a 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -13,16 +13,16 @@ # FP_SCRIPT='/DietPi/dietpi/func/dietpi-set_software' AVAIABLE_COMMANDS=" -Available commands -$FP_SCRIPT locale en_GB.UTF-8 / any other UTF-8 locale -$FP_SCRIPT allo eth_dhcp / eth_static -$FP_SCRIPT useradd X=create user with name X and default permissions, using global DietPi password (dietpi) -$FP_SCRIPT userdel X=delete user with name X -$FP_SCRIPT apt-mirror url / default -$FP_SCRIPT ntpd-mode [0-4] configures time sync mode (eg: daily/hourly/daemon) -$FP_SCRIPT verify_dietpi.txt Verifies dietpi.txt entries, adds missing entries if required -$FP_SCRIPT passwords NULL=Prompt user to change DietPi related passwords | X=optional set X as global password for future dietpi-software installations and \"root\" + \"dietpi\" login passwords. -$FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi specific content, and, DietPi userdata directory for software installs +Available commands: +$FP_SCRIPT locale en_GB.UTF-8 / any other UTF-8 locale +$FP_SCRIPT allo eth_dhcp / eth_static +$FP_SCRIPT useradd X=create user with name X and default permissions, using global DietPi password (dietpi) +$FP_SCRIPT userdel X=delete user with name X +$FP_SCRIPT apt-mirror url / default +$FP_SCRIPT ntpd-mode [0-4] configures time sync mode (eg: daily/hourly/daemon) +$FP_SCRIPT verify_dietpi.txt Verifies dietpi.txt entries, adds missing entries if required +$FP_SCRIPT passwords NULL=Prompt user to change DietPi related passwords | X=optional set X as global password for future dietpi-software installations and \"root\" + \"dietpi\" login passwords. +$FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi specific content, and, DietPi userdata directory for software installs " #//////////////////////////////////// @@ -49,7 +49,7 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi EXIT_CODE=1 G_DIETPI-NOTIFY 2 "Unknown input name ($INPUT_MODE_NAME). Nothing has been applied." - echo -e "$AVAIABLE_COMMANDS" + echo "$AVAIABLE_COMMANDS" } @@ -57,7 +57,7 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi EXIT_CODE=1 G_DIETPI-NOTIFY 2 "Unknown input value ($INPUT_MODE_VALUE). Nothing has been applied." - echo -e "$AVAIABLE_COMMANDS" + echo "$AVAIABLE_COMMANDS" } @@ -71,12 +71,8 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi echo "$INPUT_MODE_VALUE UTF-8" > /etc/locale.gen - # - Add en_GB.UTF-8 back in, if its not the default - if [[ $INPUT_MODE_VALUE != 'en_GB.UTF-8' ]]; then - - echo 'en_GB.UTF-8 UTF-8' >> /etc/locale.gen - - fi + # - Add en_GB.UTF-8 back in, if not chosen, as DietPi scripts require it + [[ $INPUT_MODE_VALUE != 'en_GB.UTF-8' ]] && echo 'en_GB.UTF-8 UTF-8' >> /etc/locale.gen # - Remove exisiting settings that will break dpkg-reconfigure [[ -f /etc/default/locale ]] && rm /etc/default/locale @@ -362,11 +358,11 @@ _EOF_ chown -R www-data:www-data $G_FP_DIETPI_USERDATA/pydio_data local datadir="$(grep -m1 '^[[:blank:]]*SOFTWARE_OWNCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" - [[ -z $datadir ]] && datadir="$G_FP_DIETPI_USERDATA/owncloud_data" + [[ $datadir ]] || datadir="$G_FP_DIETPI_USERDATA/owncloud_data" chown -R www-data:www-data "$datadir" datadir="$(grep -m1 '^[[:blank:]]*SOFTWARE_NEXTCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" - [[ -z $datadir ]] && datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" + [[ $datadir ]] || datadir="$G_FP_DIETPI_USERDATA/nextcloud_data" chown -R www-data:www-data "$datadir" # - Home Assistant Permissions @@ -444,8 +440,8 @@ _EOF_ chown -R plexpy:dietpi $G_FP_DIETPI_USERDATA/plexpy # - Deluge - chown -R deluge:dietpi $G_FP_DIETPI_USERDATA/deluge - chown deluge:dietpi /var/log/deluged.log /var/log/deluge-web.log + chown -R debian-deluged:debian-deluged $G_FP_DIETPI_USERDATA/deluge + chown -R debian-deluged /var/log/deluged # - Jackett chown -R jackett:jackett /opt/jackett From ff8ced05a34f585508255a67a76ccd5e1fbbc55d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 27 Feb 2019 01:23:53 +0100 Subject: [PATCH 04/10] v6.22 + DietPi-Patch | Deluge: Patch according to installer rework --- dietpi/patch_file | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index c6ee491b3d..630ea62335 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1708,11 +1708,21 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi #------------------------------------------------------------------------------- - #Transfer project and lead over to Micha (legend!) :) #: https://github.com/Fourdee/DietPi/issues/2589#issue-413925061 - if grep -q '^[[:blank:]]*DEV_GITOWNER=Fourdee' /DietPi/dietpi.txt; then + #Transfer project and lead over to Micha (legend!) :) #: https://github.com/MichaIng/DietPi/issues/2589#issue-413925061 + grep -q '^[[:blank:]]*DEV_GITOWNER=Fourdee' /DietPi/dietpi.txt && G_CONFIG_INJECT 'DEV_GITOWNER=' 'DEV_GITOWNER=MichaIng' /DietPi/dietpi.txt + grep -q '^[[:blank:]]*G_GITOWNER=Fourdee' /DietPi/dietpi/.version && G_CONFIG_INJECT 'G_GITOWNER=' 'G_GITOWNER=MichaIng' /DietPi/dietpi/.version + #------------------------------------------------------------------------------- + #Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 + if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[45\]=2' /DietPi/dietpi/.installed; then + + G_AGP deluge-webui + [[ -e ~deluge ]] && mv ~deluge $G_DIETPI_USERDATA/deluge_home_backup + userdel -rf deluge + mkdir -p /var/log/deluged + [[ -f /var/log/deluged.log ]] && mv /var/log/deluged.log /var/log/deluged/daemon.log + [[ -f /var/log/deluge-web.log ]] && mv /var/log/deluge-web.log /var/log/deluged/web.log - G_CONFIG_INJECT 'DEV_GITOWNER=' 'DEV_GITOWNER=MichaIng' /DietPi/dietpi.txt - G_CONFIG_INJECT 'G_GITOWNER=' 'G_GITOWNER=MichaIng' /DietPi/dietpi/.version + /DietPi/dietpi/dietpi-software reinstall 45 fi #------------------------------------------------------------------------------- From e1973b5c01ea240a88e2ed15de21587e48d53ccf Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 27 Feb 2019 01:44:31 +0100 Subject: [PATCH 05/10] v6.22 + DietPi-Patch | Deluge: Remove obsolete Deluge configs + DietPi-Patch | Deluge: Inform user about Deluge rework and user change --- dietpi/patch_file | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 630ea62335..676e64334d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1718,12 +1718,24 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior G_AGP deluge-webui [[ -e ~deluge ]] && mv ~deluge $G_DIETPI_USERDATA/deluge_home_backup userdel -rf deluge + rm -Rf /{root,home/*}/.config/deluge mkdir -p /var/log/deluged [[ -f /var/log/deluged.log ]] && mv /var/log/deluged.log /var/log/deluged/daemon.log [[ -f /var/log/deluge-web.log ]] && mv /var/log/deluge-web.log /var/log/deluged/web.log /DietPi/dietpi/dietpi-software reinstall 45 + G_WHIP_MSG '[ INFO ] Deluge rework\n +Our Deluge installer has been reworked to match Debian APT package defaults and official documentations. This also resolves an issue when attempting to access "deluge-console". +- It runs now as user "debian-deluged". +- The user "deluge" has been removed, its home directory has been backed up to: + /mnt/dietpi_userdata/deluge_home_backup + in case it existed. +- Logs have been moved to /var/log/deluged/daemon.log|web.log. +- Apart form that, all your settings and data have been preserved.\n +NB: When accessing "deluge-console" you need to do that as user "debian-deluged": + sudo -u debian-deluged deluge-console' + fi #------------------------------------------------------------------------------- From 8bca631d8c40b133920f1559d378a1bc8e180667 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 27 Feb 2019 01:55:20 +0100 Subject: [PATCH 06/10] v6.22 + DietPi-Patch | Deluge: Remove doubled reinstall --- dietpi/patch_file | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 676e64334d..1dc39ff9d0 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1486,7 +1486,7 @@ _EOF_ #------------------------------------------------------------------------------- # - Reinstalls # Blynk: Apply new run user, update binary (jar) - # Deluge: https://github.com/MichaIng/DietPi/issues/2339 + # v6.22 Deluge: https://github.com/MichaIng/DietPi/issues/2339 # Netdata: https://github.com/MichaIng/DietPi/pull/2337 # NAA Daemon: https://github.com/MichaIng/DietPi/issues/2387#issue-395321320 # MPD: https://github.com/MichaIng/DietPi/issues/2377 @@ -1496,7 +1496,7 @@ _EOF_ # Grafana: https://github.com/MichaIng/DietPi/issues/2449 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - /DietPi/dietpi/dietpi-software reinstall 37 45 65 77 108 124 128 131 + /DietPi/dietpi/dietpi-software reinstall 37 65 77 108 124 128 131 # - Samba: Link disk cache to RAM: https://github.com/MichaIng/DietPi/issues/2396 if grep -q '^aSOFTWARE_INSTALL_STATE\[96\]=2' /DietPi/dietpi/.installed; then From a6fb6045caec44f1da1f7364bf38f9508adaefae Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 27 Feb 2019 21:35:02 +0100 Subject: [PATCH 07/10] v6.22 + CHANGELOG | Deluge: Reworked the installer to better match the Debian package defaults and recommendations/examples from the official documentation --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c9a883cf1b..9c3c15ab09 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | GMediaRender: Enabled support for Debian/Raspbian Buster by using the up-to-date APT repo package. - DietPi-Software | Aria2: Tweaked settings to enhance 3rd party plugin support and removed deprecated/doubled entries. Many thanks to @msongz for the commit: https://github.com/MichaIng/DietPi/pull/2538 - DietPi-Software | UrBackup: Updated installed version to 2.3.7. Thanks to @DeathIsUnknown for the information: https://github.com/MichaIng/DietPi/issues/2577 +- DietPi-Software | Deluge: Reworked the installer to better match the Debian package defaults and recommendations/examples from the official documentation. Deluge now runs as user "debian-deluged", logs have been moved to "/var/log/deluged/" and the init.d service with its traces are removed, which are all pre-generated by the Debian APT package. The systemd units have been adjusted according to the official documentation. These changes are applied as well to existing systems during DietPi update, the old user "deluge" and obsolete configurations are removed. Your active configurations and data are preserved, the installer has been as well enhanced to better handle existing installs and never touch existing configs. Note that access to the Deluge console has to be done as user "debian-deluged" (sudo -u debian-deluged deluge-console). A related access issue to the console has been fixed by this as well. Thanks to @seanmikhaels for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5525 Bug Fixes: - General | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this: https://github.com/MichaIng/DietPi/issues/2529 From 846a526168390d94a77ea915940f582cc2bf380c Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 28 Feb 2019 22:08:39 +0100 Subject: [PATCH 08/10] v6.22 + DietPi-Software | Syntax and minor --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2867a2c862..a74e609a6b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3002,7 +3002,7 @@ _EOF_ output=2 # - Bump up for x86 - (( $G_HW_MODEL == 20 || $G_HW_MODEL == 21 )) && output=3 + (( $G_HW_ARCH == 10 )) && output=3 #Max global connections elif (( $1 == 2 )); then @@ -9129,9 +9129,9 @@ _EOF_ fi # Remove init.d service leftovers, installed by Debian APT package - [[ -f /etc/init.d/deluged ]] rm /etc/init.d/deluged - [[ -f /etc/default/deluged ]] rm /etc/default/deluged - [[ -d /var/lib/deluged ]] rm -R /var/lib/deluged + [[ -f /etc/init.d/deluged ]] && rm /etc/init.d/deluged + [[ -f /etc/default/deluged ]] && rm /etc/default/deluged + [[ -d /var/lib/deluged ]] && rm -R /var/lib/deluged fi From 2fb3502398fffc1bfa38b2fad5a2a7964cd8cd5e Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 28 Feb 2019 22:47:01 +0100 Subject: [PATCH 09/10] v6.22 + DietPi-Software | Deluge: Remove correct user on uninstall --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a74e609a6b..9878c5311f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13411,7 +13411,7 @@ _EOF_ Banner_Uninstalling G_AGP deluged deluge-web deluge-console - userdel -rf deluge + userdel -rf debian-deluged [[ -f /etc/systemd/system/deluged.service ]] && rm /etc/systemd/system/deluged.service [[ -f /etc/systemd/system/deluge-web.service ]] && rm /etc/systemd/system/deluge-web.service [[ -d $G_FP_DIETPI_USERDATA/deluge ]] && rm -R $G_FP_DIETPI_USERDATA/deluge From e410c24904be4aef5d45bdc26b413ca23b964ddd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 28 Feb 2019 23:12:17 +0100 Subject: [PATCH 10/10] v6.22 + DietPi-Patch | Typo --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 1dc39ff9d0..2c9799e7e4 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1732,7 +1732,7 @@ Our Deluge installer has been reworked to match Debian APT package defaults and /mnt/dietpi_userdata/deluge_home_backup in case it existed. - Logs have been moved to /var/log/deluged/daemon.log|web.log. -- Apart form that, all your settings and data have been preserved.\n +- Apart from that, all your settings and data have been preserved.\n NB: When accessing "deluge-console" you need to do that as user "debian-deluged": sudo -u debian-deluged deluge-console'