From 65f0ace42ffd9e61c8bb9ebc5e82eaee08c86687 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Mar 2019 15:01:22 +0100 Subject: [PATCH 01/25] v6.22 + Raise RC version --- dietpi/server_version-6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 6537feb98a..6dccc4a2f2 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 22 -0 +1 From b37b39b4fb773901d593d87368ac210a29927ba3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Mar 2019 15:02:09 +0100 Subject: [PATCH 02/25] v6.22 + DietPi-Globals | Raise default RC version --- dietpi/func/dietpi-globals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index fae7f640c3..1588f5722e 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -64,7 +64,7 @@ G_GITOWNER=${G_GITOWNER:-MichaIng} G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-22} - G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-0} + G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-1} [[ -f '/DietPi/dietpi/.version' && $(sed -n 1p /DietPi/dietpi/.version) == '#!/bin/bash' ]] && . /DietPi/dietpi/.version G_VERSIONDB_SAVE(){ From ec240df71daf41afb5ad540f4f949b504f36d887 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Mar 2019 15:08:29 +0100 Subject: [PATCH 03/25] v6.22 + DietPi-Software | WireGuard: Add Rock64 kernel package besides headers (currently disabled anyway) --- dietpi/dietpi-software | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9576471ba3..1f9cebfc01 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4869,8 +4869,7 @@ _EOF_ fi - #WireGuard - software_id=172 + software_id=172 # WireGuard if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4910,7 +4909,7 @@ _EOF_ # - Rock64 elif (( $G_HW_MODEL == 43 )); then - kernel_packages='linux-headers-rockchip64' + kernel_packages='linux-image-rockchip64 linux-headers-rockchip64' fi @@ -4947,8 +4946,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #DietPi-NordVPN - software_id=171 + software_id=171 # DietPi-NordVPN if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4962,8 +4960,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #LETSENCRYPT - software_id=92 + software_id=92 # Let's Encrypt if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing From 2cacbfe7b2ee9fdec6ab628ea942140bce61a453 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Mon, 11 Mar 2019 18:05:37 +0100 Subject: [PATCH 04/25] v6.22 + DietPi-Benchmark | Survey settings now contain opt-in/out value only + DietPi-Benchmark | Failsafe survey opt-in/out value handling + DietPi-Benchmark | Add missing $FP_TEMP: Now the temp CPU benchmark script + results are stored in default working dir: /tmp/$G_PROGRAM_NAME --- dietpi/func/dietpi-benchmark | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark index 020e0766e3..4a1202fe80 100644 --- a/dietpi/func/dietpi-benchmark +++ b/dietpi/func/dietpi-benchmark @@ -46,6 +46,7 @@ BENCH_FILESIZE=${BENCH_FILESIZE:-0} #optional input for automated FP_BENCHFILE=${FP_BENCHFILE:-/} #optional input for automated + FP_TEMP="/tmp/$G_PROGRAM_NAME" # CPU benchmark files BENCH_ROOTFS_WRITE='Not tested' BENCH_ROOTFS_READ='Not tested' BENCH_RAM_WRITE='Not tested' @@ -60,11 +61,7 @@ Load_Results(){ - if [[ -f /var/lib/dietpi/dietpi-benchmark/results ]]; then - - . /var/lib/dietpi/dietpi-benchmark/results - - fi + [[ -f /var/lib/dietpi/dietpi-benchmark/results ]] && . /var/lib/dietpi/dietpi-benchmark/results } @@ -93,11 +90,7 @@ _EOF_ Update_Survey_Opted_Status(){ - if [[ -f /DietPi/dietpi/.dietpi-survey ]]; then - - SURVEY_OPTED_IN=$(sed -n 1p /DietPi/dietpi/.dietpi-survey) - - fi + [[ -f /DietPi/dietpi/.dietpi-survey ]] && SURVEY_OPTED_IN=$( Date: Tue, 12 Mar 2019 04:29:42 +0100 Subject: [PATCH 05/25] v6.22 (#2633) + DietPi-Software | rTorrent: Resolved an issue where the ruTorrent web UI could not connect to the rTorrent daemon. Many thanks to @Chester007 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5656 + DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall --- CHANGELOG.txt | 2 + dietpi/dietpi-software | 220 +++++++++++++++++++------------- dietpi/func/dietpi-set_software | 48 +++---- dietpi/patch_file | 12 +- 4 files changed, 164 insertions(+), 118 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5a80f83f53..d0982b7471 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -18,6 +18,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | AmiBerry: Updated to latest version (2.25), thanks @midwan: https://github.com/MichaIng/DietPi/issues/2599 - DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446 - DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. +- DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 @@ -40,6 +41,7 @@ Bug Fixes: - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service to ensure the MPD user can use both dietpi and audio groups: https://github.com/MichaIng/DietPi/issues/2462 - DietPi-Software | Airsonic: Resolved an issue where during install the FFmpeg transcoder symlink could be placed wrong, leading to a failing Airsonic start. Many thanks to @pecan_pie for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5637 - DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 +- DietPi-Software | rTorrent: Resolved an issue where the ruTorrent web UI could not connect to the rTorrent daemon. Many thanks to @Chester007 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5656 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/pulls?q=is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1f9cebfc01..f0200f6ed2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -778,7 +778,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='web interface audio streamer' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=7305#p7305' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7305#p7305' aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 @@ -921,7 +921,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=2603#p2603' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2603#p2603' #------------------ software_id=116 @@ -951,7 +951,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='nzb download manager' aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=6747#p6747' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ @@ -5389,31 +5389,47 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #RTORRENT - software_id=107 + software_id=107 # rTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - DEPS_LIST='rtorrent screen' #mediainfo - # On Jessie, nginx-full is needed for SCGI module: https://github.com/MichaIng/DietPi/issues/1240 + DEPS_LIST='rtorrent' #mediainfo + # On Buster, no "screen" is required to run rTorrent as daemon: https://github.com/rakshasa/rtorrent/wiki/Daemon_Mode + (( $G_DISTRO < 5 )) && DEPS_LIST+=' screen' + # On Jessie, nginx-full is required for SCGI module: https://github.com/MichaIng/DietPi/issues/1240 (( $G_DISTRO < 4 && ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) && DEPS_LIST+=' nginx-full' - # Get current version string + # Install ruTorrent: Web UI for rTorrent + # - Get current version string INSTALL_URL_ADDRESS='https://api.github.com/repos/Novik/ruTorrent/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" local version_string=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"tag_name":' | cut -d \" -f 4) Download_Install "https://github.com/Novik/ruTorrent/archive/$version_string.tar.gz" - mkdir -p /var/www/rutorrent - mv ruTorrent-*/* /var/www/rutorrent/ - rm -R ruTorrent-* + # - Reinstall + if [[ -d /var/www/rutorrent ]]; then + + # - Backup known config files + G_BACKUP_FP /var/www/rutorrent/conf/config.php + G_BACKUP_FP /var/www/rutorrent/conf/access.ini + G_BACKUP_FP /var/www/rutorrent/conf/plugins.ini + + # - Merge new install into old to preserve e.g. 3rd party plugins + cp -a ruTorrent-*/. /var/www/rutorrent/ + rm -R ruTorrent-* + + # - Fresh install + else + + mv ruTorrent-* /var/www/rutorrent + + fi fi - #Aria2 - software_id=132 + software_id=132 # Aria2 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -10917,25 +10933,20 @@ _EOF_ fi - #RTORRENT - software_id=107 + software_id=107 # rTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - #Create username/password for rutorrent based on webserver type. + # Create username/password for rutorrent based on webserver type. # - Apache2 - if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - - # - Allow overrides redirects and .htaccess - sed -i "/AllowOverride /c\ AllowOverride All" /etc/apache2/sites-enabled/000-default* - sed -i "/AllowOverride /c\ AllowOverride All" /etc/apache2/apache2.conf - - a2enmod rewrite + if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then - #install scgi module + # - Install SCGI module G_AGI libapache2-mod-scgi + a2enmod rewrite scgi + # - Enable password protection htpasswd -cb /etc/.rutorrent-htaccess root "$GLOBAL_PW" cat << _EOF_ > /var/www/rutorrent/.htaccess AuthUserFile /etc/.rutorrent-htaccess @@ -10944,24 +10955,29 @@ AuthType Basic require user root _EOF_ + # - Allow overrides/.htaccess and enable SCGI + authentication cat << _EOF_ > /etc/apache2/sites-available/dietpi-rutorrent.conf + + AllowOverride All + + SCGIMount /RPC2 127.0.0.1:5000 -AuthName "rTorrent secure access" -AuthType Basic -AuthBasicProvider file -AuthUserFile /etc/.rutorrent-htaccess -Require user root + AuthName "rTorrent secure access" + AuthType Basic + AuthBasicProvider file + AuthUserFile /etc/.rutorrent-htaccess + Require user root _EOF_ a2ensite dietpi-rutorrent - + # - Lighttpd - elif (( ${aSOFTWARE_INSTALL_STATE[84]} >= 1 )); then + elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then echo "root:rtorrent:$(echo -n 'root:rtorrent:dietpi' | md5sum | cut -b -32)" > /etc/.rutorrent-htaccess - # - add to /etc/lighttpd/lighttpd.conf + # - Add to /etc/lighttpd/lighttpd.conf if ! grep -qi '^#RUTORRENT_DIETPI' /etc/lighttpd/lighttpd.conf; then cat << _EOF_ >> /etc/lighttpd/lighttpd.conf @@ -10994,7 +11010,7 @@ _EOF_ fi # - Nginx - elif (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then + elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then echo "root:$(openssl passwd -crypt dietpi)" > /etc/.rutorrent-htaccess @@ -11012,8 +11028,8 @@ _EOF_ fi - # - Define curl location in config.php (for lighttpd and nginx) - sed -i '/"curl"[[:space:]]/c\ "curl" => "/usr/bin/curl",' /var/www/rutorrent/conf/config.php + # - Define curl location in config.php (for Lighttpd and Nginx) + G_CONFIG_INJECT '"curl"[[:blank:]]' ' "curl" => "/usr/bin/curl",' /var/www/rutorrent/conf/config.php chown www-data:www-data /etc/.rutorrent-htaccess chmod 400 /etc/.rutorrent-htaccess @@ -11021,65 +11037,87 @@ _EOF_ # - Session folder mkdir -p $G_FP_DIETPI_USERDATA/downloads/.session + # Create rTorrent run user + local usercmd='useradd -rM' + getent passwd rtorrent &> /dev/null && usercmd='usermod' + $usercmd rtorrent -G dietpi -d $G_FP_DIETPI_USERDATA/rtorrent -s $(command -v nologin) + # - Service using screen | '/usr/bin/rtorrent &> /var/log/rtorrent.log &' doesnt work, hangs program after 5 seconds cat << _EOF_ > /etc/systemd/system/rtorrent.service [Unit] Description=rTorrent (DietPi) -After=network.target +Wants=network-online.target +After=network-online.target [Service] Type=forking +User=rtorrent +Group=dietpi KillMode=none -ExecStart=/usr/bin/screen -d -m -fa -S rtorrent /usr/bin/rtorrent -ExecStop=/usr/bin/killall -w -s 2 /usr/bin/rtorrent -WorkingDirectory=%h +ExecStart=$(command -v screen) -fa -dmS rtorrent $(command -v rtorrent) +ExecStop=$(command -v screen) -S rtorrent -X quit [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload + # - On Buster we use new daemon mode + if (( $G_DISTRO > 4 )); then - #Default conf - cat << _EOF_ > $HOME/.rtorrent.rc -#Attempt to reduce disk throttling/abuse | 0.9.2 command does not exist -#max_open_files = 50 + sed -Ei '/^(Type|KillMode|ExecStop)=/d' /etc/systemd/system/rtorrent.service + G_CONFIG_INJECT 'ExecStart=' "ExecStart=$(command -v rtorrent)" /etc/systemd/system/rtorrent.service -#Max queue + fi + systemctl daemon-reload + + # - Default conf, do not overwrite if existent + # Example: https://github.com/rakshasa/rtorrent/blob/master/doc/rtorrent.rc + # Deprecated commands: + # - https://github.com/rakshasa/rtorrent/wiki/rTorrent-0.9-Comprehensive-Command-list-(WIP) + # - https://github.com/rakshasa/rtorrent/blob/master/doc/scripts/update_commands_0.9.sed + mkdir -p $G_FP_DIETPI_USERDATA/rtorrent + [[ -f $G_FP_DIETPI_USERDATA/rtorrent/.rtorrent.rc ]] || cat << _EOF_ > $G_FP_DIETPI_USERDATA/rtorrent/.rtorrent.rc +# Attempt to reduce disk throttling/abuse +network.max_open_files.set = 50 + +# Max queue scheduler.max_active.set = 3 -#byte value -max_memory_usage = $(( $(Optimize_BitTorrent 0) * 1024 * 1024 )) +# byte value +pieces.memory.max.set = $(( $(Optimize_BitTorrent 0) * 1024 * 1024 )) # Maximum and minimum number of peers to connect to per torrent. -min_peers = 1 -max_peers = $(( $(Optimize_BitTorrent 2) / 2 + 1 )) +throttle.min_peers.normal.set = 1 +throttle.max_peers.normal.set = $(( $(Optimize_BitTorrent 2) / 2 + 1 )) # Same as above but for seeding completed torrents (-1 = same as downloading) -min_peers_seed = -1 -max_peers_seed = -1 +throttle.min_peers.seed.set = -1 +throttle.max_peers.seed.set = -1 # Maximum number of simultaneous downloads -max_downloads_global = $(Optimize_BitTorrent 2) +throttle.max_downloads.set = $(Optimize_BitTorrent 2) # Maximum number of simultaneous uploads -max_uploads_global = $(Optimize_BitTorrent 3) +throttle.max_uploads.set = $(Optimize_BitTorrent 3) # Global upload and download rate in KiB. "0" for unlimited. -download_rate = 0 -upload_rate = 0 +throttle.global_down.max_rate.set_kb = 0 +throttle.global_up.max_rate.set_kb = 0 # Default directory to save the downloaded torrents. -directory = $G_FP_DIETPI_USERDATA/downloads +directory.default.set = $G_FP_DIETPI_USERDATA/downloads # Default session directory. Make sure you don't run multiple instance # of rtorrent using the same session directory. Perhaps using a # relative path? -session = $G_FP_DIETPI_USERDATA/downloads/.session +session.path.set = $G_FP_DIETPI_USERDATA/downloads/.session + +# UMask +system.umask.set = 002 # Close torrents when diskspace is low. -schedule = low_diskspace,5,60,close_low_diskspace=1000M +schedule2 = low_diskspace,5,60,close_low_diskspace=1000M # Periodically save session data -schedule = session_save,240,300,session_save= +schedule2 = session_save,240,300,session_save= # Enable the default ratio group. ratio.enable=yes @@ -11092,16 +11130,16 @@ ratio.max.set=125 ratio.upload.set=1M # When seeding ratio is reached close the torrent -system.method.set = group.seeding.ratio.command, d.close= +method.set = group.seeding.ratio.command,d.close= # Move files to ./unsorted when download completes -system.method.set_key = event.download.finished,move_complete,"execute=mv,-n,$d.get_base_path=,./unsorted/;d.set_directory=./unsorted/" +method.set_key = event.download.finished,move_complete,"execute=mv,-n,$d.get_base_path=,./unsorted/;d.set_directory=./unsorted/" # Port range to use for listening. -port_range = 33101-33199 +network.port_range.set = 33101-33199 # Start opening ports at a random position within the port range. -port_random = yes +network.port_random.set = yes # Encryption options, set to none (default) or any combination of the following: # allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext @@ -11110,7 +11148,7 @@ port_random = yes # outgoing connections but retries with encryption if they fail, preferring # plaintext to RC4 encryption after the encrypted handshake # -encryption = require +protocol.encryption.set = require # Sort the main view by ratio view.sort_current = main,greater=d.get_ratio= @@ -11134,36 +11172,42 @@ view.sort_new = leeching,less=d.get_name= view.filter = active,d.get_peers_connected= view.sort = active -schedule = sort_main,11,5,view.sort=main -schedule = sort_seeding,12,5,view.sort=seeding -schedule = sort_leeching,13,5,view.sort=leeching -schedule = sort_active,14,5,view.sort=active +schedule2 = sort_main,11,5,view.sort=main +schedule2 = sort_seeding,12,5,view.sort=seeding +schedule2 = sort_leeching,13,5,view.sort=leeching +schedule2 = sort_active,14,5,view.sort=active # Enable DHT support for trackerless torrents or when all trackers are down. # May be set to "disable" (completely disable DHT), "off" (do not start DHT), # "auto" (start and stop DHT as needed), or "on" (start DHT immediately). # The default is "off". For DHT to work, a session directory must be defined. # -dht = auto +dht.mode.set = auto # UDP port to use for DHT. # -#dht_port = 6881 +#dht.port.set = 6881 # Enable peer exchange (for torrents not marked private) # -peer_exchange = yes - -#Enable remote access (eg: webui) -scgi_port = localhost:5000 +protocol.pex.set = yes +# SCGI Connectivity (for alternative rtorrent interfaces, XMLRPC) +# +# Use a IP socket with scgi_port, or a Unix socket with scgi_local. +# schedule can be used to set permissions on the unix socket. +# +scgi_port = 127.0.0.1:5000 +#scgi_local = /home/user/rtorrent/rpc.socket +#schedule2 = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket" _EOF_ - + # On Buster use new daemon mode + (( $G_DISTRO > 4 )) && G_CONFIG_INJECT 'system.daemon.set[[:blank:]=]' 'system.daemon.set = true' $G_FP_DIETPI_USERDATA/rtorrent/.rtorrent.rc + chown -R rtorrent:rtorrent $G_FP_DIETPI_USERDATA/rtorrent fi - #Aria2 - software_id=132 + software_id=132 # Aria2 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -14062,28 +14106,28 @@ _EOF_ fi - software_id=107 + software_id=107 # rTorrent if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP rtorrent - rm -R /var/www/rutorrent - rm $HOME/.rtorrent.rc - rm /etc/systemd/system/rtorrent.service + [[ -d /var/www/rutorrent ]] && rm -R /var/www/rutorrent + [[ -d $G_FP_DIETPI_USERDATA/rtorrent ]] && rm -R $G_FP_DIETPI_USERDATA/rtorrent + [[ -f /etc/systemd/system/rtorrent.service ]] && rm /etc/systemd/system/rtorrent.service - # - webserver rutorrent user/pw settings - rm /etc/.rutorrent-htaccess + # - Webserver rutorrent user/pw settings + [[ -f /etc/.rutorrent-htaccess ]] && rm /etc/.rutorrent-htaccess - # lighttpd + # Lighttpd #Remove from #RUTORRENT_DIETPI to #RUTORRENT_DIETPI in /etc/lighttpd/lighttpd.conf - # nginx - rm /etc/nginx/sites-dietpi/dietpi-rutorrent.conf + # Nginx + [[ -f /etc/nginx/sites-dietpi/dietpi-rutorrent.conf ]] && rm /etc/nginx/sites-dietpi/dietpi-rutorrent.conf - # apache2 + # Apache2 command -v a2dissite &> /dev/null && a2dissite dietpi-rutorrent - rm /etc/apache2/sites-available/dietpi-rutorrent.conf + [[ -f /etc/apache2/sites-available/dietpi-rutorrent.conf ]] && rm /etc/apache2/sites-available/dietpi-rutorrent.conf fi diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 3fcab5f7b1..eab42932f3 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -299,7 +299,7 @@ _EOF_ # - DietPi-Software secure global_pw encrypted chown root:root /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin - chmod 700 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin + chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin # - /var/www / www-data chown -R www-data:www-data /var/www @@ -308,12 +308,9 @@ _EOF_ #Apply non-root permissions for files and folders in G_FP_DIETPI_USERDATA # - dietpi user - chown -R dietpi:dietpi /home/dietpi - chown -R dietpi:dietpi $G_FP_DIETPI_USERDATA - chmod -R 775 $G_FP_DIETPI_USERDATA - # + for symlinked locations - chown -R dietpi:dietpi $G_FP_DIETPI_USERDATA/* - chmod -R 775 $G_FP_DIETPI_USERDATA/* + # Include symlinked locations via $G_FP_DIETPI_USERDATA/* + chown -R dietpi:dietpi /home/dietpi $G_FP_DIETPI_USERDATA $G_FP_DIETPI_USERDATA/* + chmod -R 775 $G_FP_DIETPI_USERDATA $G_FP_DIETPI_USERDATA/* # - Apply program specific permissions # NB: Following should be ordered ascending by index to prevent dupes. @@ -322,7 +319,7 @@ _EOF_ chown -R 775 /var/lib/dietpi/dietpi-software/installed/desktop # Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops. chmod +x /usr/share/applications/* - chmod +x $HOME/Desktop/* + chmod +x /root/Desktop/* # - O!MPD, requires write permissions chmod -R 777 /var/www/ompd/tmp #(required for database update) @@ -385,17 +382,13 @@ _EOF_ chown -R influxdb:influxdb $G_FP_DIETPI_USERDATA/influxdb # - gogs - chown -R gogs:gogs /etc/gogs - chown -R gogs:gogs $G_FP_DIETPI_USERDATA/gogs-repo - chown -R gogs:gogs /var/log/gogs + chown -R gogs:gogs /etc/gogs $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs # - ubooquity chown -R ubooquity:dietpi $G_FP_DIETPI_USERDATA/ubooquity # - Mineos - chown -R mineos:dietpi $G_FP_DIETPI_USERDATA/mineos - chown -R mineos:dietpi /var/games/minecraft - chown mineos:dietpi /etc/ssl/certs/mineos* + chown -R mineos:dietpi $G_FP_DIETPI_USERDATA/mineos /var/games/minecraft /etc/ssl/certs/mineos* # - cubrite chown -R cuberite:dietpi $G_FP_DIETPI_USERDATA/cubrite @@ -408,23 +401,16 @@ _EOF_ chown -R medusa:dietpi $G_FP_DIETPI_USERDATA/medusa # - Sonarr - chown -R sonarr:dietpi $G_FP_DIETPI_USERDATA/sonarr - chown -R sonarr:dietpi /opt/NzbDrone - chown -R sonarr:dietpi /var/log/sonarr + chown -R sonarr:dietpi $G_FP_DIETPI_USERDATA/sonarr /opt/NzbDrone /var/log/sonarr # - Radarr - chown -R radarr:dietpi $G_FP_DIETPI_USERDATA/radarr - chown -R radarr:dietpi /opt/Radarr - chown -R radarr:dietpi /var/log/radarr + chown -R radarr:dietpi $G_FP_DIETPI_USERDATA/radarr /opt/Radarr /var/log/radarr # - Lidarr - chown -R lidarr:dietpi $G_FP_DIETPI_USERDATA/lidarr - chown -R lidarr:dietpi /opt/Lidarr - chown -R lidarr:dietpi /var/log/lidarr + chown -R lidarr:dietpi $G_FP_DIETPI_USERDATA/lidarr /opt/Lidarr /var/log/lidarr # - Tonido - chown -R tonido:dietpi $G_FP_DIETPI_USERDATA/tonido - chown -R tonido:dietpi /home/tonido + chown -R tonido:dietpi $G_FP_DIETPI_USERDATA/tonido /home/tonido # - NZBget chown -R nzbget:dietpi $G_FP_DIETPI_USERDATA/nzbget @@ -452,13 +438,17 @@ _EOF_ # - qBitTorrent chown -R qbittorrent:dietpi /home/qbittorrent + # - rTorrent + chown -R rtorrent:rtorrent $G_FP_DIETPI_USERDATA/rtorrent $G_FP_DIETPI_USERDATA/downloads/.session + # ruTorrent web access + chown www-data:www-data /etc/.rutorrent-htaccess + chmod 400 /etc/.rutorrent-htaccess + # - FAHClient (Folding@Home) - chown -R fahclient:dietpi $G_FP_DIETPI_USERDATA/fahclient - chown fahclient:dietpi /var/log/fahclient.log + chown -R fahclient:dietpi $G_FP_DIETPI_USERDATA/fahclient /var/log/fahclient.log # - Sabnzbd - chown -R sabnzbd:dietpi /etc/sabnzbd - chown -R sabnzbd:dietpi /var/log/sabnzbd + chown -R sabnzbd:dietpi /etc/sabnzbd /var/log/sabnzbd # - Blynk chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk diff --git a/dietpi/patch_file b/dietpi/patch_file index 0e9e8dbe5e..9cb8af41f9 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1679,10 +1679,21 @@ _EOF_ #Reinstalls # Amiberry 2.25: https://github.com/MichaIng/DietPi/issues/2599 # Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 + # rTorrent: https://github.com/MichaIng/DietPi/issues/2629 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then local reinstall_indices='108' + if grep -q '^aSOFTWARE_INSTALL_STATE\[107\]=2' /DietPi/dietpi/.installed && + [[ -f /root/.rtorrent.rc ]]; then + + reinstall_indices+=' 107' + G_CONFIG_INJECT 'system.umask.set[[:blank:]=]' 'system.umask.set = 002' /root/.rtorrent.rc + mkdir -p $G_FP_DIETPI_USERDATA/rtorrent + mv /root/.rtorrent.rc $G_FP_DIETPI_USERDATA/rtorrent/ + + fi + if grep -q '^aSOFTWARE_INSTALL_STATE\[45\]=2' /DietPi/dietpi/.installed && getent passwd deluge &> /dev/null; then # Only do this once, regardless of re-patches @@ -1714,7 +1725,6 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged" fi #------------------------------------------------------------------------------- - fi #------------------------------------------------------------------------------- From 419657182bbf61e96bcaad77606262ceb922286c Mon Sep 17 00:00:00 2001 From: Daniel Knight Date: Tue, 12 Mar 2019 11:36:11 +0000 Subject: [PATCH 06/25] v6.22 General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 + Clean up of banner code + Globalize cpu temp colour print out --- CHANGELOG.txt | 3 +- dietpi/dietpi-cpuinfo | 40 ++------------------------ dietpi/func/dietpi-banner | 57 +++++++++++++------------------------- dietpi/func/dietpi-globals | 33 +++++++++++++++++++++- 4 files changed, 56 insertions(+), 77 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5a80f83f53..67b57307b7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ v6.22 Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". +- General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 - DietPi-NordVPN | Added sent/received usage stats for VPN tunnel. - DietPi-Sync | Sync will now abort if the source dir is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.2) which as well offers a native ARMv8 package: https://github.com/MichaIng/DietPi/pull/2525 @@ -39,7 +40,7 @@ Bug Fixes: - DietPi-Software | Pi-hole: Resolved an issue where "pihole -up" fails because of wrong file permissions. Many thanks to @jonare77 for resporting this issue: https://github.com/MichaIng/DietPi/issues/2516 - DietPi-Software | MPD: Resolved an issue with failed playback due to permissions. Permissions are now set via systemd service to ensure the MPD user can use both dietpi and audio groups: https://github.com/MichaIng/DietPi/issues/2462 - DietPi-Software | Airsonic: Resolved an issue where during install the FFmpeg transcoder symlink could be placed wrong, leading to a failing Airsonic start. Many thanks to @pecan_pie for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5637 -- DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 +- DietPi-Software | DietPi-RAMlog: Fixed an issue where logging mode could be set wrong when uninstalling and reinstalling RAMlog. Many thanks to @abecvar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5666 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/pulls?q=is%3Aclosed+base%3Amaster diff --git a/dietpi/dietpi-cpuinfo b/dietpi/dietpi-cpuinfo index 320f1c1200..5d297bdcf9 100644 --- a/dietpi/dietpi-cpuinfo +++ b/dietpi/dietpi-cpuinfo @@ -102,46 +102,10 @@ } - CPU_TEMP_CURRENT='N/A' - CPU_TEMP_PRINT='N/A' + CPU_TEMP_PRINT='' Obtain_Cpu_Temp(){ - CPU_TEMP_CURRENT=$(G_OBTAIN_CPU_TEMP) - - if disable_error=1 G_CHECK_VALIDINT "$CPU_TEMP_CURRENT"; then - - local cpu_temp_current_f=$(( $CPU_TEMP_CURRENT * 9/5 + 32 )) - if (( $CPU_TEMP_CURRENT >= 70 )); then - - CPU_TEMP_PRINT="\e[1;31mWarning: $CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f | Reducing the life of your device.\e[0m" - - elif (( $CPU_TEMP_CURRENT >= 60 )); then - - CPU_TEMP_PRINT="\e[38;5;202m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[90m | Running hot, not recommended.\e[0m" - - elif (( $CPU_TEMP_CURRENT >= 50 )); then - - CPU_TEMP_PRINT="\e[1;33m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m \e[90m | Running warm, but safe.\e[0m" - - elif (( $CPU_TEMP_CURRENT >= 40 )); then - - CPU_TEMP_PRINT="\e[1;32m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m\e[90m | Optimal temperature.\e[0m" - - elif (( $CPU_TEMP_CURRENT >= 30 )); then - - CPU_TEMP_PRINT="\e[1;36m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f\e[0m\e[90m | Cool runnings.\e[0m" - - else - - CPU_TEMP_PRINT="\e[1;36m$CPU_TEMP_CURRENT'c : $cpu_temp_current_f'f \e[0m \e[90m| Who put me in the freezer!\e[0m" - - fi - - else - - CPU_TEMP_PRINT=$CPU_TEMP_CURRENT - - fi + CPU_TEMP_PRINT=$(print_full_info=1 G_OBTAIN_CPU_TEMP) } diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index defb25240f..6ae252d9cc 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -46,7 +46,6 @@ UPDATE_AVAILABLE=0 UPDATE_AVAILABLE_VERSION='' # -1 = image required, other value = latest version - Obtain_Update_Available(){ # Update Available @@ -59,57 +58,44 @@ } - Hardware_Model_Print(){ - - echo -e " \e[1mv$DIETPI_VERSION\e[0m \e[90m| $G_HW_MODEL_DESCRIPTION\e[0m\n \e[38;5;154m────────────────────────────────────────────────\e[0m" + Print_Header(){ - } + local green_line='\e[38;5;154m─────────────────────────────────────────────────────\e[0m' - IPAddress_Print(){ + Obtain_Update_Available # Try to re-obtain IP if missing [[ $IP_ADDRESS ]] || Update_Ip_Address - echo -e " \e[1m$IP_ADAPTER\e[0m \e[90m| $IP_ADDRESS\e[0m\n \e[38;5;154m────────────────────────────────────────────────\e[0m" - - } - - #///////////////////////////////////////////////////////////////////////////////////// - # Banner Print - #///////////////////////////////////////////////////////////////////////////////////// - TEXT_TOP='' - - Banner_TopText_Extras(){ - - # Update Available + # Update Available? + local text_update_available_date='' if (( $UPDATE_AVAILABLE )); then if [[ $UPDATE_AVAILABLE_VERSION == '-1' ]]; then - TEXT_TOP='\e[90m| \e[1;33mImage available\e[0m' + text_update_available_date='\e[1;33mImage available\e[0m' else - TEXT_TOP='\e[90m| \e[1;33mUpdate available\e[0m' + text_update_available_date='\e[1;33mUpdate available\e[0m' fi - # Use TEXT_TOP for storing helpful info else - # Helpful mode - TEXT_TOP="\e[90m| $(date +"%a %x - %R")\e[0m" + text_update_available_date="$(date +"%a %x - %R")" fi - } - Banner_Dietpi(){ - - (( $INPUT == 1 )) && printf '\ec' # clear current terminal screen - - echo -e " \e[38;5;154m────────────────────────────────────────────────\e[0m\n \e[1mDietPi\e[0m $TEXT_TOP\n \e[38;5;154m────────────────────────────────────────────────\e[0m" - Hardware_Model_Print - IPAddress_Print + echo -e "\ + $green_line + \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m + $green_line + \e[1m$G_HW_MODEL_DESCRIPTION\e[0m \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m + $green_line + \e[1m$IP_ADAPTER ($IP_ADDRESS)\e[0m + $green_line +" } @@ -166,15 +152,12 @@ #///////////////////////////////////////////////////////////////////////////////////// if (( $INPUT == 0 )); then - Obtain_Update_Available - Banner_TopText_Extras - Banner_Dietpi + Print_Header elif (( $INPUT == 1 )); then - Obtain_Update_Available - Banner_TopText_Extras - Banner_Dietpi + printf '\ec' # clear current terminal screen + Print_Header Credits_Print fi diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index fae7f640c3..d2d45bcb25 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1835,9 +1835,11 @@ $print_logfile_info } #Returns current CPU temp 'C + # print_full_info=1# optional input to print full colour text output and temp warnings. G_OBTAIN_CPU_TEMP(){ local cpu_temp_current='N/A' #We must always return a value, due to VM lacking this feature + benchmark online + local print_full_info=${print_full_info:-0} # - Array to store possible locations for temp read. afp_temperature=( @@ -1874,6 +1876,35 @@ $print_logfile_info cpu_temp_current='N/A' + elif (( $print_full_info )); then + + local cpu_temp_current_f=$(( $cpu_temp_current * 9/5 + 32 )) + if (( $cpu_temp_current >= 70 )); then + + cpu_temp_current="\e[1;31mWarning: $cpu_temp_current'C : $cpu_temp_current_f'F (Reducing the life of your device)\e[0m" + + elif (( $cpu_temp_current >= 60 )); then + + cpu_temp_current="\e[38;5;202m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running hot, not recommended)\e[0m" + + elif (( $cpu_temp_current >= 50 )); then + + cpu_temp_current="\e[1;33m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running warm, but safe)\e[0m" + + elif (( $cpu_temp_current >= 40 )); then + + cpu_temp_current="\e[1;32m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Optimal temperature)\e[0m" + + elif (( $cpu_temp_current >= 30 )); then + + cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Cool runnings)\e[0m" + + else + + cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Who put me in the freezer!)\e[0m" + + fi + fi break @@ -1884,7 +1915,7 @@ $print_logfile_info unset afp_temperature - echo $cpu_temp_current + echo -e "$cpu_temp_current" } From 9e9c765556cedfc1ea54495a5fbce45835e86bcd Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 14:50:51 +0100 Subject: [PATCH 07/25] v6.22 + DietPi-Software | Minor: Replace all software docs URLs with a short consistent failsafe one (e.g. in case threads per page differ) + DietPi-Software | Minor: Replace all "$HOME" and "~" calls with "/root" since we force root user to run this script anyway. This allows us to run the script outside of a login where no home dir is assigned. "/root" must be root's home even defined in FHS: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard --- dietpi/dietpi-software | 244 ++++++++++++++++++++--------------------- 1 file changed, 122 insertions(+), 122 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f0200f6ed2..9b87c3ce15 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -385,7 +385,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p42' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' #------------------ software_id=24 @@ -396,7 +396,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=60#p2073' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2073#p2073' #------------------ software_id=25 @@ -407,7 +407,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2203' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203' #------------------ software_id=26 @@ -418,7 +418,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=60#p2072' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072' #------------------ software_id=113 @@ -429,7 +429,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=3011#p3011' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -446,7 +446,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p408' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -467,7 +467,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p408' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' #------------------ software_id=29 @@ -477,7 +477,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2074' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074' #------------------ software_id=30 @@ -497,7 +497,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=1 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=4149#p4149' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4149#p4149' # - License RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -517,7 +517,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p43' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43' # - Only RPi + Odroid for ((i=20; i<=$MAX_G_HW_MODEL; i++)) @@ -544,7 +544,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p50' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=50#p50' #------------------ software_id=148 @@ -627,7 +627,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='(MiniDLNA) media streaming server (dlna, upnp)' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p49' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=49#p49' #------------------ software_id=40 @@ -642,7 +642,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=40#p554' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=554#p554' #------------------ software_id=41 @@ -687,7 +687,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='web interface music & radio player' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=80#p3611' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3611#p3611' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ @@ -697,7 +697,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='Turns device into Roon capable audio player' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=80#p4153' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4153#p4153' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - Disable for ARMv6 @@ -710,7 +710,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='signalyst network audio adaptor (naa)' aSOFTWARE_CATEGORY_INDEX[$software_id]=2 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=90#p4294' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4294#p4294' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ @@ -910,7 +910,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (c++)' aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2272' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2272#p2272' #------------------ software_id=107 @@ -992,7 +992,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='automatically download music' aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=13580#p13580' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13580#p13580' aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ @@ -1095,7 +1095,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2187' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2187#p2187' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -1107,7 +1107,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='backup and sync server with web interface' aSOFTWARE_CATEGORY_INDEX[$software_id]=4 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=70#p2363' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2363#p2363' #------------------ software_id=134 @@ -1162,7 +1162,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=5 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=64#p64' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64' aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 # - Disable for All non-RPi @@ -1186,7 +1186,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p45' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=45#p45' # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1221,7 +1221,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='minecraft server with web interface (c++)' aSOFTWARE_CATEGORY_INDEX[$software_id]=5 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=60#p2068' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2068#p2068' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -1237,7 +1237,7 @@ _EOF_ aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=60#p2069' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2069#p2069' #------------------ software_id=156 @@ -1280,7 +1280,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=5#p51' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=51#p51' #------------------ software_id=55 @@ -1292,7 +1292,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p395' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=395#p395' #------------------ software_id=38 @@ -1304,7 +1304,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=130#p13918' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13918#p13918' #------------------ software_id=56 @@ -1315,7 +1315,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=40#p480' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=480#p480' #------------------ software_id=57 @@ -1327,7 +1327,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=50#p1502' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1502#p1502' #------------------ software_id=58 @@ -1381,7 +1381,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p48' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=48#p48' # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1446,7 +1446,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='system stats displayed on lcd/panel' aSOFTWARE_CATEGORY_INDEX[$software_id]=9 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p204' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=204#p204' #------------------ software_id=63 @@ -1457,7 +1457,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p108' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=108#p108' #------------------ software_id=64 @@ -1505,7 +1505,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='web interface system management' aSOFTWARE_CATEGORY_INDEX[$software_id]=9 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=80#p3047' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3047#p3047' aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 #------------------ @@ -1525,7 +1525,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='url website address for your device' aSOFTWARE_CATEGORY_INDEX[$software_id]=10 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p58' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=58#p58' #------------------ software_id=68 @@ -1555,7 +1555,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='gpio interface library for rpi (python)' aSOFTWARE_CATEGORY_INDEX[$software_id]=11 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=40#p1065' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1065#p1065' # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1594,7 +1594,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=11 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p189' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=189#p189' # - Disable for All non-RPi and RPi3 for ((i=3; i<=$MAX_G_HW_MODEL; i++)) @@ -1646,7 +1646,7 @@ _EOF_ aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=80#p4292' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4292#p4292' #------------------ software_id=123 @@ -1655,7 +1655,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='MQTT messaging broker' aSOFTWARE_CATEGORY_INDEX[$software_id]=11 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=90#p4293' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4293#p4293' #------------------ software_id=131 @@ -1712,7 +1712,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='time-series database' aSOFTWARE_CATEGORY_INDEX[$software_id]=11 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=120#p12523' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12523#p12523' #------------------ software_id=77 @@ -1732,7 +1732,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='prevents brute-force attacks with ip ban' aSOFTWARE_CATEGORY_INDEX[$software_id]=12 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p452' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=452#p452' #------------------ #Webserver stacks @@ -1743,7 +1743,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='apache2 | sqlite | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=76 @@ -1752,7 +1752,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='apache2 | mariadb | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=78 @@ -1761,7 +1761,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='nginx | sqlite | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p5' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=79 @@ -1770,7 +1770,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='nginx | mariadb | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p5' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=81 @@ -1788,7 +1788,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='lighttpd | mariadb | php' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' #------------------ software_id=83 @@ -1798,7 +1798,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' #------------------ software_id=84 @@ -1818,7 +1818,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5#p5' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' #------------------ software_id=87 @@ -1857,7 +1857,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p54' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54' #------------------ software_id=91 @@ -1874,7 +1874,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='free, ssl cert install allowing https://' aSOFTWARE_CATEGORY_INDEX[$software_id]=13 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1061#p1062' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1061#p1062' #------------------ software_id=125 @@ -1898,7 +1898,7 @@ _EOF_ aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p174' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=174#p174' aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 #File servers @@ -1909,7 +1909,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='lightweight ftp server' aSOFTWARE_CATEGORY_INDEX[$software_id]=15 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p55' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=55#p55' #------------------ software_id=95 @@ -1927,7 +1927,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='feature-rich file server' aSOFTWARE_CATEGORY_INDEX[$software_id]=15 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p56' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=56#p56' #------------------ software_id=109 @@ -1936,7 +1936,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='network file system server' aSOFTWARE_CATEGORY_INDEX[$software_id]=15 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p56' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2821#p2821' #------------------ @@ -2011,7 +2011,7 @@ _EOF_ aSOFTWARE_CATEGORY_INDEX[$software_id]=17 aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=30#p221' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=221#p221' #Home automation #-------------------------------------------------------------------------------- @@ -2021,7 +2021,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='energy usage addon board with web interface' aSOFTWARE_CATEGORY_INDEX[$software_id]=18 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&p=1529#p1525' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1525#p1525' # - Disable for All non-RPi for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -2042,7 +2042,7 @@ _EOF_ aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p70' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=70#p70' #------------------ @@ -2358,7 +2358,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='rotates log files' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ software_id=102 @@ -2366,7 +2366,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='system logging' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ software_id=103 @@ -2374,7 +2374,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='minimal, optimized logging' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=20#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' #------------------ #-------------------------------------------------------------------------------- @@ -2386,7 +2386,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='lightweight ssh server' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p62' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=62#p62' #------------------ software_id=105 @@ -2394,7 +2394,7 @@ _EOF_ aSOFTWARE_WHIP_DESC[$software_id]='feature rich ssh server' aSOFTWARE_CATEGORY_INDEX[$software_id]=0 aSOFTWARE_TYPE[$software_id]=-1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='f=8&t=5&start=10#p63' + aSOFTWARE_ONLINEDOC_URL[$software_id]='p=63#p63' #------------------ #-------------------------------------------------------------------------------- @@ -2899,13 +2899,13 @@ _EOF_ Create_Desktop_Shared_Items(){ # - Pre-create dirs - mkdir -p $HOME/Desktop + mkdir -p /root/Desktop mkdir -p /usr/share/applications mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/icons mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers # - Copy DietPi favourite links - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks -O $HOME/.gtk-bookmarks + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks -O /root/.gtk-bookmarks # - DietPi Apps to download local adesktop_items=( @@ -2952,10 +2952,10 @@ _EOF_ G_THREAD_WAIT # - Desktop app symlinks - ln -sf /usr/share/applications/htop.desktop $HOME/Desktop/htop.desktop - ln -sf /usr/share/applications/dietpi-software.desktop $HOME/Desktop/dietpi-software.desktop - ln -sf /usr/share/applications/dietpi-config.desktop $HOME/Desktop/dietpi-config.desktop - ln -sf /usr/share/applications/dietpi-launcher.desktop $HOME/Desktop/dietpi-launcher.desktop + ln -sf /usr/share/applications/htop.desktop /root/Desktop/htop.desktop + ln -sf /usr/share/applications/dietpi-software.desktop /root/Desktop/dietpi-software.desktop + ln -sf /usr/share/applications/dietpi-config.desktop /root/Desktop/dietpi-config.desktop + ln -sf /usr/share/applications/dietpi-launcher.desktop /root/Desktop/dietpi-launcher.desktop } @@ -3198,13 +3198,13 @@ _EOF_ # #Install Python and PIP # G_AGI python python-pip python-imaging # - # cd $HOME + # cd /root # git clone --depth=1 "$INSTALL_URL_ADDRESS" # # # - Move HTPC Manager to a 'better' location # mkdir -p $G_FP_DIETPI_USERDATA/htpc-manager - # mv $HOME/HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ - # rm -R $HOME/HTPC-Manager + # mv /root/HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/ + # rm -R /root/HTPC-Manager # # fi # @@ -3964,7 +3964,7 @@ _EOF_ fi - G_THREAD_START wget https://dietpi.com/downloads/binaries/all/cava.psf -O $HOME/cava.psf # + Font for cava, nice bars + G_THREAD_START wget https://dietpi.com/downloads/binaries/all/cava.psf -O /root/cava.psf # + Font for cava, nice bars DEPS_LIST='libpulse0 libfftw3-3' Download_Install "$INSTALL_URL_ADDRESS" @@ -4404,7 +4404,7 @@ _EOF_ ./build cd /tmp/$G_PROGRAM_NAME - mv wiringPi $HOME/ + mv wiringPi /root/ fi @@ -7094,7 +7094,7 @@ _EOF_ (( ${aSOFTWARE_INSTALL_STATE[101]} == 2 )) && aSOFTWARE_INSTALL_STATE[101]=-1 (( ${aSOFTWARE_INSTALL_STATE[102]} == 2 )) && aSOFTWARE_INSTALL_STATE[102]=-1 - #Ramlog - backup every 1H to $HOME/logfile_storage, then clear. + #Ramlog - backup every 1H to /root/logfile_storage, then clear. elif (( $INDEX_LOGGING_TARGET == -2 )); then aSOFTWARE_INSTALL_STATE[103]=1 @@ -7150,7 +7150,7 @@ _EOF_ # if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then # # # - file manager desktop icon - # ln -sf /usr/share/applications/caja.desktop $HOME/Desktop/caja.desktop + # ln -sf /usr/share/applications/caja.desktop /root/Desktop/caja.desktop # # Create_Desktop_Shared_Items # @@ -7179,19 +7179,19 @@ _EOF_ Banner_Configuration #Pre-create dirs - mkdir -p $HOME/.config/openbox - mkdir -p $HOME/.config/lxpanel/LXDE/panels - mkdir -p $HOME/.config/pcmanfm/LXDE + mkdir -p /root/.config/openbox + mkdir -p /root/.config/lxpanel/LXDE/panels + mkdir -p /root/.config/pcmanfm/LXDE # - PCmanFM configs - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -O $HOME/.config/pcmanfm/LXDE/pcmanfm.conf - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -O $HOME/.config/pcmanfm/LXDE/desktop-items-0.conf + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -O /root/.config/pcmanfm/LXDE/pcmanfm.conf + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -O /root/.config/pcmanfm/LXDE/desktop-items-0.conf # - Panel config - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel -O $HOME/.config/lxpanel/LXDE/panels/panel + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel -O /root/.config/lxpanel/LXDE/panels/panel # - Openbox config - G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -O $HOME/.config/openbox/lxde-rc.xml + G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -O /root/.config/openbox/lxde-rc.xml # - Remove Lxrandr Menu item (monitor configuration tool as we set res in dietpi-config) [[ -f /usr/share/applications/lxrandr.desktop ]] && rm /usr/share/applications/lxrandr.desktop @@ -7211,7 +7211,7 @@ _EOF_ Create_Desktop_Shared_Items # - file manager desktop icon - ln -sf /usr/share/applications/pcmanfm.desktop $HOME/Desktop/pcmanfm.desktop + ln -sf /usr/share/applications/pcmanfm.desktop /root/Desktop/pcmanfm.desktop fi @@ -7224,7 +7224,7 @@ _EOF_ Create_Desktop_Shared_Items # - file manager desktop icon - ln -sf /usr/share/applications/caja.desktop $HOME/Desktop/caja.desktop + ln -sf /usr/share/applications/caja.desktop /root/Desktop/caja.desktop #Odroid C2, define default pulseaudio sink: https://github.com/MichaIng/DietPi/issues/415 if (( $G_HW_MODEL == 12 )); then @@ -8692,7 +8692,7 @@ WantedBy=multi-user.target _EOF_ #Symlink to home dir: https://github.com/MichaIng/DietPi/issues/1256 - ln -sf $G_FP_DIETPI_USERDATA/node-red $HOME/.node-red + ln -sf $G_FP_DIETPI_USERDATA/node-red /root/.node-red fi @@ -8712,10 +8712,10 @@ _EOF_ Banner_Configuration # - Cava conf - mkdir -p $HOME/.config/cava + mkdir -p /root/.config/cava - G_BACKUP_FP $HOME/.config/cava/config - cp /var/lib/dietpi/dietpi-software/conf/cava.conf $HOME/.config/cava/config + G_BACKUP_FP /root/.config/cava/config + cp /var/lib/dietpi/dietpi-software/conf/cava.conf /root/.config/cava/config # - lower MPD buffer size to reduce latency of spectrum: sed -i '/audio_buffer_size /c\audio_buffer_size "384"' /etc/mpd.conf @@ -8807,10 +8807,10 @@ _EOF_ chmod +x /etc/udev/rules.d/99-dietpi-kodi.rules #Create .desktop SymLinks - mkdir -p $HOME/Desktop + mkdir -p /root/Desktop [[ -f /usr/share/applications/kodi.desktop ]] && rm /usr/share/applications/kodi.desktop G_RUN_CMD wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop -O /usr/share/applications/kodi.desktop - ln -sf /usr/share/applications/kodi.desktop $HOME/Desktop/kodi.desktop + ln -sf /usr/share/applications/kodi.desktop /root/Desktop/kodi.desktop fi @@ -8989,20 +8989,20 @@ _EOF_ #Symlink savegames to root # - Remove existing syslinks - rm -R $HOME/.d1x-rebirth &> /dev/null - rm -R $HOME/.d2x-rebirth &> /dev/null + rm -R /root/.d1x-rebirth &> /dev/null + rm -R /root/.d2x-rebirth &> /dev/null - ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_1_profiles $HOME/.d1x-rebirth - ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_2_profiles $HOME/.d2x-rebirth + ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_1_profiles /root/.d1x-rebirth + ln -sf $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_2_profiles /root/.d2x-rebirth #+exe chmod +x -R $G_FP_DIETPI_USERDATA/dxx-rebirth/* #Create .Desktop SymLinks - mkdir -p $HOME/Desktop + mkdir -p /root/Desktop mkdir -p /usr/share/applications - ln -s $G_FP_DIETPI_USERDATA/dxx-rebirth/dxx-rebirth.desktop $HOME/Desktop/dxx-rebirth.desktop + ln -s $G_FP_DIETPI_USERDATA/dxx-rebirth/dxx-rebirth.desktop /root/Desktop/dxx-rebirth.desktop ln -s $G_FP_DIETPI_USERDATA/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop fi @@ -9018,10 +9018,10 @@ _EOF_ chmod +x /usr/local/games/opentyrian/run #Create .Desktop SymLinks - mkdir -p $HOME/Desktop + mkdir -p /root/Desktop rm /usr/share/applications/opentyrian.desktop &> /dev/null G_RUN_CMD wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/opentyrian.desktop -O /usr/share/applications/opentyrian.desktop - ln -s /usr/share/applications/opentyrian.desktop $HOME/Desktop/opentyrian.desktop + ln -s /usr/share/applications/opentyrian.desktop /root/Desktop/opentyrian.desktop fi @@ -9682,8 +9682,8 @@ _EOF_ fi - mkdir -p $HOME/.vnc - cat << _EOF_ > $HOME/.vnc/xstartup + mkdir -p /root/.vnc + cat << _EOF_ > /root/.vnc/xstartup #!/bin/bash export SHELL='/bin/bash' [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup @@ -9693,7 +9693,7 @@ vncconfig -iconic & $cmd_launch_desktop _EOF_ - chmod +x $HOME/.vnc/xstartup + chmod +x /root/.vnc/xstartup fi @@ -10912,7 +10912,7 @@ program= _EOF_ #Jessie WebUI\Password_ha1 breaks login with m5dsum generated pw, revert to default 'adminadmin': https://github.com/MichaIng/DietPi/issues/1499#issuecomment-364769146 - (( $G_DISTRO == 3 )) && sed -i '/Password_ha1=/d' $HOME/.config/qBittorrent/qBittorrent.conf + (( $G_DISTRO == 3 )) && sed -i '/Password_ha1=/d' /root/.config/qBittorrent/qBittorrent.conf # - service cat << _EOF_ > /etc/systemd/system/qbittorrent.service @@ -11455,18 +11455,18 @@ $export_options _EOF_ # Chromium 60+ - cp /etc/chromium.d/custom_flags $HOME/.chromium-browser.init + cp /etc/chromium.d/custom_flags /root/.chromium-browser.init #Symlink to desktop # * for RPi Stretch due to chromium-browser.desktop - ln -sf /usr/share/applications/chromium*.desktop $HOME/Desktop/chromium.desktop &> /dev/null + ln -sf /usr/share/applications/chromium*.desktop /root/Desktop/chromium.desktop &> /dev/null # - Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh #!/bin/bash #Autostart run script for Kiosk mode, based on @AYapejian https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 -# - Please see $HOME/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional egl/gl init options +# - Please see /root/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional egl/gl init options # Command line switches https://peter.sh/experiments/chromium-command-line-switches/ # --test-type gets rid of some of the chromium warnings that you may or may not care about in kiosk on a LAN @@ -11770,7 +11770,7 @@ _EOF_ # - Install language packs: https://github.com/MichaIng/DietPi/issues/1917#issue-340631943 cd /etc/sabnzbd G_RUN_CMD python tools/make_mo.py - cd $HOME + cd /root fi @@ -12144,10 +12144,10 @@ _EOF_ Banner_Configuration mkdir -p $G_FP_DIETPI_USERDATA/steam - mv $HOME/.steam/* $G_FP_DIETPI_USERDATA/steam/ - rm -R $HOME/.steam + mv /root/.steam/* $G_FP_DIETPI_USERDATA/steam/ + rm -R /root/.steam - ln -sf $G_FP_DIETPI_USERDATA/steam $HOME/.steam + ln -sf $G_FP_DIETPI_USERDATA/steam /root/.steam fi @@ -13003,7 +13003,7 @@ _EOF_ Banner_Uninstalling npm r -g node-red rm /etc/systemd/system/node-red.service - rm $HOME/.node-red + rm /root/.node-red rm -R $G_FP_DIETPI_USERDATA/node-red [[ -f /usr/local/bin/node-red ]] && rm /usr/local/bin/node-red [[ -f /usr/local/bin/node-red-pi ]] && rm /usr/local/bin/node-red-pi @@ -13349,7 +13349,7 @@ _EOF_ Banner_Uninstalling rm -R $G_FP_DIETPI_USERDATA/octoprint rm $(command -v octoprint) - rm -R $HOME/.octoprint + rm -R /root/.octoprint rm /etc/systemd/system/octoprint.service fi @@ -13379,7 +13379,7 @@ _EOF_ Banner_Uninstalling G_AGP steam - rm -R $HOME/.steam + rm -R /root/.steam rm -R $G_FP_DIETPI_USERDATA/steam fi @@ -13389,8 +13389,8 @@ _EOF_ Banner_Uninstalling G_AGP cava - rm "$HOME/.config/cava/config" - rm "$HOME/cava.psf" + rm "/root/.config/cava/config" + rm "/root/cava.psf" fi @@ -13440,7 +13440,7 @@ _EOF_ G_AGP ibsdl1.2debian libsdl-net1.2 rm -R /usr/local/games/opentyrian rm /usr/share/applications/opentyrian.desktop - rm ~/Desktop/opentyrian.desktop + rm /root/Desktop/opentyrian.desktop fi @@ -13675,7 +13675,7 @@ _EOF_ rm /etc/systemd/system/vncserver.service rm /etc/init.d/vncserver rm /usr/local/bin/vncserver - rm -R $HOME/.vnc + rm -R /root/.vnc # + RealVNC services systemctl disable vncserver-x11-serviced.service @@ -14152,9 +14152,9 @@ _EOF_ rm -R $G_FP_DIETPI_USERDATA/dxx-rebirth/descent_2_game #Remove symlinks - rm $HOME/.d1x-rebirth - rm $HOME/.d2x-rebirth - rm $HOME/Desktop/dxx-rebirth.desktop + rm /root/.d1x-rebirth + rm /root/.d2x-rebirth + rm /root/Desktop/dxx-rebirth.desktop rm /usr/share/applications/dxx-rebirth.desktop fi @@ -14168,7 +14168,7 @@ _EOF_ rm /etc/chromium.d/custom_flags rm /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh - rm $HOME/.chromium-browser.init + rm /root/.chromium-browser.init G_AGP $(dpkg --get-selections chromium* | mawk '{print $1}') chromedriver # chromedriver: Jessie only @@ -14366,7 +14366,7 @@ _EOF_ # - config folder rm -R /etc/mysql 2> /dev/null - rm -R ~/.mysql_history 2> /dev/null + rm -R /root/.mysql_history 2> /dev/null # - SQL store rm -R /var/lib/mysql 2> /dev/null @@ -14734,8 +14734,8 @@ _EOF_ [[ -f /usr/local/CHANGELOG.md ]] && /usr/local/CHANGELOG.md [[ -f /usr/local/LICENSE ]] && /usr/local/LICENSE [[ -f /usr/local/share/systemtap/tapset/node.stp ]] && rm /usr/local/share/systemtap/tapset/node.stp - [[ -d $HOME/.npm ]] && rm -R $HOME/.npm - [[ -f $HOME/.config/configstore/update-notifier-npm.json ]] && rm $HOME/.config/configstore/update-notifier-npm.json + [[ -d /root/.npm ]] && rm -R /root/.npm + [[ -f /root/.config/configstore/update-notifier-npm.json ]] && rm /root/.config/configstore/update-notifier-npm.json fi From 70e0a664d5b12954d673cde3f20224547ed8d549 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:47:35 +0100 Subject: [PATCH 08/25] v6.22 + DietPi-Pre-patch | Set digest to sha256 explicitly as well, in case defaults change in the future. In case there is any Jessie Beta user (veery highly unlikely and non found on survey page) this needs to be re-applied manually. --- dietpi/pre-patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index b989df3e66..99bf68a7d3 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -68,7 +68,7 @@ echo -e '\e[90m[\e[0m \e[33mWARN\e[0m \e[90m]\e[0m Pre-patch 3 | Storing global DietPi-Software password with enhanced security' grep -qi 'buster' /etc/os-release && pbkdf2='-iter 10000' || pbkdf2='' - openssl enc -e -a -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW || { EXIT_CODE=3; break; } + openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW || { EXIT_CODE=3; break; } fi #------------------------------------------------------------------------------- From a908c436a0591df6271d66487eba681029f0c063 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:49:03 +0100 Subject: [PATCH 09/25] v6.22 + DietPi-Patch | Set global PW digest to sha256 explicitly as well --- dietpi/patch_file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index 9cb8af41f9..e92336958d 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -881,7 +881,7 @@ _EOF_ # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2='' (( $G_DISTRO > 4 )) && pbkdf2='-iter 10000' - openssl enc -e -a -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software + openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software unset pw_dietpi_software From b4317202dbae1d7839b95e4d18f6dc8a0b1fce0d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:51:58 +0100 Subject: [PATCH 10/25] v6.22 + DietPi-Software | Set global PW digest to sha256 explicitly as well --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9b87c3ce15..8e89f8f76f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -159,7 +159,7 @@ _EOF_ # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2='' (( $G_DISTRO > 4 )) && pbkdf2='-iter 10000' - GLOBAL_PW=$(openssl enc -d -a -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) + GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) # - 1st run automated setup only else From 96bce8c3cd207613a0da64e052c9400c3ce5f0d2 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 18:52:45 +0100 Subject: [PATCH 11/25] v6.22 + DietPi-Set_software | Set global PW digest to sha256 explicitly as well --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index eab42932f3..b409c056a7 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -647,7 +647,7 @@ It is highly recommended to change this password, ideally, it should be differen # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2='' (( $G_DISTRO > 4 )) && pbkdf2='-iter 10000' - openssl enc -e -a -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software + openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software Setpermissions_Main &> /dev/null From 922463c9e1bf239b3811bedd2fc3d0dc7cdfa7d0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 20:56:36 +0100 Subject: [PATCH 12/25] v6.22 (#2635) RPi | Remove "framebuffer_depth" handling completely which defaults to 16 which works in every known case --- CHANGELOG.txt | 1 + config.txt | 1 - dietpi/func/dietpi-set_hardware | 3 --- dietpi/patch_file | 10 +++------- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 75e3bb0bb0..f5b295d68c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". - General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 +- RPi | DietPi does not set or change "framebuffer_depth" in config.txt anymore which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. - DietPi-NordVPN | Added sent/received usage stats for VPN tunnel. - DietPi-Sync | Sync will now abort if the source dir is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 - DietPi-Software | Emby Server: Now installs the latest version automatically (currently 4.0.2) which as well offers a native ARMv8 package: https://github.com/MichaIng/DietPi/pull/2525 diff --git a/config.txt b/config.txt index 5c44670bd3..3da45b4351 100644 --- a/config.txt +++ b/config.txt @@ -22,7 +22,6 @@ # Uncomment to force a console size. By default it will be display's size minus overscan. #framebuffer_width=1280 #framebuffer_height=720 -#framebuffer_depth=16 # SDTV_MODES #sdtv_mode=0 diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 95e5a84ac8..0509ad6e8f 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -223,8 +223,6 @@ systemctl enable dietpi-rm_program_usb_boot_mode G_CONFIG_INJECT 'framebuffer_height=' '#framebuffer_height=0' /DietPi/config.txt G_CONFIG_INJECT 'max_framebuffer_width=' '#max_framebuffer_width=0' /DietPi/config.txt G_CONFIG_INJECT 'max_framebuffer_height=' '#max_framebuffer_height=0' /DietPi/config.txt - # - framebuffer_depth defaults to a set value of 16, even with HDMI disabled, so we manually reduce it to min 8 - G_CONFIG_INJECT 'framebuffer_depth=' 'framebuffer_depth=8' /DietPi/config.txt # - Splash cannot be seen anyway, without video output G_CONFIG_INJECT 'disable_splash=' 'disable_splash=1' /DietPi/config.txt # - hdmi_blanking should not play a role, however mode 1 should be generally preferred, which on idle disables HDMI output completely instead of just blanking the screen @@ -256,7 +254,6 @@ systemctl enable dietpi-rm_program_usb_boot_mode if (( $G_HW_MODEL < 10 )); then - G_CONFIG_INJECT 'framebuffer_depth=' '#framebuffer_depth=16' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_ignore_hotplug=' '#hdmi_ignore_hotplug=0' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_ignore_composite=' '#hdmi_ignore_composite=0' /DietPi/config.txt G_CONFIG_INJECT 'hdmi_blanking=' '#hdmi_blanking=0' /DietPi/config.txt diff --git a/dietpi/patch_file b/dietpi/patch_file index e92336958d..5c7dae140c 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -497,13 +497,6 @@ _EOF_ [[ -d /lib/firmware/allo ]] && rm -R /lib/firmware/allo - fi - #------------------------------------------------------------------------------- - #RPi add FB depth 16: https://github.com/MichaIng/DietPi/issues/1716 - if (( $G_HW_MODEL < 10 )) && ! grep -q 'framebuffer_depth=' /DietPi/config.txt; then - - echo -e "\n#framebuffer_depth=16" >> /DietPi/config.txt - fi #------------------------------------------------------------------------------- #RPi UART: https://github.com/MichaIng/DietPi/issues/1759 @@ -1676,6 +1669,9 @@ _EOF_ fi #------------------------------------------------------------------------------- + #RPi | Remove "framebuffer_depth" handling: https://github.com/MichaIng/DietPi/pull/2635 + (( $G_HW_MODEL < 10 )) && sed -i '/framebuffer_depth/d' /DietPi/config.txt + #------------------------------------------------------------------------------- #Reinstalls # Amiberry 2.25: https://github.com/MichaIng/DietPi/issues/2599 # Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 From 585c1668f561dcdbe38dc69a60b6a99c2aed9dcc Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Tue, 12 Mar 2019 22:23:47 +0100 Subject: [PATCH 13/25] v6.22 (#2636) + System | /etc/bashrc.d/ now allows ".bash" file ending as well. Merged all contained DietPi scripts into one: /etc/bashrc.d/dietpi.bash --- CHANGELOG.txt | 1 + dietpi/dietpi-login | 12 ++-- dietpi/patch_file | 4 +- rootfs/etc/bashrc.d/dietpi-login.sh | 7 --- .../etc/bashrc.d/dietpi-posix-set-locale.sh | 11 ---- .../etc/bashrc.d/dietpi-ps1_kill_animation.sh | 5 -- .../bashrc.d/dietpi-unsupported_terminal.sh | 36 ----------- rootfs/etc/bashrc.d/dietpi.bash | 63 +++++++++++++++++++ 8 files changed, 71 insertions(+), 68 deletions(-) delete mode 100644 rootfs/etc/bashrc.d/dietpi-login.sh delete mode 100644 rootfs/etc/bashrc.d/dietpi-posix-set-locale.sh delete mode 100644 rootfs/etc/bashrc.d/dietpi-ps1_kill_animation.sh delete mode 100644 rootfs/etc/bashrc.d/dietpi-unsupported_terminal.sh create mode 100644 rootfs/etc/bashrc.d/dietpi.bash diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f5b295d68c..4bd98437ff 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v6.22 Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 +- System | /etc/bashrc.d/ now allows ".bash" file ending as well. Merged all contained DietPi scripts into one: /etc/bashrc.d/dietpi.bash. https://github.com/MichaIng/DietPi/pull/2636 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". - General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 - RPi | DietPi does not set or change "framebuffer_depth" in config.txt anymore which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 104a20eb3f..1030319b6f 100644 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -9,8 +9,8 @@ #//////////////////////////////////// # # Info: - # - filename /DietPi/dietpi/dietpi-login - # - activates on login /etc/bashrc.d/dietpi-login.sh + # - Filename: /DietPi/dietpi/dietpi-login + # - Called in interactive bash shells from: /etc/bashrc.d/dietpi.bash #//////////////////////////////////// # Import DietPi-Globals -------------------------------------------------------------- @@ -37,12 +37,8 @@ # Autoboot Run_AutoStart(){ - # - Do we have a valid screen for autoboot? - local screen_valid=0 - [[ ! $DISPLAY && $(tty) == '/dev/tty1' ]] && screen_valid=1 - - # - Boot to specific program - if (( $screen_valid )); then + # - Boot into specific program if we have a valid screen + if [[ ! $DISPLAY && $(tty) == '/dev/tty1' ]]; then # - Kodi if (( $auto_start_index == 1 )); then diff --git a/dietpi/patch_file b/dietpi/patch_file index 5c7dae140c..0688bfcc96 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1553,8 +1553,10 @@ Also have a look at "Sonarr", another alternative TV show manager, available for #------------------------------------------------------------------------------- #Redo our /etc/bash.bashrc entry, user confirmed 4 entries: https://github.com/MichaIng/DietPi/issues/2529 + #As well allow ".bash" file ending and remove obsolete dietpi-*.sh scripts: https://github.com/MichaIng/DietPi/pull/2636 sed -i '\#for i in /etc/bashrc#d' /etc/bash.bashrc - G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc + G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh /etc/bashrc.d/*.bash; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc + rm -f /etc/bashrc.d/dietpi-*.sh #------------------------------------------------------------------------------- #Mopidy fix: https://github.com/MichaIng/DietPi/issues/2536 getent passwd mopidy &> /dev/null && usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy diff --git a/rootfs/etc/bashrc.d/dietpi-login.sh b/rootfs/etc/bashrc.d/dietpi-login.sh deleted file mode 100644 index 18e76501c1..0000000000 --- a/rootfs/etc/bashrc.d/dietpi-login.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# dietpi-* and G_* functions and variables -. /DietPi/dietpi/func/dietpi-globals - -# login scripts and banner -/DietPi/dietpi/dietpi-login diff --git a/rootfs/etc/bashrc.d/dietpi-posix-set-locale.sh b/rootfs/etc/bashrc.d/dietpi-posix-set-locale.sh deleted file mode 100644 index 3490c140a4..0000000000 --- a/rootfs/etc/bashrc.d/dietpi-posix-set-locale.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Workaround, if SSH client overrides locale with "POSIX" fallback: https://github.com/MichaIng/DietPi/issues/1540#issuecomment-367066178 -if [[ $(locale) =~ 'POSIX' ]]; then - - CURRENT_LOCALE="$(grep -m1 '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" - export LANG="${CURRENT_LOCALE:=en_GB.UTF-8}" - export LC_ALL="$CURRENT_LOCALE" - unset CURRENT_LOCALE - -fi diff --git a/rootfs/etc/bashrc.d/dietpi-ps1_kill_animation.sh b/rootfs/etc/bashrc.d/dietpi-ps1_kill_animation.sh deleted file mode 100644 index 1295ecdef7..0000000000 --- a/rootfs/etc/bashrc.d/dietpi-ps1_kill_animation.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# "G_DIETPI-NOFITY -2 message" starts a process animation. -# If scripts fail to kill the animation, e.g. cancelled by user, terminal bash prompt has to do it as last resort: -PROMPT_COMMAND="[[ -w /tmp/dietpi-process.pid ]] && rm /tmp/dietpi-process.pid && tput cub 9 && tput ed; $PROMPT_COMMAND" diff --git a/rootfs/etc/bashrc.d/dietpi-unsupported_terminal.sh b/rootfs/etc/bashrc.d/dietpi-unsupported_terminal.sh deleted file mode 100644 index c9f4cd85c7..0000000000 --- a/rootfs/etc/bashrc.d/dietpi-unsupported_terminal.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Workaround for SSH client passing an unsupported $TERM string: https://github.com/MichaIng/DietPi/issues/2034 -if [[ $SSH_TTY ]] && ! toe -a | grep -q "^$TERM[[:blank:]]"; then - - TERM_old="$TERM" - ncurses_term='' - - if [[ $TERM =~ 256 ]]; then - - export TERM='xterm-256color' - - else - - export TERM='xterm' - - fi - - G_WHIP_MENU_ARRAY=('0' 'Ignore for now, I will change the SSH clients terminal.') - - if ! dpkg-query -s ncurses-term &> /dev/null; then - - ncurses_term=' or install the "ncurses-term" APT packages, which enables a wider terminal support' - G_WHIP_MENU_ARRAY+=('1' 'Install "ncurses-term" now to enable a wider terminal support.') - G_WHIP_DEFAULT_ITEM=1 - - fi - - G_PROGRAM_NAME='Unsupported SSH client terminal' G_WHIP_MENU "[WARNING] Your SSH client passed an unsupported terminal: TERM=$TERM_old\n -As a workaround we fooled the server by setting: TERM=$TERM. This is not the cleanest solution, since commands might expect colours or formats, that are not supported by the actual terminal.\n -Please change your SSH clients terminal, respectively the passed \$TERM string$ncurses_term." && (( $G_WHIP_RETURNED_VALUE )) && G_AGI ncurses-term - - unset TERM_old - unset ncurses_term - -fi diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash new file mode 100644 index 0000000000..bfdcb905bb --- /dev/null +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -0,0 +1,63 @@ +#!/bin/bash +{ + #//////////////////////////////////// + # DietPi bash init script + # + #//////////////////////////////////// + # Created by MichaIng / micha@dietpi.com / dietpi.com + # + #//////////////////////////////////// + # + # Info: + # - Filename: /etc/bashrc.d/dietpi.bash + # - Sourced by all interactive bash shells from: /etc/bash.bashrc + # - Prepares shell for DietPi and runs autostarts on /dev/tty1 + #//////////////////////////////////// + + # - DietPi-Globals: dietpi-* aliases, G_* functions and variables + . /DietPi/dietpi/func/dietpi-globals + + # - "G_DIETPI-NOFITY -2 message" starts a process animation. + # If scripts fail to kill the animation, e.g. cancelled by user, terminal bash prompt has to do it as last resort: + PROMPT_COMMAND="[[ -w /tmp/dietpi-process.pid ]] && rm /tmp/dietpi-process.pid && tput cub 9 && tput ed; $PROMPT_COMMAND" + + # - Workaround if SSH client overrides locale with "POSIX" fallback: https://github.com/MichaIng/DietPi/issues/1540#issuecomment-367066178 + if [[ $(locale) =~ 'POSIX' ]]; then + + current_locale=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') + export LANG=${current_locale:=en_GB.UTF-8} + export LC_ALL=$current_locale + unset current_locale + + fi + + # - Workaround if SSH client sets an unsupported $TERM string: https://github.com/MichaIng/DietPi/issues/2034 + if [[ $SSH_TTY ]] && ! toe -a | grep -q "^$TERM[[:blank:]]"; then + + TERM_old=$TERM + ncurses_term='' + + [[ $TERM =~ 256 ]] && export TERM='xterm-256color' || export TERM='xterm' + + G_WHIP_MENU_ARRAY=('0' 'Ignore for now, I will change the SSH clients terminal.') + + if ! dpkg-query -s ncurses-term &> /dev/null; then + + ncurses_term=' or install the "ncurses-term" APT packages, which enables a wider terminal support' + G_WHIP_MENU_ARRAY+=('1' 'Install "ncurses-term" now to enable a wider terminal support.') + G_WHIP_DEFAULT_ITEM=1 + + fi + + G_PROGRAM_NAME='Unsupported SSH client terminal' G_WHIP_MENU "[WARNING] Your SSH client passed an unsupported terminal: TERM=$TERM_old\n +As a workaround we fooled the server by setting: TERM=$TERM. This is not the cleanest solution, since commands might expect colours or formats, that are not supported by the actual terminal.\n +Please change your SSH clients terminal, respectively the passed \$TERM string$ncurses_term." && (( $G_WHIP_RETURNED_VALUE )) && G_AGI ncurses-term + + unset TERM_old + unset ncurses_term + + fi + + # - DietPi-Login: First run setup, autostarts and login banner + /DietPi/dietpi/dietpi-login +} From a3ad63713445ed122f1ab6bac01948c1a277a5bf Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Mar 2019 01:53:13 +0100 Subject: [PATCH 14/25] v6.22 + DietPi-Software | Chromium: Enable on VM, at least on VirtualBox it works, although 3D acceleration fails due to an external issue with VirtualBox (guest additions, "vboxvideo" module) Linux guest X.org (on Windows host) --- dietpi/dietpi-software | 3 --- 1 file changed, 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8e89f8f76f..6d9672b16b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -434,9 +434,6 @@ _EOF_ # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # - VM - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 - #Remote Desktops #-------------------------------------------------------------------------------- software_id=27 From 85baeeccb1388bfbcfa935cdbdc1425f6e91e17d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Wed, 13 Mar 2019 21:33:40 +0100 Subject: [PATCH 15/25] v6.22 + DietPi-Software | GMediaRender: systemd service "!" exec prefix is not yet supported in Stretch, revert to "+" --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6d9672b16b..c50233fdeb 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12418,8 +12418,8 @@ After=network.target dietpi-boot.service [Service] User=gmrender Group=dietpi -ExecStartPre=!$(command -v touch) /var/log/gmrender.log -ExecStartPre=!$(command -v chown) gmrender:dietpi /var/log/gmrender.log +ExecStartPre=+$(command -v touch) /var/log/gmrender.log +ExecStartPre=+$(command -v chown) gmrender:dietpi /var/log/gmrender.log ExecStart=/bin/dash -c 'gmediarender -u "$(sed -n 5p /DietPi/dietpi/.hw_model)" -f "$( Date: Thu, 14 Mar 2019 01:01:47 +0100 Subject: [PATCH 16/25] META | DietPi-Survey_report: Minor wording and code cleanup --- .meta/dietpi-survey_report | 203 ++++++++++--------------------------- 1 file changed, 51 insertions(+), 152 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 8975a9a773..52a1862581 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -266,9 +266,9 @@ aSOFTWARE_NAME[106]='Lidarr' aSOFTWARE_NAME[107]='rTorrent' aSOFTWARE_NAME[108]='AmiBerry' - aSOFTWARE_NAME[109]='NFS' + aSOFTWARE_NAME[109]='NFS Server' aSOFTWARE_NAME[110]='NFS Client' - aSOFTWARE_NAME[111]='UrBackup server' + aSOFTWARE_NAME[111]='UrBackup Server' aSOFTWARE_NAME[112]='DXX-Rebirth' aSOFTWARE_NAME[113]='Chromium' aSOFTWARE_NAME[114]='Nextcloud' @@ -320,7 +320,7 @@ aSOFTWARE_NAME[160]='Allo_update' aSOFTWARE_NAME[161]='FuguHub' aSOFTWARE_NAME[162]='Docker' - aSOFTWARE_NAME[163]='Gmediarender' + aSOFTWARE_NAME[163]='GMediaRender' aSOFTWARE_NAME[164]='Nukkit' aSOFTWARE_NAME[165]='Gitea' aSOFTWARE_NAME[166]='PI-SPC' @@ -406,7 +406,7 @@ fi - # v6.10+: files can be sourced: + # Source survey files if grep -q '^#!/bin/bash' $file; then . $file @@ -474,8 +474,6 @@ fi - continue - fi done @@ -765,7 +763,7 @@

DietPi versions:

- $(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.17,1.20 -t ' ') + $(for i in "${!aDIETPI_VERSION[@]}"; do echo ""; done | sort -nrk 1.17,1.20 -t ' ')
DietPi v${i//6.9/6.09} ${aDIETPI_VERSION[$i]}
DietPi v$i ${aDIETPI_VERSION[$i]}

Git branches:

@@ -800,7 +798,7 @@

DietPi-Automation:

- +
Used by${aAUTO_SETUP_AUTOMATED[1]} of $((${aAUTO_SETUP_AUTOMATED[1]} + ${aAUTO_SETUP_AUTOMATED[0]})) users
Used by${aAUTO_SETUP_AUTOMATED[1]} of $((${aAUTO_SETUP_AUTOMATED[1]} + ${aAUTO_SETUP_AUTOMATED[0]})) installs

Network interfaces:

@@ -813,172 +811,73 @@ $(for i in "${!aSOFTWARE[@]}"; do echo "$i ${aSOFTWARE[$i]}"; done | sort -nrk 2 -t ' ') -

DietPi-Benchmarks | CPU:

- - - - - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + $(for i in "${!aBENCH_COMMON_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ')
- - - CPU time (seconds, lower is faster): - - CPU idle temp ('c): - - CPU full load temp ('c): - + CPU time (seconds, lower is faster):CPU idle temp ('c):CPU full load temp ('c):
- Device: - - Total benchmarks: - - Average: - - Fastest: - - Slowest: - - Average: - - Lowest: - - Highest: - - Average: - - Lowest: - - Highest: - Device:Total benchmarks:Average:Fastest:Slowest:Average:Lowest:Highest:Average:Lowest:Highest:
${aHW_NAME[$i]:=$i} ${aBENCH_COMMON_INDEX[$i]} ${aBENCH_RESULT_CPU_AVG[$i]} ${aBENCH_RESULT_CPU_MIN[$i]} ${aBENCH_RESULT_CPU_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]}

DietPi-Benchmarks | IO (Filesystem & RAM):

- - - - - - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + $(for i in "${!aBENCH_COMMON_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ')
- - - RootFS write (MB/s): - - RootFS read (MB/s): - - RAM write (MB/s): - - RAM read (MB/s): - + RootFS write (MB/s):RootFS read (MB/s):RAM write (MB/s):RAM read (MB/s):
- Device: - - Total benchmarks: - - Average: - - Fastest: - - Slowest: - - Average: - - Fastest: - - Slowest: - - Average: - - Fastest: - - Slowest: - - Average: - - Fastest: - - Slowest: - Device:Total benchmarks:Average:Fastest:Slowest:Average:Fastest:Slowest:Average:Fastest:Slowest:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_COMMON_INDEX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} ${aBENCH_RESULT_RAM_READ_AVG[$i]} ${aBENCH_RESULT_RAM_READ_MAX[$i]} ${aBENCH_RESULT_RAM_READ_MIN[$i]}
-

DietPi-Benchmarks | Network LAN throughput:

+

DietPi-Benchmarks | Network LAN throughput:

- - - - - - - + + - - - - - - + + + + + $(for i in "${!aBENCH_LAN_INDEX[@]}"; do echo ""; done | sort -nk 1 -t ' ')
- - - Transfer rate (MB/s): - + Transfer rate (MB/s):
- Device: - - Total benchmarks: - - Average: - - Fastest: - - Slowest: - Device:Total benchmarks:Average:Fastest:Slowest:
${aHW_NAME[$i]:=$i} ${aBENCH_LAN_INDEX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]} ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]}
- _EOF_ From 6a923c761e2fc8fab1aa7bde6e9c761db0a83899 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Thu, 14 Mar 2019 04:14:01 +0100 Subject: [PATCH 17/25] v6.22 + DietPi-RAMlog | Minor coding and wording align with DietPi-RAMdisk --- dietpi/func/dietpi-ramlog | 68 +++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/dietpi/func/dietpi-ramlog b/dietpi/func/dietpi-ramlog index 7212380b29..40244cd7af 100644 --- a/dietpi/func/dietpi-ramlog +++ b/dietpi/func/dietpi-ramlog @@ -9,49 +9,50 @@ #//////////////////////////////////// # # Info: - # - Saves /var/log/* atrributes and ownerships during shutdown to $FP_DIETPI_RAMLOG_SAVE - # - Restores /var/log/* atrributes and ownerships during boot from $FP_DIETPI_RAMLOG_SAVE - # - Uses cp with preserve ownership and attributes only. This generates blank file if required (ramlog) without override existing file data (non-ramlog). + # - /var/log is mounted as tmpfs (RAMdisk) before this script runs. + # - Saves /var/log/* attributes and ownerships to $FP_STORE during shutdown + # - Restores /var/log/* atrributes and ownerships from $FP_STORE during boot + # - This allows us to vastly reduce filesystem I/O and increase logging performance # # Usage: - # - /DietPi/dietpi/func/dietpi-ramlog 0 = Startup Phase (restores /var/log) - # - /DietPi/dietpi/func/dietpi-ramlog 1 = Shutdown Phase (saves /var/log) + # - /DietPi/dietpi/func/dietpi-ramlog 0 = Restore from $FP_STORE to /var/log + # - /DietPi/dietpi/func/dietpi-ramlog 1 = Store from /var/log to $FP_STORE #//////////////////////////////////// #------------------------------------------------------------------------------------- - #. /DietPi/dietpi/func/dietpi-globals # Not compatible until dietpi-preboot.service and overkill for the purpose of this script. - #export LC_ALL=en_GB.UTF-8 # Not needed, as we do not parse any external command and "date" is allowed to be in user locale format. - #cd $HOME # "cd: HOME not set" error and not needed, since we do not create any tmp files. + #. /DietPi/dietpi/func/dietpi-globals # Not compatible until DietPi-PreBoot has finished and overkill for the purpose of this script. + #export LC_ALL=en_GB.UTF-8 # Not required, as we do not parse any external command and "date" is allowed to be in user locale format. + #cd $HOME # Not required, as we do not create any tmp files and produces and: "cd: HOME not set" #------------------------------------------------------------------------------------- - INPUT=-1 # Use no valid default to prevent accidental removal of storage or recovery of intentionally removed files. - [[ $1 =~ ^-?[0-9]+$ ]] && INPUT=$1 + [[ $1 =~ ^-?[0-9]+$ ]] && INPUT=$1 || INPUT=-1 EXIT_CODE=0 PROGRAM_NAME='DietPi-RAMlog' - FP_DIETPI_RAMLOG_SAVE='/var/tmp/dietpi/logs/dietpi-ramlog_store' + FP_STORE='/var/tmp/dietpi/logs/dietpi-ramlog_store' #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - # Startup Phase (restore /var/log directory structure and files) + # Startup phase: Restore from disk if (( $INPUT == 0 )); then - echo "$(date) | $PROGRAM_NAME: Startup - Restoring log folder structure to RAMdisk..." + echo "$(date) | $PROGRAM_NAME: Restoring logs from disk..." - if [[ -d $FP_DIETPI_RAMLOG_SAVE ]]; then + if [[ -d $FP_STORE ]]; then - # - Apply previous attributes and ownerships. Generates empty file if it doesnt exist. - cp -Rp --attributes-only $FP_DIETPI_RAMLOG_SAVE/. /var/log/ - EXIT_CODE=$?; if (( $EXIT_CODE )); then + # - Restore empty logs with ownership and permissions from disk + cp -an --attributes-only $FP_STORE/. /var/log/ || EXIT_CODE=$? - echo "$(date) | $PROGRAM_NAME: Startup failed with exit code $EXIT_CODE" + if (( $EXIT_CODE )); then + + echo "$(date) | $PROGRAM_NAME: [ERROR] Restoring logs from disk failed with exit code: $EXIT_CODE" else - echo "$(date) | $PROGRAM_NAME: Startup completed" + echo "$(date) | $PROGRAM_NAME: Restored logs from disk." fi @@ -61,39 +62,30 @@ fi - # Shutdown Phase (saves /var/log directory structure and filenames) + # Shutdown phase: Store to disk elif (( $INPUT == 1 )); then - echo "$(date) | $PROGRAM_NAME: Shutdown - Saving log folder structure to disk..." - - # - Clear previous storage data - if [[ -d $FP_DIETPI_RAMLOG_SAVE ]]; then - - rm -Rf $FP_DIETPI_RAMLOG_SAVE/{,.??,.[^.]}* + echo "$(date) | $PROGRAM_NAME: Storing logs to disk..." - # - Create dir - else - - mkdir -p $FP_DIETPI_RAMLOG_SAVE + # - Assure empty $FP_STORE + [[ -d $FP_STORE ]] && rm -Rf $FP_STORE/{,.??,.[^.]}* || mkdir -p $FP_STORE || EXIT_CODE=$? - fi + # - Store empty logs with ownership and permissions to disk + cp -af --attributes-only /var/log/. $FP_STORE/ || EXIT_CODE=$? - # - Copy logfile attributes and ownership to storage (not file contents) - cp -Rp --attributes-only /var/log/. $FP_DIETPI_RAMLOG_SAVE/ - EXIT_CODE=$?; if (( $EXIT_CODE )); then + if (( $EXIT_CODE )); then - echo "$(date) | $PROGRAM_NAME: Shutdown failed with exit code $EXIT_CODE" + echo "$(date) | $PROGRAM_NAME: [ERROR] Storing logs to disk failed with exit code: $EXIT_CODE" else - echo "$(date) | $PROGRAM_NAME: Shutdown completed" + echo "$(date) | $PROGRAM_NAME: Stored logs to disk." fi - # Unknown argument else - echo "$(date) | $PROGRAM_NAME: Unknown argument: $INPUT. Aborting..." + echo "$(date) | $PROGRAM_NAME: [ERROR] Unknown argument: $INPUT. Aborting..." EXIT_CODE=1 fi From 31f4900b576deead5801b820aa99e72ef2a3eb8d Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Mar 2019 14:47:15 +0100 Subject: [PATCH 18/25] v6.22 + DietPi-Patch | Tiny fix for Beta users on Jessie system to switch global PW to sha256 digest --- dietpi/patch_file | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index 0688bfcc96..40998b7cdd 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1674,6 +1674,15 @@ _EOF_ #RPi | Remove "framebuffer_depth" handling: https://github.com/MichaIng/DietPi/pull/2635 (( $G_HW_MODEL < 10 )) && sed -i '/framebuffer_depth/d' /DietPi/config.txt #------------------------------------------------------------------------------- + #Tiny fix for Beta users on Jessie system to switch global PW to sha256 digest, since related pre-patch is not re-run on RC-only updates: https://github.com/MichaIng/DietPi/commit/70e0a664d5b12954d673cde3f20224547ed8d549 + local global_pw='' + if (( $G_DISTRO < 4 )) && + global_pw=$(openssl enc -d -a -md md5 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin 2> /dev/null); then + + openssl enc -e -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $global_pw + + fi + #------------------------------------------------------------------------------- #Reinstalls # Amiberry 2.25: https://github.com/MichaIng/DietPi/issues/2599 # Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 From 9b4cd690b25103a5f0635b7a522e70ef2e45c6d0 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Fri, 15 Mar 2019 22:14:54 +0100 Subject: [PATCH 19/25] v6.22 (#2554) + DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. + DietPi-Software/Process_tool | Minor coding --- CHANGELOG.txt | 1 + dietpi/dietpi-process_tool | 26 +++++++------- dietpi/dietpi-software | 71 +++++++++++++------------------------- 3 files changed, 39 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4bd98437ff..f8296e5c7f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | Netdata: On Debian Stretch/Buster and Raspbian Buster an up-to-date APT package is available, which will now be installed instead of our custom build. Many thanks to @74cmonty for this information: https://github.com/MichaIng/DietPi/issues/2446 - DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. - DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 +- DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. Many thanks to @WolfganP for informing us about this new release: https://github.com/MichaIng/DietPi/issues/2553 Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 2e373b679c..d49012ad0a 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -19,14 +19,13 @@ #Import DietPi-Globals --------------------------------------------------------------- . /DietPi/dietpi/func/dietpi-globals - G_CHECK_ROOT_USER G_PROGRAM_NAME='DietPi-Process_tool' + G_CHECK_ROOT_USER G_INIT #Import DietPi-Globals --------------------------------------------------------------- #Grab Input - INPUT=0 - disable_error=1 G_CHECK_VALIDINT $1 && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Globals @@ -171,6 +170,9 @@ done <<< "$(pgrep -f "${aPROCESS_NAME[$i]}")" + # PMS v1.15: Renice com.plexapp.system sub process to 15 which it spawns at + [[ ${aNAME[$i]} == 'Plex Media Server' ]] && renice -n 15 -p $(pgrep -f 'com.plexapp.system') &> /dev/null + fi done @@ -306,8 +308,8 @@ while read line do - aNAME[$index]="$(sed 's/:.*$//' <<< $line)" - aPROCESS_NAME[$index]="$(sed 's/^.*://' <<< $line)" + aNAME[$index]=$(sed 's/:.*$//' <<< $line) + aPROCESS_NAME[$index]=$(sed 's/^.*://' <<< $line) ((index++)) done < $fp_include @@ -358,10 +360,10 @@ do # - available schedulers - aSCHEDULE_AVAILABLE_POLICY[$index]="${line%%[[:blank:]]*}" + aSCHEDULE_AVAILABLE_POLICY[$index]=${line%%[[:blank:]]*} # - available priorities - line="${line##*: }" + line=${line##*: } # -- min aSCHEDULE_AVAILABLE_PRIORITY_MIN[$index]=${line%/*} # -- max @@ -500,7 +502,7 @@ _EOF_ done - G_WHIP_DEFAULT_ITEM="$LAST_SELECTED_NAME" + G_WHIP_DEFAULT_ITEM=$LAST_SELECTED_NAME G_WHIP_BUTTON_CANCEL_TEXT='Exit' if G_WHIP_MENU 'Please select a program:'; then @@ -591,7 +593,7 @@ _EOF_ done - G_WHIP_DEFAULT_ITEM="$nice_current" + G_WHIP_DEFAULT_ITEM=$nice_current G_WHIP_MENU "Please select your nice level for:\n${aNAME[$index_current]}\n\nInfo:\n - Negative values have a higher priority (eg: -10).\n - Positive values have a lower priority (eg: 15).\n - The default value is 0." if (( ! $? )); then @@ -644,7 +646,7 @@ _EOF_ done #Update affinity array with new value, if at least 1 item was selected. - [[ $new_affinity ]] && aAFFINITY[$index_current]="$new_affinity" + [[ $new_affinity ]] && aAFFINITY[$index_current]=$new_affinity #Apply Apply_Process_Tool @@ -687,7 +689,7 @@ _EOF_ done - G_WHIP_DEFAULT_ITEM="${aSCHEDULE_POLICY[$index_current]}" + G_WHIP_DEFAULT_ITEM=${aSCHEDULE_POLICY[$index_current]} if G_WHIP_MENU "Please select a Schedule Policy for :\n${aNAME[$index_current]}"; then aSCHEDULE_POLICY[$index_current]=$G_WHIP_RETURNED_VALUE @@ -771,7 +773,7 @@ _EOF_ done - G_WHIP_DEFAULT_ITEM="${aSCHEDULE_PRIORITY[$index_current]}" + G_WHIP_DEFAULT_ITEM=${aSCHEDULE_PRIORITY[$index_current]} G_WHIP_MENU "Please select a Schedule Priority level for :\n${aNAME[$index_current]}\n\n - Lower values are low priority\n - Higher values are high priority" if (( ! $? )); then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c50233fdeb..0a47c4b6c3 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5246,46 +5246,33 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - #PLEXMEDIASERVER - software_id=42 + software_id=42 # Plex Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - #x86_64 - if (( $G_HW_ARCH == 10 )); then - - Download_Install 'https://downloads.plex.tv/plex-media-server/1.14.0.5470-9d51fdfaa/plexmediaserver_1.14.0.5470-9d51fdfaa_amd64.deb' - - #ARM - else - - INSTALL_URL_ADDRESS='https://dev2day.de/pms/' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - - echo "deb [arch=armhf] $INSTALL_URL_ADDRESS $G_DISTRO_NAME main" > /etc/apt/sources.list.d/plex.list - wget -O - "$INSTALL_URL_ADDRESS"dev2day-pms.gpg.key | apt-key add - - - # Buster: Revert repo to Stretch, as Buster is not yet available - sed -i 's/buster/stretch/g' /etc/apt/sources.list.d/plex.list + # Derive latest version from: https://plex.tv/pms/downloads/5 + INSTALL_URL_ADDRESS='https://plex.tv/pms/downloads/5' + G_CHECK_URL "$INSTALL_URL_ADDRESS" - #ARMv8: Install 32bit binaries - if (( $G_HW_ARCH == 3 )); then + # ARMv7 + local arch='armhf' - dpkg --add-architecture armhf - G_AGUP - G_AGI libstdc++6:armhf plexmediaserver-installer:armhf + # ARMv8 + if (( $G_HW_ARCH == 3 )); then - #ARM32 - else + arch='arm64' - G_AGUP - G_AGI plexmediaserver-installer + # x86_64 + elif (( $G_HW_ARCH == 10 )); then - fi + arch='amd64' fi + # Derive URL from arch + no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "distro=\"debian\".*$arch\.deb" | cut -d \" -f 8)" + fi #CUBERITE @@ -5537,7 +5524,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior fi - no_check_url=1 Download_Install "$(curl -s $INSTALL_URL_ADDRESS | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" /etc + no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" /etc mv /etc/syncthing-* /etc/syncthing fi @@ -5834,7 +5821,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases' G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :( - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux.tar.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) DEPS_LIST='mediainfo' no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt @@ -5849,7 +5836,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS='https://api.github.com/repos/Lidarr/Lidarr/releases' G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux.tar.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) DEPS_LIST='mediainfo' no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt @@ -5890,7 +5877,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases/latest' G_CHECK_URL "$INSTALL_URL_ADDRESS" #full filepath below, returns --spider error :( - INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett.Binaries.Mono.tar.gz' | cut -d \" -f 4) + INSTALL_URL_ADDRESS=$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt @@ -10675,22 +10662,12 @@ location = /.well-known/caldav { fi - #PLEXMEDIASERVER - software_id=42 + software_id=42 # Plex Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration Download_Test_Media - # For all ARM devices: - # - en_US.UTF-8 must be installed and the default locale on system. This is for SBC installs using dev2day repo: https://github.com/MichaIng/DietPi/issues/116#issuecomment-222195911 - if (( $G_HW_ARCH < 10 )) && ! locale | grep -q 'en_US.UTF-8'; then - - G_WHIP_MSG 'Plex Media Server requires en_US.UTF-8 locale to be installed and set to default, else, Plex will not start.\n\nThe installer will now change your locale to: en_US.UTF-8' - /DietPi/dietpi/func/dietpi-set_software locale 'en_US.UTF-8' - - fi - # Run service as "dietpi" group: https://github.com/MichaIng/DietPi/issues/350#issuecomment-423763518 mkdir -p /etc/systemd/system/plexmediaserver.service.d echo -e '[Service]\nGroup=dietpi' > /etc/systemd/system/plexmediaserver.service.d/dietpi-group.conf @@ -14008,14 +13985,14 @@ _EOF_ fi - software_id=42 + software_id=42 # Plex Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP $(dpkg --get-selections plexmediaserver* | mawk '{print $1}') - [[ -d /var/lib/plexmediaserver ]] && rm -R /var/lib/plexmediaserver - [[ -f etc/apt/sources.list.d/plex.list ]] && rm /etc/apt/sources.list.d/plex.list && G_AGUP [[ -d /etc/systemd/system/plexmediaserver.service.d ]] && rm -R /etc/systemd/system/plexmediaserver.service.d # post v6.17 + [[ -d /var/lib/plexmediaserver ]] && rm -R /var/lib/plexmediaserver # pre v6.22 Plex v1.15 + [[ -f etc/apt/sources.list.d/plex.list ]] && rm /etc/apt/sources.list.d/plex.list && G_AGUP # pre v6.22 fi @@ -14023,7 +14000,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - rm -R /etc/cuberite &> /dev/null #v6.11< + rm -R /etc/cuberite &> /dev/null # pre v6.11 rm -R $G_FP_DIETPI_USERDATA/cubrite rm /etc/systemd/system/cuberite.service From ebaa4b06af61bf253dca760735821e18f23d9c1f Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 02:22:56 +0100 Subject: [PATCH 20/25] v6.22 (#2639) + DietPi-Software | Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel and further update Nginx config according to latest changes in official docs + DietPi-Software | ownCloud/Nextcloud: Workaround Redis socket permission issue on Buster. Requires more secure solution until official Buster release/support. + DietPi-Software | Nextcloud Talk: Handle new coTURN systemd unit and missing config file on Buster + DietPi-Software | Nginx: Do not add non-existent 40x/50x pages, revert to default --- .conf/dps_114/apache.nextcloud.conf | 4 ++ .conf/dps_114/lighttpd.nextcloud.conf | 6 ++ .conf/dps_114/nginx.nextcloud.conf | 21 ++++--- .conf/dps_85/nginx.default | 6 -- CHANGELOG.txt | 1 + dietpi/dietpi-software | 91 ++++++++++++++++++++------- dietpi/patch_file | 26 ++++++++ 7 files changed, 118 insertions(+), 37 deletions(-) diff --git a/.conf/dps_114/apache.nextcloud.conf b/.conf/dps_114/apache.nextcloud.conf index 55994d9fef..6d6e8e33fe 100644 --- a/.conf/dps_114/apache.nextcloud.conf +++ b/.conf/dps_114/apache.nextcloud.conf @@ -1,5 +1,9 @@ # Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#apache-web-server-configuration +# Redirect OCM/OCS provider requests to Nextcloud endpoint: +Redirect permanent /ocm-provider /nextcloud/ocm-provider +Redirect permanent /ocs-provider /nextcloud/ocs-provider + Options +FollowSymlinks AllowOverride All diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index f61d733670..489d1862a5 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -2,6 +2,12 @@ # - Apache: https://github.com/nextcloud/server/blob/master/.htaccess # - Nginx: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html +# Redirect OCM/OCS provider requests to Nextcloud endpoint: +url.redirect += ( + "^/ocm-provider" => "/nextcloud/ocm-provider", + "^/ocs-provider" => "/nextcloud/ocs-provider" +) + $HTTP["url"] =~ "^/nextcloud($|/)" { # Hardening diff --git a/.conf/dps_114/nginx.nextcloud.conf b/.conf/dps_114/nginx.nextcloud.conf index fefb601b29..057e9f4742 100644 --- a/.conf/dps_114/nginx.nextcloud.conf +++ b/.conf/dps_114/nginx.nextcloud.conf @@ -1,4 +1,9 @@ -# Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html +# Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx + +# Redirect OCM/OCS provider requests to Nextcloud endpoint: +location ~ ^\/(?:ocm-provider|ocs-provider).* { + rewrite ^ /nextcloud$request_uri; +} location ^~ /nextcloud { @@ -34,15 +39,15 @@ location ^~ /nextcloud { rewrite ^ /nextcloud/index.php$request_uri; } - location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ { + location ~ ^\/nextcloud\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { deny all; } - location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) { + location ~ ^\/nextcloud\/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } - location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; + location ~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|ocm-provider\/.+)\.php(?:$|\/) { + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; @@ -59,14 +64,14 @@ location ^~ /nextcloud { fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128"; } - location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) { + location ~ ^\/nextcloud\/(?:updater|ocs-provider|ocm-provider)(?:$|\/) { try_files $uri/ =404; index index.php; } # Adding the cache control header for js and css files # Make sure it is BELOW the PHP block - location ~ \.(?:css|js|woff|svg|gif)$ { + location ~ ^\/nextcloud\/.+[^\/]\.(?:css|js|woff2?|svg|gif)$ { try_files $uri /nextcloud/index.php$request_uri; add_header Cache-Control "public, max-age=15778463"; # Add headers to serve security related headers (It is intended @@ -83,7 +88,7 @@ location ^~ /nextcloud { access_log off; } - location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ { + location ~ ^\/nextcloud\/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg)$ { try_files $uri /nextcloud/index.php$request_uri; # Optional: Don't log access to other assets access_log off; diff --git a/.conf/dps_85/nginx.default b/.conf/dps_85/nginx.default index f422382e51..eb57a2b192 100644 --- a/.conf/dps_85/nginx.default +++ b/.conf/dps_85/nginx.default @@ -14,12 +14,6 @@ server { try_files $uri $uri/ =404; } - error_page 404 /404.html; - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /var/www; - } - location ~ \.php(?:$|/) { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f8296e5c7f..8352500203 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -23,6 +23,7 @@ Changes / Improvements / Optimisations: - DietPi-Software | DietPi-RAMlog: When installing/enabling RAMlog, the /var/log mountpoint will be now cleaned before mounting the tmpfs on it, while preserving the existing logs metadata. This resolves a warning on early boot stage and frees the disk space consumed by the disk log before. - DietPi-Software | rTorrent: Runs now as user "rtorrent" and creates files as group "dietpi" with 775/664 permissions. Enabled Buster support and enhanced config file handling on reinstall: https://github.com/MichaIng/DietPi/pull/2633 - DietPi-Software | Plex Media Server: Now installs the latest version automatically (currently 1.15) which as well includes official ARM binaries. Many thanks to @WolfganP for informing us about this new release: https://github.com/MichaIng/DietPi/issues/2553 +- DietPi-Software | Nextcloud: Resolved an admin panel warning about missing ocm/ocs-provider redirects. Many thanks to @minnux for reporting this issue: https://github.com/MichaIng/DietPi/issues/2638 Bug Fixes: - System | Resolved an issue where /etc/bashrc.d entries could be run multiple times. Many thanks to @jonare77 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2529 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0a47c4b6c3..da3faaded0 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7747,7 +7747,7 @@ Redirect permanent /.well-known/caldav /owncloud/remote.php/dav' > /etc/apache2/ if [[ ! -f /etc/lighttpd/conf-enabled/99-dietpi-dav_redirect.conf ]]; then echo '# Redirect Cal/CardDAV requests to ownCloud endpoint: -url.redirect = ( +url.redirect += ( "^/.well-known/caldav" => "/owncloud/remote.php/dav", "^/.well-known/carddav" => "/owncloud/remote.php/dav" )' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf @@ -7915,7 +7915,18 @@ _EOF_ # - Enable Redis socket and grant www-data access to it: # - NB: To allow wildcard expansion, do not use quotes around $redis_conf! GCI_PRESERVE=1 G_CONFIG_INJECT 'unixsocket[[:blank:]]' 'unixsocket /var/run/redis/redis-server.sock' $redis_conf - G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf + # - Current Buster PHP7.3 Redis module cannot access Redis socket even with group + 770 permissions. + # - Obviously group of spawned processes is overridden by only www-data while redis membership is lost. + # - Requires secure solution, however for now we workaround with 777 socket permissions. + if (( $G_DISTRO > 4 )); then + + G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 777' $redis_conf + + else + + G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf + + fi local redis_sock=$(grep -m1 '^[[:blank:]]*unixsocket[[:blank:]]' $redis_conf | mawk '{print $2}') usermod -a -G redis www-data G_RUN_CMD systemctl restart redis-server @@ -8009,7 +8020,7 @@ Redirect permanent /.well-known/caldav /nextcloud/remote.php/dav' > /etc/apache2 if [[ ! -f /etc/lighttpd/conf-enabled/99-dietpi-dav_redirect.conf ]]; then echo '# Redirect Cal/CardDAV requests to Nextcloud endpoint: -url.redirect = ( +url.redirect += ( "^/.well-known/caldav" => "/nextcloud/remote.php/dav", "^/.well-known/carddav" => "/nextcloud/remote.php/dav" )' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf @@ -8205,7 +8216,18 @@ The install script will now exit. After applying one of the the above, rerun die # - Enable Redis socket and grant www-data access to it: # - NB: To allow wildcard expansion, do not use quotes around $redis_conf! GCI_PRESERVE=1 G_CONFIG_INJECT 'unixsocket[[:blank:]]' 'unixsocket /var/run/redis/redis-server.sock' $redis_conf - G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf + # - Current Buster PHP7.3 Redis module cannot access Redis socket even with group + 770 permissions. + # - Obviously group of spawned processes is overridden by only www-data while redis membership is lost. + # - Requires secure solution, however for now we workaround with 777 socket permissions. + if (( $G_DISTRO > 4 )); then + + G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 777' $redis_conf + + else + + G_CONFIG_INJECT 'unixsocketperm[[:blank:]]' 'unixsocketperm 770' $redis_conf + + fi local redis_sock=$(grep -m1 '^[[:blank:]]*unixsocket[[:blank:]]' $redis_conf | mawk '{print $2}') usermod -a -G redis www-data G_RUN_CMD systemctl restart redis-server @@ -8231,12 +8253,28 @@ The install script will now exit. After applying one of the the above, rerun die Banner_Configuration G_DIETPI-NOTIFY 2 'Configuring TURN server:' - # - Enable init.d service - G_CONFIG_INJECT 'TURNSERVER_ENABLED=' 'TURNSERVER_ENABLED=1' /etc/default/coturn - # - Disable coturn logging by default, this can be overridden via /etc/turnserver.conf - G_CONFIG_INJECT 'DAEMON_ARGS=' "DAEMON_ARGS='-c /etc/turnserver.conf -o -l stdout --no-stdout-log --simple-log'" /etc/default/coturn + # Buster (systemd unit) + if (( $G_DISTRO > 4 )); then - # - Ask user for server domain and desired TURN server port + # - Remove init.d service traces + [[ -f /etc/init.d/coturn ]] && rm /etc/init.d/coturn + [[ -f /etc/default/coturn ]] && rm /etc/default/coturn + + # - Disable coturn logging by default, this can be overridden via /etc/turnserver.conf + 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 + + # Stretch/Jessie (init.d service) + else + + # - Enable init.d service + G_CONFIG_INJECT 'TURNSERVER_ENABLED=' 'TURNSERVER_ENABLED=1' /etc/default/coturn + # - Disable coturn logging by default, this can be overridden via /etc/turnserver.conf + G_CONFIG_INJECT 'DAEMON_ARGS=' "DAEMON_ARGS='-c /etc/turnserver.conf -o -l stdout --no-stdout-log --simple-log'" /etc/default/coturn + + fi + + # Ask user for server domain and desired TURN server port local invalid_text='' local domain=$(hostname) while : @@ -8277,7 +8315,14 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal done - # - Adjust coturn settings + # Adjust coturn settings + # - On Buster by default /etc/turnserver.conf is not created. Use example or create empty file: + if [[ ! -f /etc/turnserver.conf ]]; then + + > /etc/turnserver.conf + [[ -f /usr/share/doc/coturn/examples/etc/turnserver.conf.gz ]] && gzip -cd /usr/share/doc/coturn/examples/etc/turnserver.conf.gz > /etc/turnserver.conf + + fi G_CONFIG_INJECT 'fingerprint' 'fingerprint' /etc/turnserver.conf G_CONFIG_INJECT 'use-auth-secret' 'use-auth-secret' /etc/turnserver.conf G_CONFIG_INJECT 'realm=' "realm=$domain" /etc/turnserver.conf @@ -8287,7 +8332,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal G_CONFIG_INJECT 'no-loopback-peers' 'no-loopback-peers' /etc/turnserver.conf G_CONFIG_INJECT 'no-multicast-peers' 'no-multicast-peers' /etc/turnserver.conf - # - Add TLS settings, if LetsEncrypt certificates are available: + # Add TLS settings, if LetsEncrypt certificates are available: if [[ -f /DietPi/dietpi/.dietpi-letsencrypt && -f /etc/letsencrypt/live/$(sed -n 1p /DietPi/dietpi/.dietpi-letsencrypt)/cert.pem ]]; then @@ -8307,19 +8352,19 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal fi - # - Install Nextcloud Talk app + # Install Nextcloud Talk app G_RUN_CMD systemctl start $MARIADB_SERVICE G_RUN_CMD systemctl start redis-server G_RUN_CMD ncc maintenance:mode --off - G_RUN_CMD ncc app:install spreed + [[ -d /var/www/nextcloud/apps/spreed ]] || G_RUN_CMD ncc app:install spreed ncc app:enable spreed - # - Adjust Nextcloud Talk settings to use coturn + # Adjust Nextcloud Talk settings to use coturn ncc config:app:set spreed stun_servers --value="[\"$domain:$port\"]" - # Generate random secret to secure TURN server access + # - Generate random secret to secure TURN server access local secret=$(openssl rand -hex 32) GCI_PRESERVE=1 G_CONFIG_INJECT 'static-auth-secret=' "static-auth-secret=$secret" /etc/turnserver.conf - # Scrape existing secret, in case user manually chose/edited it + # - Scrape existing secret, in case user manually chose/edited it secret=$(grep -m1 '^[[:blank:]]*static-auth-secret=' /etc/turnserver.conf) secret=${secret#*static-auth-secret=} ncc config:app:set spreed turn_servers --value="[{\"server\":\"$domain:$port\",\"secret\":\"$secret\",\"protocols\":\"udp,tcp\"}]" @@ -10611,7 +10656,7 @@ Redirect permanent /.well-known/caldav /baikal/html/dav.php' > /etc/apache2/conf elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then echo '# Redirect Cal/CardDAV requests to Baikal endpoint: -url.redirect = ( +url.redirect += ( "^/.well-known/caldav" => "/baikal/html/dav.php", "^/.well-known/carddav" => "/baikal/html/dav.php" )' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf @@ -12739,8 +12784,7 @@ _EOF_ fi - #ownCloud - software_id=47 + software_id=47 # ownCloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -12784,21 +12828,22 @@ _EOF_ fi - #Nextcloud Talk + TURN server "coturn" - software_id=168 + software_id=168 # Nextcloud Talk + TURN server "coturn" if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling G_AGP coturn + [[ -f /etc/turnserver.conf ]] && rm /etc/turnserver.conf + [[ -d /etc/systemd/system/coturn.service.d ]] && rm -R /etc/systemd/system/coturn.service.d systemctl start $MARIADB_SERVICE + systemctl start redis-server ncc maintenance:mode --off ncc app:disable spreed G_DIETPI-NOTIFY 2 'Disabled Nextcloud Talk app, but you need to remove it manually from Nextcloud web UI, if desired.' fi - #Nextcloud - software_id=114 + software_id=114 # Nextcloud if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling diff --git a/dietpi/patch_file b/dietpi/patch_file index 40998b7cdd..d05cfac0f0 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1681,6 +1681,32 @@ _EOF_ openssl enc -e -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $global_pw + fi + #------------------------------------------------------------------------------- + #Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel: https://github.com/MichaIng/DietPi/issues/2638 + if [[ -f /etc/apache2/sites-available/dietpi-nextcloud.conf ]] && + ! grep -qE '(ocm|ocs)-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then + + echo 'Redirect permanent /ocm-provider /nextcloud/ocm-provider +Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites-available/dietpi-nextcloud.conf + + fi + if [[ -f /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf ]] && + ! grep -qE '(ocm|ocs)-provider' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then + + echo 'url.redirect += ( + "^/ocm-provider" => "/nextcloud/ocm-provider", + "^/ocs-provider" => "/nextcloud/ocs-provider" +)' >> /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf + + fi + if [[ -f /etc/nginx/sites-dietpi/dietpi-nextcloud.conf ]] && + ! grep -qE '(ocm|ocs)-provider' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; then + + echo 'location ~ ^\/(?:ocm-provider|ocs-provider).* { + rewrite ^ /nextcloud$request_uri; +}' >> /etc/nginx/sites-dietpi/dietpi-nextcloud.conf + fi #------------------------------------------------------------------------------- #Reinstalls From 2b0a4dabcafc0b165224a4b05d069383a0bd9352 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 16:40:18 +0100 Subject: [PATCH 21/25] v6.22 + DietPi-Patch | Tiny coding --- dietpi/patch_file | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index d05cfac0f0..5f99aab7a1 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -1685,23 +1685,23 @@ _EOF_ #------------------------------------------------------------------------------- #Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel: https://github.com/MichaIng/DietPi/issues/2638 if [[ -f /etc/apache2/sites-available/dietpi-nextcloud.conf ]] && - ! grep -qE '(ocm|ocs)-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then + ! grep -q 'oc[ms]-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then echo 'Redirect permanent /ocm-provider /nextcloud/ocm-provider Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites-available/dietpi-nextcloud.conf fi if [[ -f /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf ]] && - ! grep -qE '(ocm|ocs)-provider' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then + ! grep -q 'oc[ms]-provider' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then echo 'url.redirect += ( - "^/ocm-provider" => "/nextcloud/ocm-provider", + "^/ocm-provider" => "/nextcloud/ocm-provider", "^/ocs-provider" => "/nextcloud/ocs-provider" )' >> /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf fi if [[ -f /etc/nginx/sites-dietpi/dietpi-nextcloud.conf ]] && - ! grep -qE '(ocm|ocs)-provider' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; then + ! grep -q 'oc[ms]-provider' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; then echo 'location ~ ^\/(?:ocm-provider|ocs-provider).* { rewrite ^ /nextcloud$request_uri; From 813c212ab71e6d2621936deb09b7bde6ed783a77 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 18:26:19 +0100 Subject: [PATCH 22/25] v6.22 + DietPi-Globals | G_OBTAIN_CPU_TEMP(): Speed up by coding simplifications --- dietpi/func/dietpi-globals | 83 ++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 19f52a9e39..9c651cf462 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1838,82 +1838,79 @@ $print_logfile_info # print_full_info=1# optional input to print full colour text output and temp warnings. G_OBTAIN_CPU_TEMP(){ - local cpu_temp_current='N/A' #We must always return a value, due to VM lacking this feature + benchmark online + local cpu_temp_current='N/A' # We must always return a value, due to VM lacking this feature + benchmark online local print_full_info=${print_full_info:-0} - # - Array to store possible locations for temp read. - afp_temperature=( + # Read CPU temp from file + # - Sparky/Asus: Requires special case as in others array this would break other SBC temp readouts with 2 zones + if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 52 )); then - #'/sys/class/thermal/thermal_zone1/temp' #sparky/Asus, will break other SBC temp readouts as most have 2 zones, needs a special case - '/sys/class/thermal/thermal_zone0/temp' - '/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input' - '/sys/class/hwmon/hwmon0/device/temp_label' + cpu_temp_current=$(= 150 )) && cpu_temp_current=$(mawk '{print $1/1000}' <<< "$cpu_temp_current" | xargs printf "%0.0f") + # Format output + # - Check for valid value + if ! disable_error=1 G_CHECK_VALIDINT "$cpu_temp_current" 1; then - # - Native PC + possibily others, due to vast sensors /sys/class/thermal/thermal_zone[0-9], all of which we are unsure is CPU, check for possible invalid entries and set N/A - # EG: Z83 = 0, also seen some results as a minus value - if ! disable_error=1 G_CHECK_VALIDINT $cpu_temp_current || (( $cpu_temp_current <= 0 )); then + cpu_temp_current='N/A' - cpu_temp_current='N/A' + else - elif (( $print_full_info )); then + # - 2/5 digit output? + (( $cpu_temp_current >= 150 )) && cpu_temp_current=$(mawk '{print $1/1000}' <<< $cpu_temp_current | xargs printf "%0.0f") - local cpu_temp_current_f=$(( $cpu_temp_current * 9/5 + 32 )) - if (( $cpu_temp_current >= 70 )); then + if (( $print_full_info )); then - cpu_temp_current="\e[1;31mWarning: $cpu_temp_current'C : $cpu_temp_current_f'F (Reducing the life of your device)\e[0m" + local cpu_temp_current_f=$(( $cpu_temp_current * 9/5 + 32 )) + if (( $cpu_temp_current >= 70 )); then - elif (( $cpu_temp_current >= 60 )); then + cpu_temp_current="\e[1;31mWARNING: $cpu_temp_current'C : $cpu_temp_current_f'F (Reducing the life of your device)\e[0m" - cpu_temp_current="\e[38;5;202m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running hot, not recommended)\e[0m" + elif (( $cpu_temp_current >= 60 )); then - elif (( $cpu_temp_current >= 50 )); then + cpu_temp_current="\e[38;5;202m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running hot, not recommended)\e[0m" - cpu_temp_current="\e[1;33m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running warm, but safe)\e[0m" + elif (( $cpu_temp_current >= 50 )); then - elif (( $cpu_temp_current >= 40 )); then + cpu_temp_current="\e[1;33m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running warm, but safe)\e[0m" - cpu_temp_current="\e[1;32m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Optimal temperature)\e[0m" + elif (( $cpu_temp_current >= 40 )); then - elif (( $cpu_temp_current >= 30 )); then + cpu_temp_current="\e[1;32m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Optimal temperature)\e[0m" - cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Cool runnings)\e[0m" + elif (( $cpu_temp_current >= 30 )); then - else + cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Cool runnings)\e[0m" - cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Who put me in the freezer!)\e[0m" + else - fi + cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Who put me in the freezer!)\e[0m" fi - break - fi - done - - unset afp_temperature + fi echo -e "$cpu_temp_current" From f6fff7d4baf7f17080c8ab5b931487e7e1d5bed3 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 18:58:47 +0100 Subject: [PATCH 23/25] v6.22 + DietPi-Banner | If CPU temp readout is not supported on current device, show free space --- dietpi/func/dietpi-banner | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 6ae252d9cc..ddfad0fddd 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -23,8 +23,7 @@ G_INIT # Import DietPi-Globals -------------------------------------------------------------- - INPUT=0 - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 + disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Globals @@ -64,9 +63,6 @@ Obtain_Update_Available - # Try to re-obtain IP if missing - [[ $IP_ADDRESS ]] || Update_Ip_Address - # Update Available? local text_update_available_date='' if (( $UPDATE_AVAILABLE )); then @@ -83,15 +79,29 @@ else - text_update_available_date="$(date +"%a %x - %R")" + text_update_available_date=$(date +"%a %x - %R") + + fi + + # CPU temp supported? Otherwise show free space + local text_hw_info=$(print_full_info=1 G_OBTAIN_CPU_TEMP) + if [[ $text_hw_info == 'N/A' ]]; then + + text_hw_info=$(G_CHECK_FREESPACE /) + # - Show GiB if > 9999 MiB + (( $text_hw_info > 9999 )) && text_hw_info="$(( $text_hw_info / 1024 )) GiB" || text_hw_info+=' MiB' + text_hw_info="RootFS free space: $text_hw_info" fi + # Try to re-obtain IP if missing + [[ $IP_ADDRESS ]] || Update_Ip_Address + echo -e "\ $green_line \e[1mDietPi v$DIETPI_VERSION\e[0m \e[90m| $text_update_available_date\e[0m $green_line - \e[1m$G_HW_MODEL_DESCRIPTION\e[0m \e[90m| $(print_full_info=1 G_OBTAIN_CPU_TEMP)\e[0m + \e[1m$G_HW_MODEL_DESCRIPTION\e[0m \e[90m| $text_hw_info\e[0m $green_line \e[1m$IP_ADAPTER ($IP_ADDRESS)\e[0m $green_line @@ -112,7 +122,7 @@ echo -e "\e[90m Image : $image_creator (pre-image: $preimage_name)\e[0m" - IMAGE_ADDITIONAL_CREDITS='' + unset IMAGE_ADDITIONAL_CREDITS fi From 67161a7a96a830d4d63be40f4084c9e32a3c6c66 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 19:03:00 +0100 Subject: [PATCH 24/25] v6.22 + CHANGELOG | DietPi-Banner: If CPU temps are not supported by device, RootFS free space is shown instead --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8352500203..39f214f52b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,7 +6,7 @@ Changes / Improvements / Optimisations: - Security | The DietPi-Software global password is now stored with enhanced security which also resolves a warning on Buster systems: https://github.com/MichaIng/DietPi/issues/2213 - System | /etc/bashrc.d/ now allows ".bash" file ending as well. Merged all contained DietPi scripts into one: /etc/bashrc.d/dietpi.bash. https://github.com/MichaIng/DietPi/pull/2636 - General | DietPi scripts now use the lightweight standalone "7zr" command to handle 7z archives. This allows us to lower DietPi core package dependencies from "p7zip-full" to "p7zip". -- General | CPU temps (if available on the device) now displayed in the login banners. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 +- General | CPU temps are now displayed in the login banners. If unsupported by current device, free space on RootFS is shown instead. Many thanks to esturniolo for the suggestion: https://twitter.com/esturniolo/status/1104912062298423297 - RPi | DietPi does not set or change "framebuffer_depth" in config.txt anymore which defaults to 16 which works in every known case. It will be re-added as fast as we find a case where another value is required. - DietPi-NordVPN | Added sent/received usage stats for VPN tunnel. - DietPi-Sync | Sync will now abort if the source dir is empty. Merged dry run into real sync, as this was performed anyway to do required free space check. When "Sync" is selected, after dry run the user is presented a summary and given the option to view the detailed dry run log, cancel or continue with real sync. Some other minor fixes and enhancements have been applied as well. Many thanks to @midnightwatcher for doing this request: https://dietpi.com/phpbb/viewtopic.php?f=12&t=5588 From 14471cbe0c077ff6ccf81708fa3e704b4a17ce62 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sat, 16 Mar 2019 19:05:08 +0100 Subject: [PATCH 25/25] v6.22 + DietPi-Globals | Syntax --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 9c651cf462..a0b38481ba 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1864,9 +1864,9 @@ $print_logfile_info [[ -f $i ]] && { cpu_temp_current=$(<$i); break; } - fi + done - done + fi # Format output # - Check for valid value