diff --git a/.conf/dps_45/deluge.conf b/.conf/dps_45/deluge.conf index 29a08d12f0..e7de40ab1a 100644 --- a/.conf/dps_45/deluge.conf +++ b/.conf/dps_45/deluge.conf @@ -1,101 +1,71 @@ { - "file": 1, - "format": 1 + "file": 1, + "format": 1 }{ - "info_sent": 0.0, - "lsd": true, - "send_info": false, - "move_completed_path": "/mnt/dietpi_userdata/downloads", - "enc_in_policy": 1, - "queue_new_to_top": false, - "ignore_limits_on_local_network": true, - "rate_limit_ip_overhead": false, - "daemon_port": 58846, - "natpmp": true, - "max_active_limit": 2, - "utpex": true, - "max_active_downloading": 2, - "max_active_seeding": 1, - "allow_remote": true, - "max_half_open_connections": 4, - "download_location": "/mnt/dietpi_userdata/downloads", - "compact_allocation": false, - "max_upload_speed": -1.0, - "cache_expiry": 60, - "prioritize_first_last_pieces": false, - "auto_managed": true, - "enc_level": 2, - "max_connections_per_second": 2, - "dont_count_slow_torrents": false, - "random_outgoing_ports": true, - "max_upload_slots_per_torrent": -1, - "new_release_check": false, - "enc_out_policy": 1, - "outgoing_ports": [ - 0, - 0 - ], - "seed_time_limit": 60, - "cache_size": 62500, - "share_ratio_limit": 1.05, - "max_download_speed": -1.0, - "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat", - "torrentfiles_location": "/mnt/dietpi_userdata/downloads", - "stop_seed_at_ratio": true, - "peer_tos": "0x00", - "listen_interface": "", - "upnp": true, - "max_download_speed_per_torrent": -1, - "max_upload_slots_global": 2, - "enabled_plugins": [], - "random_port": false, - "autoadd_enable": false, - "max_connections_global": 12, - "enc_prefer_rc4": true, - "listen_ports": [ - 6881, - 6891 - ], - "dht": true, - "stop_seed_ratio": 1.05, - "seed_time_ratio_limit": 1.0, - "max_upload_speed_per_torrent": -1, - "copy_torrent_file": false, - "del_copy_torrent_file": false, - "move_completed": false, - "proxies": { - "peer": { - "username": "", - "password": "", - "type": 0, - "hostname": "", - "port": 8080 - }, - "web_seed": { - "username": "", - "password": "", - "type": 0, - "hostname": "", - "port": 8080 - }, - "tracker": { - "username": "", - "password": "", - "type": 0, - "hostname": "", - "port": 8080 - }, - "dht": { - "username": "", - "password": "", - "type": 0, - "hostname": "", - "port": 8080 - } - }, - "add_paused": false, - "max_connections_per_torrent": -1, - "remove_seed_at_ratio": true, - "autoadd_location": "/mnt/dietpi_userdata/deluge", - "plugins_location": "/mnt/dietpi_userdata/deluge/.config/deluge/plugins" + "add_paused": false, + "allow_remote": true, + "auto_managed": true, + "autoadd_enable": false, + "autoadd_location": "/mnt/dietpi_userdata/deluge", + "cache_expiry": 60, + "cache_size": 6208, + "compact_allocation": false, + "copy_torrent_file": false, + "daemon_port": 58846, + "del_copy_torrent_file": false, + "dht": true, + "dont_count_slow_torrents": false, + "download_location": "/mnt/dietpi_userdata/downloads", + "enabled_plugins": [], + "enc_in_policy": 1, + "enc_level": 2, + "enc_out_policy": 1, + "enc_prefer_rc4": true, + "geoip_db_location": "", + "ignore_limits_on_local_network": true, + "info_sent": 0.0, + "listen_interface": "", + "listen_ports": [ + 6881, + 6891 + ], + "lsd": true, + "max_active_downloading": 2, + "max_active_limit": 2, + "max_active_seeding": 1, + "max_connections_global": 30, + "max_connections_per_second": 2, + "max_connections_per_torrent": -1, + "max_download_speed": -1.0, + "max_download_speed_per_torrent": -1, + "max_half_open_connections": 4, + "max_upload_slots_global": 4, + "max_upload_slots_per_torrent": -1, + "max_upload_speed": -1.0, + "max_upload_speed_per_torrent": -1, + "move_completed": false, + "move_completed_path": "/mnt/dietpi_userdata/downloads", + "natpmp": true, + "new_release_check": false, + "outgoing_ports": [ + 0, + 0 + ], + "peer_tos": "0x00", + "plugins_location": "/mnt/dietpi_userdata/deluge/.config/deluge/plugins", + "prioritize_first_last_pieces": false, + "queue_new_to_top": false, + "random_outgoing_ports": true, + "random_port": false, + "rate_limit_ip_overhead": false, + "remove_seed_at_ratio": true, + "seed_time_limit": 60, + "seed_time_ratio_limit": 1.0, + "send_info": false, + "share_ratio_limit": 1.05, + "stop_seed_at_ratio": true, + "stop_seed_ratio": 1.05, + "torrentfiles_location": "/mnt/dietpi_userdata/downloads", + "upnp": true, + "utpex": true } \ No newline at end of file diff --git a/.conf/dps_45/deluge_web.conf b/.conf/dps_45/deluge_web.conf index ab9ecae43c..557174e563 100644 --- a/.conf/dps_45/deluge_web.conf +++ b/.conf/dps_45/deluge_web.conf @@ -1,22 +1,21 @@ { - "file": 1, - "format": 1 + "file": 2, + "format": 1 }{ - "sidebar_show_zero": false, - "show_session_speed": false, - "pwd_sha1": "ffdd0ce0bb6f8857ae9100e84dc5b1a361790a57", - "show_sidebar": true, - "sessions": {}, - "enabled_plugins": [], - "base": "/", - "first_login": false, - "theme": "gray", - "pkey": "ssl/daemon.pkey", - "cert": "ssl/daemon.cert", - "session_timeout": 3600, - "https": false, - "default_daemon": "", - "sidebar_multiple_filters": true, - "pwd_salt": "52fa93ba04f3577939c3fb8b11fb1ca21d8cccd4", - "port": 8112 + "base": "/", + "cert": "ssl/daemon.cert", + "default_daemon": "", + "enabled_plugins": [], + "first_login": false, + "https": false, + "pkey": "ssl/daemon.pkey", + "port": 8112, + "pwd_salt": "52fa93ba04f3577939c3fb8b11fb1ca21d8cccd4", + "pwd_sha1": "ffdd0ce0bb6f8857ae9100e84dc5b1a361790a57", + "session_timeout": 3600, + "show_session_speed": false, + "show_sidebar": true, + "sidebar_multiple_filters": true, + "sidebar_show_zero": false, + "theme": "gray" } \ No newline at end of file diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index c8a9e6edf0..9abc89b35d 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -558,8 +558,16 @@ shopt -s extglob aSOFTWARE_NAME7_6[198]='File Browser' aSOFTWARE_NAME7_6[199]='Spotifyd' + # v7.7 + aSOFTWARE_NAME7_7=() + for i in "${!aSOFTWARE_NAME7_6[@]}" + do + aSOFTWARE_NAME7_7[$i]=${aSOFTWARE_NAME7_6[$i]} + done + unset -v 'aSOFTWARE_NAME7_7[142]' # CouchPotato + # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs - for i in "${aSOFTWARE_NAME7_6[@]}" + for i in "${aSOFTWARE_NAME7_7[@]}" do aSOFTWARE["$i"]=0 done diff --git a/.update/patches b/.update/patches index 8eabe852a1..f218b3fdbc 100644 --- a/.update/patches +++ b/.update/patches @@ -157,13 +157,6 @@ Patch_7_2() \nYou may upgrade via: dietpi-software reinstall 86 \nNB: Roon extensions which were installed via the legacy method must be reinstalled with the new Roon Extension Manager. Extensions which were installed as Docker images already, will continue to function.' - # Pi-hole: Whitelist domain of GEO IP API we use in banner and DietPi-VPN as this is part of public blocklists: https://github.com/MichaIng/DietPi/pull/4398#issuecomment-845477200 - if command -v pihole > /dev/null - then - G_DIETPI-NOTIFY 2 'Whitelisting "freegeoip.app" in Pi-hole, which is used by dietpi-banner and dietpi-vpn to obtain your public IP and location...' - pihole -w freegeoip.app --comment 'Used by dietpi-banner and dietpi-vpn to obtain your public IP and location' - fi - # Inform about available software updates if [[ -f '/boot/dietpi/.installed' ]] then @@ -331,6 +324,47 @@ Patch_7_6() fi } +Patch_7_7() +{ + G_DIETPI-NOTIFY 2 'Reverting Mosquitto and Webmin repositories back to HTTPS' + G_EXEC sed -Ei 's#http://(repo.mosquitto.org|download.webmin.com)#https://\1#' /etc/apt/sources.list + [[ $(find /etc/apt/sources.list/*.list 2> /dev/null) ]] && G_EXEC sed -Ei 's#http://(repo.mosquitto.org|download.webmin.com)#https://\1#' /etc/apt/sources.list.d/*.list + + # Inform users about abandoned CouchPotato and in case add systemd service to DietPi-Services includes, at it has been removed from the hardcoded list + if [[ -f '/boot/dietpi/.installed' ]] && grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[142\]=2' /boot/dietpi/.installed + then + G_WHIP_MSG '[ INFO ] CouchPotato has been abandoned +\nSadly, the CouchPotato project is not maintained anymore and has been abandoned. In turn we removed it from DietPi. +\nThe instance installed on your system will remain, but it cannot be installed, reinstalled or uninstalled anymore. +\nWe recommend to migrate to an alternative project, like Radarr, which can be found in DietPi-Software was well. +\nManual CouchPotato uninstall instructions: https://github.com/MichaIng/DietPi/issues/4323#issuecomment-927128724 +' + if [[ -f '/etc/init.d/couchpotato' ]] + then + # shellcheck disable=SC2015 + [[ -f '/boot/dietpi/.dietpi-services_include_exclude' ]] && grep -q 'couchpotato' /boot/dietpi/.dietpi-services_include_exclude || G_EXEC eval "echo '+ couchpotato' >> /boot/dietpi/.dietpi-services_include_exclude" + fi + fi + # Remove obsolete CouchPotato install state + [[ -f '/boot/dietpi/.installed' ]] && grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[142\]=' /boot/dietpi/.installed && G_EXEC sed -i '/^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[142\]=/d' /boot/dietpi/.installed + + # Fix Deluge web interface service on Bullseye: https://github.com/MichaIng/DietPi/issues/4785 + if [[ $G_DISTRO -ge 6 && -f '/boot/dietpi/.installed' ]] && grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[45\]=2' /boot/dietpi/.installed && ! grep -q 'ExecStart.* -d ' /etc/systemd/system/deluge-web.service + then + G_DIETPI-NOTIFY 2 'Patching Deluge web interface service to fix startup at Bullseye' + G_EXEC sed -i 's/deluge-web -l/deluge-web -d -l/' /etc/systemd/system/deluge-web.service + fi + + # Mono: Migrate APT list and key to new location and naming + if [[ -f '/boot/dietpi/.installed' ]] && grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[150\]=2' /boot/dietpi/.installed + then + G_DIETPI-NOTIFY 2 'Migrating Mono APT list and key to new location and naming' + [[ -f '/etc/apt/sources.list.d/mono-xamarin.list' ]] && G_EXEC mv /etc/apt/sources.list.d/mono-xamarin.list /etc/apt/sources.list.d/dietpi-mono.list + [[ -f '/etc/apt/trusted.gpg.d/dietpi-mono.gpg' ]] || G_EXEC curl -sSfL 'https://download.mono-project.com/repo/xamarin_ring.gpg' -o /etc/apt/trusted.gpg.d/dietpi-mono.gpg + [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC apt-key --keyring /etc/apt/trusted.gpg del '3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF' + fi +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then diff --git a/.update/pre-patches b/.update/pre-patches index 164470933a..d8a7776678 100644 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -73,11 +73,11 @@ Package: linux-image-* linux-headers-* linux-dtb-* linux-u-boot-* armbian-firmwa \nPackage: *\nPin: origin apt.armbian.com\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-armbian" fi -# v7.4: On Stretch, allow interactive suite change once, to assure the update does not hang or fail on G_AGUP. From Buster on, the suite change throws a notice only and does not require any confirmation. -if (( $G_DISTRO < 5 )) && (( $G_DIETPI_VERSION_CORE < 7 || ( $G_DIETPI_VERSION_CORE == 7 && $G_DIETPI_VERSION_SUB < 4 ) )) && curl -sSfL 'https://deb.debian.org/debian/dists/bullseye/Release' | grep -q '^Suite: stable$' +# v7.5: Perform Debian suite change once, if the installed APT version does not allow it by default yet +if (( $G_DIETPI_VERSION_CORE < 7 || ( $G_DIETPI_VERSION_CORE == 7 && $G_DIETPI_VERSION_SUB < 5 ) )) && dpkg --compare-versions "$(dpkg-query -Wf '${VERSION}' apt)" lt 1.8.2.3 then - G_DIETPI-NOTIFY 2 'Debian Bullseye has been released, so you need to accept the Stretch suite change from "oldstable" to "oldoldstable" once.' - apt-get update + G_DIETPI-NOTIFY 2 'Debian Bullseye has been released, so we accept the repository suite change once.' + G_EXEC apt-get -o 'Acquire::AllowReleaseInfoChange::Suite=true' -q update fi # v7.4 @@ -96,5 +96,49 @@ then G_EXEC sed -i '/^Package:/c\Package: openbox* obconf* libob* pcmanfm* libfm* libgtk* lx*' /etc/apt/preferences.d/dietpi-lxde fi +# v7.7 +if (( $G_DIETPI_VERSION_CORE < 7 || ( $G_DIETPI_VERSION_CORE == 7 && $G_DIETPI_VERSION_SUB < 7 ) )) && [[ $G_HW_ARCH == 10 && $(findmnt -Ufnro FSTYPE -M /boot) == 'vfat' ]] +then + G_DIETPI-NOTIFY 2 'Creating kernel upgrade hook to remove existing files from /boot FAT partition before installing the new files: https://github.com/MichaIng/DietPi/issues/4788' + G_EXEC mkdir -p /etc/kernel/preinst.d + cat << '_EOF_' > /etc/kernel/preinst.d/dietpi +#!/bin/sh -e +# Remove old kernel files if existing: https://github.com/MichaIng/DietPi/issues/4788 +{ +# Fail if the package name was not passed, which is done when being invoked by dpkg +if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ] +then + echo 'DPKG_MAINTSCRIPT_PACKAGE was not set, this script must be invoked by dpkg.' + exit 1 +fi +# Loop through files in /boot, shipped by the package, and remove them, if existing +for file in $(dpkg -L "$DPKG_MAINTSCRIPT_PACKAGE" | grep '^/boot/') +do + [ ! -f "$file" ] || rm "$file" +done +} +_EOF_ + G_EXEC chmod +x /etc/kernel/preinst.d/dietpi +fi + +# v7.7 +if [[ -f '/etc/apt/sources.list.d/armbian.list' ]] && grep -q 'https://apt.armbian.com' /etc/apt/sources.list.d/armbian.list +then + G_DIETPI-NOTIFY 2 'Connecting to apt.armbian.com via plain HTTP until their router handles HTTPS redirects reliably' + G_EXEC sed -i 's|https://apt.armbian.com|http://apt.armbian.com|' /etc/apt/sources.list.d/armbian.list +fi + +# v7.7 +if (( $G_DIETPI_VERSION_CORE < 7 || ( $G_DIETPI_VERSION_CORE == 7 && $G_DIETPI_VERSION_SUB < 7 ) )) +then + G_DIETPI-NOTIFY 2 'Connecting to Mosquitto and Webmin repositories via plain HTTP once until latest OpenSSL has been installed: https://github.com/MichaIng/DietPi/issues/4795' + G_EXEC sed -Ei 's#https://(repo.mosquitto.org|download.webmin.com)#http://\1#' /etc/apt/sources.list + [[ $(find /etc/apt/sources.list/*.list 2> /dev/null) ]] && G_EXEC sed -Ei 's#https://(repo.mosquitto.org|download.webmin.com)#http://\1#' /etc/apt/sources.list.d/*.list + + # Add execute permissions to kernel/initramfs hooks + [[ -f '/etc/initramfs/post-update.d/99-dietpi-uboot' && ! -x '/etc/initramfs/post-update.d/99-dietpi-uboot' ]] && G_EXEC chmod +x /etc/initramfs/post-update.d/99-dietpi-uboot + [[ -f '/etc/kernel/preinst.d/dietpi-initramfs_cleanup' && ! -x '/etc/kernel/preinst.d/dietpi-initramfs_cleanup' ]] && G_EXEC chmod +x /etc/kernel/preinst.d/dietpi-initramfs_cleanup +fi + exit 0 } diff --git a/.update/version b/.update/version index afc23453fc..c84d2f6e69 100644 --- a/.update/version +++ b/.update/version @@ -1,7 +1,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=7 -G_REMOTE_VERSION_SUB=6 -G_REMOTE_VERSION_RC=2 +G_REMOTE_VERSION_SUB=7 +G_REMOTE_VERSION_RC=0 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=0 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 734d13ef6f..b16fc6d9ea 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,37 @@ +v7.7 +(2021-10-16) + +Removed software: +- CouchPotato | Sadly, the CouchPotato project is not maintained anymore and has been abandoned. In turn we removed it from DietPi. The instance installed on your system will remain, but it cannot be installed, reinstalled or uninstalled anymore. We recommend to migrate to an alternative project, like Radarr, which can be found in DietPi-Software was well. Manual CouchPotato uninstall instructions: https://github.com/MichaIng/DietPi/issues/4323#issuecomment-927128724 + +Changes: +- DietPi-Globals | G_GET_WAN_IP: We use our own GEO IP service now to show the systems WAN IP and location in the DietPi banner and DietPi-VPN. When Pi-hole was used, with a previous update, "freegeoip.app" was added to Pi-hole's whitlist, which is now not required anymore. You may hence remove that entry from the whitelist. +- DietPi-Globals | A new global function G_GET_NET has been added to print network interface details. Most importantly it prints info for the main interface, by following the priorities of /boot/dietpi/func/obtain_network_details: default gateway => state UP => IP assigned, but allows to additionally filter by IP family, type, interface name or print the default gateway explicitly. It aims to be a replacement for /boot/dietpi/func/obtain_network_details with more flexibility and to allow deriving always up-to-date interface info instead of depending on the correctness of a cache file. +- DietPi-Globals | The global functions G_DEV_1 and G_DEV_BENCH have been removed, which did exist for testing and development only but are not used in our current workflows. +- DietPi-Login | The DietPi banner on login won't be shown anymore if ~/.hushlogin exists, which is a common method to prevent the shell from printing /etc/motd on login and should hence be respected for the DietPi banner as well. Many thanks to @dnknth for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4786 +- DietPi-Software | Deluge: Logging is not done to /var/log/deluged/ anymore but to journal instead, accessible via "journalctl -u deluged -u deluge-web". This change only affects new installs and reinstalls of Deluge. +- DietPi-Software | Deluge: On fresh installs, the web interface is now accessible as expected with the chosen global software password, stored hashed with a fresh random salt. Previously the password was hardcoded to "dietpi". + +Fixes: +- General | Since the Armbian repository router does not reliably preservers HTTPS on redirects yet, APT by times fails, when detecting a downgrade from HTTPS to HTTP. We hence change the armbian.list to use plain HTTP, until the issues with the router have been resolved. +- DietPi-Backup | Resolved an issue where clearing the PATH cache via "hash" command did not work as of a wrong command line argument: https://github.com/MichaIng/DietPi/issues/4800 +- DietPi-LetsEncrypt | Resolved an issue where the script failed when ownCloud or Nextcloud are were installed. Many thanks to @billouetaudrey for reporting this issue: https://github.com/MichaIng/DietPi/issues/4752 +- DietPi-Software | Resolved an issue where software services failed with a cryptic error message, when an expected directory was not present. This was especially reported with Sonarr and Radarr, if their log directory was missing for some reason. When directories are missing, which are explicitly listed to be read-writeable within the systemd service, systemd prints "Failed at step NAMESPACE spawning", while Sonarr and Radarr themselves would print a clearer error message about the missing log directory. Many thanks to @stevewitz for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=9463 +- DietPi-Software | Lighttpd: Resolved an issue where the upgrade from Buster to Bullseye, following our guide, fails if HTTPS was enabled via DietPi-LetsEncrypt before. Many thanks to @fhals for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=9477 +- DietPi-Software | Kodi: Resolved an issue on RPi ARMv8/64-bit systems where Kodi fails to start when it was installed without a desktop. Many thanks to @Klola for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=38079#p38079 +- DietPi-Software | Deluge: Resolved an issue on Bullseye where the web interface service did not start as a new command line flag "-d" is required to keep it in foregound. Many thanks to @quyentruong for reporting this issue: https://github.com/MichaIng/DietPi/issues/4785 +- DietPi-Software | Home Assistant: The Python version compiled with Home Assistant has been bumped to v3.9.7, which resolves and issue with installs on 32-bit ARM systems. Many thanks to @Przemek for reporting this issue: https://github.com/MichaIng/DietPi/issues/4372#issuecomment-936656595 +- DietPi-Software | Home Assistant: Resolved an issue where Home Assistant did not start on ARM systems due to newly required runtime libraries. + +As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX + +Known/Outstanding Issues: +- DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103 + +For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues + +----------------------------------------------------------------------------------------------------------- + v7.6 (2021-09-18) @@ -7,8 +41,8 @@ Changes: - DietPi-Drive_Manager | Native Linux exFAT support is now detected and respected by skipping the obsolete FUSE driver install in case. Additionally the new "exfatprogs" are installed on Bullseye, written and implemented with Debian Bullseye along with the native Linux exFAT implementation. - DietPi-Drive_Manager | exFAT mounts now have 775 mode and are owned by the "dietpi" group, if it was not manually removed. By default, when the FUSE driver is used, mounts have 777 mode so that all users have full access, which isn't optimal for security reasons. With native Linux exFAT support mounts have 755 mode by default, so that DietPi-Software's download and media software implementations don't have write access. "775 root:dietpi" is a good compromise if the "dietpi" group exists, matching the permissions for content directories in /mnt/dietpi_userdata. Many thanks to @K92Pi for reporting a related issue: https://github.com/MichaIng/DietPi/issues/4680 - DietPi-Drive_Manager | Added support for moving the root filesystem to a different drive on Odroid N2. -- DietPi-AutoStart | A new autostart option "Custom script (foreground, with autologin)" has been added, which executes the custom script "/var/lib/dietpi/dietpi-autostart/custom.sh" after being logged in with the chosen user automatically, in foreground on the main screen. To have it more reasonably separated, the previous custom script option has been changed to "Custom script (background, no autologin)", which is executed via systemd service, independantly of any login state like before, but does not print to foreground console anymore. Instead output goes to journal (journalctl -u dietpi-autostart_custom) like most other systemd services do. The foreground mode now behaves like most other foreground/GUI autostart options, launches after autologin at the main screen (TTY1) and, if it's a long running process, it can be cancelled via CTRL+C, just like CAVA or DietPi-CloudShell. If one wants to run a custom script in foreground on the main screen before/independant of a login, placing it into /var/lib/dietpi/postboot.d/ is another option. All contained scripts are executed at the end of the boot sequence as root user on the main screen, without any manual login required. Many thanks to @scorgn for implementing this feature: https://github.com/MichaIng/DietPi/pull/4634 -- DietPi-Software | TigerVNC: Instead of x11vnc, TigerVNC's own scraping server is now used for shared desktop mode, which is a bit lighter and shares a lot of libraries with the TigerVNC standaline server package. +- DietPi-AutoStart | A new autostart option "Custom script (foreground, with autologin)" has been added, which executes the custom script "/var/lib/dietpi/dietpi-autostart/custom.sh" after being logged in with the chosen user automatically, in foreground on the main screen. To have it more reasonably separated, the previous custom script option has been changed to "Custom script (background, no autologin)", which is executed via systemd service, independently of any login state like before, but does not print to foreground console anymore. Instead output goes to journal (journalctl -u dietpi-autostart_custom) like most other systemd services do. The foreground mode now behaves like most other foreground/GUI autostart options, launches after autologin at the main screen (TTY1) and, if it's a long running process, it can be cancelled via CTRL+C, just like CAVA or DietPi-CloudShell. If one wants to run a custom script in foreground on the main screen before/independent of a login, placing it into /var/lib/dietpi/postboot.d/ is another option. All contained scripts are executed at the end of the boot sequence as root user on the main screen, without any manual login required. Many thanks to @scorgn for implementing this feature: https://github.com/MichaIng/DietPi/pull/4634 +- DietPi-Software | TigerVNC: Instead of x11vnc, TigerVNC's own scraping server is now used for shared desktop mode, which is a bit lighter and shares a lot of libraries with the TigerVNC standalone server package. - DietPi-Software | RealVNC: Having desktop autologin enabled does not force the shared desktop VNC mode anymore. Furthermore our "vncserver.service" does not call RealVNC's "vncserver-x11-serviced.service" for the shared desktop mode, but instead the actual vncserver-x11 executable is called directly. This has some benefits, e.g. it allows to use our service for a virtual desktop while using RealVNC's service to allow connections to the shared local desktop independently. Many thanks to @K92Pi for bringing this idea to us: https://github.com/MichaIng/DietPi/issues/4672 - DietPi-Software | RealVNC: The VNC server is now started with "VncAuth" authentication by default, which allows any VNC viewer to connect, not just RealVNC's ones. Use "vncpasswd" to change the password, which is now independent of the UNIX user passwords. It defaults to the global software password on a fresh install. - DietPi-Software | Amiberry: Due to changes in DietPi v7.5, enabling Amiberry fast boot won't change the TTY for boot/kernel on Raspberry Pi anymore, as they do not directly interfere with Amiberry screen output anymore. But due to this change, during screen mode changes, the raw console output is visible for a short time, which breaks the Amiga feeling. To address the issue, instead of changing the kernel command line (cmdline), Amiberry will now switch to a different expectedly empty TTY on startup and switch back to the main TTY when being stopped, including the case of failure. As this is achieved with the Amiberry service itself, the Amiberry standard boot option benefits from it as well, as well as manual "systemctl start amiberry" calls, all the same way, and it is not limited to the Raspberry Pi, as the previous TTY change was. Many thanks to @zompiexx for reporting this issue: https://github.com/MichaIng/DietPi/issues/4692 @@ -16,7 +50,7 @@ Changes: - DietPi-Software | Kodi: Our Raspberry Pi accelerated Kodi package is now installed on ARMv7 RPi systems as well. New Software: -- Box64 | This x86_64 userspace emulator allows you to run x86_64 binaries on an ARMv8/arm64 system. It works very similar to Box86, hence is able to use arm64 shared libraries with the x86_64 binaries, so that often no additional libraries need to be installed. Thanks to binfmt, it is invoked automatically if an x86_64 binary is tried to be executed. Many thanks to @ravenclaw900 for implementing this software title: https://github.com/MichaIng/DietPi/pull/4625 +- Box64 | This x86_64 user space emulator allows you to run x86_64 binaries on an ARMv8/arm64 system. It works very similar to Box86, hence is able to use arm64 shared libraries with the x86_64 binaries, so that often no additional libraries need to be installed. Thanks to binfmt, it is invoked automatically if an x86_64 binary is tried to be executed. Many thanks to @ravenclaw900 for implementing this software title: https://github.com/MichaIng/DietPi/pull/4625 - File Browser | Access and manage your data from anywhere via browser with this lightweight remote file manager. Other than ownCloud and Nextcloud, it accesses the raw data on your filesystem, based on a chosen root directory, which makes it similar to Syncthing. You can setup multiple users with their own root directory and also sharing files and directories via password-protected link is possible. - Spotifyd | Spotifyd streams music just like the official client, but is more lightweight. It also supports the Spotify Connect protocol, which makes it show up as a device that can be controlled from the official clients. Many thanks to @ressu for implementing this software title: https://github.com/MichaIng/DietPi/pull/4713 @@ -35,11 +69,6 @@ Fixes: As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/4747 -Known/Outstanding Issues: -- DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103 - -For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues - ----------------------------------------------------------------------------------------------------------- v7.5 @@ -91,7 +120,7 @@ New Software: - youtube-dl | The famous command-line program to download videos from YouTube and other video platforms has been added to DietPi-Software with ID 195. Fixes: -- Debian Stretch | Since Armbian dropped support for Debian Stretch from their APT repository, Armbian-based Stretch systems will have their APT sources adjusted to pull kernel, device tree, bootloader and firmware packages from the Armbian Buster suite. These are compatible with all Debian versions and have no dependencies or depandants which could cause conflicts. +- Debian Stretch | Since Armbian dropped support for Debian Stretch from their APT repository, Armbian-based Stretch systems will have their APT sources adjusted to pull kernel, device tree, bootloader and firmware packages from the Armbian Buster suite. These are compatible with all Debian versions and have no dependencies or dependants which could cause conflicts. - DietPi-Set_swapfile | Resolved an issue where remounting the /tmp tmpfs filesystem failed, if another filesystem type was mounted at /tmp. This could be especially the case during DietPi-PREP image creation. Many thanks to @timocapa for reporting this issue: https://github.com/MichaIng/DietPi/issues/4573#issuecomment-884993352 - DietPi-Software | X.Org X Server: Resolved an issue where the X server failed on PINE A64 as the wrong DDX driver packages were installed. Many thanks to @exadeci for reporting this issue: https://github.com/MichaIng/DietPi/issues/4541 - DietPi-Software | PaperMC: Resolved an issue where the install of Geyser and Floodgate plugins failed as the download link changed. @@ -122,7 +151,7 @@ New Software: - K3s | Added a lightweight Kubernetes implementation as install option with ID 193. Many thanks to @mortenlj for implementing this software title: https://github.com/MichaIng/DietPi/pull/4476 Removed Software: -- Tomcat 8 | Tomcat version 8 is available until Debian Stretch only, from Buster on it's Tomcat 9. There is no reasonable configration that DietPi-Software can do on top of installing the APT package, which can be easily done manually via "apt install tomcat9". The software option is hence removed from DietPi-Software, in favour of a manual package install. +- Tomcat 8 | Tomcat version 8 is available until Debian Stretch only, from Buster on it's Tomcat 9. There is no reasonable configuration that DietPi-Software can do on top of installing the APT package, which can be easily done manually via "apt install tomcat9". The software option is hence removed from DietPi-Software, in favour of a manual package install. Fixes: - DietPi-JustBoom | Resolved an issue where the equalizer was always shown as "Off" even when it was just or previously enabled (v7.2 regression). Many thanks to @shao for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=35072#p35072 @@ -147,7 +176,7 @@ Changes: - DietPi-DDNS | Added native support for FreeDNS and OVH. - DietPi-VPN | Added native support for IPVanish and Private Internet access (PIA) - DietPi-VPN | When "Reset" is selected, you're now offered to purge the OpenVPN package, as long as neither the OpenVPN (server) install option nor PiVPN is installed. Many thanks to @maartenlangeveld for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4346 -- DietPi-AutoStart | Selecting desktop autologin with non-root user has been made much more reliabe. Previously the X server itself was started by the login user, which often requires additional permissions and sometimes, based on GPU and driver, is not possible at all without further customisation. The method has been changed so that LightDM is used for non-root autologins, just like it is for manual desktop logins, but logging into the desktop automatically with the chosen user. +- DietPi-AutoStart | Selecting desktop autologin with non-root user has been made much more reliable. Previously the X server itself was started by the login user, which often requires additional permissions and sometimes, based on GPU and driver, is not possible at all without further customisation. The method has been changed so that LightDM is used for non-root autologins, just like it is for manual desktop logins, but logging into the desktop automatically with the chosen user. - DietPi-Config | On Raspberry Pi, the Allo Boss2 DAC can now be selected from the sound card list. The OLED display that comes with this product currently needs to be installed manually by following Allo's instructions, but will be natively integrated into DietPi with the next release v7.3. - DietPi-Software | A desktop preference choice has been added. Before first boot via new dietpi.txt AUTO_SETUP_DESKTOP_INDEX setting or with the new menu entry it can be now chosen which desktop to install when another software selection requires one, especially remote desktop solutions. It works like the webserver preference, so it only play a role when a desktop is installed as dependency and is overridden by manual desktop selections. - DietPi-Software | A browser preference choice has been added. Before first boot via new dietpi.txt AUTO_SETUP_BROWSER_INDEX setting or with the new menu entry it can be now chosen whether and which browser to install automatically together with desktops. It only plays a role when a desktop is installed and is overridden by manual browser selections. Previously, Firefox was always installed together with desktops, which has now become an independent software option (see new software below). @@ -198,7 +227,7 @@ v7.1 (2021-04-28) Supported SBC changes: -- For historical reasons, DietPi had internal hardware identifiers for SBCs which are not officially supported anymore for a long time, namely variouos Orange Pi and Banana Pi models, BeagleBone Black and LeMaker Guitar. Since we do not provide a reference image and do not test features on those boards, we have no chance to reasonably use those hardware IDs code-wise to apply tweaks or enable features, which renders them meaningless. To avoid wrong assumptions, we hence removed the identifies for the named SBC models. As a replacement, we added a set of generic SoC identifiers, which can as well be selected from within the DietPi-PREP system converter script. This means that one is e.g. able to select "Generic Allwinner H3" and have an SoC identifier set by this, which is used within the code for conditionals based on the SoC, e.g. regarding GPU acceleration and other SoC-internal hardware features. The removed SBC models are converted automatically to those generic identifiers, so that e.g. after the update an OrangePi PC will be shown in our scripts and banner as "Generic Allwinner H3". While it looks like a degradation, it is a hardening, as it assures that no false assumptions and conditionals are triggered in our scripts but only those which we can know for sure being true, regardless of the initial Debian image you used. +- For historical reasons, DietPi had internal hardware identifiers for SBCs which are not officially supported anymore for a long time, namely various Orange Pi and Banana Pi models, BeagleBone Black and LeMaker Guitar. Since we do not provide a reference image and do not test features on those boards, we have no chance to reasonably use those hardware IDs code-wise to apply tweaks or enable features, which renders them meaningless. To avoid wrong assumptions, we hence removed the identifies for the named SBC models. As a replacement, we added a set of generic SoC identifiers, which can as well be selected from within the DietPi-PREP system converter script. This means that one is e.g. able to select "Generic Allwinner H3" and have an SoC identifier set by this, which is used within the code for conditionals based on the SoC, e.g. regarding GPU acceleration and other SoC-internal hardware features. The removed SBC models are converted automatically to those generic identifiers, so that e.g. after the update an OrangePi PC will be shown in our scripts and banner as "Generic Allwinner H3". While it looks like a degradation, it is a hardening, as it assures that no false assumptions and conditionals are triggered in our scripts but only those which we can know for sure being true, regardless of the initial Debian image you used. - We removed the Firefly RK3399 from our supported devices list, as not a single user is reported via DietPi-Survey (https://dietpi.com/survey/#device). If case there were actually Firefly RK3399 DietPi systems, not participating DietPi-Survey, those would be migrated to the "Generic Rockchip RK3399" identifier, which code-wise maintains the exact same support. Changes: @@ -206,7 +235,7 @@ Changes: - DietPi-LetsEncrypt | It is now possible to obtain certificates without having a webserver installed. Certbot can start an own internal webserver for such case and the certificate can then be used to manually enable HTTPS for other web applications, running on other ports than 80/443. - DietPi-LetsEncrypt | It is now possible to enable OCSP (Online Certificate Status Protocol) stapling for the obtained certificate. This allows clients to check if the certificate has been revoked, e.g. when the server has been compromised or the private key stolen. - DietPi-LetsEncrypt | Lighttpd: HTTPS is now enabled for IPv6 requests and the deprecated TLSv1.0 and TLSv1.1 are disabled from Debian Buster on. With the Lighttpd version shipped by Debian Stretch, those TLS versions cannot be disabled. -- DietPi-NordVPN | The script reveived a major rework to allow being setup as ProtonVPN client and even with a custom OVPN config. For this reason it has been renamed to "DietPi-VPN", with the script moved to /boot/dietpi/dietpi-vpn and the console command alias changed to "dietpi-vpn" accordingly. Additionally a killswitch feature has been added which forcefully drops all WAN packets not sent through the VPN, when the connection got lost, until the VPN is disconnected manually/intentionally. Further is IPv6 now automatically disabled when the VPN connection is established. This is required to prevent IPv6 leaks as most public VPN providers/servers do not support IPv6. When it has not been disabled before, IPv6 is re-enabled automatically once the VPN connection stops. Many thanks to @ravenclaw900 for doing this major rework: https://github.com/MichaIng/DietPi/pull/4180 +- DietPi-NordVPN | The script received a major rework to allow being setup as ProtonVPN client and even with a custom OVPN config. For this reason it has been renamed to "DietPi-VPN", with the script moved to /boot/dietpi/dietpi-vpn and the console command alias changed to "dietpi-vpn" accordingly. Additionally a killswitch feature has been added which forcefully drops all WAN packets not sent through the VPN, when the connection got lost, until the VPN is disconnected manually/intentionally. Further is IPv6 now automatically disabled when the VPN connection is established. This is required to prevent IPv6 leaks as most public VPN providers/servers do not support IPv6. When it has not been disabled before, IPv6 is re-enabled automatically once the VPN connection stops. Many thanks to @ravenclaw900 for doing this major rework: https://github.com/MichaIng/DietPi/pull/4180 - DietPi-Arr_to_RAM | Support for Sonarr v3 and Radarr v3 has been added. On first link to RAM, a script "/mnt/dietpi_userdata/(sonarr|radarr|lidarr)/dietpi-arr_to_RAM.sh" is created, which allows updating the linked database backups via the programs "Custom Script" feature. Since v3, it is not possible anymore to pass arguments to custom script or call scripts inside the /boot directory at all, which broke the previous "/boot/dietpi/misc/dietpi-arr_to_RAM 2 (sonarr|radarr|lidarr)" calls in two ways. - DietPi-FS_partition_resize | Added support to automatically resize F2FS and Btrfs filesystems on first boot. - DietPi-Drive_Manager | Added support for resizing F2FS and Btrfs filesystems as well as format- and filesystem check & repair support for XFS filesystems. @@ -214,7 +243,7 @@ Changes: - DietPi-Config | Added a safe overclocking profile for RPi 3+ models. Many thanks to @lone for doing long-term stability tests and reporting back the result: https://dietpi.com/phpbb/viewtopic.php?p=32285#p32285 - DietPi-Config | When disabling the RPi camera feature, the bcm2835_isp kernel module is now additionally blacklisted. Since kernel 5.X it is otherwise loaded automatically and pulls in the whole camera modules stack as dependency, adding some additional memory usage and boot overhead. Many thanks to @ferbar for making us aware of this: https://github.com/MichaIng/DietPi/issues/4203 - DietPi-Software | The "optimised" and "additional" software menus have been merged. The separation did not follow consistent rules and this change allows us to have development tools and platforms in a more prominent position. Also it simplifies the software selection and addresses possible confusion about that separation among our users. -- DietPi-Software | Since multiple software titles were listeing on the ports 5000 and 8000, the default ports of those titles have been changed to avoid conflicts on concurrent installs. No change is done during the DietPi update, even a software title reinstall won't change it, in most cases. For details see the individual software changes below. +- DietPi-Software | Since multiple software titles were listening on the ports 5000 and 8000, the default ports of those titles have been changed to avoid conflicts on concurrent installs. No change is done during the DietPi update, even a software title reinstall won't change it, in most cases. For details see the individual software changes below. - DietPi-Software | Mosquitto: Since v2, by default remote connections and no unauthenticated requests are possible anymore. On fresh installs and reinstalls, we'll enable remote connections, but create a password file, so that MQTT clients need to authenticate with username "mosquitto" and the global software password by default. Many thanks to @mattsmithuk for reporting this change: https://github.com/MichaIng/DietPi/issues/4133 - DietPi-Software | IceCast: The streaming server can now be installed on virtual machines as well and the default web UI password will now be the global software password instead of a random one. Since the DarkIce config file /etc/darkice.cfg contains the global software password in plain text, its permission mode is changed to 600 to limit read access to the root user only. - DietPi-Software | OctoPrint: On fresh installs, the default listening port has been changed from 5000 to 5001 to avoid conflicts with Shairport Sync. @@ -273,7 +302,7 @@ v7.0 Changes: - DietPi-Update | A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. This especially smoothens the migration of our code base to newer Debian versions and the alternative branch can be used to inform and support Debian distribution upgrades and to upgrade the DietPi code to an intermediate version from where the system can be migrated back to the regular stable/master branch. Since this change required a new repository version file, we took the chance and incremented the DietPi core version to v7.0. This however has no further meaning, all previously supported DietPi and Debian versions remain supported and the change enables us to not require fresh image installs for major upgrades, like the upgrade from v159 to v6.0 did a few years ago. - Network | A change has been implemented on the order in which network-related systemd service targets are reached. "network.target" and "network-online.target" are now reach after all network interfaces have been configured, rather then already after only the loopback interface "lo" has been configured. This affects only systemd services which are not started by DietPi-Services, e.g. SSH/DNS/VPN/VNC servers, with the effect that they are assured to be able to bind to interfaces/IPs, where currently they would fail. The downside is, if one has an Ethernet adapter configured via dietpi-config or /etc/network/interfaces (as allow-hotplug device), but the cable not connected, affected services may be delayed until the interface bring-up timed out. -- DietPi-Backup | A new feature has been added which allows to automatically restore a dietpi-backup on first boot. For this set the new dietpi.txt option AUTO_SETUP_BACKUP_RESTORE=1, to get a list of found backups to select from (this does not work in combination with AUTO_SETUP_AUTOMATED=1). All attached drives are mounted temporarily and seached automatically. Set AUTO_SETUP_BACKUP_RESTORE=2 to have the first found backup restored non-interactively (this works in combination with AUTO_SETUP_AUTOMATED=1). The restore runs after the initial update, hence works with older images as well and can be done via SSH connection. Credits go to @ravenclaw900 for implementing this feature: https://github.com/MichaIng/DietPi/pull/4112 +- DietPi-Backup | A new feature has been added which allows to automatically restore a dietpi-backup on first boot. For this set the new dietpi.txt option AUTO_SETUP_BACKUP_RESTORE=1, to get a list of found backups to select from (this does not work in combination with AUTO_SETUP_AUTOMATED=1). All attached drives are mounted temporarily and searched automatically. Set AUTO_SETUP_BACKUP_RESTORE=2 to have the first found backup restored non-interactively (this works in combination with AUTO_SETUP_AUTOMATED=1). The restore runs after the initial update, hence works with older images as well and can be done via SSH connection. Credits go to @ravenclaw900 for implementing this feature: https://github.com/MichaIng/DietPi/pull/4112 - DietPi-Backup | Support for XFS and ZFS target file system types has been added, which fully support the required symlink and POSIX permissions capabilities. - DietPi-Config | RPi: An option has been added to toggle the SPI interface. Many thanks to @incanus for resurrecting this old feature request: https://github.com/MichaIng/DietPi/issues/98#issuecomment-783650204 - DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 @@ -332,7 +361,7 @@ Changes / Improvements / Optimisations: - DietPi-Config | Audio Options: Added an option to switch between direct audio output and automatic software conversions, for channels, format and rate via ALSA "plug" plugin. This may be required to play any raw wav file regardless of sound card capabilities and without defining supported values manually. Having automated software conversions enabled matches the Debian ALSA defaults but may increase CPU usage and decrease sound quality. - DietPi-Config | RPi: When enabling I2C support, the Python 3 SMbus module is now installed instead of the deprecated Python 2 version. This matches as well the dependency of PiJuice, which nowadays pulls Python 3 SMbus as package dependency, hence this change avoids the obsolete install of the whole Python 2 stack when PiJuice is installed through dietpi-software. Many thanks to @Trunkzeh for reporting this issue: https://github.com/MichaIng/DietPi/issues/3963#issuecomment-748547394 - DietPi-Software | OpenBazaar: Build is now done with the currently latest Go v1.15.3 and the service runs as unprivileged user "openbazaar" instead of root. -- DietPi-Software | XRDP: Remote desktop connections can now be done with the "Xorg" method and hence don't require an active VNC server anymore. New installes will not pull TigerVNC as dependency and if only RDP is required, TigerVNC can be uninstalled. +- DietPi-Software | XRDP: Remote desktop connections can now be done with the "Xorg" method and hence don't require an active VNC server anymore. New installs will not pull TigerVNC as dependency and if only RDP is required, TigerVNC can be uninstalled. - DietPi-Software | Single File PHP Gallery: Updated new installs to latest v4.7.1. Run "dietpi-software reinstall 56" to upgrade your existing instance. - DietPi-Software | MineOS: A systemd service is now used to run the daemon in favour of the previous supervisor, the obsolete "mineos" user is not created anymore, Node.js v11 is used to build MineOS, obsolete dependencies have been removed and a reinstall will now perform a MineOS upgrade and the existing /etc/mineos.conf is not replaced anymore. - DietPi-Software | Mycroft AI: By default, the ALSA automatic conversions plugin is enabled now on install, which enables OOTB compatibility with all wav sound formats and sound card. Additionally listener sampling rate override (48000 Hz) has been removed, reverting to Mycroft default (16000 Hz), which might solve an issue with hanging microphone level in CLI and related failing voice detection. @@ -420,7 +449,7 @@ Bug Fixes: - DietPi-Software | Kodi: Resolved an issue on Odroid XU4 where install failed due to missing librockchip-mpp1 package which instead was aimed to be installed on Odroid N1 only. - DietPi-Software | TigerVNC+LXDE: Resolved an issue where lxappearance start ("Customize Look and Feel") hangs within TigerVNC sessions. - DietPi-Software | Fail2Ban: Resolved an issue where the service could have failed to start due to a missing variable declaration in our default config. Many thanks to @mafioso12dk for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8147 -- DietPi-Software | DietPi-RAMlog: Resolved an issue where /var/log content was not restored when reinstalling DietPi-RAMlog, e.g. when swiching logging mode from #1 to #2. This could have led to service start issues, when those rely on log files or directories being present. Many thanks to @djashdj for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8163 +- DietPi-Software | DietPi-RAMlog: Resolved an issue where /var/log content was not restored when reinstalling DietPi-RAMlog, e.g. when switching logging mode from #1 to #2. This could have led to service start issues, when those rely on log files or directories being present. Many thanks to @djashdj for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8163 As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/3829 @@ -438,7 +467,7 @@ Changes / Improvements / Optimisations: - NanoPi K2 | Initial support for this SBC has been added. - DietPi-Set_swapfile | Added support for zram-based swap space. Use "zram" as swap location to have a zram device created (persistently via udev rule) at /dev/zram0 and used for compressed in-memory swap space. The auto-size option "1" will result in a zram size of 50% of physical RAM size, else the MiB value will be used, as long as its smaller than physical RAM size. Many thanks to @rickalm for pushing this topic with an initial implementation: https://github.com/MichaIng/DietPi/pull/3705 - DietPi-Drive_Manager | For NTFS mounts, the "big_writes" mount option is now added by default, which reduces CPU load and by this may increase performance. Many thanks to @balexandrov for suggesting this enhancement: https://github.com/MichaIng/DietPi/issues/3330#issuecomment-654072107 -- DietPi-Config | Added selection of schedutil and userspace CPU frequency governors. Schedutil is a modern dynmic governor which sets frequency tightly related and according to metrics of the CPU scheduling driver itself. Userspace is a no-op governor, i.e. it does not touch CPU frequencies at all which allows setting manual/custom frequencies according to own metrics or via scripts. Read more about native Linux CPU frequency scaling: https://www.kernel.org/doc/html/latest/admin-guide/pm/cpufreq.html#generic-scaling-governors +- DietPi-Config | Added selection of schedutil and user space CPU frequency governors. Schedutil is a modern dynmic governor which sets frequency tightly related and according to metrics of the CPU scheduling driver itself. Userspace is a no-op governor, i.e. it does not touch CPU frequencies at all which allows setting manual/custom frequencies according to own metrics or via scripts. Read more about native Linux CPU frequency scaling: https://www.kernel.org/doc/html/latest/admin-guide/pm/cpufreq.html#generic-scaling-governors - DietPi-Config | RPi: Removed the option to switch the deprecated max_usb_current setting in config.txt. Max USB current is now enabled by default via firmware on all RPi models: https://github.com/raspberrypi/documentation/issues/1655 - DietPi-LetsEncrypt | Lighttpd: Updated our default SSL cipher to match newer standards, still intermediate and compatible with Debian Stretch (Lighttpd v1.4.45). Additionally our config file names have been adjusted to use lighty-enable|disable-mod and priority prefixes to allow ordering own custom configs/vhosts more easily around them. Many thanks to @PanosssD for making us aware of this: https://github.com/MichaIng/DietPi/issues/3707 - DietPi-Software | Komga: FOSS home server for comics and mangas, now available for install as ID 179. Many thanks to @himura95 for providing the implementation: https://github.com/MichaIng/DietPi/issues/3403 @@ -450,7 +479,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | OctoPrint: On Debian Buster and up, migrated to a Python3-based install. - DietPi-Software | Wordpress: Plugins can now be installed and the internal updater used OOTB without the need to manually apply correct file permissions first. Many thanks to @Joulinar for implementing this: https://github.com/MichaIng/DietPi/pull/3720 - DietPi-Software | ProFTPD: On fresh installs, reverse DNS lookups are disabled by default now by adding "UseReverseDNS off" to /etc/proftpd/proftpd.conf. This increases login speeds, in case dramatically, depending on reverse DNS server. Additionally file uploads can now be resumed by default via "AllowStoreRestart On" and members of the "dietpi" group have write access to uploaded files ("Umask 002") to increase OOTB compatibility with media and file sharing software. Many thanks to @bbsixzz for doing these suggestions: https://github.com/MichaIng/DietPi/issues/3727 -- DietPi-Software | HTPC Manager: Migrated to a Python3-compatibe fork initiated by @gmiranda (https://github.com/HTPC-Manager/HTPC-Manager), since the previous fork stopped development. Please help test, and when possible contribute to this project to keep it alive. We'll do minimal tests and assure the basic install and web interface works fine from Debian Stretch till Debian Bullseye. +- DietPi-Software | HTPC Manager: Migrated to a Python3-compatible fork initiated by @gmiranda (https://github.com/HTPC-Manager/HTPC-Manager), since the previous fork stopped development. Please help test, and when possible contribute to this project to keep it alive. We'll do minimal tests and assure the basic install and web interface works fine from Debian Stretch till Debian Bullseye. Bug Fixes: - General | Resolved an issue where enabling or disabling IPv6 removed the expected symlink at /etc/sysctl.d/99-sysctl.conf with its actual target file. This happened when using dietpi-config network options and as well during firstrun setup when dietpi.txt choices are applied. The symlink is recreated, if missing, on all DietPi systems with next update. @@ -578,7 +607,7 @@ Bug Fixes: - DietPi-Software | Resolved an issue where extraction of zip archives to current directory failed. Many thanks to @en0rism for reporting this issue: https://github.com/MichaIng/DietPi/issues/3320 - DietPi-Software | Redis: Resolved an issue where service start fails on Stretch systems. Many thanks to @drieksje for reporting this issue: https://github.com/MichaIng/DietPi/issues/3314 - DietPi-Software | Sonarr/Radarr/Lidarr: Resolved an issue where a manual service restart was required after the internal updater has been used. -- DietPi-Software | myMPD: Resolved MPD connection issues on Stetch systems. Many thanks to @jcorporation for informing us on upstream changes, helping with debug and fixing the issues: https://github.com/MichaIng/DietPi/issues/3382 +- DietPi-Software | myMPD: Resolved MPD connection issues on Stretch systems. Many thanks to @jcorporation for informing us on upstream changes, helping with debug and fixing the issues: https://github.com/MichaIng/DietPi/issues/3382 - DietPi-Software | O!MPD: Resolved an issue where YouTube support was not functional by default due to missing youtube-dl execute permissions. Many thanks to @ArturSierzant for reporting this issue: https://github.com/MichaIng/DietPi/issues/3413 - DietPi-Software | GMediaRender: Resolved an issue where the wrong sound device could have been used. Many thanks to @kikigarel for reporting this issue: https://github.com/MichaIng/DietPi/issues/3348 - DietPi-Software | Chromium: Resolved an issue where non-root users were not able to use the Chromium autostart option due to wrong permissions. Many thanks to @lasers and @promofu for reporting this issue: https://github.com/MichaIng/DietPi/issues/3322 @@ -1038,7 +1067,7 @@ v6.19.7 (10/12/18 Hotfix) Bug Fixes: -- DietPi-Software | Netdata: Resolved an issue, where uninstalling netdata lead to a broken system. Thanks to @PDXUser for reporting this issue: https://github.com/MichaIng/DietPi/issues/2336 +- DietPi-Software | Netdata: Resolved an issue, where uninstalling Netdata lead to a broken system. Thanks to @PDXUser for reporting this issue: https://github.com/MichaIng/DietPi/issues/2336 - DietPi-Software | Docker: Resolved an issue on RPi, where a faulty "docker-ce" version from repository prevents service start on Raspberry Pi. Thanks to @iaresee and @Garret for reporting this issue, finding and testing workarounds: https://github.com/MichaIng/DietPi/issues/2282 v6.19.6 @@ -1063,7 +1092,7 @@ Changes / Improvements / Optimisations: - PREP | Serial console: Now enabled by default for all future DietPi images. Please note, only v6.19 images and above, will have this set by default. Existing images require edit of /boot/dietpi.txt and 'CONFIG_SERIAL_CONSOLE_ENABLE=1' before 1st run: https://github.com/MichaIng/DietPi/issues/2313 Bug Fixes: -- General | Asus TB (based on our recent 2.0.8 Tinker OS pre-image): Resolved issue with corrupt characters in desktops. +- General | ASUS Tinker Board (based on our recent 2.0.8 Tinker OS pre-image): Resolved issue with corrupt characters in desktops. - DietPi-Update | Prevented backup prompt during each subversion patch from displaying. - DietPi-Software | Chromium: Resolved incorrect scale of window under Kiosk mode: https://github.com/MichaIng/DietPi/issues/2298#issuecomment-442995196 - DietPi-Software | OMPD: Resolved a reinstall issue due to SQL table not being correctly dropped, before re-created: https://github.com/MichaIng/DietPi/issues/2305 @@ -1739,7 +1768,7 @@ All DietPi images have been re-created. Existing installations (v159 or lower), - https://github.com/MichaIng/DietPi/issues/1385 - All images are now Debian Stretch (excluding Odroid's) - Armbian based images are now mainline kernel 4.13+. - - Native PC (EFI): is now an ISO, with clonezilla bundled. Simplifies installation via Rufus write: https://github.com/MichaIng/DietPi/issues/1171#issuecomment-336522021 + - Native PC (EFI): is now an ISO, with Clonezilla bundled. Simplifies installation via Rufus write: https://github.com/MichaIng/DietPi/issues/1171#issuecomment-336522021 - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot continue to provide support for v159 (or lower) installations. Minor notes: diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index 5ad4849e29..aceb9fbfa2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -792,6 +792,31 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then echo 'do_symlinks=0' > /etc/kernel-img.conf G_EXEC rm -f /{,boot/}{initrd.img,vmlinuz}{,.old} + # If /boot is on a FAT partition, create a kernel upgrade hook script to remove existing files first: https://github.com/MichaIng/DietPi/issues/4788 + if [[ $(findmnt -Ufnro FSTYPE -M /boot) == 'vfat' ]] + then + G_EXEC mkdir -p /etc/kernel/preinst.d + cat << '_EOF_' > /etc/kernel/preinst.d/dietpi +#!/bin/sh -e +# Remove old kernel files if existing: https://github.com/MichaIng/DietPi/issues/4788 +{ +# Fail if the package name was not passed, which is done when being invoked by dpkg +if [ -z "$DPKG_MAINTSCRIPT_PACKAGE" ] +then + echo 'DPKG_MAINTSCRIPT_PACKAGE was not set, this script must be invoked by dpkg.' + exit 1 +fi + +# Loop through files in /boot, shipped by the package, and remove them, if existing +for file in $(dpkg -L "$DPKG_MAINTSCRIPT_PACKAGE" | grep '^/boot/') +do + [ ! -f "$file" ] || rm "$file" +done +} +_EOF_ + G_EXEC chmod +x /etc/kernel/preinst.d/dietpi + fi + G_AGI "${apackages[@]}" unset -v apackages @@ -833,11 +858,12 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC mkdir -p /etc/initramfs/post-update.d cat << _EOF_ > /etc/initramfs/post-update.d/99-dietpi-uboot #!/bin/dash -echo 'update-initramfs: Converting to u-boot format' >&2 +echo 'update-initramfs: Converting to U-Boot format' >&2 mkimage -A $arch -O linux -T ramdisk -C gzip -n uInitrd -d \$2 /boot/uInitrd-\$1 > /dev/null ln -sf uInitrd-\$1 /boot/uInitrd > /dev/null 2>&1 || mv /boot/uInitrd-\$1 /boot/uInitrd exit 0 _EOF_ + G_EXEC chmod +x /etc/initramfs/post-update.d/99-dietpi-uboot G_EXEC mkdir -p /etc/kernel/preinst.d cat << '_EOF_' > /etc/kernel/preinst.d/dietpi-initramfs_cleanup #!/bin/dash @@ -855,7 +881,7 @@ fi # avoid running multiple times if [ -n "$DEB_MAINT_PARAMS" ]; then eval set -- "$DEB_MAINT_PARAMS" - if [ -z "$1" ] || [ "$1" != 'upgrade' ]; then + if [ "$1" != 'upgrade' ]; then exit 0 fi fi @@ -887,9 +913,10 @@ done exit 0 _EOF_ fi + G_EXEC chmod +x /etc/kernel/preinst.d/dietpi-initramfs_cleanup # Remove obsolete components from Armbian list and connect via HTTPS - G_EXEC eval "echo 'deb https://apt.armbian.com/ ${DISTRO_TARGET_NAME/bookworm/bullseye} main' > /etc/apt/sources.list.d/armbian.list" + G_EXEC eval "echo 'deb http://apt.armbian.com/ ${DISTRO_TARGET_NAME/bookworm/bullseye} main' > /etc/apt/sources.list.d/armbian.list" # Exclude doubled device tree files, shipped with the kernel package echo 'path-exclude /usr/lib/linux-image-current-*' > /etc/dpkg/dpkg.cfg.d/01-dietpi-exclude_doubled_devicetrees @@ -1159,9 +1186,14 @@ _EOF_ [[ -d '/selinux' ]] && rm -Rv /selinux [[ -d '/var/cache/apparmor' ]] && rm -Rv /var/cache/apparmor + [[ -d '/var/lib/udisks2' ]] && rm -Rv /var/lib/udisks2 + [[ -d '/var/lib/bluetooth' ]] && rm -Rv /var/lib/bluetooth [[ -d '/usr/lib/firefox-esr' ]] && rm -Rv /usr/lib/firefox-esr # Armbian desktop images rm -Rfv /var/lib/dhcp/{,.??,.[^.]}* + rm -Rfv /var/lib/misc/*.leases rm -Rfv /var/backups/{,.??,.[^.]}* + [[ -f '/etc/udhcpd.conf.org' ]] && rm -v /etc/udhcpd.conf.org + [[ -f '/etc/fs.resized' ]] && rm -v /etc/fs.resized # - www [[ -d '/var/www' ]] && rm -vRf /var/www/{,.??,.[^.]}* diff --git a/boot_n2.ini b/boot_n2.ini index 1ae041aea2..d1f30040c3 100644 --- a/boot_n2.ini +++ b/boot_n2.ini @@ -2,8 +2,8 @@ ODROIDN2-UBOOT-CONFIG setenv board "odroidn2" -# Serial console device: /dev/tty1 is appended automatically -setenv condev "console=ttyS0,115200n8" +# Boot/kernel messages to ttyS0 (serial) and tty1 (HDMI) +setenv condev "console=ttyS0,115200n8 console=tty1" # Auto-detection of monitor settings based on your screen information: "false" or "true" setenv display_autodetect "true" diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 9847f15f8e..ea26b1f643 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -361,7 +361,7 @@ However, this check is a rough estimation in reasonable time, thus it could be m rsync "${aRSYNC_RUN_OPTIONS_RESTORE[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_TARGET/data/" "$FP_SOURCE" EXIT_CODE=$? - hash -d # Clear PATH cache + hash -r # Clear PATH cache (( $UPDATE_UUIDs )) && Update_UUIDs /boot/dietpi/dietpi-services start diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index a1ef70e994..efee39dacd 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -26,7 +26,7 @@ # Import DietPi-Globals -------------------------------------------------------------- # Grab Inputs - # - TARGETMENUID (valid positive interger) + # - TARGETMENUID (valid positive integer) if disable_error=1 G_CHECK_VALIDINT "$1" 1; then TARGETMENUID=$1 @@ -55,7 +55,7 @@ WHIP_SELECTION_PREVIOUS= REBOOT_REQUIRED=0 - # Interger min/max value holders + # Integer min/max value holders MIN_VALUE=0 MAX_VALUE=0 @@ -3877,7 +3877,7 @@ Additional benchmarks: done G_WHIP_DEFAULT_ITEM=$soundcard_current - G_WHIP_MENU "Please select a soundcard\n - Current : $soundcard_current" || return + G_WHIP_MENU "Please select a sound card\n - Current : $soundcard_current" || return /boot/dietpi/func/dietpi-set_hardware soundcard "$G_WHIP_RETURNED_VALUE" # RPi: Reboot required to apply device tree changes, which applies to all but auto-detected selections diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index f355bf0112..94773ad638 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -44,7 +44,7 @@ # Format menu FORMAT_GPT=1 # default GPT: https://github.com/MichaIng/DietPi/issues/531. 0=MBR - FORMAT_FILESYSTEM_TYPE=0 # 0=ext4 1=ntfs 2=fat32 3=hfs+ 4=btrfs 5=f2fs 6=exfat + FORMAT_FILESYSTEM_TYPE=0 # 0=ext4 1=ntfs 2=fat32 3=hfs+ 4=btrfs 5=f2fs 6=exfat 7=xfs FORMAT_COMPLETED=0 FORMAT_MODE=1 # 0=drive 1=partition @@ -702,9 +702,9 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return (( $G_HW_MODEL < 10 )) && dev_entry="PARTUUID=${aDRIVE_PART_UUID[$MENU_DRIVE_INDEX]}" G_EXEC sed -i "\@UUID=[^[:blank:]]*[[:blank:]]\+/[[:blank:]]@c$dev_entry / ${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} noatime,lazytime,rw 0 1" /etc/fstab_new - # Mount rootfs to tmp mountpoint to allow rsync - # - rsync "-x" option prevents copying mounts content, but it copies permissions of mountpoint dirs according to mount options instead of those of the dir on the parent fs. - # - Since mount permissions might not be wanted for the underlying filesystem dir, we copy from a temporary mountpoint to assure that underlying rootfs content matches 100%. + # Mount rootfs to tmp mount point to allow rsync + # - rsync "-x" option prevents copying mounts content, but it copies permissions of mount point dirs according to mount options instead of those of the dir on the parent fs. + # - Since mount permissions might not be wanted for the underlying filesystem dir, we copy from a temporary mount point to assure that underlying rootfs content matches 100%. G_EXEC mkdir -p /tmp/tmp_rootfs G_EXEC mount "$G_ROOTFS_DEV" /tmp/tmp_rootfs @@ -719,7 +719,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return fi - # Remove volatile systemd service PrivateTmp dirs in /var/tmp and target drive mountpoint dir + # Remove volatile systemd service PrivateTmp dirs in /var/tmp and target drive mount point dir rm -Rf "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}"/var/tmp/systemd-private-* rmdir "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}" diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index caa60c29a1..aaa8cecb90 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -364,8 +364,8 @@ _EOF_ # Skip this if HTTP access is still possible (( $LETSENCRYPT_REDIRECT || $LETSENCRYPT_HSTS )) || return G_DIETPI-NOTIFY 2 'Applying HTTPS domain to known web application configs' - [[ -f '/var/www/nextcloud/config/config.php' ]] && G_EXEC sed -i "s/'http://localhost/nextcloud'/'https://$primary_domain/nextcloud'/" /var/www/nextcloud/config/config.php - [[ -f '/var/www/owncloud/config/config.php' ]] && G_EXEC sed -i "s/'http://localhost/owncloud'/'https://$primary_domain/owncloud'/" /var/www/owncloud/config/config.php + [[ -f '/var/www/nextcloud/config/config.php' ]] && G_EXEC sed -i "s|'http://localhost/nextcloud'|'https://$primary_domain/nextcloud'|" /var/www/nextcloud/config/config.php + [[ -f '/var/www/owncloud/config/config.php' ]] && G_EXEC sed -i "s|'http://localhost/owncloud'|'https://$primary_domain/owncloud'|" /var/www/owncloud/config/config.php } #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 57be1bd5ca..596a889707 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -245,7 +245,7 @@ Please login again as user "root" with password "dietpi", respectively the one y # Normal Login if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - /boot/dietpi/func/dietpi-banner 1 + [[ -f ~/.hushlogin ]] || /boot/dietpi/func/dietpi-banner 1 # DietPi-AutoStart # - Skip if this is a desktop/X session already diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 6dd7b97344..858b86fe3e 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -134,7 +134,6 @@ Available services: 'medusa' 'aria2' 'sabnzbd' - 'couchpotato' 'jackett' 'sonarr' 'radarr' diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9be52e5937..ba78d0ba14 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -124,7 +124,7 @@ INDEX_BROWSER_TARGET=$INDEX_BROWSER_TARGET" INSTALL_SSHSERVER_CHOICESMADE=0 INDEX_SSHSERVER_CURRENT=-1 INDEX_SSHSERVER_TARGET=-1 - # - Fileserver + # - File server INSTALL_FILESERVER_CHOICESMADE=0 INDEX_FILESERVER_CURRENT=0 INDEX_FILESERVER_TARGET=0 @@ -363,8 +363,8 @@ INDEX_BROWSER_TARGET=$INDEX_BROWSER_TARGET" aSOFTWARE_CATX[$software_id]=2 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#kodi' aSOFTWARE_DEPS[$software_id]='5 152' - # RPi + Odroid N2+C4 do not use X to start Kodi - [[ $G_HW_MODEL -le 9 || $G_HW_MODEL == 1[56] ]] || aSOFTWARE_DEPS[$software_id]+=' 6' + # RPi 32-bit + Odroid N2+C4 do not use X to start Kodi + [[ $G_HW_MODEL -le 9 && $(dpkg --print-architecture) == 'armhf' || $G_HW_MODEL == 1[56] ]] || aSOFTWARE_DEPS[$software_id]+=' 6' # Only RPi + Odroid + x86_64 for ((i=22; i<=$MAX_G_HW_MODEL; i++)) do @@ -690,14 +690,14 @@ INDEX_BROWSER_TARGET=$INDEX_BROWSER_TARGET" software_id=44 aSOFTWARE_NAME[$software_id]='Transmission' - aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (c)' + aSOFTWARE_DESC[$software_id]='BitTorrent server with web interface (C)' aSOFTWARE_CATX[$software_id]=3 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/bittorrent/#transmission' #------------------ software_id=45 aSOFTWARE_NAME[$software_id]='Deluge' - aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (python)' + aSOFTWARE_DESC[$software_id]='BitTorrent server with web interface (Python)' aSOFTWARE_CATX[$software_id]=3 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/bittorrent/#deluge' #------------------ @@ -711,7 +711,7 @@ INDEX_BROWSER_TARGET=$INDEX_BROWSER_TARGET" software_id=107 aSOFTWARE_NAME[$software_id]='rTorrent' - aSOFTWARE_DESC[$software_id]='bittorrent server with rutorrent web interface' + aSOFTWARE_DESC[$software_id]='BitTorrent server with rutorrent web interface' aSOFTWARE_CATX[$software_id]=3 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/bittorrent/#rtorrent' aSOFTWARE_DEPS[$software_id]='89 170 webserver' @@ -744,17 +744,6 @@ INDEX_BROWSER_TARGET=$INDEX_BROWSER_TARGET" # Pre-compiling required on ARM (( $G_HW_ARCH > 9 )) || aSOFTWARE_DEPS[$software_id]+=' 16' #------------------ - software_id=142 - - aSOFTWARE_NAME[$software_id]='CouchPotato' - aSOFTWARE_DESC[$software_id]='automatically download movies' - aSOFTWARE_CATX[$software_id]=3 - aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/bittorrent/#couchpotato' - aSOFTWARE_DEPS[$software_id]='16 17' - # Python 2 only, hence not supported on Bullseye - aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 - aSOFTWARE_AVAIL_G_DISTRO[$software_id,7]=0 - #------------------ software_id=144 aSOFTWARE_NAME[$software_id]='Sonarr' @@ -1925,7 +1914,7 @@ INDEX_BROWSER_TARGET=$INDEX_BROWSER_TARGET" software_id=150 aSOFTWARE_NAME[$software_id]='Mono' - aSOFTWARE_DESC[$software_id]='runtime libraries and repo' + aSOFTWARE_DESC[$software_id]='Runtime libraries and repository' aSOFTWARE_CATX[$software_id]=26 # Text Editors @@ -2168,7 +2157,7 @@ INDEX_BROWSER_TARGET=$INDEX_BROWSER_TARGET" fi fi - # Skip if dependency is marked for install aleady + # Skip if dependency is marked for install already (( ${aSOFTWARE_INSTALL_STATE[$j]} == 1 )) && continue # Is it reinstalled or freshly installed? @@ -2405,7 +2394,7 @@ Exec=/var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh Icon=/var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png _EOF_ - # Add execute permissions to prevent "untrusted" prompt in MATE and possibily other desktops + # Add execute permissions to prevent "untrusted" prompt in MATE and possibly other desktops G_EXEC chmod +x /usr/share/applications/*.desktop /var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh G_THREAD_WAIT @@ -2456,7 +2445,7 @@ _EOF_ local gigabit_device=1 (( $G_HW_MODEL < 4 || $G_HW_MODEL == 40 || $G_HW_MODEL == 60 || $G_HW_MODEL == 70 )) && gigabit_device=0 - # Cache size (MB) 1/10th of total mem + # Cache size (MiB) 1/10th of total memory if (( $1 == 0 )); then output=$(( $RAM_PHYS / 10 )) @@ -2538,7 +2527,7 @@ _EOF_ # no_check_url=[01] = Optionally disable URL check # dps_index=$software_id = Download from DietPi GitHub repo based on software ID/index # DEPS_LIST='pkg1 ...' = Install APT dependency packages - # NB: This does not support installs that require user input (eg: a whiptail prompt for deb installs) + # NB: This does not support installs that require user input (e.g.: a whiptail prompt for deb installs) Download_Install(){ # Verify input URL @@ -2741,7 +2730,7 @@ _EOF_ Banner_Installing - # Get chosen soundcard + # Get chosen sound card local soundcard=$(sed -n '/^[[:blank:]]*CONFIG_SOUNDCARD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) soundcard=${soundcard:-none} @@ -2770,7 +2759,7 @@ _EOF_ # On Stretch x86_64 kernel, /dev/dri/card0 is as well not available reliably, observed on VirtualBox VM. (( $G_HW_MODEL < 10 || ( $G_HW_ARCH == 10 && $G_DISTRO < 5 ) )) && DEPS_LIST+=' xserver-xorg-video-fbdev' - # On VM, add VMware display driver, which offers slightly better performance. VirtualBox can emulate it as well, which es even the nowadays recommended default. + # On VM, add VMware display driver, which offers slightly better performance. VirtualBox can emulate it as well, which is even the nowadays recommended default. (( $G_HW_MODEL == 20 )) && DEPS_LIST+=' xserver-xorg-video-vmware' # Disable DPMS and screen blanking @@ -3103,7 +3092,7 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" # Enable DietPi-RAMdisk G_EXEC systemctl enable dietpi-ramlog - # To assure a cleaned mountpoint we need to start RAMlog now + # To assure a cleaned mount point we need to start RAMlog now local acommand=('/boot/dietpi/func/dietpi-ramlog' '1') systemctl is-active dietpi-ramlog > /dev/null && acommand=('systemctl' 'stop' 'dietpi-ramlog') G_EXEC_DESC='Storing /var/log metadata to disk' G_EXEC "${acommand[@]}" @@ -3257,29 +3246,25 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" fi - software_id=150 # Mono runtime + software_id=150 # Mono if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing # https://www.mono-project.com/download/stable/#download-lin-debian - G_EXEC apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - - # On RPi use separate Raspbian repo: https://github.com/MichaIng/DietPi/issues/1023 - # Use Buster branch on Bullseye - if (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )); then - - G_EXEC eval "echo 'deb https://download.mono-project.com/repo/debian/ raspbian${G_DISTRO_NAME/bullseye/buster} main' > /etc/apt/sources.list.d/mono-xamarin.list" - - else - - G_EXEC eval "echo 'deb https://download.mono-project.com/repo/debian/ ${G_DISTRO_NAME/bullseye/buster} main' > /etc/apt/sources.list.d/mono-xamarin.list" - - fi + # APT key + G_EXEC curl -sSfL 'https://download.mono-project.com/repo/xamarin_ring.gpg' -o /etc/apt/trusted.gpg.d/dietpi-mono.gpg + # APT list + # - On RPi use separate Raspbian suite: https://github.com/MichaIng/DietPi/issues/1023 + local raspbian= + (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )) && raspbian='raspbian' + G_EXEC eval "echo 'deb https://download.mono-project.com/repo/debian/ $raspbian${G_DISTRO_NAME/bullseye/buster} main' > /etc/apt/sources.list.d/dietpi-mono.list" G_AGUP + + # APT package G_AGI mono-runtime mono-complete - rm -f /tmp/mono* # https://github.com/MichaIng/DietPi/issues/1877#issuecomment-403856446 + G_EXEC rm -f /tmp/mono* # https://github.com/MichaIng/DietPi/issues/1877#issuecomment-403856446 fi @@ -3650,7 +3635,7 @@ _EOF_ [[ $deflate && ! -f '/etc/lighttpd/conf-enabled/20-deflate.conf' ]] && G_EXEC lighty-enable-mod deflate # Enable mod_openssl, if flagged - [[ $openssl && ! -f '/etc/lighttpd/conf-enabled/10-ssl.conf' ]] && G_EXEC lighty-enable-mod openssl + [[ $openssl && ! -f '/etc/lighttpd/conf-enabled/10-ssl.conf' ]] && G_EXEC lighty-enable-mod ssl # Change webroot from /var/www/html to /var/www G_CONFIG_INJECT 'server.document-root' 'server.document-root = "/var/www"' /etc/lighttpd/lighttpd.conf @@ -3762,7 +3747,7 @@ _EOF_ Banner_Installing - # Stretch: Add Ondrejs PHP repository for latest PHP version (currently PHP7.3) + # Stretch: Add Ondrej's PHP repository for latest PHP version (currently PHP7.3) if (( $G_DISTRO < 5 )); then # Debian (+sury.org) armhf is not ARMv6 compatible: https://github.com/MichaIng/DietPi/issues/2794 @@ -4669,6 +4654,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf local platform='rpi1' # Include ID -1 + 0 (( $G_HW_MODEL > 1 )) && platform="rpi$G_HW_MODEL" /boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d + DEPS_LIST+=' libraspberrypi0' # - Odroid XU4: https://dietpi.com/meveric/pool/main/s/setup-odroid/ elif (( $G_HW_MODEL == 11 )); then @@ -4676,7 +4662,7 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf local platform='xu4' DEPS_LIST+=' malit628-odroid' - # - ASUS Tunker Board + # - ASUS Tinker Board elif (( $G_HW_MODEL == 52 )); then local platform='RK3288' @@ -4687,8 +4673,9 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf # Download Amiberry Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/amiberry_$platform.tar.bz2" - # Reinstall: Install new amiberry.conf as amiberry.conf_new, to preserve user settings + # Reinstall: Install new amiberry.conf as amiberry.conf_new, to preserve user settings and remove obsolete config file: https://github.com/midwan/amiberry/releases/tag/v2.25 [[ -f '/mnt/dietpi_userdata/amiberry/conf/amiberry.conf' ]] && G_EXEC mv amiberry/conf/amiberry.conf /mnt/dietpi_userdata/amiberry/conf/amiberry.conf_new + [[ -f '/mnt/dietpi_userdata/amiberry/conf/adfdir.conf' ]] && G_EXEC rm /mnt/dietpi_userdata/amiberry/conf/adfdir.conf # Move/Merge new instance in place G_EXEC cp -a amiberry /mnt/dietpi_userdata/ @@ -4696,6 +4683,26 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf # Cleanup G_EXEC_NOHALT=1 G_EXEC rm -R amiberry + # Service + cat << '_EOF_' > /etc/systemd/system/amiberry.service +[Unit] +Description=Amiberry Amiga Emulator (DietPi) +Documentation=https://github.com/midwan/amiberry/wiki + +[Service] +WorkingDirectory=/mnt/dietpi_userdata/amiberry +Environment=LD_LIBRARY_PATH=/mnt/dietpi_userdata/amiberry/lib +ExecStartPre=/bin/chvt 3 +ExecStart=/mnt/dietpi_userdata/amiberry/amiberry +ExecStopPost=/bin/chvt 1 + +[Install] +WantedBy=local-fs.target +_EOF_ + # Permissions: Enable access for kickstart uploads via file servers + G_EXEC chgrp dietpi /mnt/dietpi_userdata/amiberry/kickstarts + G_EXEC chmod 0775 /mnt/dietpi_userdata/amiberry/kickstarts + fi software_id=112 # DXX-Rebirth @@ -4810,8 +4817,80 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing + + # Packages G_AGI deluged deluge-web deluge-console + # Remove SysV service leftovers, installed by Debian APT package + Remove_SysV deluged 1 + [[ -d '/var/lib/deluged' ]] && G_EXEC rm -R /var/lib/deluged + [[ -d '/var/log/deluged' ]] && G_EXEC rm -R /var/log/deluged + + # User + Create_User -g dietpi -G debian-deluged -d /mnt/dietpi_userdata/deluge debian-deluged + + # Config + if [[ ! -f '/mnt/dietpi_userdata/deluge/.config/deluge/core.conf' ]] + then + [[ -d '/mnt/dietpi_userdata/deluge/.config/deluge' ]] || G_EXEC mkdir -p /mnt/dietpi_userdata/deluge/.config/deluge + + # Default configs + dps_index=$software_id Download_Install 'deluge.conf' /mnt/dietpi_userdata/deluge/.config/deluge/core.conf + dps_index=$software_id Download_Install 'deluge_web.conf' /mnt/dietpi_userdata/deluge/.config/deluge/web.conf + + # Apply optimised settings + # - Cache size in 16 KiB units + G_CONFIG_INJECT '"cache_size":' " \"cache_size\": $(( $(Optimise_BitTorrent 0) * 1024 / 16 ))," /mnt/dietpi_userdata/deluge/.config/deluge/core.conf + G_CONFIG_INJECT '"max_active_limit":' " \"max_active_limit\": $(Optimise_BitTorrent 1)'," /mnt/dietpi_userdata/deluge/.config/deluge/core.conf + G_CONFIG_INJECT '"max_active_downloading":' " \"max_active_downloading\": $(Optimise_BitTorrent 1)," /mnt/dietpi_userdata/deluge/.config/deluge/core.conf + G_CONFIG_INJECT '"max_connections_global":' " \"max_connections_global\": $(Optimise_BitTorrent 2)," /mnt/dietpi_userdata/deluge/.config/deluge/core.conf + G_CONFIG_INJECT '"max_upload_slots_global":' " \"max_upload_slots_global\": $(Optimise_BitTorrent 3)," /mnt/dietpi_userdata/deluge/.config/deluge/core.conf + + # Web UI access + local salt=$(tr -dc '0-9a-f' < /dev/random | head -c40) + GCI_PASSWORD=1 G_CONFIG_INJECT '"pwd_salt":' " \"pwd_salt\": $salt," /mnt/dietpi_userdata/deluge/.config/deluge/web.conf + GCI_PASSWORD=1 G_CONFIG_INJECT '"pwd_sha1":' " \"pwd_sha1\": $(echo -n "$salt$GLOBAL_PW" | sha1sum | mawk '{print $1}')," /mnt/dietpi_userdata/deluge/.config/deluge/web.conf + + # Remote access + > /mnt/dietpi_userdata/deluge/.config/deluge/auth + G_EXEC chmod 0600 /mnt/dietpi_userdata/deluge/.config/deluge/auth + echo "root:$GLOBAL_PW:10" > /mnt/dietpi_userdata/deluge/.config/deluge/auth + fi + + # Permissions + G_EXEC chown -R debian-deluged:root /mnt/dietpi_userdata/deluge + + # Service: https://github.com/deluge-torrent/deluge/blob/develop/packaging/systemd/deluged.service + cat << _EOF_ > /etc/systemd/system/deluged.service +[Unit] +Description=Deluge Daemon (DietPi) +Documentation=man:deluged + +[Service] +User=debian-deluged +UMask=002 +ExecStart=$(command -v deluged) -d + +[Install] +WantedBy=multi-user.target +_EOF_ + # https://github.com/deluge-torrent/deluge/blob/develop/packaging/systemd/deluge-web.service + # - Bullseye: deluge-web v2 requires the "-d" flag to stay in foreground, but v1 does not understand it yet + local flag= + (( $G_DISTRO < 6 )) || flag=' -d' + cat << _EOF_ > /etc/systemd/system/deluge-web.service +[Unit] +Description=Deluge Web UI (DietPi) +Documentation=man:deluge-web + +[Service] +User=debian-deluged +UMask=027 +ExecStart=$(command -v deluge-web)$flag + +[Install] +WantedBy=multi-user.target +_EOF_ fi software_id=115 # Webmin @@ -5169,7 +5248,7 @@ _EOF_ local url='https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh' G_CHECK_URL "$url" - # Check free available memory. Increase swap size to prevent gravity running out of mem. + # Check free available memory. Increase swap size to prevent gravity running out of memory. if (( $(free -m | mawk '/^Mem:/{print $7;exit}') < 512 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) then G_DIETPI-NOTIFY 2 'Increasing swap size to 512 MiB for running gravity.sh, please wait...\n' @@ -6122,7 +6201,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # Purge DKMS as it is not required and might mess with available kernel module dpkg-query -s wireguard-dkms &> /dev/null && G_AGP wireguard-dkms - # Install userspace tools only + # Install user space tools only G_AGI wireguard-tools iptables qrencode # Else, kernel headers and matching kernel image is required for wireguard-dkms to build the WireGuard kernel module @@ -6263,7 +6342,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi - software_id=37 # Shairport-Sync + software_id=37 # Shairport Sync if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6845,10 +6924,10 @@ _EOF_ Banner_Installing - # Prereqs + Motion + # Pre-reqs + Motion G_AGI v4l-utils python-pip python-dev curl libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev motion - # Motioneye + # MotionEye pip2 install -U pip setuptools wheel pip2 install -U motioneye @@ -7092,22 +7171,6 @@ WantedBy=multi-user.target _EOF_ fi - software_id=142 # CouchPotato - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Installing - - DEPS_LIST='libffi-dev libssl-dev python-lxml python-pip python-dev' - Download_Install 'https://github.com/CouchPotato/CouchPotatoServer/archive/master.tar.gz' - - [[ -d '/etc/couchpotato' ]] && rm -R /etc/couchpotato - G_EXEC mv CouchPotatoServer-master /etc/couchpotato - - pip2 install -U pip setuptools wheel - pip2 install -U pyopenssl - - fi - software_id=143 # Koel if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -7335,7 +7398,7 @@ ProtectHome=true PrivateDevices=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/opt/lidarr /mnt /media /var/log/lidarr /tmp +ReadWritePaths=-/opt/lidarr -/mnt -/media -/var/log/lidarr -/tmp [Install] WantedBy=multi-user.target @@ -7373,7 +7436,7 @@ _EOF_ fi - # ARM: Install known required Python modules via APT to avoid time-comsuming compiling and large build dependencies (on x86 pre-compiled wheels are available) + # ARM: Install known required Python modules via APT to avoid time-consuming compiling and large build dependencies (on x86 pre-compiled wheels are available) (( $G_HW_ARCH == 10 )) || G_AGI python3-{lxml,numpy} G_EXEC cd /opt/bazarr @@ -7767,11 +7830,57 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u software_id=166 # Audiophonics PI-SPC if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing + Banner_Installing # https://github.com/audiophonics/Raspberry-pwr-management + + [[ -d '/var/lib/dietpi/dietpi-software/installed/pi-spc' ]] || G_EXEC mkdir -p /var/lib/dietpi/dietpi-software/installed/pi-spc + cat << '_EOF_' > /var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh +#!/bin/dash + +echo 'Audiophonics PI-SPC: Shutdown script starting... +Asserting pins: +Shutdown : GPIO17=in, Low +Boot OK : GPIO22=out, High +Soft Shutdown : GPIO04=out, Low' + +gpio -g mode 04 out +gpio -g write 04 0 +gpio -g mode 17 in +gpio -g write 17 0 +gpio -g mode 22 out +gpio -g write 22 1 + +until [ $(gpio -g read 17) = 1 ] +do + sleep 0.25 +done + +echo 'Audiophonics PI-SPC: Shutting down system as requested...' +poweroff +exit 0 +_EOF_ + G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh + + cat << '_EOF_' > /etc/systemd/system/pi-spc.service +[Unit] +Description=Audiophonics PI-SPC (DietPi) - # Required for systemd-logind, used by dtoverlay=gpio-shutdown,gpio_pin=22,active_low=0 - # dtoverlay=gpio-poweroff,gpiopin=17 - G_AGI dbus +[Service] +StandardOutput=tty +ExecStart=/var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh + +[Install] +WantedBy=multi-user.target +_EOF_ + + # Alternative: Use native GPIO shutdown and poweroff device tree overlays + + # systemd-logind < dbus is required for the gpio-shutdown device tree overlay to trigger the shutdown. + #G_AGI dbus + #G_EXEC systemctl unmask systemd-logind + #G_EXEC systemctl start systemd-logind + + #G_CONFIG_INJECT 'dtoverlay=gpio-shutdown' 'dtoverlay=gpio-shutdown,gpio_pin=17,active_low=0,gpio_pull=down' /boot/config.txt + #G_CONFIG_INJECT 'dtoverlay=gpio-poweroff' 'dtoverlay=gpio-poweroff,gpiopin=22,active_low' /boot/config.txt fi @@ -8075,10 +8184,10 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u local ha_user='homeassistant' local ha_home="/home/$ha_user" local ha_pyenv_activation=". $ha_home/pyenv-activate.sh" - local ha_python_version='3.8.11' + local ha_python_version='3.9.7' G_DIETPI-NOTIFY 2 "Home Assistant user: $ha_user" - G_DIETPI-NOTIFY 2 "Home Assistent home: $ha_home" + G_DIETPI-NOTIFY 2 "Home Assistant home: $ha_home" G_DIETPI-NOTIFY 2 "pyenv activation: \"$ha_pyenv_activation\"" G_DIETPI-NOTIFY 2 "pyenv Python version: $ha_python_version" @@ -8096,8 +8205,8 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u # - All: gcc, libc6-dev, make, libssl-dev, zlib1g-dev for Python built and libbz2-dev, libreadline-dev, libsqlite3-dev to suppress warnings # - All: libffi-dev for cffi on ARMv6/7 and for python-slugify==4.0.1 on ARMv8/x86_64 DEPS_LIST="gcc libc6-dev make libssl-dev zlib1g-dev libffi-dev libbz2-dev libreadline-dev libsqlite3-dev $custom_apt_deps" - # - ARMv6/7: libjpeg-dev for Pillow and g++ for greenlet - [[ $G_HW_ARCH == [12] ]] && DEPS_LIST+=' libjpeg-dev g++' + # - ARMv6/7: libjpeg-dev for Pillow, g++ for greenlet and libopenjp2-7 + libtiff5 + libxcb1 for runtime + [[ $G_HW_ARCH == [12] ]] && DEPS_LIST+=' libjpeg-dev g++ libopenjp2-7 libtiff5 libxcb1' # Install pyenv to $ha_home G_EXEC mkdir -p $ha_home @@ -8670,7 +8779,7 @@ _EOF_ Banner_Configuration - # Custom confs, included by sites-enabled/default within server directive, while nginx/(conf.d|sites-enabled) is included by nginx.conf outside server directive + # Custom configs, included by sites-enabled/default within server directive, while nginx/(conf.d|sites-enabled) is included by nginx.conf outside server directive G_EXEC mkdir -p /etc/nginx/sites-dietpi G_BACKUP_FP /etc/nginx/nginx.conf @@ -8707,7 +8816,7 @@ _EOF_ sed -i "/pm.min_spare_servers = /c\pm.min_spare_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf sed -i "/pm.max_spare_servers = /c\pm.max_spare_servers = $G_HW_CPU_CORES" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf - # Enviroment settings + # Environment settings sed -i "/env\[HOSTNAME\]/c\env\[HOSTNAME\] = \$HOSTNAME" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf sed -i "/env\[PATH\]/c\env\[PATH\] = /usr/local/bin:/usr/bin:/bin" "$FP_PHP_BASE_DIR"/fpm/pool.d/www.conf @@ -8744,7 +8853,7 @@ _EOF_ # - OPcache G_CONFIG_INJECT 'opcache.enable[[:blank:]]*=' 'opcache.enable=1' $target_php_ini G_CONFIG_INJECT 'opcache.memory_consumption[[:blank:]]*=' "opcache.memory_consumption=$target_php_cachesize" $target_php_ini - # Assure that interned_strings_buffer is never larger than hald of memory_consumption: https://github.com/MichaIng/DietPi/issues/2293 + # Assure that interned_strings_buffer is never larger than half of memory_consumption: https://github.com/MichaIng/DietPi/issues/2293 (( $($PHP_NAME -i | mawk '/^opcache.interned_strings_buffer/{print $5;exit}') > $target_php_cachesize / 2 )) && G_CONFIG_INJECT 'opcache.interned_strings_buffer[[:blank:]]*=' "opcache.interned_strings_buffer=$(( $target_php_cachesize / 2 ))" $target_php_ini G_CONFIG_INJECT 'opcache.revalidate_freq[[:blank:]]*=' 'opcache.revalidate_freq=60' $target_php_ini # 1 minute # - APCu @@ -9443,7 +9552,7 @@ The install script will now exit. After applying one of the the above, rerun die G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf G_EXEC usermod -aG redis www-data G_EXEC systemctl restart redis-server - # - Enable Nextloud to use Redis socket: + # - Enable Nextcloud to use Redis socket: G_CONFIG_INJECT "'filelocking.enabled'" "'filelocking.enabled' => true," $config_php "'memcache.local'" local redis_sock=$(grep -m1 '^[[:blank:]]*unixsocket[[:blank:]]' $redis_conf | mawk '{print $2}') # Re-estimate in case of existing custom path GCI_PRESERVE=1 GCI_NEWLINE=1 G_CONFIG_INJECT "'memcache.locking'" "'memcache.locking' => '\\\\OC\\\\Memcache\\\\Redis',\n'redis' => array ('host' => '$redis_sock', 'port' => 0,)," $config_php "'filelocking.enabled'" @@ -9451,7 +9560,7 @@ The install script will now exit. After applying one of the the above, rerun die # Tweak Argon2 hashing # - Use all available CPU threads GCI_PRESERVE=1 G_CONFIG_INJECT "'hashingThreads'" "'hashingThreads' => ${G_HW_CPU_CORES}," $config_php "'version'" - # - ToDo: Configure the other settings after getting some clarifiations: https://github.com/nextcloud/server/pull/19023#issuecomment-660071524 + # - ToDo: Configure the other settings after getting some clarifications: https://github.com/nextcloud/server/pull/19023#issuecomment-660071524 #GCI_PRESERVE=1 G_CONFIG_INJECT "'hashingMemoryCost'" "'hashingMemoryCost' => 65536," $config_php "'hashingThreads'" #GCI_PRESERVE=1 G_CONFIG_INJECT "'hashingTimeCost'" "'hashingTimeCost' => 4," $config_php "'hashingMemoryCost'" @@ -9486,7 +9595,7 @@ The install script will now exit. After applying one of the the above, rerun die Remove_SysV coturn 1 - # Disable coturn logging by default, this can be overridden via /etc/turnserver.conf + # Disable Coturn logging by default, this can be overridden via /etc/turnserver.conf G_EXEC mkdir -p /etc/systemd/system/coturn.service.d echo -e "[Service]\nExecStart=\n$(grep -m1 "^[[:blank:]]*ExecStart=" /lib/systemd/system/coturn.service) -l stdout --no-stdout-log --simple-log" > /etc/systemd/system/coturn.service.d/dietpi-logging.conf @@ -9763,7 +9872,7 @@ _EOF_ # Lower MPD buffer size to reduce latency of spectrum: sed -i '/audio_buffer_size /c\audio_buffer_size "384"' /etc/mpd.conf - # fifo stream for mpd + # FIFO stream for mpd if ! grep -q '/tmp/mpd.fifo' /etc/mpd.conf; then cat << '_EOF_' >> /etc/mpd.conf @@ -9902,43 +10011,13 @@ _EOF_ fi - software_id=108 # Amiberry - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - # Reinstall: Remove obsolete config file: https://github.com/midwan/amiberry/releases/tag/v2.25 - [[ -f '/mnt/dietpi_userdata/amiberry/conf/adfdir.conf' ]] && G_EXEC rm /mnt/dietpi_userdata/amiberry/conf/adfdir.conf - - # Service - cat << '_EOF_' > /etc/systemd/system/amiberry.service -[Unit] -Description=Amiberry Amiga Emulator (DietPi) -Documentation=https://github.com/midwan/amiberry/wiki - -[Service] -WorkingDirectory=/mnt/dietpi_userdata/amiberry -Environment=LD_LIBRARY_PATH=/mnt/dietpi_userdata/amiberry/lib -ExecStartPre=/bin/chvt 3 -ExecStart=/mnt/dietpi_userdata/amiberry/amiberry -ExecStopPost=/bin/chvt 1 - -[Install] -WantedBy=local-fs.target -_EOF_ - # Permissions: Enable access for kickstart uploads via file servers - G_EXEC chown :dietpi /mnt/dietpi_userdata/amiberry/kickstarts - G_EXEC chmod 0775 /mnt/dietpi_userdata/amiberry/kickstarts - - fi - software_id=112 # DXX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration # Symlink savegames to root - # - Remove existing syslinks + # - Remove existing symlinks G_EXEC rm -Rf /root/.d{1,2}x-rebirth G_EXEC ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_1_profiles /root/.d1x-rebirth @@ -10003,7 +10082,7 @@ ExecStop=/var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh stop [Install] WantedBy=multi-user.target _EOF_ - # Replace confs with /var/www to /var/www/rpicam, once + # Replace configs with /var/www to /var/www/rpicam, once if ! grep -q '/rpicam' /etc/raspimjpeg; then G_EXEC sed -i 's#/var/www#/var/www/rpicam#g' /etc/raspimjpeg @@ -10024,87 +10103,6 @@ _EOF_ fi - software_id=45 # Deluge - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - # User - Create_User -G dietpi -d /mnt/dietpi_userdata/deluge debian-deluged - - # Dirs - G_EXEC mkdir -p /mnt/dietpi_userdata/deluge/.config/deluge /var/log/deluged - - # Service: https://git.deluge-torrent.org/deluge/tree/packaging/systemd/deluged.service - cat << _EOF_ > /etc/systemd/system/deluged.service -[Unit] -Description=Deluge Daemon (DietPi) -Documentation=man:deluged - -[Service] -User=debian-deluged -Group=dietpi -UMask=002 -ExecStart=$(command -v deluged) -d -l /var/log/deluged/daemon.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 UI (DietPi) -Documentation=man:deluge-web - -[Service] -User=debian-deluged -UMask=027 -ExecStart=$(command -v deluge-web) -l /var/log/deluged/web.log -L warning -Restart=on-failure - -[Install] -WantedBy=multi-user.target -_EOF_ - # 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 '/mnt/dietpi_userdata/deluge/.config/deluge/core.conf' ]]; then - - # Copy DietPi configs - dps_index=$software_id Download_Install 'deluge.conf' /mnt/dietpi_userdata/deluge/.config/deluge/core.conf - dps_index=$software_id Download_Install 'deluge_web.conf' /mnt/dietpi_userdata/deluge/.config/deluge/web.conf - - # Set remote access login details - echo "root:$GLOBAL_PW:10" > /mnt/dietpi_userdata/deluge/.config/deluge/auth - - # Apply optimised settings - # - Cache size is in steps of 16 KiB. (Cache size * 16 = total KiB) - sed -i '/"cache_size": /c\ "cache_size": '$(( $(Optimise_BitTorrent 0) * 1024 / 16 ))',' /mnt/dietpi_userdata/deluge/.config/deluge/core.conf - sed -i '/"max_active_limit": /c\ "max_active_limit": '"$(Optimise_BitTorrent 1)"',' /mnt/dietpi_userdata/deluge/.config/deluge/core.conf - sed -i '/"max_active_downloading": /c\ "max_active_downloading": '"$(Optimise_BitTorrent 1)"',' /mnt/dietpi_userdata/deluge/.config/deluge/core.conf - sed -i '/"max_connections_global": /c\ "max_connections_global": '"$(Optimise_BitTorrent 2)"',' /mnt/dietpi_userdata/deluge/.config/deluge/core.conf - sed -i '/"max_upload_slots_global": /c\ "max_upload_slots_global": '"$(Optimise_BitTorrent 3)"',' /mnt/dietpi_userdata/deluge/.config/deluge/core.conf - - fi - - # Remove sysvinit service leftovers, installed by Debian APT package - Remove_SysV deluged 1 - [[ -d '/var/lib/deluged' ]] && rm -R /var/lib/deluged - - # Permissions - chown -R debian-deluged:debian-deluged /mnt/dietpi_userdata/deluge - chown -R debian-deluged /var/log/deluged - - fi - software_id=115 # Webmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -10229,10 +10227,6 @@ _EOF_ # Set web interface PW: https://github.com/MichaIng/DietPi/issues/662 pihole -a -p "$GLOBAL_PW" - # Pi-hole: Whitelist domain of GEO IP API we use in banner and DietPi-VPN as this is part of public blocklists: https://github.com/MichaIng/DietPi/pull/4398#issuecomment-845477200 - G_DIETPI-NOTIFY 2 'Whitelisting "freegeoip.app", which is used by dietpi-banner and dietpi-vpn to obtain your public IP and location...' - pihole -w freegeoip.app --comment 'Used by dietpi-banner and dietpi-vpn to obtain your public IP and location' - # Reduce long-term database TTL: https://github.com/MichaIng/DietPi-Docs/issues/476 G_DIETPI-NOTIFY 2 'The DNS query database logging duration is reduced to 2 days. If you require long-term query logs, read our docs about how to change the log duration: - https://dietpi.com/docs/software/dns_servers/#pi-hole' @@ -11078,7 +11072,7 @@ _EOF_ echo -e 'net.ipv4.ip_forward=1\nnet.ipv6.conf.all.forwarding=1\nnet.ipv6.conf.default.forwarding=1' > /etc/sysctl.d/dietpi-openvpn.conf sysctl net.ipv4.ip_forward=1 net.ipv6.conf.all.forwarding=1 net.ipv6.conf.default.forwarding=1 - # Web Fowarding (Setup IPtables, must also be run during boot) + # Web Forwarding (Setup IPtables, must also be run during boot) #iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$(mawk 'NR==3' /run/dietpi/.network)" -j MASQUERADE aSTART_SERVICES+=('openvpn') @@ -11504,7 +11498,7 @@ _EOF_ # Update apt package stats /usr/share/rpimonitor/scripts/updatePackagesStatus.pl - # USB drive stats implimentation by Rich + # USB drive stats implementation by Rich if findmnt -S /dev/sda1 > /dev/null; then sed -i '\/include=\/etc\/rpimonitor\/template\/sdcard.conf/a include=\/etc\/rpimonitor\/template\/usb_hdd.conf' /etc/rpimonitor/data.conf @@ -11754,7 +11748,7 @@ ProtectSystem=full PrivateDevices=yes PrivateTmp=yes NoNewPrivileges=true -ReadWritePaths=/etc/gogs +ReadWritePaths=-/etc/gogs [Install] WantedBy=multi-user.target @@ -12159,7 +12153,7 @@ _EOF_ # - Prevent unlimited restarts on failure: Permit up to three restarts in 10 minutes G_CONFIG_INJECT 'StartLimitIntervalSec=' 'StartLimitIntervalSec=600' /etc/systemd/system/medusa.service '\[Unit\]' G_CONFIG_INJECT 'StartLimitBurst=' 'StartLimitBurst=3' /etc/systemd/system/medusa.service 'StartLimitIntervalSec=' - # - Remove "Group=medusa" which does not exist, instead fallback to prinmary group "dietpi" + # - Remove "Group=medusa" which does not exist, instead fallback to primary group "dietpi" G_EXEC sed -i '/^[[:blank:]]*Group=/d' /etc/systemd/system/medusa.service # - Launch from our install and data directory G_CONFIG_INJECT 'ExecStart=' "ExecStart=$(command -v python3) /mnt/dietpi_userdata/medusa/start.py -q --nolaunch --datadir=/mnt/dietpi_userdata/medusa" /etc/systemd/system/medusa.service @@ -12608,7 +12602,7 @@ PrivateTmp=true PrivateDevices=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/mnt/dietpi_userdata/firefox-sync +ReadWritePaths=-/mnt/dietpi_userdata/firefox-sync [Install] WantedBy=multi-user.target @@ -12678,7 +12672,7 @@ ProtectHome=true ProtectSystem=strict # Only allow writes to the following directory and set it to the working directory (user and password data are stored here) WorkingDirectory=/mnt/dietpi_userdata/vaultwarden -ReadWritePaths=/mnt/dietpi_userdata/vaultwarden +ReadWritePaths=-/mnt/dietpi_userdata/vaultwarden # Allow vaultwarden to bind ports in the range of 0-1024 AmbientCapabilities=CAP_NET_BIND_SERVICE @@ -12687,23 +12681,6 @@ WantedBy=multi-user.target _EOF_ fi - software_id=142 # CouchPotato - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - G_EXEC cp /etc/couchpotato/init/ubuntu.default /etc/default/couchpotato - sed -i '/CP_USER=/c\CP_USER=root' /etc/default/couchpotato - sed -i '/CP_HOME=/c\CP_HOME=/etc/couchpotato' /etc/default/couchpotato - sed -i '/CP_DATA=/c\CP_DATA=/mnt/dietpi_userdata/couchpotato' /etc/default/couchpotato - - G_EXEC mkdir -p /mnt/dietpi_userdata/couchpotato - #Create_User -d /mnt/dietpi_userdata/couchpotato couchpotato - - G_EXEC cp /etc/couchpotato/init/ubuntu /etc/init.d/couchpotato - - fi - software_id=143 # Koel if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -12803,7 +12780,7 @@ ProtectHome=true PrivateDevices=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/usr/lib/sonarr /mnt /media /var/log/sonarr /tmp +ReadWritePaths=-/usr/lib/sonarr -/mnt -/media -/var/log/sonarr -/tmp [Install] WantedBy=multi-user.target @@ -12854,7 +12831,7 @@ ProtectHome=true PrivateDevices=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/opt/radarr /mnt /media /var/log/radarr /tmp +ReadWritePaths=-/opt/radarr -/mnt -/media -/var/log/radarr -/tmp [Install] WantedBy=multi-user.target @@ -12906,7 +12883,7 @@ PrivateDevices=true PrivateTmp=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/opt/bazarr /mnt /media /var/log/bazarr /tmp +ReadWritePaths=-/opt/bazarr -/mnt -/media -/var/log/bazarr -/tmp [Install] WantedBy=multi-user.target @@ -13013,7 +12990,7 @@ PrivateDevices=true PrivateTmp=true ProtectKernelTunables=true ProtectControlGroups=true -ReadWritePaths=/opt/jackett +ReadWritePaths=-/opt/jackett [Install] WantedBy=multi-user.target @@ -13307,14 +13284,14 @@ _EOF_ G_EXEC systemctl daemon-reload G_EXEC systemctl restart docker - # Check for existing portainer container + # Check for existing Portainer container local container=$(docker ps -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $1;exit}') [[ $container ]] && G_EXEC docker rm -f "$container" local image=$(docker images -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $3;exit}') [[ $image ]] && G_EXEC docker rmi "$image" docker volume ls -q | grep -q '^portainer_data$' || G_EXEC docker volume create portainer_data - # Deploy the portainer container + # Deploy the Portainer container G_DIETPI-NOTIFY 2 'Portainer will be deployed now. This could take a while...' G_EXEC_OUTPUT=1 G_EXEC docker run -d -p 9002:9000 --name=portainer --restart=always -v /run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce @@ -13350,7 +13327,7 @@ _EOF_ Banner_Configuration - # Conig file to autostart -- english default + # Config file to autostart -- english default G_EXEC curl -sSfLo /usr/local/bin/nukkit/nukkit.yml 'https://github.com/Nukkit/Languages/raw/master/eng/nukkit.yml' # Service @@ -13468,57 +13445,6 @@ WantedBy=multi-user.target _EOF_ fi - software_id=166 # Audiophonics PI-SPC - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - G_EXEC mkdir -p /var/lib/dietpi/dietpi-software/installed/pi-spc - cat << '_EOF_' > /var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh -#!/bin/dash - -TICKRATE='0.25' - -echo 'Audiophonics PI-SPC: Shutdown script starting... -Asserting pins : -ShutDown : GPIO17=in, Low -BootOK : GPIO22=out, High -SoftSD : GPIO04=out, Low' - -gpio -g mode 04 out -gpio -g write 04 0 -gpio -g mode 17 in -gpio -g write 17 0 -gpio -g mode 22 out -gpio -g write 22 1 - -until [ $(gpio -g read 17) = 1 ] -do - sleep $TICKRATE -done - -echo 'Audiophonics PI-SPC: Power off requested. Shutting down system.' -poweroff -exit 0 -_EOF_ - G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh - - cat << '_EOF_' > /etc/systemd/system/pi-spc.service -[Unit] -Description=Audiophonics PI-SPC (DietPi) - -[Service] -StandardOutput=tty -ExecStart=/var/lib/dietpi/dietpi-software/installed/pi-spc/sds.sh - -[Install] -WantedBy=multi-user.target -_EOF_ - #G_CONFIG_INJECT 'dtoverlay=gpio-shutdown' 'dtoverlay=gpio-shutdown,gpio_pin=22,active_low=0' /boot/config.txt - #G_CONFIG_INJECT 'dtoverlay=gpio-poweroff' 'dtoverlay=gpio-poweroff,gpio_pin=17' /boot/config.txt - - fi - software_id=169 # Google AIY if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -14447,26 +14373,6 @@ _EOF_ [[ -d '/var/cache/unbound' ]] && rm -R /var/cache/unbound fi - software_id=142 # CouchPotato - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - - Banner_Uninstalling - if [[ -f '/etc/init.d/couchpotato' ]]; then - - systemctl unmask couchpotato - systemctl disable --now couchpotato - rm /etc/init.d/couchpotato - update-rc.d -f couchpotato remove - - fi - [[ -d '/etc/systemd/system/couchpotato.service.d' ]] && rm -R /etc/systemd/system/couchpotato.service.d - getent passwd couchpotato > /dev/null && userdel couchpotato # Currently not created - getent group couchpotato > /dev/null && groupdel couchpotato # Currently not created - [[ -d '/etc/couchpotato' ]] && rm -R /etc/couchpotato - [[ -d '/mnt/dietpi_userdata/couchpotato' ]] && rm -R /mnt/dietpi_userdata/couchpotato - - fi - software_id=143 # Koel if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -14634,7 +14540,8 @@ _EOF_ Banner_Uninstalling apt-mark auto mono-complete mono-devel mono-runtime libmono-cil-dev 2>/dev/null - [[ -f '/etc/apt/sources.list.d/mono-xamarin.list' ]] && rm /etc/apt/sources.list.d/mono-xamarin.list + [[ -f '/etc/apt/sources.list.d/dietpi-mono.list' ]] && G_EXEC rm /etc/apt/sources.list.d/dietpi-mono.list + [[ -f '/etc/apt/trusted.gpg.d/dietpi-mono.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-mono.gpg fi @@ -14646,7 +14553,7 @@ _EOF_ fi - software_id=37 # Shairport-Sync + software_id=37 # Shairport Sync if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -14861,22 +14768,22 @@ _EOF_ Banner_Uninstalling if [[ -f '/etc/systemd/system/deluge-web.service' ]]; then - systemctl disable --now deluge-web - rm -R /etc/systemd/system/deluge-web.service* + G_EXEC systemctl disable --now deluge-web + G_EXEC rm /etc/systemd/system/deluge-web.service fi - [[ -d '/etc/systemd/system/deluge-web.service.d' ]] && rm -R /etc/systemd/system/deluge-web.service.d + [[ -d '/etc/systemd/system/deluge-web.service.d' ]] && G_EXEC rm -R /etc/systemd/system/deluge-web.service.d if [[ -f '/etc/systemd/system/deluged.service' ]]; then - systemctl disable --now deluged - rm -R /etc/systemd/system/deluged.service* + G_EXEC systemctl disable --now deluged + G_EXEC rm /etc/systemd/system/deluged.service fi - [[ -d '/etc/systemd/system/deluged.service.d' ]] && rm -R /etc/systemd/system/deluged.service.d + [[ -d '/etc/systemd/system/deluged.service.d' ]] && G_EXEC rm -R /etc/systemd/system/deluged.service.d + [[ -d '/mnt/dietpi_userdata/deluge' ]] && G_EXEC rm -R /mnt/dietpi_userdata/deluge G_AGP deluged deluge-web deluge-console - getent passwd debian-deluged > /dev/null && userdel debian-deluged - getent group debian-deluged > /dev/null && groupdel debian-deluged - [[ -d '/mnt/dietpi_userdata/deluge' ]] && rm -R /mnt/dietpi_userdata/deluge + getent passwd debian-deluged > /dev/null && G_EXEC userdel debian-deluged + getent group debian-deluged > /dev/null && G_EXEC groupdel debian-deluged fi @@ -15341,7 +15248,7 @@ _EOF_ [[ -f '/etc/default/isc-dhcp-server' ]] && rm /etc/default/isc-dhcp-server [[ -f '/etc/etc/default/hostapd' ]] && rm /etc/default/hostapd [[ -f '/etc/iptables.ipv4.nat' ]] && rm /etc/iptables.ipv4.nat - # Remove binary (used a -f trigger to detect wifi hotspot mode in dietpi-config). + # Remove binary (used a -f trigger to detect WiFi hotspot mode in dietpi-config). [[ -f '/usr/sbin/hostapd' ]] && rm /usr/sbin/hostapd [[ -f '/usr/sbin/hostapd_cli' ]] && rm /usr/sbin/hostapd_cli @@ -15444,7 +15351,7 @@ _EOF_ Banner_Uninstalling # Remove webserver configs - # - Ligttpd + # - Lighttpd if [[ -f '/etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf' ]]; then command -v lighty-disable-mod > /dev/null && lighty-disable-mod dietpi-dav_redirect @@ -15733,8 +15640,7 @@ _EOF_ fi - # DXX-Rebirth - software_id=112 + software_id=112 # DXX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -15754,12 +15660,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - - rm /etc/chromium.d/custom_flags - rm /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh - rm /root/.chromium-browser.init - + # Package G_AGP 'chromium*' + # Files + [[ -d '/etc/chromium.d' ]] && G_EXEC rm -R /etc/chromium.d + [[ -f '/root/.chromium-browser.init' ]] && G_EXEC rm /root/.chromium-browser.init + [[ -f '/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh' ]] && G_EXEC rm /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh + # Autostart index: If currently Chromium, revert to console login + [[ -f '/boot/dietpi/.dietpi-autostart_index' && $(&1); } Check_Connected() { diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 42a55a4124..d3dbdaa121 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -227,7 +227,7 @@ $GREEN_LINE" # LAN IP [5] Print_Local_Ip # WAN IP + location info: Move this to /run/dietpi/.network? - (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(G_GET_WAN_IP)" + (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(G_GET_WAN_IP 2>&1)" # DietPi-VPN connection status (( ${aENABLED[13]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[13]} $GREEN_SEPARATOR $(/boot/dietpi/dietpi-vpn status 2>&1)" # Freespace (RootFS) @@ -235,14 +235,14 @@ $GREEN_LINE" # Freespace (DietPi userdata) (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" # Weather - (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 3 https://wttr.in/?format=4 2>&1)" + (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 3 'https://wttr.in/?format=4' 2>&1)" # Custom [[ ${aENABLED[10]} == 1 && -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash $FP_CUSTOM 2>&1)" # MOTD if (( ${aENABLED[12]} == 1 )); then local motd fp_motd='/run/dietpi/.dietpi_motd' - [[ -f $fp_motd ]] || curl -sSfLm 3 https://dietpi.com/motd -o $fp_motd + [[ -f $fp_motd ]] || curl -sSfLm 3 'https://dietpi.com/motd' -o $fp_motd [[ -f $fp_motd ]] && . $fp_motd &> /dev/null && [[ $motd ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" fi diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 5e096fd903..36754dfa33 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -56,8 +56,8 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=7 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=6 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=2 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=7 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch @@ -1020,6 +1020,82 @@ $log_content" || break # Exit error handler menu loop on cancel } + #----------------------------------------------------------------------------------- + # Multithreading handler + #----------------------------------------------------------------------------------- + # Not yet compatible with dietpi global commands. single bash commands only with no error handling. + G_THREAD_START(){ + + # Run in blocking mode + if [[ $G_THREADING_ENABLED == 0 ]]; then + + G_DIETPI-NOTIFY 2 "G_THREADING disabled, running command in blocking mode | $*" + "$@" + + # Launch as background process + else + + [[ $G_THREAD_COUNT =~ ^[0-9]+$ ]] || G_THREAD_COUNT=-1 + ((G_THREAD_COUNT++)) + G_THREAD_COMMAND[$G_THREAD_COUNT]=$* # Store for later output with G_THREAD_WAIT + + echo -1337 > "/tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT" + { { G_INTERACTIVE=0 "$@" &> "/tmp/.G_THREAD_COMMAND_$G_THREAD_COUNT"; echo $? > "/tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT"; } & disown; } &> /dev/null + + G_DIETPI-NOTIFY 2 "G_THREAD_START_$G_THREAD_COUNT | $*" + + fi + + } + + G_THREAD_WAIT(){ + + #local wait_for_specific_thread_pid=-1 + #[[ $1 ]] && wait_for_specific_thread_pid=$1 + + local i waiting_for exit_code + + # Wait until all theads finished + while : + do + for i in "${!G_THREAD_COMMAND[@]}" + do + [[ -f /tmp/.G_THREAD_EXITCODE_$i && $(<"/tmp/.G_THREAD_EXITCODE_$i") == '-1337' ]] || continue + # Print what we are waiting for, update processing message if thread changed since last loop + [[ $waiting_for == "$i" ]] || G_DIETPI-NOTIFY -2 "G_THREAD_WAIT_$i | ${G_THREAD_COMMAND[$i]}" + waiting_for=$i + sleep 1 + continue 2 + done + + break + done + + G_DIETPI-NOTIFY 0 'G_THREAD: All threads finished' + + # Check all thread's exit codes for issues + for i in "${!G_THREAD_COMMAND[@]}" + do + if [[ -r /tmp/.G_THREAD_EXITCODE_$i ]]; then + + exit_code=$(<"/tmp/.G_THREAD_EXITCODE_$i") + (( $exit_code )) && G_WHIP_MSG "G_THREAD ERROR:\n - Command = ${G_THREAD_COMMAND[$i]}\n - Exit code = $exit_code\n\n$(<"/tmp/.G_THREAD_COMMAND_$i")" + + else + + G_DIETPI-NOTIFY 2 "DEBUG: /tmp/.G_THREAD_EXITCODE_$i does not exist or is not readable" + + fi + done + + rm -f /tmp/.G_THREAD* + unset -v G_THREAD_COUNT G_THREAD_COMMAND + + } + + #----------------------------------------------------------------------------------- + # Network connection checks + #----------------------------------------------------------------------------------- # General network connection check # - Checks general network connectivity by pinging a raw IP that must be publicly reachable at all time. # - Uses the given input argument as IP to test against, else CONFIG_CHECK_CONNECTION_IP from dietpi.txt, else defaults to 9.9.9.9 (Quad9 DNS IP). @@ -1160,6 +1236,144 @@ $log_content" || break # Exit error handler menu loop on cancel } + #----------------------------------------------------------------------------------- + # Print network details + #----------------------------------------------------------------------------------- + # Commands: + # "gateway": Print the default gateway IP + # "iface": Print the interface name + # "ip": Print the IP address + # Options: + # "-4": Print info for interfaces with an IPv4 address only if available, else return 1 + # "-6": Print info for interfaces with an IPv6 address only if available, else return 1 + # "-t TYPE": Print info for interfaces of type TYPE only if available, else return 1 + # TYPE can be one of "eth" and "wlan". + # "-i IFACE": Print info for the network interface named IFACE only it present, else return 1 + # Notes: + # Info is shown for the one matching interface, following the following priorities: + # - 1. the interface which has the default gateway assigned + # - 2. the first interface with state "UP" + # - 3. the first interface with an IP address assigned + # - 4. the first available interface + # - If no interface exists, the function returns error 1. + # If not defined, IPv4 addresses are shown if available, else IPv6 addresses if available. + G_GET_NET() + { + # Grab input + local fam type iface command + while (( $# )) + do + case "$1" in + '-'[46]) fam=$1;; + '-t') shift; type=$1;; + '-i') shift; iface=$1;; + 'gateway'|'iface'|'ip') command=$1;; + *) G_DIETPI-NOTIFY 2 "An invalid argument \"${1:-}\" was given."; return 1;; + esac + shift + done + + # A command is required + [[ $command ]] || { G_DIETPI-NOTIFY 2 "No command was given."; return 1; } + + # Early return if given interface does not exists or does not match given type + if [[ $iface ]] + then + if [[ ! -e /sys/class/net/$iface ]] + then + G_DIETPI-NOTIFY 2 "The given interface \"$iface\" does not exist." + return 1 + + elif [[ $type && $iface != $type* ]] + then + G_DIETPI-NOTIFY 2 "The given interface \"$iface\" is not of type \"$type\"." + return 1 + fi + fi + + # Get default gateway if requested or no interface given + local ip if + if [[ $command == 'gateway' || ! $iface ]] + then + local gateway + [[ $fam != '-6' ]] && read -r gateway if < <(ip r l 0/0 ${iface:+dev "$iface"} | mawk '{print $3,$5;exit}') + [[ ! $gateway && $fam != '-4' ]] && read -r gateway if < <(ip -6 r l ::/0 ${iface:+dev "$iface"} | mawk '{print $3,$5;exit}') + + # ip r does not print the interface name if one was given, so used the given one to check for type. + [[ $iface ]] && if=$iface + + # Print default gateway if requested + if [[ $command == 'gateway' ]] + then + if [[ $gateway ]] + then + # Check for interface type + if [[ $type && $if != $type* ]] + then + G_DIETPI-NOTIFY 2 "The default gateway is not assigned to any interface of type \"$type\"." + return 1 + fi + echo "$gateway" + else + G_DIETPI-NOTIFY 2 "A default gateway${fam:+ for IPv${fam#-}}${iface:+ on interface \"$iface\"} does not exist." + return 1 + fi + return 0 + fi + + # Print interface/IP address if matching default gateway was found + if [[ $gateway && ( ! $type || $if == $type* ) ]] + then + iface=$if + [[ $command == 'ip' ]] && ip=$(ip -br $fam a s dev "$iface" | mawk '{print $3}') ip=${ip%/*} + echo "${!command}" + return 0 + fi + fi + + local state if_final ip_final + while read -r if state ip + do + [[ $type && $if != $type* ]] && continue + + # Return state UP + if [[ $state == 'UP' ]] + then + iface=$if + echo "${!command}" + return 0 + fi + + # Store info in separate variables to return if no UP state interface was found + if [[ $ip && ! $ip_final ]] + then + if_final=$if + ip_final=$ip + + elif [[ ! $if_final ]] + then + if_final=$if + fi + + done < <(ip -br $fam a ${iface:+s dev "$iface"}) + + # Return final values + iface=$if_final + ip=$ip_final ip=${ip%/*} + if [[ $command == 'ip' && ! $ip ]] + then + G_DIETPI-NOTIFY 2 "An interface${iface:+ named \"$iface\"}${type:+ of type \"$type\"} with an IP${fam:+v${fam#-}} address does not exist." + return 1 + + elif [[ $command == 'iface' && ! $iface ]] + then + G_DIETPI-NOTIFY 2 "An interface${iface:+ named \"$iface\"}${type:+ of type \"$type\"}${fam:+ with an IPv${fam#-} address} does not exist." + return 1 + fi + echo "${!command}" + return 0 + } + # Print public IP address and location info # - Optional arguments: # -t : Set timeout in seconds, supports floats, default: 3 @@ -1177,10 +1391,7 @@ $log_content" || break # Exit error handler menu loop on cancel esac shift done - local response=$(curl -sSfLm "$timeout" https://freegeoip.app/csv/ 2>&1 | mawk -F, '($5){r=$5" "}{print $1" "r$3}') - # https://github.com/MichaIng/DietPi/issues/4445 - [[ $response == 'curl: (60)'* ]] && response='freegeoip.app seems to be blocked via DNS, please add it to the whitelist to allow WAN IP retrieval.' - echo "$response" + curl -sSfLm "$timeout" 'https://dietpi.com/geoip' } # $1 = directory to test permissions support @@ -1731,99 +1942,6 @@ $log_content" || break # Exit error handler menu loop on cancel } - #----------------------------------------------------------------------------------- - # Multithreading handler - #----------------------------------------------------------------------------------- - # Not yet compatible with dietpi global commands. single bash commands only with no error handling. - G_THREAD_START(){ - - # Run in blocking mode - if [[ $G_THREADING_ENABLED == 0 ]]; then - - G_DIETPI-NOTIFY 2 "G_THREADING disabled, running command in blocking mode | $*" - "$@" - - # Launch as background process - else - - [[ $G_THREAD_COUNT =~ ^[0-9]+$ ]] || G_THREAD_COUNT=-1 - ((G_THREAD_COUNT++)) - G_THREAD_COMMAND[$G_THREAD_COUNT]=$* # Store for later output with G_THREAD_WAIT - - echo -1337 > "/tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT" - { { G_INTERACTIVE=0 "$@" &> "/tmp/.G_THREAD_COMMAND_$G_THREAD_COUNT"; echo $? > "/tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT"; } & disown; } &> /dev/null - - G_DIETPI-NOTIFY 2 "G_THREAD_START_$G_THREAD_COUNT | $*" - - fi - - } - - G_THREAD_WAIT(){ - - #local wait_for_specific_thread_pid=-1 - #[[ $1 ]] && wait_for_specific_thread_pid=$1 - - local i waiting_for exit_code - - # Wait until all theads finished - while : - do - for i in "${!G_THREAD_COMMAND[@]}" - do - [[ -f /tmp/.G_THREAD_EXITCODE_$i && $(<"/tmp/.G_THREAD_EXITCODE_$i") == '-1337' ]] || continue - # Print what we are waiting for, update processing message if thread changed since last loop - [[ $waiting_for == "$i" ]] || G_DIETPI-NOTIFY -2 "G_THREAD_WAIT_$i | ${G_THREAD_COMMAND[$i]}" - waiting_for=$i - sleep 1 - continue 2 - done - - break - done - - G_DIETPI-NOTIFY 0 'G_THREAD: All threads finished' - - # Check all thread's exit codes for issues - for i in "${!G_THREAD_COMMAND[@]}" - do - if [[ -r /tmp/.G_THREAD_EXITCODE_$i ]]; then - - exit_code=$(<"/tmp/.G_THREAD_EXITCODE_$i") - (( $exit_code )) && G_WHIP_MSG "G_THREAD ERROR:\n - Command = ${G_THREAD_COMMAND[$i]}\n - Exit code = $exit_code\n\n$(<"/tmp/.G_THREAD_COMMAND_$i")" - - else - - G_DIETPI-NOTIFY 2 "DEBUG: /tmp/.G_THREAD_EXITCODE_$i does not exist or is not readable" - - fi - done - - rm -f /tmp/.G_THREAD* - unset -v G_THREAD_COUNT G_THREAD_COMMAND - - } - - #----------------------------------------------------------------------------------- - # DEV tools (Not for public use! All mine! :D) - #----------------------------------------------------------------------------------- - # Restore backup and update DietPi to latest development branch code - # - Restore backup - # - Set dev branch - # - Reapply latest DietPi update - # - Update backup - G_DEV_1(){ - - G_CHECK_ROOT_USER 1 - export G_INTERACTIVE=0 - /boot/dietpi/dietpi-backup -1 - G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=dev' /boot/dietpi.txt - /boot/dietpi/dietpi-update -1 - /boot/dietpi/dietpi-backup 1 - unset -v G_INTERACTIVE - - } - # Apply and update to different branch G_DEV_BRANCH(){ @@ -1833,14 +1951,6 @@ $log_content" || break # Exit error handler menu loop on cancel } - # Automatically opt in to DietPi-Survey and run + send benchmark + data - G_DEV_BENCH(){ - - G_CONFIG_INJECT 'SURVEY_OPTED_IN=' 'SURVEY_OPTED_IN=1' /boot/dietpi.txt - G_INTERACTIVE=0 /boot/dietpi/func/dietpi-benchmark 2 - - } - # Inject setting into config file: First tries to replace old setting, else commented setting and otherwise adds to end of file. # Usage: # - $1 Setting pattern to find existing setting with grep extended regular expression support