diff --git a/.conf/desktop/gtk/.gtk-bookmarks b/.conf/desktop/gtk/.gtk-bookmarks index ec897e174b..34bfd7635f 100644 --- a/.conf/desktop/gtk/.gtk-bookmarks +++ b/.conf/desktop/gtk/.gtk-bookmarks @@ -1,5 +1,5 @@ file:/// / -file:///root /root +file:///root Home file:///mnt/dietpi_userdata DietPi User Data file:///mnt/samba Samba Client file:///mnt/nfs_client NFS Client diff --git a/.conf/desktop/lxde/panel b/.conf/desktop/lxde/panel index 0b2ff23450..81a2cc2b3b 100644 --- a/.conf/desktop/lxde/panel +++ b/.conf/desktop/lxde/panel @@ -1,25 +1,24 @@ Global { - edge=bottom - allign=left - margin=0 - widthtype=percent - width=100 - height=36 - transparent=0 - tintcolor=#434343 - alpha=255 - autohide=0 - heightwhenhidden=2 - setdocktype=1 - setpartialstrut=1 - usefontcolor=1 - fontsize=10 - fontcolor=#ffffff - usefontsize=0 - background=1 - backgroundfile=/var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png - iconsize=34 + edge=bottom + allign=left + margin=0 + widthtype=percent + width=100 + height=36 + transparent=1 + tintcolor=#313131 + alpha=255 + autohide=0 + heightwhenhidden=2 + setdocktype=1 + setpartialstrut=1 + usefontcolor=1 + fontsize=10 + fontcolor=#ffffff + usefontsize=0 + background=0 + iconsize=34 } Plugin { type=space @@ -109,7 +108,7 @@ Plugin { FlatButton=0 MaxTaskWidth=150 spacing=2 - UseSmallerIcons=-1 + UseSmallerIcons=-1 } } Plugin { diff --git a/.conf/desktop/lxqt/lxqt-buster.7z b/.conf/desktop/lxqt/lxqt-buster.7z index 2c55cd37a7..185acb2b9e 100644 Binary files a/.conf/desktop/lxqt/lxqt-buster.7z and b/.conf/desktop/lxqt/lxqt-buster.7z differ diff --git a/.conf/dps_114/apache.nextcloud.conf b/.conf/dps_114/apache.nextcloud.conf index 149fb4abff..f129493b4a 100644 --- a/.conf/dps_114/apache.nextcloud.conf +++ b/.conf/dps_114/apache.nextcloud.conf @@ -1,11 +1,11 @@ # Location: /etc/apache2/sites-available/dietpi-nextcloud.conf -# Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#apache-web-server-configuration +# Based on: https://github.com/nextcloud/documentation/blob/master/admin_manual/installation/source_installation.rst#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 +# Redirect webfinger and nodeinfo requests to Nextcloud endpoint +Redirect permanent /.well-known/webfinger /nextcloud/index.php/.well-known/webfinger +Redirect permanent /.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo - + Require all granted AllowOverride All Options FollowSymLinks diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index 4010b05ffc..44cf82ceb6 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -1,11 +1,11 @@ # Derived from: # - Apache: https://github.com/nextcloud/server/blob/master/.htaccess -# - Nginx: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html +# - Nginx: https://github.com/nextcloud/documentation/blob/master/admin_manual/installation/nginx.rst#nextcloud-in-a-subdir-of-the-nginx-webroot # Redirect OCM/OCS provider requests to Nextcloud endpoint: url.redirect += ( - "^/ocm-provider" => "/nextcloud/ocm-provider", - "^/ocs-provider" => "/nextcloud/ocs-provider" + "^/.well-known/webfinger" => "/nextcloud/index.php/.well-known/webfinger", + "^/.well-known/nodeinfo" => "/nextcloud/index.php/.well-known/nodeinfo" ) $HTTP["url"] =~ "^/nextcloud($|/)" { @@ -17,10 +17,9 @@ $HTTP["url"] =~ "^/nextcloud($|/)" { $HTTP["url"] =~ "^/nextcloud/(\.|autotest|occ|issue|indie|db_|console)" { url.access-deny = ("") } # - Directory listing dir-listing.activate = "disable" - # - Cache control and security headers for static resources - $HTTP["url"] =~ "^/nextcloud/.+[^/]\.(css|js|woff2?|svg|gif|map)$" { + # - Security and cache control headers for static resources + $HTTP["url"] =~ "\.(css|js|svg|gif|png|woff2?|map)$" { setenv.add-response-header += ( - "Cache-Control" => "public, max-age=15778463", "Referrer-Policy" => "no-referrer", "X-Content-Type-Options" => "nosniff", "X-Download-Options" => "noopen", @@ -28,6 +27,7 @@ $HTTP["url"] =~ "^/nextcloud($|/)" { "X-Permitted-Cross-Domain-Policies" => "none", "X-Robots-Tag" => "none", "X-XSS-Protection" => "1; mode=block", + "Cache-Control" => "public, max-age=15778463", ) } diff --git a/.conf/dps_114/nginx.nextcloud.conf b/.conf/dps_114/nginx.nextcloud.conf index 7c2fd9396b..150c3e859a 100644 --- a/.conf/dps_114/nginx.nextcloud.conf +++ b/.conf/dps_114/nginx.nextcloud.conf @@ -1,25 +1,12 @@ -# Based on: https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx +# Based on: https://github.com/nextcloud/documentation/blob/master/admin_manual/installation/nginx.rst#nextcloud-in-a-subdir-of-the-nginx-webroot -# Redirect OCM/OCS provider requests to Nextcloud endpoint: -location ~ ^\/(?:ocm-provider|ocs-provider).* { - rewrite ^ /nextcloud$request_uri; +# Redirect webfinger and nodeinfo requests to Nextcloud endpoint +location ~ ^/\.well-known/(?:webfinger|nodeinfo) { + return 301 /nextcloud/index.php$request_uri; } location ^~ /nextcloud { - # Add headers to serve security related headers - #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;" always; - add_header Referrer-Policy "no-referrer" always; - add_header X-Content-Type-Options "nosniff" always; - add_header X-Download-Options "noopen" always; - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-Permitted-Cross-Domain-Policies "none" always; - add_header X-Robots-Tag "none" always; - add_header X-XSS-Protection "1; mode=block" always; - - # Remove X-Powered-By, which is an information leak - fastcgi_hide_header X-Powered-By; - # Set max upload size client_max_body_size 1048576M; fastcgi_buffers 64 4K; @@ -32,22 +19,51 @@ location ^~ /nextcloud { gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; - # Uncomment if your server is build with the ngx_pagespeed module - # This module is currently not supported. + # Pagespeed is not supported by Nextcloud, so if your server is built + # with the `ngx_pagespeed` module, uncomment this line to disable it. #pagespeed off; - location /nextcloud { - rewrite ^ /nextcloud/index.php; - } + # HTTP response headers borrowed from Nextcloud `.htaccess` + #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;" always; + add_header Referrer-Policy "no-referrer" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-Download-Options "noopen" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Permitted-Cross-Domain-Policies "none" always; + add_header X-Robots-Tag "none" always; + add_header X-XSS-Protection "1; mode=block" always; - location ~ ^\/nextcloud\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { - deny all; - } - location ~ ^\/nextcloud\/(?:\.|autotest|occ|issue|indie|db_|console) { - deny all; + # Remove X-Powered-By, which is an information leak + fastcgi_hide_header X-Powered-By; + + # Specify how to handle directories -- specifying `/nextcloud/index.php$request_uri` + # here as the fallback means that Nginx always exhibits the desired behaviour + # when a client requests a path that corresponds to a directory that exists + # on the server. In particular, if that directory contains an index.php file, + # that file is correctly served; if it doesn't, then the request is passed to + # the front-end controller. This consistent behaviour means that we don't need + # to specify custom rules for certain paths (e.g. images and other assets, + # `/updater`, `/ocm-provider`, `/ocs-provider`), and thus + # `try_files $uri $uri/ /nextcloud/index.php$request_uri` + # always provides the desired behaviour. + index index.php index.html /nextcloud/index.php$request_uri; + + # Rule borrowed from `.htaccess` to handle Microsoft DAV clients + location = /nextcloud { + if ( $http_user_agent ~ ^DavClnt ) { + return 302 /nextcloud/remote.php/webdav/$is_args$args; + } } - location ~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) { + # Rules borrowed from `.htaccess` to hide certain paths from clients + location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } + location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } + + # Ensure this block, which passes PHP files to the PHP process, is above the blocks + # which handle static assets (as seen below). If this block is not declared first, + # then Nginx will encounter an infinite rewriting loop when it prepends + # `/nextcloud/index.php` to the URI, resulting in a HTTP 500 error response. + location ~ \.php(?:$|/) { fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; @@ -60,36 +76,21 @@ location ^~ /nextcloud { fastcgi_pass php; fastcgi_intercept_errors on; fastcgi_request_buffering off; - } - - location ~ ^\/nextcloud\/(?:updater|oc[ms]-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 ~ ^\/nextcloud\/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ { + location ~ \.(?:css|js|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 - # to have those duplicated to the ones above) - #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;" always; - add_header Referrer-Policy "no-referrer" always; - add_header X-Content-Type-Options "nosniff" always; - add_header X-Download-Options "noopen" always; - add_header X-Frame-Options "SAMEORIGIN" always; - add_header X-Permitted-Cross-Domain-Policies "none" always; - add_header X-Robots-Tag "none" always; - add_header X-XSS-Protection "1; mode=block" always; - - # Optional: Don't log access to assets - access_log off; + expires 6M; # Cache-Control policy borrowed from `.htaccess` + access_log off; # Optional: Don't log access to assets } - location ~ ^\/nextcloud\/.+[^\/]\.(?:png|html|ttf|ico|jpg|jpeg)$ { + location ~ \.woff2?$ { try_files $uri /nextcloud/index.php$request_uri; - # Optional: Don't log access to other assets - access_log off; + expires 7d; # Cache-Control policy borrowed from `.htaccess` + access_log off; # Optional: Don't log access to assets + } + + location /nextcloud { + try_files $uri $uri/ /nextcloud/index.php$request_uri; } } diff --git a/.conf/dps_182/unbound.conf b/.conf/dps_182/unbound.conf new file mode 100644 index 0000000000..99e9140dc0 --- /dev/null +++ b/.conf/dps_182/unbound.conf @@ -0,0 +1,92 @@ +# https://nlnetlabs.nl/documentation/unbound/unbound.conf/ +server: + # Do not daemonize, to allow proper systemd service control and status estimation. + do-daemonize: no + + # A single thread is pretty sufficient for home or small office instances. + num-threads: 1 + + # Logging: For the sake of privacy and performance, keep logging at a minimum! + # - Verbosity 2 and up practically contains query and reply logs. + verbosity: 0 + log-queries: no + log-replies: no + # - If required, uncomment to log to a file, else logs are available via "journalctl -u unbound". + #logfile: "/var/log/unbound.log" + + # Set interface to "0.0.0.0" to make Unbound listen on all network interfaces. + # Set it to "127.0.0.1" to listen on requests from the same machine only, useful in combination with Pi-hole. + interface: 0.0.0.0 + # Default DNS port is "53". When used with Pi-hole, set this to e.g. "5335", since "5353" is used by mDNS already. + port: 53 + + # Control IP ranges which should be able to use this Unbound instance. + # The DietPi defaults permit access from official local network IP ranges only, hence requests from www are denied. + access-control: 0.0.0.0/0 refuse + access-control: 10.0.0.0/8 allow + access-control: 127.0.0.1/8 allow + access-control: 172.16.0.0/12 allow + access-control: 192.168.0.0/16 allow + access-control: ::/0 refuse + access-control: ::1/128 allow + access-control: fd00::/8 allow + access-control: fe80::/10 allow + + # Private IP ranges, which shall never be returned or forwarded as public DNS response. + # NB: 127.0.0.1/8 is sometimes used by adblock lists, hence DietPi by default allows those as response. + private-address: 10.0.0.0/8 + private-address: 172.16.0.0/12 + private-address: 192.168.0.0/16 + private-address: 169.254.0.0/16 + private-address: fd00::/8 + private-address: fe80::/10 + + # Define protocols for connections to and from Unbound. + # NB: Disabling IPv6 does not disable IPv6 IP resolving, which depends on the clients request. + do-udp: yes + do-tcp: yes + do-ip4: yes + do-ip6: yes + prefer-ip6: no + + # DNS root server information file. Update regularly via: "curl -# https://www.internic.net/domain/named.root > /var/lib/unbound/root.hints" + root-hints: "/var/lib/unbound/root.hints" + + # Maximum number of queries per second + ratelimit: 1000 + + # Defend against and print warning when reaching unwanted reply limit. + unwanted-reply-threshold: 10000 + + # Set EDNS reassembly buffer size to match new upstream default, as of DNS Flag Day 2020 recommendation. + edns-buffer-size: 1232 + + # Increase incoming and outgoing query buffer size to cover traffic peaks. + so-rcvbuf: 4m + so-sndbuf: 4m + + # Hardening + harden-glue: yes + harden-dnssec-stripped: yes + harden-algo-downgrade: yes + harden-large-queries: yes + harden-short-bufsize: yes + + # Privacy + use-caps-for-id: yes # Spoof protection by randomising capitalisation + rrset-roundrobin: yes + qname-minimisation: yes + minimal-responses: yes + hide-identity: yes + identity: "Server" # Purposefully a dummy identity name + hide-version: yes + + # Caching + cache-min-ttl: 300 + cache-max-ttl: 86400 + serve-expired: yes + neg-cache-size: 4M + prefetch: yes + prefetch-key: yes + msg-cache-size: 50m + rrset-cache-size: 100m diff --git a/.conf/dps_39/minidlna.conf b/.conf/dps_39/minidlna.conf index 44b1544c7e..5f5d913b65 100644 --- a/.conf/dps_39/minidlna.conf +++ b/.conf/dps_39/minidlna.conf @@ -9,11 +9,9 @@ media_dir=V,/mnt/dietpi_userdata/Video # Path to the directory that should hold the database and album art cache. db_dir=/mnt/dietpi_userdata/.MiniDLNA_Cache -# Path to the directory that should hold the log file. -log_dir=/var/log - # Must be one of "off", "fatal", "error", "warn", "info" or "debug". -# "off" turns of logging entirely, "fatal" is the highest level of importance +# "off" turns of logging entirely, "fatal" is the highest level of importance. +# Access logs via: "journalctl -u minidlna" log_level=warn # Use a different container as the root of the directory tree presented to diff --git a/.conf/dps_59/raspimjpeg.sh b/.conf/dps_59/raspimjpeg.sh index 0cd9161a73..65c7eb4c40 100644 --- a/.conf/dps_59/raspimjpeg.sh +++ b/.conf/dps_59/raspimjpeg.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/dash { #//////////////////////////////////// # DietPi Raspimjpeg control Script @@ -7,7 +7,7 @@ # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com # # Info: - # - Location: /var/lib/dietpi/dietpi-software/services/raspimjpeg.sh + # - Location: /var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh # - Allows service control for Raspimjpeg and PHP schedule, used by RPi Camera Web # - Called from /etc/systemd/system/raspimjpeg.service # @@ -24,17 +24,17 @@ mkdir -p /dev/shm/mjpeg chown www-data:www-data /dev/shm/mjpeg chmod 777 /dev/shm/mjpeg - sudo -u www-data raspimjpeg &> /dev/null & + sudo -u www-data raspimjpeg > /dev/null 2>&1 & sleep 4 - sudo -u www-data php /var/www/rpicam/schedule.php &> /dev/null & + sudo -u www-data php /var/www/rpicam/schedule.php > /dev/null 2>&1 & } - if [[ $1 == 'stop' ]]; then + if [ "$1" = 'stop' ]; then Raspimjeg_Stop - elif [[ $1 == 'start' ]]; then + elif [ "$1" = 'start' ]; then Raspimjeg_Start diff --git a/.conf/dps_93/apache.pihole.conf b/.conf/dps_93/apache.pihole.conf index ac71caa7a0..c9f87ac2a6 100644 --- a/.conf/dps_93/apache.pihole.conf +++ b/.conf/dps_93/apache.pihole.conf @@ -24,10 +24,7 @@ -# Block public access to blocking page +# Block public access to 404 page Require ip 127 192.168 10 172.16.0.0/12 - -# Enable blocking page via 404 handler -#ErrorDocument 404 /html/pihole/index.php diff --git a/.conf/dps_93/lighttpd.pihole.conf b/.conf/dps_93/lighttpd.pihole.conf index d3fbd1c095..981721aa2a 100644 --- a/.conf/dps_93/lighttpd.pihole.conf +++ b/.conf/dps_93/lighttpd.pihole.conf @@ -19,12 +19,9 @@ $HTTP["url"] =~ "^(/html)?/admin/\." { url.access-deny = ("") } -# Block public access to blocking page +# Block public access to 404 page $HTTP["url"] =~ "^(/html)?/pihole/" { $HTTP["remoteip"] !~ "^1(27|92\.168|0|72\.(1[6-9]|2[0-9]|3[0-1]))\." { url.access-deny = ("") } } - -# Enable blocking page via 404 handler -#server.error-handler-404 = "/html/pihole/index.php" diff --git a/.conf/dps_93/nginx.pihole.conf b/.conf/dps_93/nginx.pihole.conf index 40d6e3db80..e3e77bd86d 100644 --- a/.conf/dps_93/nginx.pihole.conf +++ b/.conf/dps_93/nginx.pihole.conf @@ -29,9 +29,9 @@ location ~ ^(?:/html|)/admin(?:$|/) { } } -# Blocking page +# 404 page location ~ ^(?:/html|)/pihole(?:$|/) { - # Block public access to blocking page + # Block public access allow 127.0.0.0/8; allow 192.168.0.0/16; allow 10.0.0.0/8; @@ -45,6 +45,3 @@ location ~ ^(?:/html|)/pihole(?:$|/) { include snippets/fastcgi-php.conf; } } - -# Enable blocking page via 404 handler -#error_page 404 /html/pihole/index.php; diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager index aa5a7f4bbe..13ce29b6a9 100755 --- a/.meta/dietpi-imager +++ b/.meta/dietpi-imager @@ -160,16 +160,16 @@ { G_WHIP_MENU_ARRAY=( 'Source type' ": [$SOURCE_TYPE] Select how the input OS is stored" - 'Source path' ": [${FP_SOURCE_IMG:-${FP_SOURCE}}] Select the input $SOURCE_TYPE" + 'Source path' ": [${FP_SOURCE_IMG:-$FP_SOURCE}] Select the input $SOURCE_TYPE" ) [[ $FP_SOURCE ]] && G_WHIP_MENU_ARRAY+=('Source rootfs' ": [$FP_ROOT_DEV] Select input OS root partition") G_WHIP_MENU_ARRAY+=( 'Target type' ": [$CLONING_TOOL] Select output image type" - 'Target name' ": [${OUTPUT_IMG_NAME%.$OUTPUT_IMG_EXT}.$OUTPUT_IMG_EXT] Choose the output image name" + 'Target name' ": [$OUTPUT_IMG_NAME] Choose the output image name" '' '●─' 'Mount' ": [$MOUNT_IT] Review or edit drive content before image creation" ) - [[ $FP_SOURCE && $FP_ROOT_DEV ]] && G_WHIP_MENU_ARRAY+=('' '●─' 'Start' ": Start creating $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT from ${FP_SOURCE_IMG:-${FP_SOURCE}}") + [[ $FP_SOURCE && $FP_ROOT_DEV ]] && G_WHIP_MENU_ARRAY+=('' '●─' 'Start' ": Start creating $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT") G_WHIP_DEFAULT_ITEM=$main_menu_choice G_WHIP_BUTTON_CANCEL_TEXT='Exit' @@ -244,7 +244,7 @@ fi sync sleep 1 # Give the system 1 second to avoid "mount is busy" - G_EXEC umount $FP_MNT_TMP + G_EXEC umount -R $FP_MNT_TMP G_EXEC rmdir $FP_MNT_TMP G_EXEC partprobe "$FP_SOURCE" # Failsafe G_EXEC partx -u "$FP_SOURCE" # Failsafe diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 55a7252525..fe9774473e 100644 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -23,7 +23,7 @@ aHW_NAME[13]='Odroid U3' aHW_NAME[14]='Odroid N1' aHW_NAME[15]='Odroid N2' - aHW_NAME[16]='Odroid C4' + aHW_NAME[16]='Odroid C4/HC4' aHW_NAME[20]='x86_64 VM' aHW_NAME[21]='x86_64 PC' aHW_NAME[22]='Generic Device' @@ -179,7 +179,7 @@ aSOFTWARE_NAME[3]='MC' aSOFTWARE_NAME[4]='ViFM' aSOFTWARE_NAME[5]='ALSA' - aSOFTWARE_NAME[6]='Xserver' + aSOFTWARE_NAME[6]='X.Org X server' aSOFTWARE_NAME[7]='FFmpeg' aSOFTWARE_NAME[8]='Java' aSOFTWARE_NAME[9]='Node.js' @@ -321,7 +321,7 @@ aSOFTWARE_NAME[145]='Radarr' aSOFTWARE_NAME[146]='Tautulli' aSOFTWARE_NAME[147]='Jackett' - aSOFTWARE_NAME[148]=148 + #aSOFTWARE_NAME[148]= aSOFTWARE_NAME[149]='NZBGet' aSOFTWARE_NAME[150]='Mono' aSOFTWARE_NAME[151]='Nvidia' @@ -331,7 +331,7 @@ aSOFTWARE_NAME[155]='HTPC Manager' aSOFTWARE_NAME[156]='Steam' aSOFTWARE_NAME[157]='Home Assistant' - aSOFTWARE_NAME[158]='Minio' + aSOFTWARE_NAME[158]='MinIO' aSOFTWARE_NAME[159]='Allo' aSOFTWARE_NAME[160]='Allo_update' aSOFTWARE_NAME[161]='FuguHub' @@ -341,7 +341,7 @@ aSOFTWARE_NAME[165]='Gitea' aSOFTWARE_NAME[166]='PI-SPC' aSOFTWARE_NAME[167]='Raspotify' - aSOFTWARE_NAME[168]=168 + #aSOFTWARE_NAME[168]= aSOFTWARE_NAME[169]='Google AIY' # v6.14 (earliest version that can currently upload) + v6.15 @@ -349,10 +349,8 @@ aSOFTWARE_NAME6_15=() for i in "${!aSOFTWARE_NAME[@]}" do - aSOFTWARE_NAME6_14[$i]=${aSOFTWARE_NAME[$i]} aSOFTWARE_NAME6_15[$i]=${aSOFTWARE_NAME6_14[$i]} - done aSOFTWARE_NAME6_15[148]='myMPD' @@ -362,11 +360,9 @@ aSOFTWARE_NAME6_18=() for i in "${!aSOFTWARE_NAME6_15[@]}" do - aSOFTWARE_NAME6_16[$i]=${aSOFTWARE_NAME6_15[$i]} aSOFTWARE_NAME6_17[$i]=${aSOFTWARE_NAME6_16[$i]} aSOFTWARE_NAME6_18[$i]=${aSOFTWARE_NAME6_17[$i]} - done aSOFTWARE_NAME6_18[168]='Nextcloud Talk' @@ -375,10 +371,8 @@ aSOFTWARE_NAME6_20=() for i in "${!aSOFTWARE_NAME6_18[@]}" do - aSOFTWARE_NAME6_19[$i]=${aSOFTWARE_NAME6_18[$i]} aSOFTWARE_NAME6_20[$i]=${aSOFTWARE_NAME6_19[$i]} - done aSOFTWARE_NAME6_20[116]='Medusa' aSOFTWARE_NAME6_20[170]='UnRAR' @@ -391,11 +385,9 @@ aSOFTWARE_NAME6_23=() for i in "${!aSOFTWARE_NAME6_20[@]}" do - aSOFTWARE_NAME6_21[$i]=${aSOFTWARE_NAME6_20[$i]} aSOFTWARE_NAME6_22[$i]=${aSOFTWARE_NAME6_21[$i]} aSOFTWARE_NAME6_23[$i]=${aSOFTWARE_NAME6_22[$i]} - done aSOFTWARE_NAME6_23[173]='LXQt' aSOFTWARE_NAME6_23[174]='GIMP' @@ -406,10 +398,8 @@ aSOFTWARE_NAME6_25=() for i in "${!aSOFTWARE_NAME6_23[@]}" do - aSOFTWARE_NAME6_24[$i]=${aSOFTWARE_NAME6_23[$i]} aSOFTWARE_NAME6_25[$i]=${aSOFTWARE_NAME6_24[$i]} - done aSOFTWARE_NAME6_25[176]='Mycroft AI' @@ -417,21 +407,17 @@ aSOFTWARE_NAME6_26=() for i in "${!aSOFTWARE_NAME6_25[@]}" do - aSOFTWARE_NAME6_26[$i]=${aSOFTWARE_NAME6_25[$i]} - done - aSOFTWARE_NAME6_26[27]=27 # TightVNC: Replaced by TigerVNC on Stretch+ - aSOFTWARE_NAME6_26[140]=140 # SDL2: Merged into Amiberry for targeted minimal install + unset -v 'aSOFTWARE_NAME6_26[27]' # TightVNC: Replaced by TigerVNC on Stretch+ + unset -v 'aSOFTWARE_NAME6_26[140]' # SDL2: Merged into Amiberry for targeted minimal install # v6.27 aSOFTWARE_NAME6_27=() for i in "${!aSOFTWARE_NAME6_26[@]}" do - aSOFTWARE_NAME6_27[$i]=${aSOFTWARE_NAME6_26[$i]} - done aSOFTWARE_NAME6_27[27]='TasmoAdmin' @@ -440,10 +426,8 @@ aSOFTWARE_NAME6_29=() for i in "${!aSOFTWARE_NAME6_27[@]}" do - aSOFTWARE_NAME6_28[$i]=${aSOFTWARE_NAME6_27[$i]} aSOFTWARE_NAME6_29[$i]=${aSOFTWARE_NAME6_28[$i]} - done aSOFTWARE_NAME6_29[140]='Domoticz' @@ -452,10 +436,8 @@ aSOFTWARE_NAME6_31=() for i in "${!aSOFTWARE_NAME6_29[@]}" do - aSOFTWARE_NAME6_30[$i]=${aSOFTWARE_NAME6_29[$i]} aSOFTWARE_NAME6_31[$i]=${aSOFTWARE_NAME6_30[$i]} - done aSOFTWARE_NAME6_31[177]='Firefox Sync Server' @@ -463,9 +445,7 @@ aSOFTWARE_NAME6_32=() for i in "${!aSOFTWARE_NAME6_31[@]}" do - aSOFTWARE_NAME6_32[$i]=${aSOFTWARE_NAME6_31[$i]} - done aSOFTWARE_NAME6_32[178]='Jellyfin' aSOFTWARE_NAME6_32[179]='Komga' @@ -474,9 +454,7 @@ aSOFTWARE_NAME6_33=() for i in "${!aSOFTWARE_NAME6_32[@]}" do - aSOFTWARE_NAME6_33[$i]=${aSOFTWARE_NAME6_32[$i]} - done aSOFTWARE_NAME6_33[180]='Bazarr' @@ -484,20 +462,35 @@ aSOFTWARE_NAME6_34=() for i in "${!aSOFTWARE_NAME6_33[@]}" do - aSOFTWARE_NAME6_34[$i]=${aSOFTWARE_NAME6_33[$i]} - done - aSOFTWARE_NAME6_34[134]='62' # DietPi-CloudShell - aSOFTWARE_NAME6_34[134]='134' # Tonido - aSOFTWARE_NAME6_34[137]='137' # CloudPrint + unset -v 'aSOFTWARE_NAME6_34[62]' # DietPi-CloudShell + unset -v 'aSOFTWARE_NAME6_34[134]' # Tonido + unset -v 'aSOFTWARE_NAME6_34[137]' # CloudPrint aSOFTWARE_NAME6_34[181]='PaperMC' aSOFTWARE_NAME6_34[182]='Unbound' aSOFTWARE_NAME6_34[183]='Bitwarden_RS' aSOFTWARE_NAME6_34[184]='Tor Relay' - # shellcheck disable=SC2034 aSOFTWARE_NAME6_34[185]='Portainer' + # v6.35 + aSOFTWARE_NAME6_35=() + for i in "${!aSOFTWARE_NAME6_34[@]}" + do + aSOFTWARE_NAME6_35[$i]=${aSOFTWARE_NAME6_34[$i]} + done + aSOFTWARE_NAME6_35[62]='Box86' + aSOFTWARE_NAME6_35[134]='Docker Compose' + aSOFTWARE_NAME6_35[137]='mjpg-streamer' + + # v7.0 (identical to v6.35 transition version) + aSOFTWARE_NAME7_0=() + for i in "${!aSOFTWARE_NAME6_35[@]}" + do + # shellcheck disable=SC2034 + aSOFTWARE_NAME7_0[$i]=${aSOFTWARE_NAME6_35[$i]} + done + Main(){ # Copy files to RAM to speed up sourcing @@ -530,7 +523,7 @@ # CPU # - BENCH_CPU: Remove decimal point, equals times 100 since CPU time is always in x.xx BENCH_CPU=${BENCH_CPU/.} - if [[ $BENCH_CPU =~ ^[0-9]+$ && $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then + if [[ $BENCH_CPU =~ ^[0-9]*[1-9][0-9]*$ && $BENCH_CPU_TEMP_START =~ ^[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^[0-9]+$ ]]; then aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU @@ -548,7 +541,7 @@ # - Remove decimal places BENCH_ROOTFS_WRITE=${BENCH_ROOTFS_WRITE%%.*} BENCH_ROOTFS_READ=${BENCH_ROOTFS_READ%%.*} - if [[ $BENCH_ROOTFS_WRITE =~ ^[0-9]+$ && $BENCH_ROOTFS_READ =~ ^[0-9]+$ ]]; then + if [[ $BENCH_ROOTFS_WRITE =~ ^[0-9]*[1-9][0-9]*$ && $BENCH_ROOTFS_READ =~ ^[0-9]*[1-9][0-9]*$ ]]; then aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_ROOTFS_WRITE aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_ROOTFS_READ @@ -561,7 +554,7 @@ # - Remove decimal places BENCH_RAM_WRITE=${BENCH_RAM_WRITE%%.*} BENCH_RAM_READ=${BENCH_RAM_READ%%.*} - if [[ $BENCH_VERSION =~ ^[0-9]+$ && $BENCH_RAM_WRITE =~ ^[0-9]+$ && $BENCH_RAM_READ =~ ^[0-9]+$ ]] && (( $BENCH_VERSION > 1 )); then + if [[ $BENCH_VERSION =~ ^[0-9]+$ && $BENCH_RAM_WRITE =~ ^[0-9]*[1-9][0-9]*$ && $BENCH_RAM_READ =~ ^[0-9]*[1-9][0-9]*$ ]] && (( $BENCH_VERSION > 1 )); then aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_RAM_WRITE aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]}]=$BENCH_RAM_READ @@ -573,7 +566,7 @@ # - Remove decimal places BENCH_CUSTOMFS_WRITE=${BENCH_CUSTOMFS_WRITE%%.*} BENCH_CUSTOMFS_READ=${BENCH_CUSTOMFS_READ%%.*} - if [[ $BENCH_CUSTOMFS_WRITE =~ ^[0-9]+$ && $BENCH_CUSTOMFS_READ =~ ^[0-9]+$ ]]; then + if [[ $BENCH_CUSTOMFS_WRITE =~ ^[0-9]*[1-9][0-9]*$ && $BENCH_CUSTOMFS_READ =~ ^[0-9]*[1-9][0-9]*$ ]]; then aBENCH_CUSTOMFS_WRITE[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CUSTOMFS_WRITE aBENCH_CUSTOMFS_READ[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CUSTOMFS_READ @@ -584,7 +577,7 @@ # LAN # - Remove decimal places BENCH_NET_LAN_SPEED=${BENCH_NET_LAN_SPEED%%.*} - if [[ $BENCH_NET_LAN_SPEED =~ ^[0-9]+$ ]]; then + if [[ $BENCH_NET_LAN_SPEED =~ ^[0-9]*[1-9][0-9]*$ ]]; then aBENCH_NET_LAN_SPEED[$BENCH_HW_MODEL,${aBENCH_LAN_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_NET_LAN_SPEED ((aBENCH_LAN_INDEX[$BENCH_HW_MODEL]++)) @@ -592,12 +585,12 @@ fi # Done, clear vars - unset BENCH_VERSION BENCH_HW_MODEL - unset BENCH_CPU BENCH_CPU_TEMP_START BENCH_CPU_TEMP_END - unset BENCH_ROOTFS_WRITE BENCH_ROOTFS_READ - unset BENCH_RAM_WRITE BENCH_RAM_READ - unset BENCH_CUSTOMFS_WRITE BENCH_CUSTOMFS_READ - unset BENCH_NET_LAN_SPEED + unset -v BENCH_VERSION BENCH_HW_MODEL + unset -v BENCH_CPU BENCH_CPU_TEMP_START BENCH_CPU_TEMP_END + unset -v BENCH_ROOTFS_WRITE BENCH_ROOTFS_READ + unset -v BENCH_RAM_WRITE BENCH_RAM_READ + unset -v BENCH_CUSTOMFS_WRITE BENCH_CUSTOMFS_READ + unset -v BENCH_NET_LAN_SPEED done @@ -618,6 +611,7 @@ [[ $i == 'RPi (armv6l)' ]] && ((aDEVICE_NAME['RPi (Unknown) (armv6l)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" [[ $i == 'RPi (armv7l)' ]] && ((aDEVICE_NAME['RPi (Unknown) (armv7l)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" [[ $i == 'Odroid XU3/XU4/HC1/HC2 (armv7l)' ]] && ((aDEVICE_NAME['Odroid XU3/XU4/MC1/HC1/HC2 (armv7l)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" + [[ $i == 'Odroid C4 (aarch64)' ]] && ((aDEVICE_NAME['Odroid C4/HC4 (aarch64)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" # v6.35 [[ $i == 'Asus Tinker Board (armv7l)' ]] && ((aDEVICE_NAME['ASUS Tinker Board (armv7l)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" [[ $i == 'Pine A64 (aarch64)' ]] && ((aDEVICE_NAME['PINE A64 (aarch64)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" [[ $i == 'Pine H64 (aarch64)' ]] && ((aDEVICE_NAME['PINE H64 (aarch64)']+=aDEVICE_NAME["$i"])) && unset "aDEVICE_NAME[$i]" @@ -637,35 +631,34 @@ # Process all results, for later use in HTML printout # - NB: HW_MODEL array based - local default_min_value=100000 # CPU for i in "${!aBENCH_CPU_INDEX[@]}" do - aBENCH_RESULT_CPU_MIN[$i]=$default_min_value - aBENCH_RESULT_CPU_MAX[$i]=0 - aBENCH_RESULT_CPU_AVG[$i]=0 - aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=$default_min_value - aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=0 - aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=0 - aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=$default_min_value - aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=0 - aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=0 + aBENCH_RESULT_CPU_MIN[$i]= + aBENCH_RESULT_CPU_MAX[$i]= + aBENCH_RESULT_CPU_AVG[$i]= + aBENCH_RESULT_CPU_TEMP_START_MIN[$i]= + aBENCH_RESULT_CPU_TEMP_START_MAX[$i]= + aBENCH_RESULT_CPU_TEMP_START_AVG[$i]= + aBENCH_RESULT_CPU_TEMP_END_MIN[$i]= + aBENCH_RESULT_CPU_TEMP_END_MAX[$i]= + aBENCH_RESULT_CPU_TEMP_END_AVG[$i]= for (( j=0; j<${aBENCH_CPU_INDEX[$i]}; j++ )) do - (( ${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]} )) && aBENCH_RESULT_CPU_MIN[$i]=${aBENCH_CPU[$i,$j]} - (( ${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]} )) && aBENCH_RESULT_CPU_MAX[$i]=${aBENCH_CPU[$i,$j]} + (( ${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]:=${aBENCH_CPU[$i,$j]}} )) && aBENCH_RESULT_CPU_MIN[$i]=${aBENCH_CPU[$i,$j]} + (( ${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]:=${aBENCH_CPU[$i,$j]}} )) && aBENCH_RESULT_CPU_MAX[$i]=${aBENCH_CPU[$i,$j]} (( aBENCH_RESULT_CPU_AVG[$i] += ${aBENCH_CPU[$i,$j]} )) - (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )) && aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} - (( ${aBENCH_CPU_TEMP_START[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]} )) && aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} + (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]:=${aBENCH_CPU_TEMP_START[$i,$j]}} )) && aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} + (( ${aBENCH_CPU_TEMP_START[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_START_MAX[$i]:=${aBENCH_CPU_TEMP_START[$i,$j]}} )) && aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=${aBENCH_CPU_TEMP_START[$i,$j]} (( aBENCH_RESULT_CPU_TEMP_START_AVG[$i] += ${aBENCH_CPU_TEMP_START[$i,$j]} )) - (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} )) && aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} - (( ${aBENCH_CPU_TEMP_END[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]} )) && aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} + (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]:=${aBENCH_CPU_TEMP_END[$i,$j]}} )) && aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} + (( ${aBENCH_CPU_TEMP_END[$i,$j]} > ${aBENCH_RESULT_CPU_TEMP_END_MAX[$i]:=${aBENCH_CPU_TEMP_END[$i,$j]}} )) && aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=${aBENCH_CPU_TEMP_END[$i,$j]} (( aBENCH_RESULT_CPU_TEMP_END_AVG[$i] += ${aBENCH_CPU_TEMP_END[$i,$j]} )) # Last item in current array. Work out averages @@ -685,22 +678,22 @@ for i in "${!aBENCH_ROOTFS_INDEX[@]}" do - aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=$default_min_value - aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=0 - aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=0 - aBENCH_RESULT_ROOTFS_READ_MIN[$i]=$default_min_value - aBENCH_RESULT_ROOTFS_READ_MAX[$i]=0 - aBENCH_RESULT_ROOTFS_READ_AVG[$i]=0 + aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]= + aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]= + aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]= + aBENCH_RESULT_ROOTFS_READ_MIN[$i]= + aBENCH_RESULT_ROOTFS_READ_MAX[$i]= + aBENCH_RESULT_ROOTFS_READ_AVG[$i]= for (( j=0; j<${aBENCH_ROOTFS_INDEX[$i]}; j++ )) do - (( ${aBENCH_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]} )) && aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} - (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]} )) && aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} + (( ${aBENCH_ROOTFS_WRITE[$i,$j]} < ${aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]:=${aBENCH_ROOTFS_WRITE[$i,$j]}} )) && aBENCH_RESULT_ROOTFS_WRITE_MIN[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} + (( ${aBENCH_ROOTFS_WRITE[$i,$j]} > ${aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]:=${aBENCH_ROOTFS_WRITE[$i,$j]}} )) && aBENCH_RESULT_ROOTFS_WRITE_MAX[$i]=${aBENCH_ROOTFS_WRITE[$i,$j]} (( aBENCH_RESULT_ROOTFS_WRITE_AVG[$i] += ${aBENCH_ROOTFS_WRITE[$i,$j]} )) - (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} )) && aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} - (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]} )) && aBENCH_RESULT_ROOTFS_READ_MAX[$i]=${aBENCH_ROOTFS_READ[$i,$j]} + (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]:=${aBENCH_ROOTFS_READ[$i,$j]}} )) && aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]} + (( ${aBENCH_ROOTFS_READ[$i,$j]} > ${aBENCH_RESULT_ROOTFS_READ_MAX[$i]:=${aBENCH_ROOTFS_READ[$i,$j]}} )) && aBENCH_RESULT_ROOTFS_READ_MAX[$i]=${aBENCH_ROOTFS_READ[$i,$j]} (( aBENCH_RESULT_ROOTFS_READ_AVG[$i] += ${aBENCH_ROOTFS_READ[$i,$j]} )) # Last item in current array. Work out averages @@ -716,22 +709,22 @@ for i in "${!aBENCH_RAM_INDEX[@]}" do - aBENCH_RESULT_RAM_WRITE_MIN[$i]=$default_min_value - aBENCH_RESULT_RAM_WRITE_MAX[$i]=0 - aBENCH_RESULT_RAM_WRITE_AVG[$i]=0 - aBENCH_RESULT_RAM_READ_MIN[$i]=$default_min_value - aBENCH_RESULT_RAM_READ_MAX[$i]=0 - aBENCH_RESULT_RAM_READ_AVG[$i]=0 + aBENCH_RESULT_RAM_WRITE_MIN[$i]= + aBENCH_RESULT_RAM_WRITE_MAX[$i]= + aBENCH_RESULT_RAM_WRITE_AVG[$i]= + aBENCH_RESULT_RAM_READ_MIN[$i]= + aBENCH_RESULT_RAM_READ_MAX[$i]= + aBENCH_RESULT_RAM_READ_AVG[$i]= for (( j=0; j<${aBENCH_RAM_INDEX[$i]}; j++ )) do - (( ${aBENCH_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]} )) && aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} - (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]} )) && aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} + (( ${aBENCH_RAM_WRITE[$i,$j]} < ${aBENCH_RESULT_RAM_WRITE_MIN[$i]:=${aBENCH_RAM_WRITE[$i,$j]}} )) && aBENCH_RESULT_RAM_WRITE_MIN[$i]=${aBENCH_RAM_WRITE[$i,$j]} + (( ${aBENCH_RAM_WRITE[$i,$j]} > ${aBENCH_RESULT_RAM_WRITE_MAX[$i]:=${aBENCH_RAM_WRITE[$i,$j]}} )) && aBENCH_RESULT_RAM_WRITE_MAX[$i]=${aBENCH_RAM_WRITE[$i,$j]} (( aBENCH_RESULT_RAM_WRITE_AVG[$i] += ${aBENCH_RAM_WRITE[$i,$j]} )) - (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]} )) && aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} - (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]} )) && aBENCH_RESULT_RAM_READ_MAX[$i]=${aBENCH_RAM_READ[$i,$j]} + (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]:=${aBENCH_RAM_READ[$i,$j]}} )) && aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]} + (( ${aBENCH_RAM_READ[$i,$j]} > ${aBENCH_RESULT_RAM_READ_MAX[$i]:=${aBENCH_RAM_READ[$i,$j]}} )) && aBENCH_RESULT_RAM_READ_MAX[$i]=${aBENCH_RAM_READ[$i,$j]} (( aBENCH_RESULT_RAM_READ_AVG[$i] += ${aBENCH_RAM_READ[$i,$j]} )) # Last item in current array. Work out averages @@ -747,15 +740,15 @@ for i in "${!aBENCH_LAN_INDEX[@]}" do - aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]=$default_min_value - aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]=0 - aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]=0 + aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]= + aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]= + aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]= for (( j=0; j<${aBENCH_LAN_INDEX[$i]}; j++ )) do - (( ${aBENCH_NET_LAN_SPEED[$i,$j]} < ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]} )) && aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]} - (( ${aBENCH_NET_LAN_SPEED[$i,$j]} > ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]} )) && aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]} + (( ${aBENCH_NET_LAN_SPEED[$i,$j]} < ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]:=${aBENCH_NET_LAN_SPEED[$i,$j]}} )) && aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]} + (( ${aBENCH_NET_LAN_SPEED[$i,$j]} > ${aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]:=${aBENCH_NET_LAN_SPEED[$i,$j]}} )) && aBENCH_RESULT_NET_LAN_SPEED_MAX[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]} (( aBENCH_RESULT_NET_LAN_SPEED_AVG[$i] += ${aBENCH_NET_LAN_SPEED[$i,$j]} )) # Last item in current array. Work out averages @@ -770,22 +763,22 @@ for i in "${!aBENCH_CUSTOMFS_INDEX[@]}" do - aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=$default_min_value - aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=0 - aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=0 - aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=$default_min_value - aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=0 - aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=0 + aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]= + aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]= + aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]= + aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]= + aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]= + aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]= for (( j=0; j<${aBENCH_CUSTOMFS_INDEX[$i]}; j++ )) do - (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]} )) && aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} - (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]} )) && aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} + (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]:=${aBENCH_CUSTOMFS_WRITE[$i,$j]}} )) && aBENCH_RESULT_CUSTOMFS_WRITE_MIN[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} + (( ${aBENCH_CUSTOMFS_WRITE[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]:=${aBENCH_CUSTOMFS_WRITE[$i,$j]}} )) && aBENCH_RESULT_CUSTOMFS_WRITE_MAX[$i]=${aBENCH_CUSTOMFS_WRITE[$i,$j]} (( aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i] += ${aBENCH_CUSTOMFS_WRITE[$i,$j]} )) - (( ${aBENCH_CUSTOMFS_READ[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]} )) && aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} - (( ${aBENCH_CUSTOMFS_READ[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]} )) && aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} + (( ${aBENCH_CUSTOMFS_READ[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]:=${aBENCH_CUSTOMFS_READ[$i,$j]}} )) && aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} + (( ${aBENCH_CUSTOMFS_READ[$i,$j]} > ${aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]:=${aBENCH_CUSTOMFS_READ[$i,$j]}} )) && aBENCH_RESULT_CUSTOMFS_READ_MAX[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]} (( aBENCH_RESULT_CUSTOMFS_READ_AVG[$i] += ${aBENCH_CUSTOMFS_READ[$i,$j]} )) # Last item in current array. Work out averages @@ -837,8 +830,9 @@ body { color: #ffffff; background-color: #181a1c; - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: Arial, sans-serif; } + table { display: block; overflow-x: auto; } td { border: 1px solid grey; padding: 5px; } a { color: #ffffff; text-decoration: none; } a:hover, a:focus, a:active { color: #c5ff00; } @@ -846,7 +840,7 @@ text-transform: uppercase; font-size: 15px; line-height: 40px; - padding: 10px 15px; + padding: 10px 14px; border: 1px solid #181a1c; border-radius: 5px; transition: border-color 1s; @@ -876,7 +870,7 @@ color: #181a1c; background-color: #c5ff00; border: 1px solid #181a1c; - border-radius: 5px; + border-radius: 4px; transition: color 0.5s, background-color 0.5s, border-color 0.5s; } a.scrollup:hover, @@ -898,7 +892,7 @@

DietPi-Survey statistics

-

Uploads since: 2020-01-01 00:00:00 UTC

+

Uploads since: 2020-07-01 00:00:00 UTC +0100

Last update: $(TZ=UTC date '+%Y-%m-%d %T UTC')


diff --git a/.update/patches b/.update/patches new file mode 100644 index 0000000000..954a146cba --- /dev/null +++ b/.update/patches @@ -0,0 +1,11 @@ +#!/bin/bash +{ +# DietPi-Update incremental patches to apply system and software migrations and fixes +# Created by MichaIng / micha@dietpi.com / https://dietpi.com/ +# License: GPLv2 / https://github.com/MichaIng/DietPi#license + +# Remove obsolete udev rule, as WiFi power saving is disabled via /etc/network/intefaces > "wireless-power off" > /etc/network/if-pre-up.d/wireless-tools (wireless-tools package) when the WiFi interface is configured. +[[ -f '/etc/udev/rules.d/10-wifi-disable-powermanagement.rules' ]] && rm -v /etc/udev/rules.d/10-wifi-disable-powermanagement.rules + +exit 0 +} diff --git a/.update/pre-patches b/.update/pre-patches new file mode 100644 index 0000000000..5d00232950 --- /dev/null +++ b/.update/pre-patches @@ -0,0 +1,28 @@ +#!/bin/bash +{ +# DietPi-Update pre-patches that need to run before new scripts are downloaded and/or before APT upgrades +# Created by MichaIng / micha@dietpi.com / https://dietpi.com/ +# License: GPLv2 / https://github.com/MichaIng/DietPi#license + +# Load DietPi-Globals +. /boot/dietpi/func/dietpi-globals +readonly G_PROGRAM_NAME='DietPi-Pre-patches' +G_CHECK_ROOT_USER +G_CHECK_ROOTFS_RW +G_INIT + +# IMPORTANT: This script can be called with DietPi v6.17, hence assure compatibility! +# - Pre-v6.29: Create G_EXEC as G_RUN_CMD wrapper +declare -F G_EXEC > /dev/null || G_EXEC(){ G_RUN_CMD "$@"; } + +# Update Jellyfin APT repo key: https://dietpi.com/phpbb/viewtopic.php?t=8703 +if [[ -f '/etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg' && $(date -u '+%Y%m%d' -r '/etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg') -lt 20201216 ]] +then + G_DIETPI-NOTIFY 2 'Updating Jellyfin APT repo key: https://dietpi.com/phpbb/viewtopic.php?t=8703' + G_EXEC curl -sSfLO 'https://repo.jellyfin.org/jellyfin_team.gpg.key' + G_EXEC gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg --yes jellyfin_team.gpg.key + G_EXEC rm jellyfin_team.gpg.key +fi + +exit 0 +} diff --git a/.update/version b/.update/version new file mode 100644 index 0000000000..26e350ba72 --- /dev/null +++ b/.update/version @@ -0,0 +1,13 @@ +# Available DietPi version +G_REMOTE_VERSION_CORE=7 +G_REMOTE_VERSION_SUB=0 +G_REMOTE_VERSION_RC=2 +# Minimum DietPi version to allow update +G_MIN_VERSION_CORE=6 +G_MIN_VERSION_SUB=-1 +# Alternative Git branch to automatically migrate to when version is too low +G_OLD_VERSION_BRANCH='master' +# Minimum Debian version to allow update +G_MIN_DEBIAN=4 +# Alternative Git branch to automatically migrate to when Debian version is too low +G_OLD_DEBIAN_BRANCH='jessie-support' diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fa80f40e13..16d9e1134e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,60 @@ +v7.0 +(2021-02-28) + +Changes: +- DietPi-Update | A new update check system has been implemented, which checks for a minimum required Debian and DietPi version and migrates systems with either too old Debian version or too old DietPi version to a different Git branch automatically. This especially smoothens the migration of our code base to newer Debian versions and the alternative branch can be used to inform and support Debian distribution upgrades and to upgrade the DietPi code to an intermediate version from where the system can be migrated back to the regular stable/master branch. Since this change required a new repository version file, we took the chance and incremented the DietPi core version to v7.0. This however has no further meaning, all previously supported DietPi and Debian versions remain supported and the change enables us to not require fresh image installs for major upgrades, like the upgrade from v159 to v6.0 did a few years ago. +- Network | A change has been implemented on the order in which network-related systemd service targets are reached. "network.target" and "network-online.target" are now reach after all network interfaces have been configured, rather then already after only the loopback interface "lo" has been configured. This affects only systemd services which are not started by DietPi-Services, e.g. SSH/DNS/VPN/VNC servers, with the effect that they are assured to be able to bind to interfaces/IPs, where currently they would fail. The downside is, if one has an Ethernet adapter configured via dietpi-config or /etc/network/interfaces (as allow-hotplug device), but the cable not connected, affected services may be delayed until the interface bring-up timed out. +- DietPi-Backup | A new feature has been added which allows to automatically restore a dietpi-backup on first boot. For this set the new dietpi.txt option AUTO_SETUP_BACKUP_RESTORE=1, to get a list of found backups to select from (this does not work in combination with AUTO_SETUP_AUTOMATED=1). All attached drives are mounted temporarily and seached automatically. Set AUTO_SETUP_BACKUP_RESTORE=2 to have the first found backup restored non-interactively (this works in combination with AUTO_SETUP_AUTOMATED=1). The restore runs after the initial update, hence works with older images as well and can be done via SSH connection. Credits go to @ravenclaw900 for implementing this feature: https://github.com/MichaIng/DietPi/pull/4112 +- DietPi-Backup | Support for XFS and ZFS target file system types has been added, which fully support the required symlink and POSIX permissions capabilities. +- DietPi-Config | RPi: An option has been added to toggle the SPI interface. Many thanks to @incanus for resurrecting this old feature request: https://github.com/MichaIng/DietPi/issues/98#issuecomment-783650204 +- DietPi-Software | The mandatory reboot after installs has been removed. Installed services, which are not controlled by DietPi-Services, but would start automatically on reboot, are now started at the end of installs instead. A manual reboot is still a good idea, but strictly required only in rare cases. Many thanks to @Games-Crack for doing this suggesting: https://github.com/MichaIng/DietPi/issues/4032 +- DietPi-Software | Installs do not imply all APT package upgrades anymore. While we recommend to keep all APT packages upgraded regularly, the new daily APT check and info within the DietPi-Banner, helps to keep you informed to do the best decision youself whether and when to apply which package upgrade. On first run installs the full upgrade is however kept, to assure each image starts in fully upgraded state, and packages which are required for the actual software choices you're installing, are upgraded as well, when installed already. +- DietPi-Software | Uninstalls do not stop other services anymore. E.g. your webserver or media streaming server will stay active while you uninstall that other software that you don't require anymore. Since uninstalls do not require much RAM or CPU resources, this is perfectly fine. Many thanks to @mrgreaper giving the hint: https://github.com/MichaIng/DietPi/issues/4116 +- DietPi-Software | Unbound: On install in combination with Pi-hole, no additional configuration file will be created anymore but the adjusted interface binding and port will be applied to "/etc/unbound/unbound.conf.d/dietpi.conf". Declaring "interface" in two configuration files do not override each other but lead to two concurrent bindings, which is not intended. The two files, if present, will be merged as well on DietPi update. It is hence intended that admins change "dietpi.conf" directly, if required, and this file won't be overwritten on reinstalls to preserve local changes. Additionally, on new installs, the configuration file will be better sorted and contain comments to explain their purpose. +- DietPi-Software | Unbound: On new installs, by default access is now granted to all private IPv4 and IPv6 address ranges instead of to the 192.168.0.0/16 subnet only, which includes VPNs, containers and cases of multiple local networks the server is attached to. +- DietPi-Software | Unbound: A monthly cron job is now created to keep the root hints file updated. Many thanks to @APraxx for doing this suggestion: https://github.com/MichaIng/DietPi/issues/4077 +- DietPi-Software | Python 3 pip: pip and pip-based installs on ARMv6 and ARMv7 boards will have the piwheels.org repository for pre-compiled wheels added automatically, which can reduce build dependencies and compile time dramatically. +- DietPi-Software | Node-RED: New installs and reinstalls with setup Node-RED as local module for the "nodered" service user, rather than as global system module/command. This allows upgrading and removing all related Node modules through the web interface, instead of just the ones which were installed via web interface. Additionally a console alias for the "node-red-admin" CLI command has been added so that running this command with any user will call the local Node-RED instance as "nodered" service user. +- DietPi-Software | Docker: The Docker APT repository is now installed manually instead of using the official Docker installer. This allows us to enable the Docker install option for Debian Bullseye systems, if only to allow widened testing of this upcoming Debian release with DietPi. + +Interface Changes: +- DietPi-Banner | Running the script without input argument will now open the menu instead of printing the banner. The console alias has been adjusted accordingly, so that it is now possible to run "dietpi-banner 0" and "dietpi-banner 1" from console to have full and short banner versions printed. The "dietpi-banner" console command remains opening the menu. + +New Software: +- DietPi-Software | Docker Compose: A tool to define and run multi-container Docker applications can now be installed through our software selection. Docker will be pulled in as dependency automatically. +- DietPi-Software | Box86: An x86 wrapper/emulator for ARMv7 systems is now available for install. Thanks to it's ability to wrap ARMv7 shared system libraries to be used with i386 binaries, often no additional libraries need to be installed. Thanks to binfmt, it will be invoked automatically when an i386 binary is executed. +- DietPi-Software | Steam: By automatically pulling in Box86 as dependency, Steam can now be installed on ARMv7 boards. It won't run perfectly stable yet and has limited features and game support, but we're optimistic that further improvements will address this in the future. Check out our documentation about it: https://dietpi.com/docs/software/gaming/#steam +- DietPi-Software | mjpg-streamer: Lightweight multi-source and multi-output plugin JPEG streamer, now available for install. By default your attached camera capture will be streamed to a custom HTTP port. When installed along with OctoPrint, both will be automatically configured to work together. The Raspberry Pi camera module support is enabled by default, when installed on Raspberry Pi. + +Fixes: +- Audio | Resolved a bug with Debian Buster, where the ALSA state daemon was always running, even when it was not configured. +- DietPi-Globals | G_OBTAIN_CPU_TEMP: Negative temperatures are not trusted anymore, "N/A" will be printed instead. This allows a generic approach to fix/allow temperature estimation on further SBC models. Many thanks to @Thanapat for reporting a related issue on Roseapple Pi: https://dietpi.com/phpbb/viewtopic.php?t=8677 +- DietPi-Set_swapfile | Resolve an issue where "zram"/"zram0" dietpi.txt path entries were dropped, when running the script without input arguments. This especially broke applying zram-swap on first boot. Many thanks to @Dr0bac for reporting this issue: https://github.com/MichaIng/DietPi/issues/4002 +- DietPi-Software | Bitwarden_RS: Resolved an issue where the self-signed TLS certificate could not be imported on iOS. To apply this fix to an existing instance, the configuration file "/mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env" needs to be removed or moved to a different location, so "dietpi-software reinstall 183" will re-create the configuration and TLS certificate. +- DietPi-Software | Unbound: Resolved an issue where during install in combination with Pi-hole the service restart could have failed. Many thanks to @Ernstian for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-739154892 +- DietPi-Software | Unbound: Resolved an issue where the service start failed if the host system had a local IP address outside of the 192.168.0.0/16 subnet. Many thanks to @faxesystem for reporting this issue: https://github.com/MichaIng/DietPi/issues/2409#issuecomment-749174984 +- DietPi-Software | ReadyMedia: Resolved an issue where the media library was not rescanned on service start. Many thanks to @AdamFarnsworth0 for reporting this issue: https://twitter.com/AdamFarnsworth0/status/1347977813635305475 +- DietPi-Software | WiFi Hotspot: Resolved an issue where the install on Armbian-based images with RTL8188C* WiFi chip failed. Many thanks to @smogan71 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8523 +- DietPi-Software | Medusa: This software option has been disabled on Stretch systems, since it now requires Python >=3.6, which is not available in the Debian Stretch repository. If you run Medusa on a Stretch system, it will continue to work, but updating will either not be possible or break it. Many thanks to @aermak for reporting this issue: https://github.com/MichaIng/DietPi/issues/3991 +- DietPi-Software | WiringPi: Resolved an issue where the install failed, if the /usr/local/bin directory was not present. Many thanks to @bruz for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8609 +- DietPi-Software | PaperMC: Resolved an issue where the install failed due to changed download URLs and stabilised service start and config creation by setting the Java heap size and allowing more time for the startup on smaller SBCs. Many thanks to @omavoss for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=30191#p30191 +- DietPi-Software | OpenTyrian: The install option has been disabled on x86_64, since the Debian package comes with a different file structure and it has been disabled on 64-bit RPi systems, since the binary has been compiled for armhf. +- DietPi-Software | Domoticz: Resolved an issue where saving custom scripts and starting with a template did not work. Many thanks to @tec13 for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8627 +- DietPi-Software | Resolved an issue where for ruTorrent, Koel and Bitwarden_RS the automatic newest version detection failed and instead a possibly older fallback was used. Many thanks to @kelvmod for reporting this issue: https://github.com/MichaIng/DietPi/issues/4105 +- DietPi-Software | LXQt: Resolved visual issues with our default configuration of Debian Buster, drastically simplified and cleaned up the files we ship. +- DietPi-Software | SABnzbd: Resolved an issue on Stretch where the install failed due to raised minimum Python version with SABnzbd v3.2.0. If Python 3.5 is installed, SABnzbd v3.1.1 will be installed now to allow keeping the install option enabled for now. Many thanks to @19eighties for reporting this issue: https://github.com/MichaIng/DietPi/issues/2762#issuecomment-787118995 + +As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/4126 + +Known/Outstanding Issues: +- DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103 +- DietPi-Software | MATE desktop: When logging in as root, desktop items and right-click context menu is missing: https://github.com/MichaIng/DietPi/issues/3160 +- DietPi-Software | Sonarr/Radarr/Mono: With current Mono version 6, import to a file system without UNIX permissions support (exFAT, FAT32/vfat, CIFS mounts and NTFS without "permissions" option) fails, regardless of user/umask mount options: https://github.com/MichaIng/DietPi/issues/3179 + +For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues + +----------------------------------------------------------------------------------------------------------- + v6.34 (20/12/20) @@ -32,7 +89,7 @@ New Software Packages: Removed Software Packages: - DietPi-Software | DietPi-CloudShell: The install option has been removed, but DietPi-CloudShell stays available of course. The install did nothing else than creating the service file and enabling the autostart option, but the script was always available and did work well without having the software option installed. The service is now as well available statically, the script can always be started from console via "dietpi-cloudshell" shortcut alias now and is shown in dietpi-launcher. Also non-root users can run now run it via "dietpi-cloudshell 1" (with intro) or "dietpi-cloudshell 2" (no intro), only changing the settings via menu (no command argument) requires root permissions. - DietPi-Software | CloudPrint: This software option has been removed, since the Google Cloud Print service will be shut down at the end of 2020 and we don't want to offer software options which will work for at most two months. Please migrate to another printing solution in time. Already installed CloudPrint instances will remain installed and the system service remains functional until the end of the year. With the first DietPi release in 2021 we will remove service handling and offer the package removal during the update process. Further information can be found here: https://www.google.com/cloudprint/learn/ -- DietPi-Software | Tonido: This software option has been removed, since it is not developed anymore fore three years, no sources have been found and the latest binaries require ancient library versions which fail to be easily installed on currently supported Debian versions. +- DietPi-Software | Tonido: This software option has been removed, since it is not developed anymore for three years, no sources have been found and the latest binaries require ancient library versions which fail to be easily installed on currently supported Debian versions. Bug Fixes: - DietPi-Config | Resolved an issue on RPi where the onboard 3.5mm jack selection did not work if an HDMI screen was attached. When selecting explicit either HDMI audio or onboard 3.5mm jack, the other one is now disabled on device tree level, which means it cannot be switched without reboot. This is currently the only known way to assure that 3.5mm jack is used for audio output regardless of now or later attached or detached HDMI screens. Many thanks to @corasaniti for reporting this issue: https://github.com/MichaIng/DietPi/issues/3887 @@ -60,15 +117,6 @@ Bug Fixes: As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/3982 -Known/Outstanding Issues: -- DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103 -- DietPi-Software | Node-RED: Pre-installed modules cannot be updated via web UI: https://github.com/MichaIng/DietPi/issues/2073 -- DietPi-Software | Raspimjpeg: With Lighttpd, streaming mjpeg does not work: https://github.com/MichaIng/DietPi/issues/1747 -- DietPi-Software | MATE desktop: When logging in as root, desktop items and right-click context menu is missing: https://github.com/MichaIng/DietPi/issues/3160 -- DietPi-Software | Sonarr/Radarr/Mono: With current Mono version 6, import to a file system without UNIX permissions support (exFAT, FAT32/vfat, CIFS mounts and NTFS without "permissions" option) fails, regardless of user/umask mount options: https://github.com/MichaIng/DietPi/issues/3179 - -For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues - ----------------------------------------------------------------------------------------------------------- v6.33 @@ -1341,8 +1389,8 @@ General | Resolved multiple issues with failed GNU key management during APT ins General | Resolved basic APT issues with Meveric's repo and failing dependencies. Debian repo is now used in the first instance: https://github.com/MichaIng/DietPi/pull/1571#issuecomment-369973745 General | DietPi-Globals are now loaded prior to login script. Ensures aliases are functional during exit of 1st run setup: https://github.com/MichaIng/DietPi/issues/1580#issuecomment-370149636 DietPi-Config | Resolved an issue with NTPD mode #4 (systemd) reporting dbus errors, dbus is now installed on demand: https://github.com/MichaIng/DietPi/issues/1580#issuecomment-370173703 -DietPi-LetsEncrypt | Lighttpd/Minio: Fixed auto renewal: https://github.com/MichaIng/DietPi/pull/1553 -DietPi-LetsEncrypt | Minio: Fixed an issue, where port 443 listening would fail due to missing libcap2-bin/setcap package: https://github.com/MichaIng/DietPi/pull/1553#issuecomment-368261474 +DietPi-LetsEncrypt | Lighttpd/MinIO: Fixed auto renewal: https://github.com/MichaIng/DietPi/pull/1553 +DietPi-LetsEncrypt | MinIO: Fixed an issue, where port 443 listening would fail due to missing libcap2-bin/setcap package: https://github.com/MichaIng/DietPi/pull/1553#issuecomment-368261474 DietPi-Software | Radarr/Sonarr: Reinstall patch, to bring binaries upto date, which resolves issues with the latest mono lib version: https://github.com/MichaIng/DietPi/issues/1566 DietPi-Software | Desktops: USB drive removed from .gtk-bookmarks as no longer used in DietPi. DietPi-Software | Shairport-Sync: Resolved ARMv6 binary Illegal instruction: https://github.com/MichaIng/DietPi/issues/1548 @@ -1366,7 +1414,7 @@ DietPi-Config | Display options > Resolution: Added fkms/kms (OpenGL) modes for DietPi-Config | Sparky SBC: Added option to select usb-dac-1.1 sound card, which will enable USB1.1 compatibility. DietPi-Config | WiFi: Now supports connecting to hidden WiFi networks, thanks @shahwahed : https://github.com/MichaIng/DietPi/pull/1497 DietPi-LetsEncrypt | On Jessie, changed certificate auto renewal to native certbot renew command, to prevent certificate duplication: https://github.com/MichaIng/DietPi/issues/734 -DietPi-LetsEncrypt | On Stretch, added automated Minio certificate renewal. Rerun "dietpi-letsencrypt" on your Stretch system to gain this feature. +DietPi-LetsEncrypt | On Stretch, added automated MinIO certificate renewal. Rerun "dietpi-letsencrypt" on your Stretch system to gain this feature. DietPi-Process_tool | Reduction of onscreen print. Additional status print will only occur when HIERARCHY is less than 2 and/or an error occurs. DietPi-Software | Amiberry: Massive update to v2.14 and SDL2, new installations only. Currently for RPi's under Stretch only, however, we have plans to implement for other devices: https://dietpi.com/phpbb/viewtopic.php?p=64#p64 https://github.com/MichaIng/DietPi/issues/1410 DietPi-Software | LMS/Squeezebox: Has undergone an install review and re-write. All archs are now supported for Stretch + Jessie: https://github.com/MichaIng/DietPi/issues/1496 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 84ce773ccf..0fe26142c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,13 +9,15 @@ Are you able to: - Provide feedback and/or test areas of DietPi, to improve the user experience? - Report bugs? - Improve/add more features to the DietPi [website](https://github.com/MichaIng/DietPi-Website) or [documentation](https://github.com/MichaIng/DietPi-Docs)? -- Compile software for our supported SBCs? +- Compile software for our [supported platforms](https://dietpi.com/docs/hardware/)? - Contribute to DietPi with programming on GitHub? - Suggest new software that we can add to the `dietpi-software` install system? -If so, let us know! +If so, let us know! We are always looking for talented people who believe in the DietPi project, and, wish to contribute in any way you can. -- Send me an Email: micha@dietpi.com -- Join our forums: https://dietpi.com/phpbb/ -- GitHub: https://github.com/MichaIng/DietPi +- Send us an email: +- Join our forum: +- GitHub: + +Read more: diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index a08e4cb7bb..7d92fdd8e2 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -55,6 +55,8 @@ # - Remove unwanted APT configs # RPi: Allow PDiffs since the "slow implementation" argument is outdated and PDiffs allow lower download size and less disk I/O [[ -f '/etc/apt/apt.conf.d/50raspi' ]] && rm -v /etc/apt/apt.conf.d/50raspi + # https://github.com/MichaIng/DietPi/issues/4083 + rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg /etc/apt/preferences.d/3rd_parties.pref # Meveric: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-355759321 [[ -f '/etc/apt/sources.list.d/deb-multimedia.list' ]] && rm -v /etc/apt/sources.list.d/deb-multimedia.list [[ -f '/etc/apt/preferences.d/deb-multimedia-pin-99' ]] && rm -v /etc/apt/preferences.d/deb-multimedia-pin-99 @@ -126,23 +128,23 @@ _EOF_ fi # Setup locale - # - Remove existing settings that could break dpkg-reconfigure locales + # - Reset existing configs > /etc/environment [[ -f '/etc/default/locale' ]] && rm /etc/default/locale - # - NB: DEV, any changes here must be also rolled into function '/boot/dietpi/func/dietpi-set_software locale', for future script use + # - Prepare C.UTF-8 generation only, statically shipped as /usr/lib/locale/C.UTF-8 via libc-bin essential package echo 'C.UTF-8 UTF-8' > /etc/locale.gen + # - Apply override LC_ALL and default LANG for current script + export LC_ALL='C.UTF-8' LANG='C.UTF-8' # - dpkg-reconfigure includes: # - "locale-gen": Generate locale(s) based on "/etc/locale.gen" or interactive selection. - # - "update-locale": Add $LANG to "/etc/default/locale" based on generated locale(s) or interactive default language selection. + # - "update-locale": Add LANG to "/etc/default/locale" based on generated locale(s) or interactive default language selection. if ! dpkg-reconfigure -f noninteractive locales; then echo -e '[FAILED] Locale generation failed. Aborting...\n' exit 1 fi - # - Export locale vars to assure the following whiptail being beautiful - export LC_ALL='C.UTF-8' LANG='C.UTF-8' - # - Update /etc/default/locales with new values (not effective until next load of bash session, eg: logout/in) + # - Add override LC_ALL to "/etc/default/locale" as well update-locale 'LC_ALL=C.UTF-8' # Set Git owner @@ -256,35 +258,32 @@ _EOF_ # Init setup step headers SETUP_STEP=0 readonly G_NOTIFY_3_MODE='Step' - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Detecting existing DietPi system"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Detecting existing DietPi system"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ if [[ -d '/DietPi' || -d '/boot/dietpi' ]]; then G_DIETPI-NOTIFY 2 'DietPi system found, uninstalling old instance...' - # Stop services: RAMdisk includes (Pre|Post)Boot due to dependencies + # Stop services [[ -f '/boot/dietpi/dietpi-services' ]] && /boot/dietpi/dietpi-services stop [[ -f '/etc/systemd/system/dietpi-ramlog.service' ]] && systemctl stop dietpi-ramlog - [[ -f '/etc/systemd/system/dietpi-ramdisk.service' ]] && systemctl stop dietpi-ramdisk + [[ -f '/etc/systemd/system/dietpi-ramdisk.service' ]] && systemctl stop dietpi-ramdisk # Includes (Pre|Post)Boot on pre-v6.29 systems + [[ -f '/etc/systemd/system/dietpi-preboot.service' ]] && systemctl stop dietpi-preboot # Includes (Pre|Post)Boot on post-v6.28 systems # Disable DietPi services for i in /etc/systemd/system/dietpi-* do - [[ -f $i ]] && systemctl disable --now "${i##*/}" rm -Rfv "$i" - done # Delete any previous existing data - # - /DietPi mount point: Pre-v6.29 + # - Pre-v6.29: /DietPi mount point findmnt /DietPi > /dev/null && umount -R /DietPi [[ -d '/DietPi' ]] && rm -R /DietPi rm -Rfv /{boot,mnt,etc,var/lib,var/tmp,run}/*dietpi* rm -fv /etc{,/cron.*,/{bashrc,profile,sysctl,network/if-up,udev/rules}.d}/{,.}*dietpi* rm -fv /etc/apt/apt.conf.d/{99-dietpi-norecommends,98-dietpi-no_translations,99-dietpi-forceconf} # Pre-v6.32 - - [[ -f '/root/DietPi-Automation.log' ]] && rm -v /root/DietPi-Automation.log [[ -f '/boot/Automation_Format_My_Usb_Drive' ]] && rm -v /boot/Automation_Format_My_Usb_Drive else @@ -294,7 +293,7 @@ _EOF_ fi #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Target system inputs"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Target system inputs"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ # Image creator @@ -373,7 +372,7 @@ _EOF_ G_WHIP_MENU_ARRAY=( '' '●─ ARM ─ Core devices with GPU support ' - '0' ': Raspberry Pi (All models)' + '0' ': Raspberry Pi (all models)' #'0' ': Raspberry Pi 1 (256 MiB) #'1' ': Raspberry Pi 1/Zero (512 MiB)' #'2' ': Raspberry Pi 2' @@ -382,7 +381,7 @@ _EOF_ '11' ': Odroid XU3/XU4/MC1/HC1/HC2' '12' ': Odroid C2' '15' ': Odroid N2' - '16' ': Odroid C4' + '16' ': Odroid C4/HC4' '44' ': Pinebook' '' '●─ x86_64 ' '21' ': x86_64 Native PC' @@ -597,7 +596,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_DIETPI-NOTIFY 2 "Selected Debian version: $DISTRO_TARGET_NAME (ID: $DISTRO_TARGET)" #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Downloading and installing DietPi source code"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Downloading and installing DietPi source code"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ local url="https://github.com/$G_GITOWNER/DietPi/archive/$G_GITBRANCH.tar.gz" @@ -652,7 +651,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC systemctl daemon-reload #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] APT configuration"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] APT configuration"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" @@ -852,11 +851,17 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_AGI linux-image-arm64-odroid-c4 meveric-keyring G_EXEC_NOHALT=1 G_EXEC apt-mark manual u-boot # Workaround until C4 u-boot package has been added to repo: https://dietpi.com/meveric/pool/c4/ + # Apply kernel postinst steps manually, that depend on /proc/cpuinfo content, not matching when running in a container. + [[ -f '/boot/Image' ]] && G_EXEC mv /boot/Image /boot/Image.gz + [[ -f '/boot/Image.gz.bak' ]] && G_EXEC rm /boot/Image.gz.bak # Odroid N2 elif (( $G_HW_MODEL == 15 )); then G_AGI linux-image-arm64-odroid-n2 meveric-keyring + # Apply kernel postinst steps manually, that depend on /proc/cpuinfo content, not matching when running in a container. + [[ -f '/boot/Image' ]] && G_EXEC mv /boot/Image /boot/Image.gz + [[ -f '/boot/Image.gz.bak' ]] && G_EXEC rm /boot/Image.gz.bak # Odroid N1 elif (( $G_HW_MODEL == 14 )); then @@ -961,7 +966,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_AGA #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] APT installations"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] APT installations"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ G_AGDUG @@ -981,7 +986,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_EXEC_DESC='Preserving modified DEB package config files from now on' G_EXEC rm -v /etc/apt/apt.conf.d/98dietpi-forceconf #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Applying DietPi tweaks and cleanup"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Applying DietPi tweaks and cleanup"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ # https://github.com/jirka-h/haveged/pull/7 https://github.com/MichaIng/DietPi/issues/3689#issuecomment-678322767 @@ -1018,10 +1023,6 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then G_DIETPI-NOTIFY 2 'Removing misc files/folders/services, not required by DietPi' - # shellcheck disable=SC2015,SC2115 - [[ -d '/home' ]] && rm -Rfv /home/{,.??,.[^.]}* || mkdir /home - # shellcheck disable=SC2015,SC2115 - [[ -d '/media' ]] && rm -Rfv /media/{,.??,.[^.]}* || mkdir /media [[ -d '/selinux' ]] && rm -Rv /selinux [[ -d '/var/cache/apparmor' ]] && rm -Rv /var/cache/apparmor rm -Rfv /var/lib/dhcp/{,.??,.[^.]}* @@ -1114,9 +1115,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then for i in "${aservices[@]}" do - G_EXEC update-rc.d -f "$i" remove - done unset -v aservices @@ -1128,8 +1127,6 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then [[ -f '/usr/local/sbin/log2ram' ]] && rm -v /usr/local/sbin/log2ram umount /var/log.hdd 2> /dev/null [[ -d '/var/log.hdd' ]] && rm -R /var/log.hdd - [[ -f '/root/.not_logged_in_yet' ]] && rm -v /root/.not_logged_in_yet - [[ -f '/root/.desktop_autologin' ]] && rm -v /root/.desktop_autologin rm -vf /etc/X11/xorg.conf.d/*armbian* #rm -vf /etc/armbian* armbian-release # Required for kernel/bootloader package upgrade (initramfs postinst) rm -vf /lib/systemd/system/*armbian* @@ -1139,6 +1136,7 @@ Currently installed: $G_DISTRO_NAME (ID: $G_DISTRO)"; then #rm -vf /etc/default/*armbian* # Required for Armbian root package upgrade rm -vf /etc/update-motd.d/*armbian* rm -vf /etc/profile.d/*armbian* + rm -Rfv /etc/skel/.config #[[ -d '/usr/lib/armbian' ]] && rm -vR /usr/lib/armbian # Required for Armbian root package upgrade #[[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian # Required for Armbian root package upgrade # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi @@ -1148,12 +1146,16 @@ path-exclude /lib/systemd/system/*armbian* path-exclude /etc/systemd/system/logrotate.service path-exclude /etc/apt/apt.conf.d/*armbian* path-exclude /etc/cron.*/*armbian* +path-exclude /etc/skel/.config/htop/htoprc #path-exclude /etc/default/*armbian* # Required for Armbian root package upgrade path-exclude /etc/update-motd.d/*armbian* path-exclude /etc/profile.d/*armbian* #path-exclude /usr/lib/armbian # Required for Armbian root package upgrade #path-exclude /usr/share/armbian # Required for Armbian root package upgrade _EOF_ + # Armbian auto-login + [[ -d '/etc/systemd/system/getty@.service.d' ]] && rm -Rv /etc/systemd/system/getty@.service.d + [[ -d '/etc/systemd/system/serial-getty@.service.d' ]] && rm -Rv /etc/systemd/system/serial-getty@.service.d # - OMV: https://github.com/MichaIng/DietPi/issues/2994 [[ -d '/etc/openmediavault' ]] && rm -vR /etc/openmediavault @@ -1162,8 +1164,6 @@ _EOF_ # - Meveric specific [[ -f '/usr/local/sbin/setup-odroid' ]] && rm -v /usr/local/sbin/setup-odroid - [[ -d '/root/scripts' ]] && rm -R /root/scripts - [[ -f '/root/resize--log.txt' ]] && rm /root/resize--log.txt rm -fv /installed-packages*.txt # - RPi specific: https://github.com/MichaIng/DietPi/issues/1631#issuecomment-373965406 @@ -1198,11 +1198,6 @@ _EOF_ #----------------------------------------------------------------------------------- # Bash Profiles - # - Pre v6.9 cleaning: - [[ -f '/root/.bashrc' ]] && sed -i '/\/DietPi/d' /root/.bashrc - [[ -f '/home/dietpi/.bashrc' ]] && sed -i '/\/DietPi/d' /home/dietpi/.bashrc - rm -vf /etc/profile.d/99-dietpi* - # - Enable /etc/bashrc.d/ support for custom interactive non-login shell scripts: sed -i '\#/etc/bashrc\.d/#d' /etc/bash.bashrc # shellcheck disable=SC2016 @@ -1282,10 +1277,6 @@ _EOF_' fi [[ -f '/etc/udev/rules.d/70-persistent-net.rules' ]] && rm -v /etc/udev/rules.d/70-persistent-net.rules # Jessie pre-image - G_DIETPI-NOTIFY 2 'Resetting and adding dietpi.com SSH pub host key for DietPi-Survey/Bugreport uploads:' - mkdir -pv /root/.ssh - echo 'ssh.dietpi.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE6aw3r6aOEqendNu376iiCHr9tGBIWPgfrLkzjXjEsHGyVSUFNnZt6pftrDeK7UX+qX4FxOwQlugG4fymOHbimRCFiv6cf7VpYg1Ednquq9TLb7/cIIbX8a6AuRmX4fjdGuqwmBq3OG7ZksFcYEFKt5U4mAJIaL8hXiM2iXjgY02LqiQY/QWATsHI4ie9ZOnwrQE+Rr6mASN1BVFuIgyHIbwX54jsFSnZ/7CdBMkuAd9B8JkxppWVYpYIFHE9oWNfjh/epdK8yv9Oo6r0w5Rb+4qaAc5g+RAaknHeV6Gp75d2lxBdCm5XknKKbGma2+/DfoE8WZTSgzXrYcRlStYN' > /root/.ssh/known_hosts - G_DIETPI-NOTIFY 2 'Configuring DNS nameserver:' # Failsafe: Assure that /etc/resolv.conf is not a symlink and disable systemd-resolved systemctl disable --now systemd-resolved @@ -1332,15 +1323,22 @@ _EOF_' G_DIETPI-NOTIFY 2 'Disabling apt-daily services to prevent random APT cache lock' for i in apt-daily{,-upgrade}.{service,timer} do - - systemctl disable --now $i 2> /dev/null - systemctl mask $i 2> /dev/null - + G_EXEC systemctl disable --now $i + G_EXEC systemctl mask $i done - G_DIETPI-NOTIFY 2 'Disabling e2scrub services which are for LVM and require lvm2/lvcreate being installed' - systemctl disable --now e2scrub_all.timer 2> /dev/null - systemctl disable --now e2scrub_reap 2> /dev/null + if (( $G_DISTRO > 5 )) + then + G_DIETPI-NOTIFY 2 'Disabling e2scrub services which are for LVM and require lvm2/lvcreate being installed' + G_EXEC systemctl disable --now e2scrub_all.timer + G_EXEC systemctl disable --now e2scrub_reap + fi + + if (( $G_DISTRO > 4 )) + then + G_DIETPI-NOTIFY 2 'Enabling weekly TRIM' + G_EXEC systemctl enable fstrim.timer + fi (( $G_HW_MODEL > 9 )) && echo "$G_HW_MODEL" > /etc/.dietpi_hw_model_identifier G_EXEC_DESC='Generating /boot/dietpi/.hw_model' G_EXEC /boot/dietpi/func/dietpi-obtain_hw_model @@ -1355,9 +1353,15 @@ _EOF_' echo -e "Samba client: $info_use_drive_manager" > /mnt/samba/readme.txt echo -e "NFS client: $info_use_drive_manager" > /mnt/nfs_client/readme.txt - G_DIETPI-NOTIFY 2 'Restoring original MOTD:' - rm -fv /etc/motd - cp -v /usr/share/base-files/motd /etc/motd + G_DIETPI-NOTIFY 2 'Restoring default base files:' + # shellcheck disable=SC2114 + rm -Rfv /etc/{motd,profile,update-motd.d,issue{,.net}} /root /home /media /var/mail + G_AGI -o 'Dpkg::Options::=--force-confmiss,confnew' --reinstall base-files # Restore /etc/{update-motd.d,issue{,.net}} /root /home + G_EXEC /var/lib/dpkg/info/base-files.postinst configure # Restore /root/.{profile,bashrc} /etc/{motd,profile} /media /var/mail + + G_DIETPI-NOTIFY 2 'Resetting and adding dietpi.com SSH pub host key for DietPi-Survey/Bugreport uploads:' + G_EXEC mkdir -p /root/.ssh + echo 'ssh.dietpi.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE6aw3r6aOEqendNu376iiCHr9tGBIWPgfrLkzjXjEsHGyVSUFNnZt6pftrDeK7UX+qX4FxOwQlugG4fymOHbimRCFiv6cf7VpYg1Ednquq9TLb7/cIIbX8a6AuRmX4fjdGuqwmBq3OG7ZksFcYEFKt5U4mAJIaL8hXiM2iXjgY02LqiQY/QWATsHI4ie9ZOnwrQE+Rr6mASN1BVFuIgyHIbwX54jsFSnZ/7CdBMkuAd9B8JkxppWVYpYIFHE9oWNfjh/epdK8yv9Oo6r0w5Rb+4qaAc5g+RAaknHeV6Gp75d2lxBdCm5XknKKbGma2+/DfoE8WZTSgzXrYcRlStYN' > /root/.ssh/known_hosts # Add pre-up lines for WiFi on OrangePi Zero if (( $G_HW_MODEL == 32 )); then @@ -1420,12 +1424,6 @@ left_meter_modes=1 1 right_meters=Memory Swap Tasks LoadAverage Uptime right_meter_modes=1 1 2 2 2 _EOF_' - - G_DIETPI-NOTIFY 2 'Configuring fake-hwclock:' - # Allow times in the past - G_CONFIG_INJECT 'FORCE=' 'FORCE=force' /etc/default/fake-hwclock - systemctl restart fake-hwclock # Failsafe, apply now if date is way far back... - G_DIETPI-NOTIFY 2 'Configuring serial login consoles:' # On virtual machines, serial consoles are not required if (( $G_HW_MODEL == 20 )); then @@ -1452,11 +1450,11 @@ _EOF_' fi - G_DIETPI-NOTIFY 2 'Reducing getty count and resource usage:' - systemctl mask --now getty-static - # - logind features disabled by default. Usually not needed and all features besides auto getty creation are not available without libpam-systemd package. - # - It will be unmasked, automatically if libpam-systemd got installed during dietpi-software install, usually with desktops. - systemctl mask --now systemd-logind + G_DIETPI-NOTIFY 2 'Disabling static and automatic login prompts on consoles tty2 to tty6:' + G_EXEC systemctl mask --now getty-static + # - logind features are usually not needed and (aside of automatic getty spawn) require the libpam-systemd package. + # - It will be unmasked automatically if libpam-systemd got installed during dietpi-software install, e.g. with desktops. + G_EXEC systemctl mask --now systemd-logind #G_DIETPI-NOTIFY 2 'Configuring locales:' # Runs at start of script @@ -1690,7 +1688,7 @@ _EOF_ fi #------------------------------------------------------------------------------------------------ - G_DIETPI-NOTIFY 3 "[$SETUP_STEP] Finalise system for first boot of DietPi"; ((SETUP_STEP++)) + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Finalise system for first boot of DietPi"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ G_EXEC_DESC='Enable Dropbear autostart' G_EXEC sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear @@ -1839,7 +1837,7 @@ _EOF_ G_EXEC rmdir /mnt/tmp_root G_DIETPI-NOTIFY 2 'Running general cleanup of misc files' - rm -Rfv /{root,home/*}/.{bash_history,nano_history,wget-hsts,cache,local,config,gnupg,viminfo,dbus,gconf,nano,vim} + rm -Rfv /{root,home/*}/.{bash_history,nano_history,wget-hsts,cache,local,config,gnupg,viminfo,dbus,gconf,nano,vim,zshrc,oh-my-zsh} # Remove PREP script [[ -f $FP_PREP_SCRIPT ]] && rm -v "$FP_PREP_SCRIPT" @@ -1858,9 +1856,6 @@ _EOF_ G_DIETPI-NOTIFY 2 'Please delete outdated non-APT kernel modules:' ls -lAh /lib/modules - G_DIETPI-NOTIFY 2 'Please check and delete all non-required home diretory content:' - ls -lAh /root /home/*/ - G_DIETPI-NOTIFY 0 'Completed, disk can now be saved to .img for later use, or, reboot system to start first run of DietPi.' # Power off system diff --git a/README.md b/README.md index e0562244b6..aba323a39a 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,17 @@ - -

- DietPi Logo -

-

- Lightweight justice for your single-board computer! -

- optimised • simplified • for everyone -

- WebsiteDocumentationView all supported platforms -

-
-

- Ready to run optimised software choices with dietpi-software -
Feature-rich configuration tool for your device with dietpi-config. -

-
- +

DietPi Logo

+

+ Lightweight justice for your single-board computer! +

+ optimised • simplified • for everyone +

+ WebsiteDocumentationView all supported platformsForum +

+
+

+ Ready to run optimised software choices with dietpi-software +
Feature-rich configuration tool for your device with dietpi-config. +

+
## Introduction @@ -151,7 +147,7 @@ If so, let us know! We are always looking for talented people who believe in the DietPi project, and, wish to contribute in any way you can. - Send me an Email: micha@dietpi.com -- Join our forums: https://dietpi.com/phpbb/ +- Join our forum: https://dietpi.com/phpbb/ - GitHub: https://github.com/MichaIng/DietPi ### FeatHub @@ -288,6 +284,10 @@ Links to hardware and software manufacturers, sources and build instructions use - [Docker](https://github.com/docker/docker-ce) - [Portainer](https://github.com/portainer/portainer) - [Tor](https://gitlab.torproject.org/tpo/core/tor) +- [Docker Compose](https://github.com/docker/compose) +- [Box86](https://github.com/ptitSeb/box86) +- [Steam](https://steamcommunity.com/) +- [mjpg-streamer](https://github.com/jacksonliam/mjpg-streamer) --- diff --git a/dietpi.txt b/dietpi.txt index de431e4d1d..62bbdba433 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -67,6 +67,10 @@ AUTO_UNMASK_LOGIND=0 # - Executed script log: /var/tmp/dietpi/logs/dietpi-automation_custom_script.log AUTO_SETUP_CUSTOM_SCRIPT_EXEC=0 +# Restore a DietPi-Backup on first boot: 0 => disable | 1 => interactive restore (show list of found backups) | 2 => non-interactive restore (restore first found backup) +# - Simply attach the drive/disk/stick with contains the backup. All attached drives will be mounted temporarily and searched automatically. +AUTO_SETUP_BACKUP_RESTORE=0 + ##### Software Options ##### # SSH Server Selection: 0=none/custom | -1=Dropbear | -2=OpenSSH AUTO_SETUP_SSH_SERVER_INDEX=-1 @@ -99,8 +103,9 @@ AUTO_SETUP_AUTOSTART_LOGIN_USER=root AUTO_SETUP_AUTOMATED=0 # Global Password to be applied for the system -# - Affects user "root" and "dietpi" login passwords, and, all software installed by dietpi-software, that requires a login password -# - WARN: Passwords with any of the following characters are not supported: \"$ +# - Affects "root" and "dietpi" users login passwords and is used by dietpi-software as default for software installs which require a password. +# - On first dietpi-software execution, the password is removed from this file and instead encrypted and saved to rootfs. +# - WARN: We cannot guarantee that all software options can handle special characters like \"$. AUTO_SETUP_GLOBAL_PASSWORD=dietpi # Software to automatically install @@ -114,7 +119,7 @@ AUTO_SETUP_GLOBAL_PASSWORD=dietpi ##### Misc DietPi program settings ##### #------------------------------------------------------------------------------------------------------ # DietPi-Survey: 1=opt in | 0=opt out | -1=ask on first call -# - https://dietpi.com/phpbb/viewtopic.php?p=34#p34 +# - https://dietpi.com/docs/dietpi_tools/#miscellaneous (see tab 'DietPi Survey') SURVEY_OPTED_IN=-1 #------------------------------------------------------------------------------------------------------ diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart index 3a44f3840d..e919d6cb64 100644 --- a/dietpi/dietpi-autostart +++ b/dietpi/dietpi-autostart @@ -18,7 +18,7 @@ # Import DietPi-Globals -------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals - readonly G_PROGRAM_NAME='DietPi-Autostart' + readonly G_PROGRAM_NAME='DietPi-AutoStart' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT @@ -103,7 +103,7 @@ _EOF_ G_EXEC_NOHALT=1 G_AG_CHECK_INSTALL_PREREQ dbus G_EXEC_NOHALT=1 G_EXEC systemctl unmask systemd-logind - # Apply tweaks + # RPi tweaks if (( $G_HW_MODEL < 10 )); then G_CONFIG_INJECT 'boot_delay=' 'boot_delay=0' /boot/config.txt @@ -114,8 +114,9 @@ _EOF_ fi # - LightDM: Install only if startx (a desktop) is already installed. This is re-applied by dietpi-software after install automatically. - elif (( $ID_AUTOSTART == 16 )) && command -v startx > /dev/null; then + elif (( $ID_AUTOSTART == 16 )); then + command -v X > /dev/null || { G_WHIP_MSG '[FAILED] No X server has been found\n\nLightDM requires an X server. Please install a desktop or other X application first.'; return 1; } G_AG_CHECK_INSTALL_PREREQ lightdm # graphical.target Wants=display-manager.service G_EXEC ln -sf /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service @@ -255,7 +256,7 @@ This mode allows for a < 2.5 second boot on an RPi3, into Amiberry.\n\nIf you ex elif [[ $ID_AUTOSTART == 14 && ! -f '/var/lib/dietpi/dietpi-autostart/custom.sh' ]]; then G_EXEC mkdir -p /var/lib/dietpi/dietpi-autostart - cat << _EOF_ > /var/lib/dietpi/dietpi-autostart/custom.sh + cat << '_EOF_' > /var/lib/dietpi/dietpi-autostart/custom.sh #!/bin/bash #---Examples--- @@ -266,10 +267,9 @@ This mode allows for a < 2.5 second boot on an RPi3, into Amiberry.\n\nIf you ex #startx # Print Hello -#echo "Hello" +#echo 'Hello' #---Put your code below this line--- - _EOF_ G_WHIP_MSG 'A template script has been created:\n - /var/lib/dietpi/dietpi-autostart/custom.sh\n Please edit this file and enter the required commands you wish to launch. DietPi will then execute this script during boot.' diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 38c9876d4e..0b713be8a6 100644 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -30,14 +30,12 @@ G_INIT # Import DietPi-Globals -------------------------------------------------------------- - # Grab Input - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 + # Grab input + [[ $1 =~ ^-?1$ ]] && INPUT=$1 || INPUT=0 #///////////////////////////////////////////////////////////////////////////////////// # Backup System #///////////////////////////////////////////////////////////////////////////////////// - RSYNC_MODE_TEXT=0 - readonly FP_LOG='/var/log/dietpi-backup.log' # Backup Filepaths @@ -53,9 +51,8 @@ readonly FP_FILTER_CUSTOM='/boot/dietpi/.dietpi-backup_inc_exc' # Supported filesystems - TARGET_FILESYSTEM_TYPE=0 - TARGET_DIRECTORY_SUPPORTED=0 - readonly aSUPPORTED_FILESYSTEMS=('ext4' 'ext3' 'ext2' 'nfs' 'nfs4' 'btrfs' 'f2fs') + TARGET_FILESYSTEM_TYPE= + readonly aSUPPORTED_FILESYSTEMS=('ext4' 'ext3' 'ext2' 'nfs' 'nfs4' 'btrfs' 'f2fs' 'xfs' 'zfs') # rsync options # - Backup: Delete files in target which are not present in source, or excluded @@ -65,7 +62,7 @@ readonly aRSYNC_LOGGING_OPTIONS=('-v' "--log-file=$FP_LOG") # Date format for logs - Print_Date(){ date +"%Y-%m-%d_%T"; } + Print_Date(){ date '+%Y-%m-%d_%T'; } Create_Filter_Include_Exclude(){ @@ -98,174 +95,242 @@ _EOF_ } - Services_Stop(){ - - /boot/dietpi/dietpi-services stop - killall -w rsync &> /dev/null # https://github.com/MichaIng/DietPi/issues/1869#issuecomment-400036370 - - } - - Services_Start(){ /boot/dietpi/dietpi-services start; } - Run_Backup(){ - RSYNC_MODE_TEXT='Backup' - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$RSYNC_MODE_TEXT" + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Backup' # Check valid FS - Check_Supported_Directory_Location - - # Filesystem supported - if (( $TARGET_DIRECTORY_SUPPORTED )); then - - Services_Stop - - # Generate target dir - mkdir -p "$FP_TARGET" - - # Error: Unable to create target folder. - if [[ ! -d $FP_TARGET ]]; then + Check_Supported_Directory_Location || return 1 - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n\nUnable to create $FP_TARGET" + # Generate target dir + G_EXEC_NOHALT=1 G_EXEC mkdir -p "$FP_TARGET/data" - # Error: Rsync is already running - elif pgrep 'rsync' &> /dev/null; then + # Error: Unable to create target folder. + if [[ ! -d $FP_TARGET/data ]]; then - Error_Rsync_Already_Running + G_WHIP_MSG "Backup failed:\n\nUnable to create $FP_TARGET/data" - else - - # Start Backup - echo -e "DietPi-Backup Log File. $(Print_Date)\n\n" > $FP_LOG - - # Generate Exclude/Include lists - Create_Filter_Include_Exclude - - while : - do - - # System - mkdir -p "$FP_TARGET"/data - - # Check for sufficient free space - # - NB: working in KiB until end MiB conversion, as, don't like using long long int, and, KiB should offer a good end result. - local old_backup_size=$(du -ks "$FP_TARGET"/data | mawk '{print $1}') # Actual disk space usage - - rsync --dry-run --stats "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "$FP_SOURCE" "$FP_TARGET"/data/ > /tmp/dietpi-backup_result - local new_backup_size=$(( $(grep -m1 '^Total file size:' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') / 1024 +1 )) # Theoretical, data size only - local total_file_count=$(mawk '/^Number of files:/{print $6;exit}' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') - local total_folder_count=$(mawk '/^Number of files:/{print $8;exit}' /tmp/dietpi-backup_result | sed 's/[^0-9]*//g') - local target_fs_blocksize=$(stat -fc %s "$FP_TARGET"/data) - new_backup_size=$(( $new_backup_size + ( $total_file_count + $total_folder_count ) * $target_fs_blocksize / 1024 + 1 )) # Add one block size to each file + dir as worst case result - local end_result=$(( ( $new_backup_size - $old_backup_size ) / 1024 + 1 )) - rm /tmp/dietpi-backup_result - - if ! G_CHECK_FREESPACE "$FP_TARGET"/data $end_result; then + else - G_WHIP_BUTTON_OK_TEXT='Ignore' - G_WHIP_BUTTON_CANCEL_TEXT='Exit' - if ! G_WHIP_YESNO 'The backup target location appears to have insufficient free space to successfully finish the backup.\nHowever, this check is a rough estimation in reasonable time, thus it could be marginally incorrect. + /boot/dietpi/dietpi-services stop + + # Check if rsync is already running, while the daemon should have been stopped above + pgrep 'rsync' &> /dev/null && { Error_Rsync_Already_Running 'Backup'; return 1; } + + # Generate Exclude/Include lists + Create_Filter_Include_Exclude + + # Check for sufficient free space + local old_backup_size=$(du -sB1 "$FP_TARGET/data" | mawk '{print $1}') # Actual disk usage in bytes + # - Dry run to obtain transferred data size + rsync --dry-run --stats "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "$FP_SOURCE" "$FP_TARGET/data/" > .dietpi-backup_result + local new_backup_size=$(grep -m1 '^Total file size:' .dietpi-backup_result | sed 's/[^0-9]*//g') # Apparent data size without block size related overhead + local total_file_count=$(mawk '/^Number of files:/{print $6;exit}' .dietpi-backup_result | sed 's/[^0-9]*//g') + local total_folder_count=$(mawk '/^Number of files:/{print $8;exit}' .dietpi-backup_result | sed 's/[^0-9]*//g') + rm .dietpi-backup_result + local target_fs_blocksize=$(stat -fc '%s' "$FP_TARGET/data") + new_backup_size=$(( $new_backup_size + ( $total_file_count + $total_folder_count ) * $target_fs_blocksize )) # Add one block size for each file + dir as worst case result + local end_result=$(( ( $new_backup_size - $old_backup_size ) / 1024**2 + 1 )) # bytes => MiB rounded up + # - Perform check + if ! G_CHECK_FREESPACE "$FP_TARGET/data" $end_result; then + + G_WHIP_BUTTON_OK_TEXT='Ignore' + G_WHIP_BUTTON_CANCEL_TEXT='Exit' + if ! G_WHIP_YESNO 'The backup target location appears to have insufficient free space to successfully finish the backup. +However, this check is a rough estimation in reasonable time, thus it could be marginally incorrect. \nWould you like to override this warning and continue with the backup?'; then - echo -e "$RSYNC_MODE_TEXT cancelled due to insufficient free space : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - break + echo -e "Backup cancelled due to insufficient free space : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + /boot/dietpi/dietpi-services start + return 1 - fi + fi - fi + fi - G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT to $FP_TARGET in progress, please wait..." + G_DIETPI-NOTIFY 2 "Backup to $FP_TARGET in progress, please wait..." - rsync "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_SOURCE" "$FP_TARGET"/data/ - EXIT_CODE=$? - G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" - if (( $EXIT_CODE == 0 )); then + # Init log file + echo -e "Backup log from $(Print_Date)\n" > $FP_LOG - echo -e "$RSYNC_MODE_TEXT completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - G_WHIP_MSG "$RSYNC_MODE_TEXT completed:\n - $FP_TARGET" + rsync "${aRSYNC_RUN_OPTIONS_BACKUP[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_SOURCE" "$FP_TARGET/data/" + EXIT_CODE=$? - else + /boot/dietpi/dietpi-services start - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will given an option to view the logfile on the next screen. Please check it for information and/or errors." + G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: Backup" + if (( $EXIT_CODE == 0 )); then - fi + echo -e "Backup completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + G_WHIP_MSG "Backup completed:\n - $FP_TARGET" - # Done - break + else - done + G_WHIP_MSG "Backup failed:\n - $FP_TARGET\n\nYou will see the log file on the next screen. Please check it for information and/or errors." - log=1 G_WHIP_VIEWFILE $FP_LOG + fi - # Return to main menu - TARGETMENUID=0 + log=1 G_WHIP_VIEWFILE $FP_LOG - fi + fi - Services_Start + } + # When restoring a backup, assure that either the UUIDs stored in the backup fstab/boot config matches the current system drive, or that we know all relevant files to adjust afterwards. + Check_UUIDs() + { + UPDATE_UUIDs=0 UPDATE_GRUB=0 UPDATE_RPI=0 UPDATE_ARMBIAN=0 UPDATE_ODROID=0 UPDATE_UBOOT=0 + UUID_ROOT=$(findmnt -no UUID /) + PARTUUID_ROOT=$(findmnt -no PARTUUID /) + + # If the current rootfs' UUID or PARTUUID can be found in the the backups fstab, it can be assumed that it was created from the same drives. + grep -q "^UUID=${UUID_ROOT}[[:blank:]]" "$FP_TARGET/data/etc/fstab" || grep -q "^PARTUUID=${PARTUUID_ROOT}[[:blank:]]" "$FP_TARGET/data/etc/fstab" && return 0 + + UPDATE_UUIDs=1 + + # Else check if we know how to adjust the boot config after the backup has been restored. + # - x86_64 + if (( $G_HW_ARCH == 10 )) && command -v update-grub > /dev/null + then + UPDATE_GRUB=1 + + # - RPi + elif (( $G_HW_MODEL < 10 )) && [[ -f $FP_TARGET/data/boot/cmdline.txt ]] + then + UPDATE_RPI=1 + + # - Armbian + elif [[ -f $FP_TARGET/data/boot/armbianEnv.txt ]] + then + UPDATE_ARMBIAN=1 + + # - Odroids / classic U-Boot + elif [[ -f $FP_TARGET/data/boot/boot.ini ]] + then + UPDATE_ODROID=1 + + # - Modern U-Boot + elif [[ -f $FP_TARGET/data/boot/boot.cmd ]] && command -v mkimage > /dev/null + then + UPDATE_UBOOT=1 + + # - Else we cannot assure that the restored image will boot. + else + # Let user decide, but default to "no" + G_WHIP_YESNO '[WARNING] UUIDs of the backup and the current system differ +\nThe file systems unique identifiers, usually used to mount the drives at boot, seem to differ between the backup and the current system. +\nThis usually indicates that you try to restore an old backup onto a newly flashed DietPi system. +\nMoreover are we not able to find the boot configuration, where those UUIDs would need to be adjusted, to assure that the system will boot. +\nWe hence do not recommend to restore this backup on this system. If you continue, you will need to assure yourself that fstab and boot configurations match the UUIDs, else the system may not boot. +\nDo you want to restore this backup?' && return 0 || return 1 fi + G_WHIP_DEFAULT_ITEM='ok' G_WHIP_YESNO '[WARNING] UUIDs of the backup and the current system differ +\nThe file systems unique identifiers, usually used to mount the drives at boot, seem to differ between the backup and the current system. +\nThis usually indicates that you try to restore an old backup onto a newly flashed DietPi system. +\nBut we were able to find the boot configuration, where those UUIDs would need to be adjusted, to assure that the system will boot. +\nIt should be hence safe to restore this backup, but if the UUIDs were used elsewhere, you might need to adjust it manually. +\nDo you want to restore this backup?' && return 0 || return 1 } - Run_Restore(){ + Update_UUIDs() + { + # fstab + while read -r mountpoint + do + [[ $mountpoint ]] || continue + local uuid=$(findmnt -no UUID "$mountpoint") + [[ $uuid ]] && G_EXEC sed -i "\|[[:blank:]]${mountpoint}[[:blank:]]|s|^[[:blank:]]*UUID=[^[:blank:]]*|UUID=$uuid|" /etc/fstab + local partuuid=$(findmnt -no PARTUUID "$mountpoint") + [[ $partuuid ]] && G_EXEC sed -i "\|[[:blank:]]${mountpoint}[[:blank:]]|s|^[[:blank:]]*PARTUUID=[^[:blank:]]*|PARTUUID=$partuuid|" /etc/fstab + + done < <(lsblk -no MOUNTPOINT "/dev/$(lsblk -no PKNAME "$G_ROOTFS_DEV")") + + # boot configs + # - x86_64 + if (( UPDATE_GRUB == 1 )) + then + G_EXEC update-grub + command -v update-tirfs > /dev/null && G_EXEC update-tirfs && return + command -v update-initramfs > /dev/null && G_EXEC update-initramfs -u + + # - RPi + elif (( UPDATE_RPI == 1 )) + then + G_EXEC sed -Ei "s/(^|[[:blank:]])root=[^[:blank:]]*/\1root=PARTUUID=$PARTUUID_ROOT/" /boot/cmdline.txt + + # - Armbian + elif (( UPDATE_ARMBIAN == 1 )) + then + grep -q '^[[:blank:]]*rootdev=UUID=' /boot/armbianEnv.txt && G_CONFIG_INJECT 'rootdev=UUID=' "rootdev=UUID=$UUID_ROOT" /boot/armbianEnv.txt && return + grep -q '^[[:blank:]]*rootdev=PARTUUID=' /boot/armbianEnv.txt && G_CONFIG_INJECT 'rootdev=PARTUUID=' "rootdev=PARTUUID=$PARTUUID_ROOT" /boot/armbianEnv.txt + + # - Odroids / classic U-Boot + elif (( UPDATE_ODROID == 1 )) + then + G_EXEC sed -Ei "s/(\"|root=)UUID=[^[:blank:]\"]*/\1UUID=$UUID_ROOT/" /boot/boot.ini + G_EXEC sed -Ei "s/(\"|root=)PARTUUID=[^[:blank:]\"]*/\1PARTUUID=$PARTUUID_ROOT/" /boot/boot.ini + + # - Modern U-Boot + elif (( UPDATE_UBOOT == 1 )) + then + G_EXEC sed -Ei "s/(\"|root=)UUID=[^[:blank:]\"]*/\1UUID=$UUID_ROOT/" /boot/boot.cmd + G_EXEC sed -Ei "s/(\"|root=)PARTUUID=[^[:blank:]\"]*/\1PARTUUID=$PARTUUID_ROOT/" /boot/boot.cmd + G_EXEC mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr + fi + } - RSYNC_MODE_TEXT='Restore' + Run_Restore(){ - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$RSYNC_MODE_TEXT" + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Restore' # Check valid FS - Check_Supported_Directory_Location - - # Filesystem supported - if (( $TARGET_DIRECTORY_SUPPORTED )); then + Check_Supported_Directory_Location || return 1 - Services_Stop + # Error: Backup not found + if [[ ! -f $FP_TARGET/$BACKUP_STATS_FILENAME ]]; then - # Error: Backup not found - if [[ ! -f $FP_TARGET/$BACKUP_STATS_FILENAME ]]; then + G_WHIP_MSG "Restore failed:\n\n$FP_TARGET/$BACKUP_STATS_FILENAME does not exist\n\nHave you created a backup?" - G_DIETPI-NOTIFY 2 "No Backup was found in $FP_TARGET" - G_DIETPI-NOTIFY 1 "$RSYNC_MODE_TEXT failed.\n" + # Restore + else - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n\n$FP_TARGET/$BACKUP_STATS_FILENAME does not exist\n\nHave you created a backup?" + Check_UUIDs || return 1 - # Error: Rsync is already running - elif pgrep 'rsync' &> /dev/null; then + /boot/dietpi/dietpi-services stop - Error_Rsync_Already_Running + # Check if rsync is already running, while the daemon should have been stopped above + pgrep 'rsync' &> /dev/null && { Error_Rsync_Already_Running 'Restore'; return 1; } - # Restore - else + # Generate Exclude/Include lists + Create_Filter_Include_Exclude - # Generate Exclude/Include lists - Create_Filter_Include_Exclude + G_DIETPI-NOTIFY 2 "Restore from $FP_TARGET in progress, please wait..." - G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT from $FP_TARGET in progress, please wait..." + # Init log file + echo -e "Restore log from $(Print_Date)\n" > $FP_LOG - rsync "${aRSYNC_RUN_OPTIONS_RESTORE[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_TARGET"/data/ "$FP_SOURCE" - EXIT_CODE=$? - G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: $RSYNC_MODE_TEXT" - if (( $EXIT_CODE == 0 )); then + rsync "${aRSYNC_RUN_OPTIONS_RESTORE[@]}" "${aRSYNC_LOGGING_OPTIONS[@]}" "$FP_TARGET/data/" "$FP_SOURCE" + EXIT_CODE=$? - echo -e "$RSYNC_MODE_TEXT completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" - G_WHIP_MSG "$RSYNC_MODE_TEXT completed:\n - $FP_TARGET\n\nNB: A Reboot is highly recommended." + hash -d # Clear PATH cache + (( $UPDATE_UUIDs )) && Update_UUIDs - else + /boot/dietpi/dietpi-services start - G_WHIP_MSG "$RSYNC_MODE_TEXT failed:\n - $FP_TARGET\n\nYou will given an option to view the logfile on the next screen. Please check it for information and/or errors." + G_DIETPI-NOTIFY -1 $EXIT_CODE "$G_PROGRAM_NAME: Restore" + if (( $EXIT_CODE == 0 )); then - fi + echo -e "Restore completed : $(Print_Date)" >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + G_WHIP_MSG "Restore completed:\n - $FP_TARGET\n\nNB: A Reboot is highly recommended." - log=1 G_WHIP_VIEWFILE $FP_LOG + else - # Done - TARGETMENUID=0 + G_WHIP_MSG "Restore failed:\n - $FP_TARGET\n\nYou will see the log file on the next screen. Please check it for information and/or errors." fi - Services_Start + log=1 G_WHIP_VIEWFILE $FP_LOG fi @@ -273,43 +338,32 @@ _EOF_ Check_Supported_Directory_Location(){ - TARGET_DIRECTORY_SUPPORTED=0 - - # Userdata location verify - G_CHECK_USERDATA - - #Disallow dietpi_userdata location, due to includes in that location - if [[ $FP_TARGET == '/mnt/dietpi_userdata'* || $FP_TARGET == "$FP_DIETPI_USERDATA_ACTUAL"* ]] ; then + # Disallow dietpi_userdata location, due to includes in that location + if [[ $FP_TARGET == '/mnt/dietpi_userdata'* || $FP_TARGET == "$FP_DIETPI_USERDATA_ACTUAL"* ]]; then Error_DietpiUserdata_Directory # Check location contains /mnt/ elif [[ $FP_TARGET == '/mnt/'* ]]; then - # Generate the target directory if it doesnt exist. So we can check what filesystem it will be. - local directory_generated=0 - if [[ ! -d $FP_TARGET ]]; then - - mkdir -p "$FP_TARGET" - directory_generated=1 - + # Check file system type. Create directory temporarily, if necessary. + if [[ ! -d $FP_TARGET ]] + then + G_EXEC mkdir -p "$FP_TARGET" + TARGET_FILESYSTEM_TYPE=$(df -T "$FP_TARGET" | mawk 'NR==2 {print $2}') + G_EXEC rmdir "$FP_TARGET" + else + TARGET_FILESYSTEM_TYPE=$(df -T "$FP_TARGET" | mawk 'NR==2 {print $2}') fi - TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET | mawk 'NR == 2 {print $2}') - for ((i=0; i<${#aSUPPORTED_FILESYSTEMS[@]}; i++)) + for i in "${aSUPPORTED_FILESYSTEMS[@]}" do - - [[ $TARGET_FILESYSTEM_TYPE == "${aSUPPORTED_FILESYSTEMS[$i]}" ]] || continue - TARGET_DIRECTORY_SUPPORTED=1 - break - + [[ $TARGET_FILESYSTEM_TYPE == "$i" ]] || continue + return 0 done - # Delete directory if tested - (( $directory_generated )) && rm -R "$FP_TARGET" - - # Not ext2/3/4 - (( $TARGET_DIRECTORY_SUPPORTED )) || Error_Filesystem_Not_Supported + # Not supported + Error_Filesystem_Not_Supported # Not inside /mnt else @@ -318,6 +372,8 @@ _EOF_ fi + return 1 + } #///////////////////////////////////////////////////////////////////////////////////// @@ -332,10 +388,9 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # MENUS #///////////////////////////////////////////////////////////////////////////////////// - MENU_LASTITEM= - TARGETMENUID=0 - - EXIT_CODE=-1 # Used for 1 time automated running only (eg: G_PROMPT_BACKUP) + MENU_LASTITEM='Help' # Select "Help" by default + TARGETMENUID=0 # Main menu + EXIT_CODE=-1 # Relevant for automated calls "dietpi-backup -1" and "dietpi-backup 1" e.g. via G_PROMPT_BACKUP # TARGETMENUID=0 Menu_Main(){ @@ -366,41 +421,20 @@ _EOF_ case "$G_WHIP_RETURNED_VALUE" in - 'Location') - - TARGETMENUID=1 - - ;; - - 'Custom Filters') - - nano $FP_FILTER_CUSTOM - - ;; - - 'Help') - - G_WHIP_MSG "DietPi-Backup is a program that allows you to Backup and Restore your DietPi system.\n\nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup.\n\nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore.\n\nMore information:\n - https://dietpi.com/phpbb/viewtopic.php?p=255#p255" - - ;; - - 'Delete') + 'Location') TARGETMENUID=1;; - G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && rm -R "$FP_TARGET" + 'Custom Filters') nano $FP_FILTER_CUSTOM;; - ;; - - 'Backup') - - G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nDo you wish to continue and start the backup?" && Run_Backup + 'Help') G_WHIP_MSG "DietPi-Backup is a program that allows you to Backup and Restore your DietPi system. +\nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup. +\nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore. +\nMore information: https://dietpi.com/docs/dietpi_tools/#dietpi-backup-backuprestore";; - ;; - - 'Restore') + 'Delete') G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && G_EXEC_NOEXIT=1 G_EXEC rm -R "$FP_TARGET";; - G_WHIP_YESNO "The system will be restored from:\n - $FP_TARGET\n\nDo you wish to continue and start the restore?" && Run_Restore + 'Backup') G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nDo you wish to continue and start the backup?" && Run_Backup;; - ;; + 'Restore') G_WHIP_YESNO "The system will be restored from:\n - $FP_TARGET\n\nDo you wish to continue and start the restore?" && Run_Restore;; esac @@ -412,18 +446,11 @@ _EOF_ } - Menu_Exit(){ - - G_WHIP_SIZE_X_MAX=50 - G_WHIP_YESNO "Exit $G_PROGRAM_NAME?" && TARGETMENUID=-1 EXIT_CODE=0 - - } + Menu_Exit(){ G_WHIP_SIZE_X_MAX=50 G_WHIP_YESNO "Exit $G_PROGRAM_NAME?" && TARGETMENUID=-1 EXIT_CODE=0; } # TARGETMENUID=1 Menu_Set_Directory(){ - local current_directory=$FP_TARGET - G_WHIP_MENU_ARRAY=( 'Search' ': Find previous backups in /mnt/*' @@ -434,16 +461,18 @@ _EOF_ if G_WHIP_MENU "Please select the location where the backup will be saved, and restored from.\n\nYour current location:\n$FP_TARGET"; then + local current_directory=$FP_TARGET + case "$G_WHIP_RETURNED_VALUE" in 'Search') G_DIETPI-NOTIFY 2 'Searching /mnt/* for previous backups, please wait...' - local alist + local alist=() mapfile -t alist < <(find /mnt -type f -name "$BACKUP_STATS_FILENAME") # Do we have any results? - if (( ${alist[0]} )); then + if [[ ${alist[0]} ]]; then # Create List for Whiptail G_WHIP_MENU_ARRAY=() @@ -456,11 +485,13 @@ _EOF_ done - G_WHIP_MENU 'Please select a previous backup to use:' && FP_TARGET=$G_WHIP_RETURNED_VALUE + G_WHIP_MENU 'Please select a previous backup to use:' || return + FP_TARGET=$G_WHIP_RETURNED_VALUE else G_WHIP_MSG 'No previous backups were found in /mnt/*' + return fi @@ -468,13 +499,15 @@ _EOF_ 'Manual') - Input_User_Directory + G_WHIP_DEFAULT_ITEM=$FP_TARGET + G_WHIP_INPUTBOX 'Please enter the filepath to your directory.\nE.g.: /mnt/dietpi-backup\n - Must be located inside /mnt/*\n - Must be a symlink and UNIX permissions compatible file system, like ext4, Btrfs, F2FS or valid NFS mount' || return + FP_TARGET=$G_WHIP_RETURNED_VALUE ;; 'List') - /boot/dietpi/dietpi-drive_manager 1 + /boot/dietpi/dietpi-drive_manager 1 || return FP_TARGET=$(> "$FP_TARGET/$BACKUP_STATS_FILENAME" - G_WHIP_MSG "$RSYNC_MODE_TEXT Error:\n\nA $RSYNC_MODE_TEXT could not be started as rsync is already running." + G_DIETPI-NOTIFY 1 'Another rsync process is already running.' + echo -e "$1 failed: $(Print_Date). rsync is already running." >> "$FP_TARGET/$BACKUP_STATS_FILENAME" + G_WHIP_MSG "$1 Error:\n\nA $1 could not be started as rsync is already running." + /boot/dietpi/dietpi-services start } #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// - # pre-reqs, install if required. + # Install required rsync if missing G_AG_CHECK_INSTALL_PREREQ rsync # Read settings file Read_Settings_File - # $2 Optional directory input. + # $2 Optional directory input [[ $2 ]] && FP_TARGET=$2 - # Create user inc/exc templates - # - Add users filter list - if [[ ! -f $FP_FILTER_CUSTOM ]]; then - - cat << _EOF_ > $FP_FILTER_CUSTOM + # Create user inc/exc template, if missing + [[ -f $FP_FILTER_CUSTOM ]] || cat << _EOF_ > $FP_FILTER_CUSTOM # $G_PROGRAM_NAME | Custom include/exclude filters # # To INCLUDE (+) a file/directory: @@ -565,11 +588,8 @@ _EOF_ # NB: To exclude from a custom located dietpi_userdata, you need to add its symlinked path: /mnt/dietpi_userdata/excludeThis #- /path/to/my/file #- /path/to/my/directory/ - _EOF_ - fi - #----------------------------------------------------------------------------- # Run Backup if (( $INPUT == 1 )); then @@ -582,8 +602,8 @@ _EOF_ Run_Restore #----------------------------------------------------------------------------- - # Run menu - else + # Run menu, if interactive + elif (( $G_INTERACTIVE )); then until (( $TARGETMENUID < 0 )) do diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner index 114ac4bb3e..3b9a0b0b4e 100644 --- a/dietpi/dietpi-cleaner +++ b/dietpi/dietpi-cleaner @@ -87,7 +87,7 @@ G_WHIP_MSG "$G_PROGRAM_NAME is a program that allows you to remove unwanted junk from your DietPi system, freeing up filesystem space in the process.\n Simply enable the cleaners you require, then select \"Test\" to see what will happen, without modifying your system.\nOnce your satisfied with the Test results, select \"Run\" to clean your system.\n -Further information:\n - https://dietpi.com/phpbb/viewtopic.php?p=623#p623" +Further information:\n - https://dietpi.com/docs/dietpi_tools/#dietpi-cleaner" ;; diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell index ed64365e59..11da8da78c 100644 --- a/dietpi/dietpi-cloudshell +++ b/dietpi/dietpi-cloudshell @@ -24,13 +24,13 @@ G_INIT # Import DietPi-Globals -------------------------------------------------------------- - # Grab Input (valid interger) - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 + # Grab valid input + [[ $1 == [12] ]] && INPUT=$1 || INPUT=0 # Version - readonly DIETPI_CLOUDSHELL_VERSION=10 + readonly DIETPI_CLOUDSHELL_VERSION=11 - # /tmp/.* files used throughout this script. + # Temporary file used throughout the script readonly FP_TMP='.tmp' BLANK_SCREEN_ACTIVE=0 @@ -38,7 +38,7 @@ BLANK_SCREEN_TIME_HOUR_START=0 BLANK_SCREEN_TIME_HOUR_END=0 - # This will only work if dietpi-cloudshell was started by autostart (login script), as the setterm power options can only be applied when the command originates from the same terminal (no redirects). + # This will only work if dietpi-cloudshell was started via dietpi-autostart/dietpi-login, as the setterm power options can only be applied when the command originates from the same terminal without redirects. RUN_BLANK_SCREEN_AT_SPECIFIC_TIME(){ local current_hour=$(date +%-H) @@ -272,7 +272,7 @@ #///////////////////////////////////////////////////////////////////////////////////// # Obtain Stat Data #///////////////////////////////////////////////////////////////////////////////////// - TEMPERATURE_CONVERSION_VALUE=0 + TEMPERATURE_CONVERSION_VALUE= Obtain_Temperature_Conversion(){ if (( $TEMPERATURE_OUTPUT_TYPE == 0 )); then @@ -288,41 +288,14 @@ } - DATE_TIME=0 + DATE_TIME= Obtain_DATE_TIME(){ DATE_TIME=$(date +"%a %x - %R"); } - UPTIME=0 + UPTIME= Obtain_UPTIME(){ - local fSeconds=$(mawk '{print $1}' /proc/uptime) - - local seconds=${fSeconds%.*} - local minutes=0 - local hours=0 - local days=0 - - while (( $seconds >= 60 )); do - - ((minutes++)) - seconds=$(( $seconds - 60 )) - - done - - while (( $minutes >= 60 )); do - - ((hours++)) - minutes=$(( $minutes - 60 )) - - done - - while (( $hours >= 24 )); do - - ((days++)) - hours=$(( $hours - 24 )) - - done - - UPTIME="Uptime: $days Day, $hours Hour" + local seconds=$(mawk -F\. '{print $1}' /proc/uptime) + UPTIME="Uptime: $(( $seconds / 86400 )) Day, $(( $seconds % 86400 / 3600)) Hour" } @@ -428,9 +401,9 @@ # df will endless hang when NFS server is down: https://github.com/MichaIng/DietPi/issues/395 # - So lets run it as another thread so we can kill it if it hangs. - local df_failed=0 - rm $FP_TMP - df -Ph > $FP_TMP & + local df_failed=0 pid + [[ -f $FP_TMP ]] && rm $FP_TMP + df -Ph > $FP_TMP & pid=$! # - Wait X seconds before terminating the df thread local max_seconds=4 @@ -443,13 +416,9 @@ G_DIETPI-NOTIFY 1 'DF failed, unable to obtain drive data' sleep 2 - - killall -w df - + kill $pid df_failed=1 - echo -e "$(date) | df failed to respond" >> /var/log/dietpi-cloudshell.log - break else @@ -700,54 +669,66 @@ } - # PI-HOLE STATS! + # Pi-hole stats PIHOLE_QUERY_COUNT=0 PIHOLE_TOTAL_ADS=0 - PIHOLE_PERCENT_ADS=0 + PIHOLE_PERCENT_ADS= PIHOLE_TOTAL_DOMAINS=0 - PIHOLE_LAST_DOMAIN_BLOCKED=0 + PIHOLE_LAST_DOMAIN_BLOCKED= Obtain_PIHOLE(){ - local pihole_log_file='/var/log/pihole.log' + # Pi-hole FTL API: + # - https://github.com/pi-hole/pi-hole/blob/development/advanced/Scripts/chronometer.sh + # - https://docs.pi-hole.net/ftldns/telnet-api/ - # Lets pull the total number of blocked domains only once during 1st run, its quite cpu intensive. - if (( $PIHOLE_TOTAL_DOMAINS == 0 )); then + # Exit if Pi-hole FTL is not running + [[ -f '/run/pihole-FTL.port' ]] || { first_line="${aCOLOUR[1]}$C_REVERSE Pi-hole not yet started "; return; } - if [[ -f '/etc/pihole/gravity.list' ]]; then + # Get FTL port + local port=$("/dev/tcp/127.0.0.1/$port" - PIHOLE_TOTAL_DOMAINS='Not Installed' + # Exit if connection fails + >&3 || { first_line="${aCOLOUR[1]}$C_REVERSE Pi-hole connection failed"; return; } - fi - - fi - - local today=$(date +'%b %e') - - PIHOLE_QUERY_COUNT=$(grep "$today" $pihole_log_file | mawk '/query/{print $7}' | wc -l) - # Prevent / 0 on percentage - (( $PIHOLE_QUERY_COUNT > 0 )) || PIHOLE_QUERY_COUNT=1 + # Ask FTL for last blocked domain and to quit when finished + echo '>recentBlocked >quit' >&3 + # Read last blocked domain, allowing 1 second timeout + read -r -t 1 PIHOLE_LAST_DOMAIN_BLOCKED <&3 - PIHOLE_TOTAL_ADS=$(grep "$today" $pihole_log_file | mawk '/\/etc\/pihole\/gravity.list/{print $7}' | wc -l) - PIHOLE_PERCENT_ADS=$(echo | mawk "{print $PIHOLE_TOTAL_ADS / $PIHOLE_QUERY_COUNT * 100}") + # Re-establish connection, then ask FTL for stats and to quit when finished + exec 3<>"/dev/tcp/127.0.0.1/$port" + echo '>stats >quit' >&3 - # Convert to interger and graph it - Percent_To_Graph "$PIHOLE_PERCENT_ADS" - PIHOLE_PERCENT_ADS=$C_PERCENT_GRAPH - - # Get last blocked domain - if (( $PIHOLE_TOTAL_ADS == 0 )); then + # Read output, allowing 1 second timeout per line, exit on empty string when connection is closed + while read -r -t 1 line && [[ $line || -t 3 ]] + do + if [[ $line == 'domains_being_blocked '* ]] + then + PIHOLE_TOTAL_DOMAINS=${line#* } - PIHOLE_LAST_DOMAIN_BLOCKED='None' + elif [[ $line == 'dns_queries_today '* ]] + then + PIHOLE_QUERY_COUNT=${line#* } - else + elif [[ $line == 'ads_blocked_today '* ]] + then + PIHOLE_TOTAL_ADS=${line#* } + fi + done <&3 - PIHOLE_LAST_DOMAIN_BLOCKED=$(tac /var/log/pihole.log | mawk '/gravity.list/{print $6;exit}' | cut -c 1-24 ) + # Close connection / Remove file descriptors + exec 3>&- + exec 3<&- - fi + # Calculate percentage of blocked queries and convert to graph + Percent_To_Graph $(( $PIHOLE_QUERY_COUNT ? $PIHOLE_TOTAL_ADS * 100 / $PIHOLE_QUERY_COUNT : 0 )) + PIHOLE_PERCENT_ADS=$C_PERCENT_GRAPH } @@ -1038,14 +1019,15 @@ # Pi-hole Update_Scene_8(){ - # Update data + # Update data, replace first output line with error message in case of failure + local first_line=" $BANNER_PRINT" Obtain_PIHOLE # Clear screen clear # Banner - echo -e "$C_RESET $BANNER_PRINT" + echo -e "$C_RESET$first_line" echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]}$C_REVERSE Pi-hole stats (TODAY): " echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Ads Blocked: $C_RESET$PIHOLE_TOTAL_ADS" echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} DNS Queries: $C_RESET$PIHOLE_QUERY_COUNT" @@ -1119,7 +1101,7 @@ _EOF_ #-------------------------------------------------------------------------------- # Check and disable scenes if software is not installed: # - 8 Pi-hole - [[ -f '/etc/pihole/gravity.list' ]] || aEnabledScenes[8]=0 + command -v pihole-FTL > /dev/null || aEnabledScenes[8]=0 # - 9 Tor Relay command -v tor > /dev/null && command -v nyx > /dev/null || aEnabledScenes[9]=0 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index d207d20fbb..d279b91fdd 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1263,7 +1263,7 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before local swap_location=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local swap_size_text="$swap_size MB" (( $swap_size )) || swap_size_text='Off' - G_WHIP_MENU_ARRAY=('Swapfile' ": [$swap_size_text | $swap_location]") + G_WHIP_MENU_ARRAY=('Swap file' ": [$swap_size_text | $swap_location]") # APT cache G_WHIP_MENU_ARRAY+=('APT cache' ': Manage APT cache/info storage') @@ -1327,19 +1327,9 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before G_WHIP_MENU_ARRAY+=('Serial/UART' ': Manage available devices') # Bluetooth: Not for VM - if (( $G_HW_MODEL != 20 )); then - - local bluetooth_state_text='On' - local bluetooth_state=1 - if [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]]; then - - bluetooth_state=0 - bluetooth_state_text='Off' - - fi - G_WHIP_MENU_ARRAY+=('Bluetooth' ": [$bluetooth_state_text]") - - fi + local bluetooth_state=1 bluetooth_state_text='On' + [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && bluetooth_state=0 bluetooth_state_text='Off' + G_WHIP_MENU_ARRAY+=('Bluetooth' ": [$bluetooth_state_text]") # RPi specific if (( $G_HW_MODEL < 10 )); then @@ -1356,6 +1346,12 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before rpi_i2c_baudrate=$(( ${rpi_i2c_baudrate:-100000} / 1000 )) G_WHIP_MENU_ARRAY+=('I2C frequency' ": [$rpi_i2c_baudrate kHz]") + # SPI state + local rpi_spi_enabled=$(grep -cm1 '^[[:blank:]]*dtparam=spi=on' /boot/config.txt) + local rpi_spi_text='Off' + (( $rpi_spi_enabled )) && rpi_spi_text='On' + G_WHIP_MENU_ARRAY+=('SPI state' ": [$rpi_spi_text]") + # USB boot option: RPi3 only and not required for RPi3+: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md if [[ $G_HW_MODEL == 3 && $G_HW_MODEL_NAME != *'+'* ]]; then @@ -1372,14 +1368,10 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before TARGETMENUID=3 # Return to this menu - if [[ $G_WHIP_RETURNED_VALUE == 'Swapfile' ]]; then + if [[ $G_WHIP_RETURNED_VALUE == 'Swap file' ]]; then - if G_WHIP_YESNO 'Swapfile control has been moved to DietPi-Drive_Manager, would you like to run the application now? -\nOnce finished, exit to resume DietPi-Config'; then - - /boot/dietpi/dietpi-drive_manager - - fi + G_WHIP_YESNO 'Swapfile control has been moved to DietPi-Drive_Manager, would you like to run the application now? +\nOnce finished, exit to resume DietPi-Config' && /boot/dietpi/dietpi-drive_manager elif [[ $G_WHIP_RETURNED_VALUE == 'APT cache' ]]; then @@ -1407,9 +1399,7 @@ Please choose whether your device have an active RTC or requires "fake-hwclock": if [[ $G_WHIP_RETURNED_VALUE == 'Emulated' ]]; then G_AGI fake-hwclock - # - Allow times in the past - G_CONFIG_INJECT 'FORCE=' 'FORCE=force' /etc/default/fake-hwclock - systemctl restart fake-hwclock + G_EXEC systemctl enable --now fake-hwclock else @@ -1482,15 +1472,7 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr elif [[ $G_WHIP_RETURNED_VALUE == 'I2C state' ]]; then - if (( $rpi_i2c_enabled )); then - - /boot/dietpi/func/dietpi-set_hardware i2c disable - - else - - /boot/dietpi/func/dietpi-set_hardware i2c enable - - fi + /boot/dietpi/func/dietpi-set_hardware i2c $(( ! $rpi_i2c_enabled )) REBOOT_REQUIRED=1 elif [[ $G_WHIP_RETURNED_VALUE == 'I2C frequency' ]]; then @@ -1504,21 +1486,20 @@ Further information: https://www.raspberrypi.org/documentation/hardware/raspberr fi + elif [[ $G_WHIP_RETURNED_VALUE == 'SPI state' ]]; then + + /boot/dietpi/func/dietpi-set_hardware spi $(( ! $rpi_spi_enabled )) + REBOOT_REQUIRED=1 + elif [[ $G_WHIP_RETURNED_VALUE == 'Serial/UART' ]]; then TARGETMENUID=18 elif [[ $G_WHIP_RETURNED_VALUE == 'Bluetooth' ]]; then - if (( $bluetooth_state )); then - - /boot/dietpi/func/dietpi-set_hardware bluetooth disable - - else - - /boot/dietpi/func/dietpi-set_hardware bluetooth enable - - fi + /boot/dietpi/func/dietpi-set_hardware bluetooth $(( ! $bluetooth_state )) + # On RPi, when enabling onboard Bluetooth, a reboot is required to have the device tree changes taking effect. + (( $bluetooth_state || G_HW_MODEL > 9 )) || (( ! $G_HW_ONBOARD_WIFI )) || REBOOT_REQUIRED=1 elif [[ $G_WHIP_RETURNED_VALUE == 'USB boot support' && $rpi3_usb_boot_bit_enabled == 0 ]] && G_WHIP_YESNO 'The following will enable the RPi 3 to boot from USB mass storage devices. A hardware bit "17:3020000a", specific to the device is set to enable the feature. @@ -2251,15 +2232,15 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR # Drop Connections G_DIETPI-NOTIFY 0 'Dropping connections, please wait...' - ifdown eth$ETH_DEV_INDEX --force &> /dev/null - ifdown wlan$WIFI_DEV_INDEX --force &> /dev/null + ifdown eth$ETH_DEV_INDEX --force 2> /dev/null + ifdown wlan$WIFI_DEV_INDEX --force 2> /dev/null # Kill dhclient - killall dhclient &> /dev/null + killall dhclient 2> /dev/null - # Flush, not viable to handle this if change of IP, requires a detect of SSH loss/ip change, then exit script. - # - ip addr flush dev eth$ETH_DEV_INDEX &> /dev/null - # - ip addr flush dev wlan$WIFI_DEV_INDEX &> /dev/null + # Flush, not viable to handle this if change of IP, requires a detect of SSH loss/IP change, then exit script. + #ip a flush dev eth$ETH_DEV_INDEX &> /dev/null + #ip a flush dev wlan$WIFI_DEV_INDEX &> /dev/null # Restart Networking G_DIETPI-NOTIFY 2 'Restarting network, please wait...' @@ -2272,7 +2253,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR # Restart all services (required for hotspot) /boot/dietpi/dietpi-services start - # - Add a little delay to ensure all network device data are updated (eg: SSID current takes a little longer) + # Add a little delay to ensure all network device data are updated (eg: SSID current takes a little longer) G_DIETPI-NOTIFY 2 'Reloading networking data, please wait...' sleep 2 @@ -2281,8 +2262,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR G_DIETPI-NOTIFY 0 'Network restarted' - if [[ $ETH_MODE_TARGET == 0 && $ETH_IP != "$ETH_IP_STATIC" ]] || - [[ $WIFI_MODE_TARGET == 0 && $WIFI_IP != "$WIFI_IP_STATIC" ]]; then + if [[ $ETH_MODE_TARGET == 0 && $ETH_IP != "$ETH_IP_STATIC" ]] || [[ $WIFI_MODE_TARGET == 0 && $WIFI_IP != "$WIFI_IP_STATIC" ]]; then G_WHIP_MSG 'IP STATIC address change detected. A reboot is required to apply the new IP.\n\nPlease reboot the system.' REBOOT_REQUIRED=1 @@ -2344,6 +2324,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR fi + # Create interface config cat << _EOF_ > /etc/network/interfaces # Location: /etc/network/interfaces # Please modify network settings via: dietpi-config @@ -2352,10 +2333,6 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR # Drop-in configs source interfaces.d/* -# Local -auto lo -iface lo inet loopback - # Ethernet ${eth_enabled_text}allow-hotplug eth$ETH_DEV_INDEX iface eth$ETH_DEV_INDEX inet $eth_dhcp_static_text @@ -2366,46 +2343,45 @@ ${eth_dns_text}dns-nameservers $ETH_DNS # WiFi ${wifi_enabled_text}allow-hotplug wlan$WIFI_DEV_INDEX -iface wlan$WIFI_DEV_INDEX inet $wifi_dhcp_static_text -address $WIFI_IP -netmask $WIFI_MASK -gateway $WIFI_GATEWAY -${wifi_dns_text}dns-nameservers $WIFI_DNS -wireless-power off -wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf _EOF_ - - # - Additional settings/changes, required for hotspot mode + # WiFi Hotspot if (( $WIFI_HOTSPOT )); then - # - Remove all entries below wlan, so we can recreate them. - sed -i '/allow-hotplug wlan/q0' /etc/network/interfaces - cat << _EOF_ >> /etc/network/interfaces iface wlan$WIFI_DEV_INDEX inet static address 192.168.42.1 netmask 255.255.255.0 #gateway 192.168.0.1 -wireless-power off #dns-nameservers 9.9.9.9 149.112.112.112 +wireless-power off # IP tables up iptables-restore < /etc/iptables.ipv4.nat _EOF_ - + # WiFi client + else + cat << _EOF_ >> /etc/network/interfaces +iface wlan$WIFI_DEV_INDEX inet $wifi_dhcp_static_text +address $WIFI_IP +netmask $WIFI_MASK +gateway $WIFI_GATEWAY +${wifi_dns_text}dns-nameservers $WIFI_DNS +wireless-power off +wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf +_EOF_ fi - # - Remove wireless-power setting, if not supported by adapter/firmware - iwconfig wlan$WIFI_DEV_INDEX power off &> /dev/null || sed -i '/^wireless-power/d' /etc/network/interfaces + # Remove wireless-power setting, if not supported by adapter/firmware + iwconfig wlan$WIFI_DEV_INDEX power off 2> /dev/null || sed -i '/^wireless-power/d' /etc/network/interfaces - # - Update WiFi db/wpa_supplicant + # Update WiFi db/wpa_supplicant /boot/dietpi/func/dietpi-wifidb 1 # Update Current Mode for network restart ETH_MODE=$ETH_MODE_TARGET WIFI_MODE=$WIFI_MODE_TARGET - # Restart net + # Restart network Network_Restart } @@ -2859,8 +2835,8 @@ NB: All Ethernet connections will be dropped!' && Network_ApplyChanges # Disabled elif (( $ETH_DISABLED )); then - if G_WHIP_YESNO 'Ethernet must be enabled before settings can be changed.\n -Would you like to enable Ethernet now?\n - (NOTICE) Connections may drop!'; then + if G_WHIP_YESNO 'Ethernet must be enabled before settings can be changed. +\nWould you like to enable Ethernet now?\n - (NOTICE) Connections may drop!'; then ETH_DISABLED=0 Network_ApplyChanges @@ -2881,8 +2857,8 @@ Would you like to enable Ethernet now?\n - (NOTICE) Connections may drop!'; then # Disabled | Offer chance to enable (also enables WiFi modules) if (( $WIFI_DISABLED )); then - if G_WHIP_YESNO 'WiFi must be enabled before settings can be changed.\n -Would you like to enable WiFi now?\n - NB: Connections may drop!'; then + if G_WHIP_YESNO 'WiFi must be enabled before settings can be changed. +\nWould you like to enable WiFi now?\n - NB: Connections may drop!'; then WIFI_DISABLED=0 Network_ApplyChanges @@ -2892,8 +2868,8 @@ Would you like to enable WiFi now?\n - NB: Connections may drop!'; then # No hardware found elif (( ! $WIFI_HARDWARE )); then - if G_WHIP_YESNO 'No supported WiFi hardware was found.\n -Would you like to disable WiFi?\n - NB: Connections may drop!'; then + if G_WHIP_YESNO 'No supported WiFi hardware was found. +\nWould you like to disable WiFi?\n - NB: Connections may drop!'; then WIFI_DISABLED=1 Network_ApplyChanges @@ -3905,8 +3881,8 @@ Additional benchmarks: if [[ $psu_noise_reduction == 'Off' ]]; then - G_WHIP_YESNO 'PSU noise reduction:\n\nThis mode attempts to reduce power consumption on your SBC. In turn, this may reduce PSU inflicted noise, that may degrade audio output quality.\n -The following will now be applied:\n - CPU governor = Powersave\n - Display output = Disabled\n\nDo you want to continue?' || return + G_WHIP_YESNO 'PSU noise reduction:\n\nThis mode attempts to reduce power consumption on your SBC. In turn, this may reduce PSU inflicted noise, that may degrade audio output quality. +\nThe following will now be applied:\n - CPU governor = powersave\n - Display output = disabled\n\nDo you want to continue?' || return G_CONFIG_INJECT 'CONFIG_CPU_GOVERNOR=' 'CONFIG_CPU_GOVERNOR=powersave' /boot/dietpi.txt /boot/dietpi/func/dietpi-set_cpu @@ -4038,6 +4014,9 @@ The following will now be applied:\n - CPU governor = Powersave\n - Display outp G_WHIP_MENU "Please select a soundcard\n - Current : $soundcard_current" || return /boot/dietpi/func/dietpi-set_hardware soundcard "$G_WHIP_RETURNED_VALUE" + # RPi: Reboot required to apply device tree changes, which applies to all but auto-detected selections + (( $G_HW_MODEL > 9 )) || [[ $G_WHIP_RETURNED_VALUE == 'hw:'[0-9]','[0-9] || $G_WHIP_RETURNED_VALUE == 'usb-dac' ]] || REBOOT_REQUIRED=1 + elif [[ $G_WHIP_RETURNED_VALUE == 'Auto-conversion' ]]; then # Remove equalizer and plug suffix @@ -4222,7 +4201,7 @@ The following will now be applied:\n - CPU governor = Powersave\n - Display outp # No-IP Client local noip_installed=0 local noip_menutext='[Not Installed] Install No-IP now' - if grep -q '^aSOFTWARE_INSTALL_STATE\[67\]=2' /boot/dietpi/.installed; then + if command -v noip2 > /dev/null && [[ -f '/etc/systemd/system/noip2.service' ]]; then noip_installed=1 noip_menutext='[Offline] Enter/Setup No-IP details' @@ -4450,7 +4429,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s G_TERM_CLEAR G_EXEC systemctl stop noip2 # Failsafe: Directory required for "noip2 -C" to create the config file there - mkdir -p /usr/local/etc + G_EXEC mkdir -p /usr/local/etc noip2 -C read -rp 'Press any key to continue...' G_EXEC systemctl restart noip2 @@ -4712,8 +4691,8 @@ _EOF_ else - G_WHIP_MSG "[FAILED] Unknown menu ID $TARGETMENUID, reverting to DietPi-Config main menu\n -This error should never show up. Please try to reproduce it. If it reappears, you found a coding bug. + G_WHIP_MSG "[FAILED] Unknown menu ID $TARGETMENUID, reverting to DietPi-Config main menu +\nThis error should never show up. Please try to reproduce it. If it reappears, you found a coding bug. Please report it to: https://github.com/MichaIng/DietPi/issues" TARGETMENUID=0 diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index f40903a4ac..b58b751ec4 100644 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -30,8 +30,8 @@ SERVICES_STOPPED=0 G_EXIT_CUSTOM(){ (( $SERVICES_STOPPED )) && /boot/dietpi/dietpi-services start; } - # Grab input (valid interger) - disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0 + # Grab input + [[ $1 == [134] ]] && INPUT=$1 || INPUT=0 EXIT_CODE=0 @@ -65,7 +65,6 @@ aDRIVE_SIZE_TOTAL[$index]= aDRIVE_SIZE_USED[$index]= aDRIVE_SIZE_PERCENTUSED[$index]= - aDRIVE_ISFILESYSTEM[$index]=0 aDRIVE_ISMOUNTED[$index]=0 aDRIVE_ISREADONLY_CURRENTLY[$index]=0 @@ -126,7 +125,8 @@ tmpfs /var/log tmpfs size=${var_log_size:-50}M,noatime,lazytime,nodev,nosuid,mod fi - echo "# Please use \"dietpi-drive_manager\" to setup mounts + echo "# You can use \"dietpi-drive_manager\" to setup mounts. +# NB: It overwrites and re-creates physical drive mount entries on use. #---------------------------------------------------------------- # NETWORK #---------------------------------------------------------------- @@ -151,21 +151,16 @@ $swap_mounts # PHYSICAL DRIVES #----------------------------------------------------------------" > $fp_fstab_tmp - # Detect mounted drives G_DIETPI-NOTIFY 2 'Detecting drives, please wait...' + + # Detect mounted drives via df # - Exclude special treated fs types: tmpfs, ecryptfs, vboxsf, glusterfs + # - Workaround for /dev/root on RPi: Replace with actual device path $G_ROOTFS_DEV # - Only detect mounts with "/" in source path, which excludes other special/pseudo fs types - # - Remove duplicates, which excludes bind mounts: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-417413867 - df -a --output=source --exclude-type=tmpfs --exclude-type=ecryptfs --exclude-type=vboxsf --exclude-type=glusterfs | mawk '/\// && !x[$0]++' > .df_out_tmp - - # Process df result - # shellcheck disable=SC2094 + # - Remove duplicates, e.g. from bind mounts and due to /dev/root conversion: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-417413867 while read -r line do - # Workaround for /dev/root under RPi, force physical location - [[ $line == '/dev/root' ]] && { grep -q "^$G_ROOTFS_DEV$" .df_out_tmp && continue || line=$G_ROOTFS_DEV; } - Init_New_Device aDRIVE_ISMOUNTED[$index]=1 @@ -270,11 +265,9 @@ $swap_mounts fi - done < .df_out_tmp - rm .df_out_tmp + done < <(df -a --output=source --exclude-type=tmpfs --exclude-type=ecryptfs --exclude-type=vboxsf --exclude-type=glusterfs | sed "\|^/dev/root$|c$G_ROOTFS_DEV" | mawk '/\// && !x[$0]++') # Check blkid for unmounted drives, if drive is not mounted, add entry as disabled/commented mount - blkid -o device > .blkid_out_tmp while read -r line do @@ -283,9 +276,7 @@ $swap_mounts # Exclude drives already found for i in "${aDRIVE_MOUNT_SOURCE[@]}" do - - [[ $i == $line* ]] && continue 2 - + [[ $i == "$line"* ]] && continue 2 done # Must have a valid UUID! (this excludes /dev/mmcblk0) @@ -311,12 +302,10 @@ $swap_mounts echo "#UUID=${aDRIVE_UUID[$index]} ${aDRIVE_MOUNT_TARGET[$index]} ${type:-auto} noatime,lazytime,rw,nofail,noauto,x-systemd.automount" >> $fp_fstab_tmp - done < .blkid_out_tmp - rm .blkid_out_tmp + done < <(blkid -o device) # Find unformated drives # - Exclude mtdblock devices: https://github.com/MichaIng/DietPi/issues/2067#issuecomment-422400520 - lsblk -nro NAME | sed '/^mtdblock[0-9]/d' > .lsblk_out_tmp while read -r line do @@ -325,9 +314,7 @@ $swap_mounts # Exclude drives already found for i in "${aDRIVE_SOURCE_DEVICE[@]}" do - [[ $line == $i* ]] && continue 2 - done G_DIETPI-NOTIFY 2 " - Detected unformated drive: /dev/$line" @@ -338,8 +325,7 @@ $swap_mounts aDRIVE_MOUNT_TARGET[$index]="/tmp/$line" aDRIVE_SOURCE_DEVICE[$index]=$line - done < .lsblk_out_tmp - rm .lsblk_out_tmp + done < <(lsblk -nro NAME | sed '/^mtdblock[0-9]/d') # Set required global flags and deps for all drives found for i in "${!aDRIVE_MOUNT_SOURCE[@]}" @@ -371,7 +357,6 @@ $swap_mounts G_DIETPI-NOTIFY 0 'DEBUG INFO:' for i in "${!aDRIVE_MOUNT_SOURCE[@]}" do - G_DIETPI-NOTIFY 0 "Index=$i aDRIVE_UUID ${aDRIVE_UUID[$i]} aDRIVE_PART_UUID ${aDRIVE_PART_UUID[$i]} @@ -422,15 +407,10 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]} local i [[ $MENU_DRIVE_TARGET ]] && for i in "${!aDRIVE_MOUNT_TARGET[@]}" do - - if [[ $MENU_DRIVE_TARGET == "${aDRIVE_MOUNT_TARGET[$i]}" ]]; then - - MENU_DRIVE_INDEX=$i - [[ $G_DEBUG == 1 ]] && echo "[DEBUG$i] EDIT | ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} | ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]} | ${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}" - break - - fi - + [[ $MENU_DRIVE_TARGET == "${aDRIVE_MOUNT_TARGET[$i]}" ]] || continue + MENU_DRIVE_INDEX=$i + [[ $G_DEBUG == 1 ]] && echo "[DEBUG$i] EDIT | ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} | ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]} | ${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}" + break done } @@ -1001,7 +981,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return if (( $1 == 0 )); then - G_WHIP_MSG "[FAILED]\n\nYour DietPi userdata is currently located on this drive:\n - $FP_USERDATA_CURRENT\n\nThe requested option for this drive is not currently possible.\n\nPlease move your userdata elsewhere, before trying again:\nhttps://dietpi.com/phpbb/viewtopic.php?t=478" + G_WHIP_MSG "[FAILED]\n\nYour DietPi userdata is currently located on this drive:\n - $FP_USERDATA_CURRENT\n\nThe requested option for this drive is not currently possible.\n\nPlease move your userdata elsewhere, before trying again:\nhttps://dietpi.com/docs/dietpi_tools/#quick-selections" elif (( $1 == 1 )); then @@ -1645,7 +1625,7 @@ NB: If you are planning to dedicate the drive to this system, it is recommended G_WHIP_DEFAULT_ITEM=$FORMAT_FILESYSTEM_TYPE if G_WHIP_MENU 'Please select a filesystem type for this format:\n\nEXT4:\nHighly recommended if you plan to use this drive solely on this system (dedicated drive).\n -NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU usage during transfers.\n\nFull list of different filesystem types:\nhttps://dietpi.com/phpbb/viewtopic.php?p=2898#p2898'; then +NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU usage during transfers.\n\nFull list of different filesystem types:\nhttps://dietpi.com/docs/dietpi_tools/#dietpi-drive-manager'; then # Install FS pre-reqs # - NTFS @@ -1744,7 +1724,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u G_AG_CHECK_INSTALL_PREREQ smbclient cifs-utils # Mount now - mkdir -p "$samba_fp_mount_target" + G_EXEC mkdir -p "$samba_fp_mount_target" > $fp_tmp # - Mount attempts from highest CIFS version to lowest, until one succeeds @@ -1759,7 +1739,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u # Apply to fstab sed -i "\#[[:space:]]${samba_fp_mount_target}[[:space:]]#d" /etc/fstab # - NB: Convert spaces to '\040': https://github.com/MichaIng/DietPi/issues/1201#issuecomment-339720271 - echo "//$samba_clientname/${samba_clientshare//[[:space:]]/\\040} $samba_fp_mount_target cifs username=$samba_clientuser,password=$samba_clientpassword,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i,_netdev,nofail,noauto,x-systemd.automount" >> /etc/fstab + echo "//$samba_clientname/${samba_clientshare//[[:space:]]/\\040} $samba_fp_mount_target cifs username=$samba_clientuser,password=$samba_clientpassword,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i,nofail,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$samba_fp_mount_target Init_Drives_and_Refresh @@ -1814,14 +1794,14 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u G_AG_CHECK_INSTALL_PREREQ nfs-common netbase # Mount now - mkdir -p "$nfs_fp_mount_target" + G_EXEC mkdir -p "$nfs_fp_mount_target" > $fp_tmp if mount -vt nfs -o port=2049 "$nfs_server_ip":/ "$nfs_fp_mount_target" &>> $fp_tmp; then # Apply to fstab sed -i "\#[[:space:]]${nfs_fp_mount_target}[[:space:]]#d" /etc/fstab - echo "$nfs_server_ip:/ $nfs_fp_mount_target nfs _netdev,nofail,noauto,x-systemd.automount" >> /etc/fstab + echo "$nfs_server_ip:/ $nfs_fp_mount_target nfs nofail,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$nfs_fp_mount_target Init_Drives_and_Refresh @@ -1844,7 +1824,7 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u # Apply to fstab sed -i "\#[[:space:]]${nfs_fp_mount_target}[[:space:]]#d" /etc/fstab - echo "$nfs_server_ip:$nfs_fp_server_share $nfs_fp_mount_target nfs _netdev,nofail,noauto,x-systemd.automount" >> /etc/fstab + echo "$nfs_server_ip:$nfs_fp_server_share $nfs_fp_mount_target nfs nofail,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$nfs_fp_mount_target Init_Drives_and_Refresh @@ -1889,24 +1869,18 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u # Generate menu G_WHIP_MENU_ARRAY=() - df -Ph | tail -n +2 | sed -E '/(^udev|tmpfs)/d' > .df_out_tmp - while read -r line do G_WHIP_MENU_ARRAY+=("$(mawk '{print $6}' <<< "$line")" ": $(mawk '{print $1" | size: "$2"iB | available: "$4"iB"}' <<< "$line")") - done < .df_out_tmp - rm .df_out_tmp + done < <(df -Ph | tail -n +2 | sed -E '/(^udev|tmpfs)/d') - if G_WHIP_MENU 'Please select a mount location to use:'; then + G_WHIP_MENU 'Please select a mount location to use:' || exit 1 - G_DIETPI-NOTIFY 0 "Drive mount selected: $G_WHIP_RETURNED_VALUE" - echo "$G_WHIP_RETURNED_VALUE" > $fp_mount_selection - exit 0 - - fi - exit 1 + G_DIETPI-NOTIFY 0 "Drive mount selected: $G_WHIP_RETURNED_VALUE" + echo "$G_WHIP_RETURNED_VALUE" > $fp_mount_selection + exit 0 } diff --git a/dietpi/dietpi-led_control b/dietpi/dietpi-led_control index dae9817fd9..a67967cedf 100644 --- a/dietpi/dietpi-led_control +++ b/dietpi/dietpi-led_control @@ -17,7 +17,7 @@ # Import DietPi-Globals -------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-LED_control' + readonly G_PROGRAM_NAME='DietPi-LED_control' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT @@ -144,17 +144,12 @@ #----------------------------------------------------------------------------------- until (( $TARGETMENUID < 0 )) do - - if (( $TARGETMENUID == 1 )); then - + if (( $TARGETMENUID == 1 )) + then Menu_LED - else - Menu_Main - fi - done #----------------------------------------------------------------------------------- exit diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 91c524e6d4..1b9d630ba2 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -19,7 +19,7 @@ # Import DietPi-Globals -------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-LetsEncrypt' + readonly G_PROGRAM_NAME='DietPi-LetsEncrypt' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT @@ -247,10 +247,10 @@ _EOF_ fi #------------------------------------------------------------------------------------------------------ - # Minio + # MinIO elif pgrep '[m]inio' > /dev/null; then - G_DIETPI-NOTIFY 0 'Minio S3 server detected' + G_DIETPI-NOTIFY 0 'MinIO S3 server detected' # Cert me up /boot/dietpi/dietpi-services stop @@ -298,7 +298,7 @@ _EOF_ # Create renewl script cat << _EOF_ > /home/minio-user/.minio/dietpi-cert-renewl.sh #!/bin/dash -# Minio only works with copied and owned certs. Upon renewal the new certs needs to be copied and re-owned +# MinIO only works with copied and owned certs. Upon renewal the new certs needs to be copied and re-owned systemctl stop minio # Ensure strict permissions while copying: @@ -318,15 +318,15 @@ _EOF_ # Change permissions on renewal script G_EXEC chmod +x /home/minio-user/.minio/dietpi-cert-renewl.sh - # Add Minio renewal to certbot system service + # Add MinIO renewal to certbot system service [[ -d $FP_RENEWAL ]] || mkdir "$FP_RENEWAL" cat << _EOF_ > "$FP_RENEWAL"/dietpi-minio.conf [Service] ExecStartPost=/home/minio-user/.minio/dietpi-cert-renewl.sh &>> $FP_LOGFILE _EOF_ - # Inform user that HTTPS redirect and HSTS is not supported for Minio, if chosen - (( $LETSENCRYPT_REDIRECT || $LETSENCRYPT_HSTS )) && echo '[ INFO ] HTTPS redirect and HSTS is not supported for Minio, thus will be ignored.' | tee $FP_LOGFILE + # Inform user that HTTPS redirect and HSTS is not supported for MinIO, if chosen + (( $LETSENCRYPT_REDIRECT || $LETSENCRYPT_HSTS )) && echo '[ INFO ] HTTPS redirect and HSTS is not supported for MinIO, thus will be ignored.' | tee $FP_LOGFILE else @@ -336,7 +336,7 @@ Currently DietPi-LetsEncrypt configures the following web applications: - Apache2 (webserver) - Nginx (webserver) - Lighttpd (webserver) - - Minio S3 (object storage server)\n + - MinIO S3 (object storage server)\n Would you like to switch to DietPi-Software, to install one of the above?' && /boot/dietpi/dietpi-software return 1 diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 7fbd9831d3..e110ca3f7e 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -75,6 +75,7 @@ Available services: 'php7.2-fpm' 'php7.3-fpm' 'php7.4-fpm' + 'php8.0-fpm' # - Webservers 'apache2' @@ -133,7 +134,6 @@ Available services: 'radarr' 'lidarr' 'bazarr' - 'htpc-manager' 'deluge-web' # - Cloud/Backups @@ -155,9 +155,9 @@ Available services: # - Camera/Surveillance 'motioneye' 'raspimjpeg' + 'mjpg-streamer' # - Printing - 'cups' 'cloudprintd' # Remove in 2021 due to Google Cloud Print service shutdown 'octoprint' # - Social/Search @@ -189,6 +189,7 @@ Available services: 'netdata' 'rpimonitor' 'webmin' + 'htpc-manager' # - Misc 'docker' @@ -211,14 +212,13 @@ Available services: # Misc aSERVICE_NAME+=('fail2ban') # Brute-force protection, which should not be stopped during updates/installs etc #aSERVICE_NAME+=('systemd-timesyncd') # Network time sync: DietPi stops this by default after success, may confuse user/prompt questions. - aSERVICE_NAME+=('dnsmasq') # https://github.com/MichaIng/DietPi/issues/1501 aSERVICE_NAME+=('pihole-FTL') # https://github.com/MichaIng/DietPi/issues/1696 aSERVICE_NAME+=('openvpn') # https://github.com/MichaIng/DietPi/issues/1501 aSERVICE_NAME+=('vncserver') # DietPi VNC Server aSERVICE_NAME+=('nxserver') # NoMachine Server aSERVICE_NAME+=('xrdp') # XRDP Server aSERVICE_NAME+=('amiberry') # DietPi Amiberry service - aSERVICE_NAME+=('unbound') # Unbound DNS server, could be currently used by machine + aSERVICE_NAME+=('unbound') # Unbound DNS server, could be currently used by machine #aSERVICE_NAME+=('wg-quick@wg0') # WireGuard: Currently instantiated services are not supported # DietPi @@ -244,7 +244,7 @@ Available services: readonly FP_INCLUDE_EXCLUDE='/boot/dietpi/.dietpi-services_include_exclude' Process_Includes_Excludes(){ - [[ -f $FP_INCLUDE_EXCLUDE ]] || cat << _EOF_ > $FP_INCLUDE_EXCLUDE + [[ -f $FP_INCLUDE_EXCLUDE ]] || cat << '_EOF_' > $FP_INCLUDE_EXCLUDE # DietPi-Services Include/Exclude configuration # Include custom service (Use '+ servicename' without the comments to enable DietPi control of that service) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cfc51297f7..880b5a9fde 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -35,43 +35,33 @@ Available commands: # Filepath #///////////////////////////////////////////////////////////////////////////////////// readonly FP_INSTALLED_FILE='/boot/dietpi/.installed' - readonly FP_INSTALLED_FILE_TMP='.installed' # Used to set user/personal data directories (e.g.: usbdrive) FP_DIETPI_DEDICATED_USBDRIVE= Write_InstallFileList(){ - local fp_target=$FP_INSTALLED_FILE - local write_software_in_pending_state=0 - if [[ $1 == 'temp' ]]; then - - fp_target=$FP_INSTALLED_FILE_TMP - write_software_in_pending_state=1 - - fi - - > $fp_target + > $FP_INSTALLED_FILE # Save installed states for i in "${!aSOFTWARE_NAME[@]}" do - # Never save pending state for software (=1). Excluding temp saves. - if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 && ! $write_software_in_pending_state )); then + # Never save pending state for software (=1). + if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )); then - echo "aSOFTWARE_INSTALL_STATE[$i]=0" >> $fp_target + echo "aSOFTWARE_INSTALL_STATE[$i]=0" >> $FP_INSTALLED_FILE else - echo "aSOFTWARE_INSTALL_STATE[$i]=${aSOFTWARE_INSTALL_STATE[$i]}" >> $fp_target + echo "aSOFTWARE_INSTALL_STATE[$i]=${aSOFTWARE_INSTALL_STATE[$i]}" >> $FP_INSTALLED_FILE fi done # Misc - cat << _EOF_ >> $fp_target + cat << _EOF_ >> $FP_INSTALLED_FILE # DietPi Choice System: SSH Server INDEX_SSHSERVER_CURRENT=$INDEX_SSHSERVER_CURRENT @@ -97,11 +87,8 @@ _EOF_ # Load Software states G_DIETPI-NOTIFY -2 'Reading database' - local fp_target=$FP_INSTALLED_FILE - [[ $1 == 'temp' ]] && fp_target=$FP_INSTALLED_FILE_TMP - # Load - [[ -f $fp_target ]] && . $fp_target + [[ -f $FP_INSTALLED_FILE ]] && . $FP_INSTALLED_FILE # Always reset choice system during first run to defaults: https://github.com/MichaIng/DietPi/issues/1122 if (( $G_DIETPI_INSTALL_STAGE == 1 )); then @@ -142,69 +129,65 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # Installation System #///////////////////////////////////////////////////////////////////////////////////// - # Reboot after installation has finished - DISABLE_REBOOT=0 + # Since no automated reboot is done anymore after installs, collect services to start manually, when not controlled by DietPi-Services + aSTART_SERVICES=() # Uninstall flag, used in software installations + removals, runs Uninstall_Software() UNINSTALL_REQUIRED=0 # Global password for software installs GLOBAL_PW= - Update_Global_Pw(){ - - GLOBAL_PW= - + Update_Global_Pw() + { # Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 - local pbkdf2=() + local pbkdf2=() encrypt=0 (( $G_DISTRO > 4 )) && pbkdf2=('-iter' '10000') # Read encrypted password - if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then - - 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) - # - Allow decryption without "-iter 10000" and re-encrypt on dist-upgraded Buster systems - if (( $? && $G_DISTRO > 4 )); then - - GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) - # shellcheck disable=SC2181 - [[ $? == 0 && $GLOBAL_PW ]] && openssl enc -e -a -md sha256 -aes-256-cbc -iter 10000 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< "$GLOBAL_PW" - + if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]] + then + if ! 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) + then + # Allow decryption without "-iter 10000" and re-encrypt on dist-upgraded Buster systems + encrypt=1 + # In case of error, assure empty password to fallback to default + (( $G_DISTRO > 4 )) && GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) || GLOBAL_PW= fi # If encryption has not yet been done, do it now! - elif GLOBAL_PW=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt); then - - G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /boot/dietpi.txt - 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" - # Inform user if encryption is done after update of an old DietPi instance, else firstrun setup does the job - (( $G_DIETPI_INSTALL_STAGE == 2 )) && G_WHIP_MSG '[ INFO ] For security reasons your global software password has been removed from dietpi.txt and instead ecrypted and saved to: - - /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin\n -DietPi-Software will decrypt and use it for software installs. You can change it via: - - dietpi-config > Security Options > Change Passwords' + else + encrypt=1 + GLOBAL_PW=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + G_EXEC sed -i '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/c\#AUTO_SETUP_GLOBAL_PASSWORD= # Password has been ecrypted and saved to rootfs' /boot/dietpi.txt + fi + # Fallback + if [[ ! $GLOBAL_PW ]] + then + encrypt=1 + GLOBAL_PW='dietpi' + G_WHIP_MSG "[FAILED] Unable to obtain your global software password +\nThe following fallback password will be used:\n - $GLOBAL_PW +\nYou can change it via:\n - dietpi-config > Security Options > Change Passwords" fi + # Encrypt + [[ $encrypt == 1 ]] && 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 + # Apply safe permissions chown root:root /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin - - # Failsafe - if [[ ! $GLOBAL_PW ]]; then - - GLOBAL_PW='dietpi' - G_WHIP_MSG "[FAILED] Unable to obtain your global software password\n\nThe following fallback password will be used:\n - $GLOBAL_PW" - - fi - } - # Total system RAM: Used to calculate percentage based value for software cache limits, e.g.: OPcache/APCu - RAM_TOTAL=$(free -m | mawk '/^Mem:/{print $2;exit}') + # Total physical system RAM: Used to calculate percentage based value for software cache limits, e.g.: OPcache/APCu + RAM_PHYS=$(free -m | mawk '/^Mem:/{print $2;exit}') + # Total RAM + swap space: Used to estimate whether the swap file size needs to be increased. + RAM_TOTAL=$(free -tm | mawk '/^Total:/{print $2;exit}') # Run Installation Flag (1 = run installs) GOSTARTINSTALL=0 - # Install variables + # Temporary placeholder variables INSTALL_URL_ADDRESS= UNINSTALL_URL_ADDRESS= DEPS_LIST= @@ -255,8 +238,6 @@ DietPi-Software will decrypt and use it for software installs. You can change it INDEX_WEBSERVER_CURRENT=-2 INDEX_WEBSERVER_TARGET=-2 - readonly FP_ONLINEDOC_URL='https://dietpi.com/phpbb/viewtopic.php?' - # Available for (need to match highest value in dietpi-obtain_hw_model) readonly MAX_G_HW_MODEL=73 readonly MAX_G_HW_ARCH=10 @@ -332,7 +313,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='ultra lightweight desktop' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#lxde' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -342,7 +323,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='lightweight desktop' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17712#p17712' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#lxqt' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -352,7 +333,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='desktop enviroment' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2073#p2073' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#mate' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -362,17 +343,17 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='lightweight desktop' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#xfce' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ software_id=26 - aSOFTWARE_NAME[$software_id]='GNUStep' + aSOFTWARE_NAME[$software_id]='GNUstep' aSOFTWARE_DESC[$software_id]='lightweight desktop based on OpenStep' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#gnustep' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -382,7 +363,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web browser for desktop or autostart' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#chromium' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ @@ -392,15 +373,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='mspaint on steroids' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17713#p17713' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#gimp' aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 #------------------ software_id=175 - aSOFTWARE_NAME[$software_id]='Xfce4 Power' - aSOFTWARE_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)' + aSOFTWARE_NAME[$software_id]='Xfce Power Manager' + aSOFTWARE_DESC[$software_id]='with brightness control, recommended for LXDE/LXQt' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#xfce-power-manager' aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 # Remote Desktop @@ -411,7 +393,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='desktop for remote connection' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#tigervnc-server' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #------------------ software_id=29 @@ -420,7 +402,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='remote desktop protocol (rdp) server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#xrdp' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #------------------ software_id=30 @@ -429,7 +411,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='multi-platform server and client access' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2071#p2071' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#nomachine' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #------------------ software_id=120 @@ -438,7 +420,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='desktop for remote connection' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=1 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4149#p4149' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#realvnc-server' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 # RPi only (archive.raspberrypi.org repo, libraspberrypi dependency, license) for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -454,7 +436,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='the media centre for linux' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#kodi' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # Odroid N2+C4 have not GPU support for Xserver, hence it's not required for Kodi [[ $G_HW_MODEL == 1[56] ]] || aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 @@ -479,7 +461,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='lightweight web interface music player for mpd' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=50#p50' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#ympd' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=148 @@ -488,7 +470,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='fork of ympd with improved features' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13978#p13978' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#mympd' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ @@ -498,7 +480,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='optional: console audio vis for mpd' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3928#p3928' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#cava' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=33 @@ -507,7 +489,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=11280#p11280' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#airsonic' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 @@ -518,7 +500,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=213#p213' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#subsonic' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 @@ -529,10 +511,10 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=35 aSOFTWARE_NAME[$software_id]='Logitech Media Server' - aSOFTWARE_DESC[$software_id]='aka LMS, Squeezebox Server, SqueezeCenter, SlimServer' + aSOFTWARE_DESC[$software_id]='aka SlimServer, SqueezeCenter, Squeezebox Server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#logitech-media-server' #------------------ software_id=36 @@ -549,7 +531,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='airplay audio player with multiroom sync' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1221#p1221' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#shairport-sync' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=39 @@ -558,7 +540,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='(MiniDLNA) media streaming server (dlna, upnp)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=49#p49' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#readymedia' #------------------ software_id=40 @@ -566,7 +548,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=554#p554' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#ampache' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 @@ -576,11 +558,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it #------------------ software_id=41 - aSOFTWARE_NAME[$software_id]='Emby Server' + aSOFTWARE_NAME[$software_id]='Emby' aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1789#p1789' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#emby' # - ARMv6: https://github.com/MichaIng/DietPi/issues/534#issuecomment-416405968 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ @@ -590,7 +572,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1949#p1949' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#plex-media-server' # - ARMv6: https://github.com/MichaIng/DietPi/issues/648 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ @@ -600,7 +582,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='mumble voip server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1691#p1691' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#murmur' #------------------ software_id=118 @@ -617,7 +599,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Turns device into Roon capable audio player' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4153#p4153' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#roon-bridge' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 @@ -628,7 +610,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='signalyst network audio adaptor (naa)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4294#p4294' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#naa-daemon' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=128 @@ -645,7 +627,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='feature-rich, web interface audio player for mpd' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5171#p5171' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#ompd' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -657,7 +639,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Shoutcast streaming server (+DarkIce)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6526#p6526' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#icecast' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - VM aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0 @@ -668,7 +650,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface for spotify premium' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7013#p7013' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#spotify-connect-web' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # ARMv7 only for ((i=1; i<=$MAX_G_HW_ARCH; i++)) @@ -683,7 +665,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface audio streamer' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7305#p7305' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#koel' aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 @@ -698,7 +680,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='monitoring and tracking tool for Plex' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7463#p7463' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#tautulli' aSOFTWARE_REQUIRES_GIT[$software_id]=1 #------------------ software_id=154 @@ -707,7 +689,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Roon capable audio player and core' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7966#p7966' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#roon-server' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 # x86_64 only @@ -723,7 +705,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='t=2317' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/phpbb/viewtopic.php?t=2317' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -742,7 +724,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Resource efficient UPnP/DLNA renderer' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9012#p9012' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#gmediarender' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 #------------------ software_id=167 @@ -751,7 +733,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='spotify connect client' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9368#p9368' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#raspotify' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # - ARMv8 - x86_64 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 @@ -763,7 +745,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='free home server for your comics and ebooks library' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12969#p12969' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#ubooquity' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 #------------------ software_id=179 @@ -772,7 +754,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Free and open source comics/mangas media server with web UI' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=26858#p26858' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#komga' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 #------------------ software_id=86 @@ -781,7 +763,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Manage extensions from within Roon' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13160#p13160' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#roon-extension-manager' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 #------------------ @@ -791,7 +773,9 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='FOSS web interface media streaming server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=2 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=26255#p26255' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/media/#jellyfin' + # - ARMv6: https://github.com/jellyfin/jellyfin/issues/5011 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 # BitTorrent & Download #-------------------------------------------------------------------------------- @@ -801,7 +785,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (c)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=46#p46' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#transmission' #------------------ software_id=45 @@ -809,7 +793,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (python)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=61#p61' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#deluge' #------------------ software_id=46 @@ -825,7 +809,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='bittorrent server with rutorrent web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2603#p2603' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#rtorrent' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ @@ -835,7 +819,9 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Automatic Video Library Manager for TV Shows' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3327#p3327' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#medusa' + # - Stretch: Python 3 > 3.5 only: https://github.com/pymedusa/Medusa#dependencies + aSOFTWARE_AVAIL_G_DISTRO[$software_id,4]=0 #------------------ software_id=132 @@ -843,7 +829,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='download manager with web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6177#p6177' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#arias' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 @@ -854,7 +840,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='nzb download manager' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#sabnzbd' # Pre-compiling required on ARM (( $G_HW_ARCH > 9 )) || aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ @@ -864,7 +850,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='automatically download movies' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7212#p7212' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#couchpotato' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 # Python 2 only, hence not supported on Bullseye @@ -876,7 +862,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='automatically download TV shows' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7455#p7455' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#sonarr' aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=145 @@ -885,7 +871,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='automatically download movies' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7457#p7457' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#radarr' aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=106 @@ -894,7 +880,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='automatically download music' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13580#p13580' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#lidarr' aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 #------------------ software_id=180 @@ -903,7 +889,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='automatically download subtitles' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=27577#p27577' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#bazarr' aSOFTWARE_REQUIRES_GIT[$software_id]=1 # FFmpeg required on ARM, x86_64 binaries are shipped with the Bazarr repo: https://github.com/morpheus65535/bazarr/tree/master/bin/Linux # build-essential required on ARM to assure all required Python modules build successfully: https://github.com/MichaIng/DietPi/pull/3796#issuecomment-706768323 @@ -917,7 +903,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='API support for your torrent trackers' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7503#p7503' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#jackett' #------------------ software_id=149 @@ -925,7 +911,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='nzb download manager' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7575#p7575' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#nzbget' #------------------ software_id=155 @@ -933,7 +919,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='manage your HTPC from anywhere' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8043#p8043' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/bittorrent/#htpc-manager' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 @@ -945,7 +931,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='File sync, sharing and collaboration platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=47#p47' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#owncloud' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -956,7 +942,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='File sync, sharing and collaboration platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3026#p3026' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#nextcloud' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -967,7 +953,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Video calls with configured coTURN server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=15227#p15227' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#nextcloud-talk' # Currently requires manual domain and coTURN server port input. # - To resolve: Default port 5349 could be used, but reliable method to get external domain/static IP is required. aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -978,7 +964,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='feature-rich backup and sync server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1064#p1064' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#pydio' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -989,7 +975,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='full system backup server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=65#p65' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#urbackup' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ @@ -999,7 +985,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='personal github server with web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2187#p2187' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#gogs' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 #------------------ @@ -1009,15 +995,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='backup and sync server with web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2363#p2363' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#syncthing' #------------------ software_id=158 - aSOFTWARE_NAME[$software_id]='Minio' + aSOFTWARE_NAME[$software_id]='MinIO' aSOFTWARE_DESC[$software_id]='S3 compatible distributed object server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9121#p9121' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#minio' #------------------ software_id=161 @@ -1025,6 +1011,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Lightweight WebDAV cloud (eg: dropbox) with a CMS' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#fuguhub' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ @@ -1034,7 +1021,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Git with a cup of tea' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9863#p9863' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#gitea' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 #------------------ @@ -1044,7 +1031,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Sync bookmarks, tabs, history & passwords' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=24713#p24713' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#firefox-sync-server' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 # - Bullseye: python(2)-virtualenv not available (yet): https://packages.debian.org/python-virtualenv @@ -1056,7 +1043,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Unofficial Bitwarden password manager server written in Rust' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=28903#p28903' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/cloud/#bitwarden_rs' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_SQLITE[$software_id]=1 @@ -1068,7 +1055,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Optimised Amiga emulator for ARM-based SoCs' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#amiberry' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1086,7 +1073,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='a classic retro game, addictive' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=45#p45' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#opentyrian' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 # RPi only @@ -1094,8 +1081,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it do aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 done - # + x86_64 - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1 + # - ARMv8 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ software_id=112 @@ -1103,7 +1090,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Descent 1/2' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2963#p2963' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#dxx-rebirth' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) @@ -1117,7 +1104,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Minecraft server with web interface (C++)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2068#p2068' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#cuberite' # - ARMv8 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ @@ -1127,7 +1114,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Minecraft servers with web interface (Java/Node.js)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2069#p2069' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#mineos' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 @@ -1136,19 +1123,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=156 aSOFTWARE_NAME[$software_id]='Steam' - aSOFTWARE_DESC[$software_id]='client' + aSOFTWARE_DESC[$software_id]='Valve gaming platform client' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8016#p8016' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#steam' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 - # Native PC only - for ((i=0; i<=$MAX_G_HW_MODEL; i++)) - do - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0 - done - aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1 + # x86_64 and ARMv7 only + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 #------------------ software_id=164 @@ -1156,7 +1140,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='A nuclear-powered server for Minecraft Pocket Edition' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10675#p10675' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#nukkit' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 #------------------ software_id=181 @@ -1165,11 +1149,25 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Highly optimised Minecraft server with plugins, written in Java' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=5 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=28177#p28177' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#papermc' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 + #------------------ + software_id=62 + + aSOFTWARE_NAME[$software_id]='Box86' + aSOFTWARE_DESC[$software_id]='x86 userspace emulation' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=5 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/gaming/#box86' + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 + # Only works on ARMv7 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,10]=0 + # Social & Search #-------------------------------------------------------------------------------- software_id=54 @@ -1178,7 +1176,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='bulletin board forum software' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=51#p51' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#phpbb' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -1189,7 +1187,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='website blog and publishing platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=395#p395' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#wordpress' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -1200,7 +1198,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='self-hosted RSS feed aggregator' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13918#p13918' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#freshrss' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -1211,7 +1209,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='website to host and browse your images' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=480#p480' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#single-file-php-gallery' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ @@ -1221,7 +1219,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='lightweight caldav + carddav server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1502#p1502' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#baikal' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 @@ -1232,7 +1230,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='decentralised peer to peer bitcoin market' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1796#p1796' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#openbazaar' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -1243,7 +1241,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='decentralised open source search engine' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6202#p6202' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/social/#yacy' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 # Camera & Surveillance @@ -1251,10 +1249,10 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=59 aSOFTWARE_NAME[$software_id]='RPi Cam Control' - aSOFTWARE_DESC[$software_id]='web interface & controls for your rpi camera' + aSOFTWARE_DESC[$software_id]='Web interface & controls for your RPi camera' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=48#p48' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#rpi-cam-control' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 # RPi only @@ -1266,14 +1264,22 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=136 aSOFTWARE_NAME[$software_id]='MotionEye' - aSOFTWARE_DESC[$software_id]='web interface & surveillance for your camera' + aSOFTWARE_DESC[$software_id]='Web interface & surveillance for your camera' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=7 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6610#p6610' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#motioneye' aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # Python 2 only, hence not supported on Bullseye aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 + #------------------ + software_id=137 + + aSOFTWARE_NAME[$software_id]='mjpg-streamer' + aSOFTWARE_DESC[$software_id]='Simple camera streaming tool with HTML plugin' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=7 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/camera/#mjpg-streamer' # System Stats & Management #-------------------------------------------------------------------------------- @@ -1283,7 +1289,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface system stats' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=108#p108' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#linuxdash' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ @@ -1293,7 +1299,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface system stats' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=451#p451' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#phpsysinfo' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ @@ -1303,7 +1309,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='real-time performance monitoring' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1611#p1611' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#netdata' # Node.js only required for our custom v1.11 package for Stretch ARMv6 RPi (( $G_HW_ARCH == 1 && $G_DISTRO < 5 )) && aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 #------------------ @@ -1313,7 +1319,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface system stats' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1503#p1503' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#rpi-monitor' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1326,7 +1332,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface system management' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3047#p3047' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_stats/#webmin' #------------------ software_id=162 @@ -1334,9 +1340,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Build, ship, and run distributed applications' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9120#p9120' - # - Bullseye: https://download.docker.com/linux/debian/dists/ - aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#docker' #------------------ software_id=185 @@ -1344,9 +1348,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Simplifies container management in Docker (standalone host)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=29377#p29377' - # - Bullseye - aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#portainer' + #------------------ + software_id=134 + + aSOFTWARE_NAME[$software_id]='Docker Compose' + aSOFTWARE_DESC[$software_id]='Manage multi-container Docker applications' + aSOFTWARE_TYPE[$software_id]=0 + aSOFTWARE_CATEGORY_INDEX[$software_id]=8 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/programming/#docker-compose' # Remote Access #-------------------------------------------------------------------------------- @@ -1356,7 +1366,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='(Weaved) access your device over the internet' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=188#p188' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#remot3it' #------------------ software_id=138 @@ -1364,7 +1374,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='server: share USB devices over the network' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=9 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6709#p6709' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/remote_desktop/#virtualhere' # Hardware Projects #-------------------------------------------------------------------------------- @@ -1374,7 +1384,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='gpio interface library for rpi (python)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1065#p1065' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#rpigpio' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1387,7 +1397,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='gpio interface library (c)' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1066#p1066' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#wiringpi' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # RPi + Odroids only for ((i=20; i<=$MAX_G_HW_MODEL; i++)) @@ -1403,7 +1413,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface to control rpi.gpio' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=189#p189' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#webiopi' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # RPi1/2/Zero only for ((i=3; i<=$MAX_G_HW_MODEL; i++)) @@ -1429,7 +1439,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='pisupply ups' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10740#p10740' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#pijuice' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1442,7 +1452,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='tool for wiring devices, APIs and online services' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4292#p4292' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#node-red' aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ @@ -1452,7 +1462,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='MQTT messaging broker' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4293#p4293' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#mosquitto' #------------------ software_id=131 @@ -1460,7 +1470,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='msg controller for blynk mobile app and sbcs' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5901#p5901' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#blynk-server' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 aSOFTWARE_REQUIRES_NODEJS[$software_id]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 @@ -1471,7 +1481,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='audiophonics pi-spc power control module' aSOFTWARE_CATEGORY_INDEX[$software_id]=10 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9359#p9359' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#audiophonics-pi-spc' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1484,7 +1494,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='voice kit' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9486#p9486' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#google-aiy' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 # RPi only @@ -1499,7 +1509,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Open Source Voice Assistant' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=18562#p18562' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#mycroft-ai' aSOFTWARE_REQUIRES_ALSA[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -1510,7 +1520,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='time-series database' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12523#p12523' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#influxdb' #------------------ software_id=77 @@ -1518,7 +1528,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='platform for analytics and monitoring' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=10 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12524#p12524' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/hardware_projects/#grafana' # System Security #-------------------------------------------------------------------------------- @@ -1528,7 +1538,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='prevents brute-force attacks with ip ban' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=11 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=452#p452' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_security/#fail2ban' # Webserver Stacks #-------------------------------------------------------------------------------- @@ -1538,7 +1548,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='apache2 | sqlite | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lasp-web-stack' #------------------ software_id=76 @@ -1546,7 +1556,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='apache2 | mariadb | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lamp-web-stack' #------------------ software_id=78 @@ -1554,7 +1564,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='nginx | sqlite | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lesp-web-stack' #------------------ software_id=79 @@ -1562,7 +1572,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='nginx | mariadb | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lemp-web-stack' #------------------ software_id=81 @@ -1570,7 +1580,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='lighttpd | sqlite | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#llsp-web-stack' #------------------ software_id=82 @@ -1578,7 +1588,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='lighttpd | mariadb | php' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#llmp-web-stack' #------------------ software_id=83 @@ -1586,7 +1596,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='webserver' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#apache2' aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ software_id=84 @@ -1595,7 +1605,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='webserver' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#lighttpd' aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ software_id=85 @@ -1604,7 +1614,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='webserver' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#nginx' aSOFTWARE_REQUIRES_PHP[$software_id]=1 #------------------ software_id=87 @@ -1613,7 +1623,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='database' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#sqlite' #------------------ software_id=88 @@ -1621,7 +1631,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='database' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#mariadb' #------------------ software_id=89 @@ -1629,7 +1639,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Hypertext Preprocessor for dynamic web content' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#php' #------------------ software_id=90 @@ -1637,7 +1647,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='optional mysql admin tools' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#phpmyadmin' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_MYSQL[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -1648,6 +1658,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='optional non-sql database store' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#redis' #------------------ software_id=92 @@ -1655,7 +1666,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]="Obtain and renew Let's Encrypt SSL certs for HTTPS" aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=12 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1062#p1062' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/system_security/#lets-encrypt' #------------------ software_id=125 @@ -1663,7 +1674,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='apache tomcat server' aSOFTWARE_CATEGORY_INDEX[$software_id]=12 aSOFTWARE_TYPE[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4316#p4316' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/webserver_stack/#tomcat' aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1 # - non-Raspbian Buster: https://packages.debian.org/tomcat8 (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0 @@ -1676,7 +1687,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='block adverts for any device on your network' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=174#p174' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/dns_servers/#pi-hole' aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -1689,7 +1700,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='validating, recursive, caching DNS resolver' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=13 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=28779#p28779' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/dns_servers/#unbound' # File Servers #-------------------------------------------------------------------------------- @@ -1699,7 +1710,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='lightweight ftp server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=55#p55' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/file_servers/#proftpd' #------------------ software_id=95 @@ -1707,7 +1718,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='alternative ftp server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2820#p2820' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/file_servers/#vsftpd' #------------------ software_id=96 @@ -1715,7 +1726,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='feature-rich file server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=56#p56' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/file_servers/#samba' #------------------ software_id=109 @@ -1723,7 +1734,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='network file system server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=14 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2821#p2821' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/file_servers/#nfs' # VPN #-------------------------------------------------------------------------------- @@ -1733,7 +1744,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='vpn server' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=613#p613' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/vpn/#openvpn' #------------------ software_id=172 @@ -1741,7 +1752,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='an extremely simple yet fast and modern VPN' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=16308#p16308' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/vpn/#wireguard' # Required to ask for public domain/IP and desired VPN server port aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 # RPi/Odroids/x86_64 only @@ -1768,7 +1779,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='openvpn/wireguard server install & management tool' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3469#p3469' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/vpn/#pivpn' aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 aSOFTWARE_REQUIRES_GIT[$software_id]=1 aSOFTWARE_RECOMMENDS_AUTOMATED_UPGRADES[$software_id]=1 @@ -1779,7 +1790,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='vpn client with connection gui' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=15 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p15975#p15975' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/vpn/#dietpi-nordvpn' # Advanced Networking #-------------------------------------------------------------------------------- @@ -1789,7 +1800,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='turn your device into a wifi hotspot' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1207#p1207' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#wifi-hotspot' #------------------ software_id=61 @@ -1797,7 +1808,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='optional: route hotspot traffic through tor' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1529#p1529' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#tor-hotspot' #------------------ software_id=67 @@ -1805,7 +1816,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Dynamic DNS update client' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=58#p58' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#no-ip' #------------------ software_id=98 @@ -1813,7 +1824,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='high performance tcp/http load balancer' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=221#p221' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#haproxy' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 #------------------ software_id=184 @@ -1822,7 +1833,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='add a node to the Tor network' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=16 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=29381#p29381' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/advanced_networking/#tor-relay' aSOFTWARE_RECOMMENDS_AUTOMATED_UPGRADES[$software_id]=1 aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1 @@ -1834,7 +1845,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='energy usage addon board with web interface' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1525#p1525' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/home_automation/#emonpi' # RPi only for ((i=10; i<=$MAX_G_HW_MODEL; i++)) do @@ -1849,7 +1860,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='open-source home automation platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=70#p70' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/home_automation/#home-assistant' #------------------ software_id=140 @@ -1857,7 +1868,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='open-source home automation platform' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=23065#p23065' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/home_automation/#domoticz' #------------------ software_id=27 @@ -1865,7 +1876,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Website to manage ESP8266 devices flashed with Tasmota' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=17 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=20584#p20584' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/home_automation/#tasmoadmin' aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1 aSOFTWARE_REQUIRES_PHP[$software_id]=1 @@ -1877,7 +1888,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='web interface for controlling 3d printers' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=18 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7958#p7958' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/printing/#octoprint' aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1 # Computational Science @@ -1888,7 +1899,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='distributed disease research project' aSOFTWARE_TYPE[$software_id]=0 aSOFTWARE_CATEGORY_INDEX[$software_id]=19 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13704#p13704' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/computational_science/#foldinghome' # - ARMv6 - ARMv7 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,2]=0 @@ -1945,21 +1956,21 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=5 aSOFTWARE_NAME[$software_id]='ALSA' - aSOFTWARE_DESC[$software_id]='linux sound system' + aSOFTWARE_DESC[$software_id]='Advanced Linux Sound Architecture' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 #------------------ software_id=6 - aSOFTWARE_NAME[$software_id]='Xserver' - aSOFTWARE_DESC[$software_id]='linux display system' + aSOFTWARE_NAME[$software_id]='X.Org X Server' + aSOFTWARE_DESC[$software_id]='aka X11 - X Window System implementation' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 #------------------ software_id=151 aSOFTWARE_NAME[$software_id]='Nvidia' - aSOFTWARE_DESC[$software_id]='display driver' + aSOFTWARE_DESC[$software_id]='Proprietary display driver for Nvidia graphics cards' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=3 aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1 @@ -1975,21 +1986,21 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=7 aSOFTWARE_NAME[$software_id]='FFmpeg' - aSOFTWARE_DESC[$software_id]='audio & visual libary' + aSOFTWARE_DESC[$software_id]='Audio & video codec libary and programs' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 #------------------ software_id=8 aSOFTWARE_NAME[$software_id]='Java' - aSOFTWARE_DESC[$software_id]='OpenJDK + JRE libary' + aSOFTWARE_DESC[$software_id]='OpenJDK runtime environment and development kit' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 #------------------ software_id=9 aSOFTWARE_NAME[$software_id]='Node.js' - aSOFTWARE_DESC[$software_id]='javascript runtime' + aSOFTWARE_DESC[$software_id]='JavaScript runtime environment' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 #------------------ @@ -2010,7 +2021,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=126 aSOFTWARE_NAME[$software_id]='LibSSL1.0.0' - aSOFTWARE_DESC[$software_id]='backwards compatibility (stretch, buster, bullseye)' + aSOFTWARE_DESC[$software_id]='for backwards compatibility on Stretch, Buster and Bullseye' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=4 @@ -2070,14 +2081,14 @@ DietPi-Software will decrypt and use it for software installs. You can change it software_id=16 aSOFTWARE_NAME[$software_id]='Build-Essentials' - aSOFTWARE_DESC[$software_id]='common packages for compile' + aSOFTWARE_DESC[$software_id]='common packages for compiling' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 #------------------ software_id=17 aSOFTWARE_NAME[$software_id]='Git Client' - aSOFTWARE_DESC[$software_id]='git clone etc' + aSOFTWARE_DESC[$software_id]='Clone and manage Git repositories locally' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=6 #------------------ @@ -2133,7 +2144,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='cross-platform, free rss reader' aSOFTWARE_TYPE[$software_id]=1 aSOFTWARE_CATEGORY_INDEX[$software_id]=8 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2075#p2075' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/desktop/#quiterss' aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1 #-------------------------------------------------------------------------------- @@ -2145,7 +2156,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='rotates log files' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/log_system/#full-logging' #------------------ software_id=102 @@ -2153,7 +2164,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='system logging' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/log_system/#full-logging' #------------------ software_id=103 @@ -2161,7 +2172,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='minimal, optimised logging' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/log_system/#dietpi-ramlog' #-------------------------------------------------------------------------------- # SSH Servers (hidden) @@ -2172,7 +2183,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Lightweight SSH server' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=62#p62' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/ssh/#dropbear' #------------------ software_id=105 @@ -2180,7 +2191,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it aSOFTWARE_DESC[$software_id]='Feature-rich SSH server with SFTP and SCP support' aSOFTWARE_TYPE[$software_id]=-1 aSOFTWARE_CATEGORY_INDEX[$software_id]=0 - aSOFTWARE_ONLINEDOC_URL[$software_id]='p=63#p63' + aSOFTWARE_ONLINEDOC_URL[$software_id]='https://dietpi.com/docs/software/ssh/#openssh' #-------------------------------------------------------------------------------- # Init install state for defined software @@ -2238,8 +2249,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it # Docker # - Portainer (185) + # - Docker Compose (134) software_id=162 - if ((${aSOFTWARE_INSTALL_STATE[185]} == 1 && ${aSOFTWARE_INSTALL_STATE[$software_id]} < 1 )) + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} < 1 )) && + (( ${aSOFTWARE_INSTALL_STATE[185]} == 1 || + ${aSOFTWARE_INSTALL_STATE[134]} == 1 )) then aSOFTWARE_INSTALL_STATE[$software_id]=1 G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" @@ -2249,10 +2263,10 @@ DietPi-Software will decrypt and use it for software installs. You can change it if [[ ${aSOFTWARE_INSTALL_STATE[162]} == 1 && ! -d /lib/modules/$(uname -r) ]] then G_WHIP_MSG '[WARNING] Docker install will be deselected -\nIt seems that your kernel version has just been upgraded. The mismatch between loaded and installed kernel versions would cause a failure during Docker install. -\nPlease reselect Docker from dietpi-software after next reboot.' +\nIt seems that your kernel has just been upgraded. The mismatch between loaded and installed kernel versions would cause a failure during Docker install. +\nPlease reselect Docker from dietpi-software after next reboot, or run: +# dietpi-software install 162' aSOFTWARE_INSTALL_STATE[162]=0 - (( ${aSOFTWARE_INSTALL_STATE[185]} == 1 )) && aSOFTWARE_INSTALL_STATE[185]=0 fi @@ -2275,6 +2289,14 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi + # If OctoPrint and mjpg-streamer both are installed, OctoPrint is automatically configured to use mjpg-streamer. For the integrated time-lapse feature, FFmpeg is required. + software_id=7 + if (( ${aSOFTWARE_INSTALL_STATE[137]} > 0 && ${aSOFTWARE_INSTALL_STATE[153]} > 0 && ${aSOFTWARE_INSTALL_STATE[137]} + ${aSOFTWARE_INSTALL_STATE[153]} < 4 )) + then + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" + fi + # Software that requires WiringPi # - Audiophonics Pi-SPC (166) software_id=70 @@ -2381,13 +2403,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it # - HTPC Manager (155) # - Google AIY (169) # - Bazarr (180) + # - Docker Compose (134) software_id=130 if (( ( ${aSOFTWARE_INSTALL_STATE[118]} == 1 && $G_DISTRO > 4 ) || ${aSOFTWARE_INSTALL_STATE[139]} == 1 || ( ${aSOFTWARE_INSTALL_STATE[153]} == 1 && $G_DISTRO > 4 ) || ${aSOFTWARE_INSTALL_STATE[155]} == 1 || ${aSOFTWARE_INSTALL_STATE[169]} == 1 || - ${aSOFTWARE_INSTALL_STATE[180]} == 1 )); then + ${aSOFTWARE_INSTALL_STATE[180]} == 1 || + ${aSOFTWARE_INSTALL_STATE[134]} == 1 )); then aSOFTWARE_INSTALL_STATE[$software_id]=1 G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" @@ -2438,6 +2462,17 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi + # Software that requires Box86 on ARM: Do not reinstall Box86 if present already! + # - Steam (156) + software_id=62 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} < 2 && $G_HW_ARCH == 2 && + ${aSOFTWARE_INSTALL_STATE[156]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed" + + fi + #------------------------------------------------------------------------- # WEBSERVER - Manual stack install # - Define extra DietPi install flags for WEBSERVER_STACKS @@ -2708,12 +2743,21 @@ DietPi-Software will decrypt and use it for software installs. You can change it Create_Desktop_Shared_Items(){ # Pre-create dirs - G_EXEC mkdir -p /root/Desktop /usr/share/applications /var/lib/dietpi/dietpi-software/installed/desktop/{icons,wallpapers} + G_EXEC mkdir -p /usr/share/applications /var/lib/dietpi/dietpi-software/installed/desktop/{icons,wallpapers} - # Copy DietPi favourite links - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks" -o /root/.gtk-bookmarks + # Icons + G_THREAD_START curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi-Website/master/images/dietpi-logo_128x128.png' -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/grey_16x16.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/justboom.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/justboom.png + + # Wallpapers + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_inverted_1080p.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_1080p.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_1080p.png + + # File manager bookmarks + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks" -o /var/lib/dietpi/dietpi-software/installed/desktop/.gtk-bookmarks - # DietPi apps to download + # Desktop applications local adesktop_items=( 'dietpi-software' @@ -2736,34 +2780,82 @@ DietPi-Software will decrypt and use it for software installs. You can change it for i in "${adesktop_items[@]}" do - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/$i.desktop" -o "/usr/share/applications/$i.desktop" - done - # Icons - G_THREAD_START curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi-Website/master/images/dietpi-logo_128x128.png' -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/grey_16x16.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/justboom.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/justboom.png + # Create autostart script to add default desktop icons and configs to users that login the first time into a desktop + cat << '_EOF_' > /var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh +#!/bin/dash - # Wallpapers - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_inverted_1080p.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png - G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_1080p.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_1080p.png +# Create desktop shortcuts +set 'opentyrian' 'kodi' 'steam' 'dxx-rebirth' 'chromium' 'chromium-browser' 'htop' +[ $USER = 'root' ] && set "$@" 'dietpi-launcher' 'dietpi-software' 'dietpi-config' +[ -d ~/Desktop ] || mkdir -p ~/Desktop +for i in "$@" +do + [ -f /usr/share/applications/$i.desktop ] && ! [ -f ~/Desktop/$i.desktop ] && ln -sf /usr/share/applications/$i.desktop ~/Desktop/$i.desktop +done - G_THREAD_WAIT +# Create file manager bookmarks +if ! [ -f ~/.gtk-bookmarks ] +then + cp /var/lib/dietpi/dietpi-software/installed/desktop/.gtk-bookmarks ~/.gtk-bookmarks + sed -i "s|/root|$HOME|g" ~/.gtk-bookmarks +fi - # Desktop app symlinks - 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 +# Disable this autostart entry +mkdir -p ~/.config/autostart +echo -e '[Desktop Entry]\nHidden=true' > ~/.config/autostart/dietpi-desktop_setup.desktop + +# Apply desktop-specific configs +if [ $XDG_CURRENT_DESKTOP = 'LXDE' ] +then + pcmanfm --desktop-off + sleep 0.2 + sed -i '/^desktop_shadow=/c\desktop_shadow=#333333' ~/.config/pcmanfm/LXDE/desktop-items-0.conf + nohup pcmanfm --desktop -p LXDE & + sleep 0.2 + pcmanfm -w /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png +fi +_EOF_ + + cat << '_EOF_' > /etc/xdg/autostart/dietpi-desktop_setup.desktop +[Desktop Entry] +Version=1.0 +Name=DietPi-Desktop_setup +Type=Application +Comment=Adds default desktop entries and configs to the users desktop +NoDisplay=true +Exec=/var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh +Icon=/var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png +_EOF_ - # Set execute to prevent "untrusted" prompt in MATE, and possibily other desktops. - G_EXEC chmod +x /usr/share/applications/*.desktop + # Add execute permissions to prevent "untrusted" prompt in MATE and possibily other desktops + G_EXEC chmod +x /usr/share/applications/*.desktop /var/lib/dietpi/dietpi-software/installed/desktop/dietpi-desktop_setup.sh + + G_THREAD_WAIT } + # Add desktop entry for users which logged into a desktop already and hence have DietPi-Desktop_setup disabled. + # $1 = Application name + Create_Desktop_Shortcut() + { + local uid gid app=$1 + for i in /root /home/* + do + [[ -f $i/.config/autostart/dietpi-desktop_setup.desktop && ! -f $i/Desktop/$app.desktop ]] || continue + if [[ ! -d $i/Desktop ]] + then + # shellcheck disable=SC2012 + read -r uid gid <<< "$(ls -dn "$i" | mawk '{print $3" "$4}')" + G_EXEC mkdir -p "$i/Desktop" + G_EXEC chown "$uid:$gid" "$i/Desktop" + fi + G_EXEC ln -sf "/usr/share/applications/$app.desktop" "$i/Desktop/$app.desktop" + done + } + Create_UserContent_Folders(){ G_EXEC mkdir -p /mnt/dietpi_userdata/{Music,Pictures,Video,downloads} /var/www /opt @@ -2792,7 +2884,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it # Cache size (MB) 1/10th of total mem if (( $1 == 0 )); then - output=$(( $RAM_TOTAL / 10 )) + output=$(( $RAM_PHYS / 10 )) # Max active downloads elif (( $1 == 1 )); then @@ -2874,7 +2966,23 @@ DietPi-Software will decrypt and use it for software installs. You can change it # NB: This does not support installs that require user input (eg: a whiptail prompt for deb installs) Download_Install(){ - local url=${1:-$fallback_url} + # Verify input URL + if [[ $1 ]] + then + local url=$1 + + elif [[ $fallback_url ]] + then + G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} download URL detection failed." + G_DIETPI-NOTIFY 1 "\"$fallback_url\" will be used as fallback, but a newer version might be available." + G_DIETPI-NOTIFY 1 'Please report this at: https://github.com/MichaIng/DietPi/issues' + local url=$fallback_url + + else + G_DIETPI-NOTIFY 1 "An empty download URL was passed during ${aSOFTWARE_NAME[$software_id]} install. Please report this at: https://github.com/MichaIng/DietPi/issues" + return 1 + fi + local target=$2 # Target path local file=${url##*/} # Grab file name from URL local type=${file##*.} # Grab file type from file name to special handle deb|zip|tar(.gz|.bz2)|tgz|tbz2|7z @@ -2888,7 +2996,9 @@ DietPi-Software will decrypt and use it for software installs. You can change it fi + # shellcheck disable=SC2154 (( $no_check_url )) || G_CHECK_URL "$url" + unset -v fallback_url dps_index no_check_url G_EXEC cd /tmp/$G_PROGRAM_NAME # Failsafe @@ -2925,23 +3035,21 @@ DietPi-Software will decrypt and use it for software installs. You can change it G_EXEC 7zr x -y "$file" ${target:+"-o$target"} - else - - # For all other types a target must be given to move/rename the download - G_EXEC_DESC="Verifying download target: ${target:-missing!}" G_EXEC test "$target" + elif [[ $target && $target != "$file" ]]; then # Pre-create target dir, if given - local fp_dir - [[ $target == *'/'* ]] && fp_dir=${target%/*} - [[ $fp_dir && ! -d $fp_dir ]] && G_EXEC mkdir -p "$fp_dir" + [[ $target == *'/'* && ! -d ${target%/*} ]] && G_EXEC mkdir -p "${target%/*}" [[ -f $target ]] && G_DIETPI-NOTIFY 2 "Updating file: $target" G_EXEC mv "$file" "$target" + else + + return + fi [[ -f $file ]] && G_EXEC rm "$file" - unset -v fallback_url dps_index no_check_url } @@ -2991,6 +3099,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it { local file=$1 service=$2 local timeout=${3:-25} # Optional + local output=$4 pid # Optional, if timeout is set, hence for startups which may take long so that showing some process becomes reasonable local content=$CREATE_CONFIG_CONTENT # Optional unset -v CREATE_CONFIG_CONTENT @@ -3001,16 +3110,24 @@ DietPi-Software will decrypt and use it for software installs. You can change it G_EXEC systemctl daemon-reload # File does not exist or does not contain required content: Start service - G_EXEC_DESC="Starting ${aSOFTWARE_NAME[$software_id]} to pre-create config file" G_EXEC systemctl start "$service" + G_EXEC_DESC="Starting ${aSOFTWARE_NAME[$software_id]} to pre-create config file in max $timeout seconds" G_EXEC systemctl start "$service" + + # Print and follow output of the service startup + [[ $output ]] && { journalctl -fu "$service" & pid=$!; } # Wait for max $timeout seconds until config file has been created and required content added, if given local i=0 - until [[ -f $file ]] && { [[ ! $content ]] || grep -q "$content" "$file"; } || (( $i >= $timeout )) + until [[ -f $file ]] && { [[ ! $content ]] || grep -q "$content" "$file"; } || (( $i >= $timeout )) || ! systemctl -q is-active "$service" do ((i++)) - G_DIETPI-NOTIFY -2 "Waiting for ${aSOFTWARE_NAME[$software_id]} config file to be created ($i/$timeout)" + [[ $output ]] || G_DIETPI-NOTIFY -2 "Waiting for ${aSOFTWARE_NAME[$software_id]} config file to be created ($i/$timeout)" sleep 1 done + + # Stop journal prints + [[ $output ]] && { kill $pid; wait $pid; } 2> /dev/null + + # Stop service sleep 1 G_EXEC_NOHALT=1 G_EXEC systemctl stop "$service" sleep 1 @@ -3022,7 +3139,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it return 0 fi - G_DIETPI-NOTIFY 1 "Waiting for ${aSOFTWARE_NAME[$software_id]} config file timed out, skipping pre-configuration" + G_DIETPI-NOTIFY 1 "Waiting for ${aSOFTWARE_NAME[$software_id]} config file failed, skipping pre-configuration" return 1 } @@ -3047,7 +3164,7 @@ _EOF_ # https://github.com/MichaIng/DietPi/issues/1558#issuecomment-701547904 local dbus_package= (( ${aSOFTWARE_INSTALL_STATE[28]} > 0 )) && dbus_package='dbus-user-session' - G_AGI lxde upower firefox-esr $dbus_package + G_AGI lxde upower firefox-esr $dbus_package xcompmgr fi @@ -3068,15 +3185,15 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - G_AGI mate-desktop-environment-core upower firefox-esr + G_AGI mate-desktop-environment-core mate-media upower firefox-esr fi - software_id=26 # GNUStep + software_id=26 # GNUstep if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - G_AGI x-window-system-core wmaker gnustep gnustep-devel gnustep-games libc-dbg upower policykit-1 firefox-esr + G_AGI wmaker gnustep gnustep-devel gnustep-games upower policykit-1 firefox-esr xterm fi @@ -3085,9 +3202,6 @@ _EOF_ Banner_Installing G_AGI xfce4 xfce4-terminal gnome-icon-theme tango-icon-theme upower policykit-1 firefox-esr - # Composition manager: Xfce has one integrated with xfwm4, which is blocked by xcompmgr, breaking settings and leading to ugly results: https://github.com/MichaIng/DietPi/issues/3665 - [[ -f '/etc/xdg/autostart/xcompmgr.desktop' ]] && rm /etc/xdg/autostart/xcompmgr.desktop - dpkg-query -s xcompmgr &> /dev/null && G_AGP xcompmgr # Safe to purge as it has no single dependant fi @@ -3107,7 +3221,7 @@ _EOF_ fi - software_id=175 # Xfce4 Power + software_id=175 # Xfce Power Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -3131,6 +3245,9 @@ _EOF_ G_CONFIG_INJECT 'Option "CoreKeyboard"' ' Option "CoreKeyboard"' /etc/X11/xrdp/xorg.conf 'Driver "xrdpkeyb"' G_CONFIG_INJECT 'Option "CorePointer"' ' Option "CorePointer"' /etc/X11/xrdp/xorg.conf 'Driver "xrdpmouse"' + G_EXEC systemctl enable xrdp + aSTART_SERVICES+=('xrdp') + fi software_id=30 # NoMachine @@ -3138,6 +3255,8 @@ _EOF_ Banner_Installing Download_Install "https://dietpi.com/downloads/binaries/all/nomachine_$G_HW_ARCH_NAME.deb" + G_EXEC systemctl enable nxserver + aSTART_SERVICES+=('nxserver') fi @@ -3392,18 +3511,16 @@ Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /et # Quick install: https://docs.phpmyadmin.net/en/latest/setup.html#quick-install # - Get latest version name - INSTALL_URL_ADDRESS='https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - local version=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 '^[[:blank:]]*"name":' | cut -d \" -f 4) - local fallback_url='https://files.phpmyadmin.net/phpMyAdmin/5.0.4/phpMyAdmin-5.0.4-english.tar.gz' + local version=$(curl -sSfL 'https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest' | mawk -F\" '/"name": /{print $4}') + [[ $version ]] || { version='5.0.4'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-english.tar.gz" # - Reinstall: Clean install but preserve existing config file - [[ -f '/var/www/phpmyadmin/config.inc.php' ]] && G_EXEC mv /var/www/phpmyadmin/config.inc.php phpMyAdmin-*-english/ + [[ -f '/var/www/phpmyadmin/config.inc.php' ]] && G_EXEC mv /var/www/phpmyadmin/config.inc.php "phpMyAdmin-$version-english/" G_EXEC rm -Rf /var/www/phpmyadmin # Include pre-v6.27 symlink: https://github.com/MichaIng/DietPi/issues/3304 # - Remove GUI setup: https://docs.phpmyadmin.net/en/latest/setup.html#securing-your-phpmyadmin-installation - rm -R phpMyAdmin-*-english/setup + G_EXEC_NOHALT=1 G_EXEC rm -R "phpMyAdmin-$version-english/setup" # - Move new instance in place - G_EXEC mv phpMyAdmin-*-english /var/www/phpmyadmin + G_EXEC mv "phpMyAdmin-$version-english" /var/www/phpmyadmin fi @@ -3447,7 +3564,7 @@ Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /et else - Download_Install 'https://download.phpbb.com/pub/release/3.3/3.3.2/phpBB-3.3.2.tar.bz2' + Download_Install 'https://download.phpbb.com/pub/release/3.3/3.3.3/phpBB-3.3.3.tar.bz2' G_EXEC mv phpBB3 /var/www/phpbb # Files are shipped with strange UID:GID 1000:1000 while for security reasons it should be root:root. G_EXEC chown -R root:root /var/www/phpbb @@ -3945,7 +4062,6 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf local platform='rpi1' # Include ID -1 + 0 (( $G_HW_MODEL > 1 )) && platform="rpi$G_HW_MODEL" - (( $G_DISTRO > 4 )) && DEPS_LIST+=' libegl1' || DEPS_LIST+=' libegl1-mesa' /boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d # - Odroid XU4: https://dietpi.com/meveric/pool/main/s/setup-odroid/ @@ -3995,11 +4111,11 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf G_EXEC cp -a amiberry /mnt/dietpi_userdata/ # Cleanup - rm -R amiberry + G_EXEC_NOHALT=1 G_EXEC rm -R amiberry fi - software_id=112 # DDX-Rebirth + software_id=112 # DXX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -4054,21 +4170,13 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing - # Debian - if (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )); then - - G_AGI opentyrian - - # Raspbian: No build available: http://raspbian.raspberrypi.org/raspbian/pool/contrib/o/opentyrian/ - else + DEPS_LIST='libsdl1.2debian libsdl-net1.2' + Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / - DEPS_LIST='ibsdl1.2debian libsdl-net1.2' - Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' / - cp -a /usr/local/games/opentyrian /usr/games/ # cp 'just does it', mv will fail if already exists. - rm -R /usr/local/games/opentyrian - chmod +x /usr/games/opentyrian/opentyrian - - fi + # Move to /usr/games + G_EXEC cp -a /usr/local/games/opentyrian /usr/games/ + G_EXEC rm -R /usr/local/games/opentyrian + G_EXEC chmod +x /usr/games/opentyrian/opentyrian fi @@ -4080,33 +4188,35 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf DEPS_LIST='gpac motion' Download_Install 'https://github.com/silvanmelchior/RPi_Cam_Web_Interface/archive/master.tar.gz' - G_EXEC cd RPi_Cam* + G_EXEC cd RPi_Cam_Web_Interface-master # Config /etc/motion - mkdir -p /etc/motion - cp etc/motion/motion.conf.1 /etc/motion/motion.conf + G_EXEC mkdir -p /etc/motion + G_EXEC cp etc/motion/motion.conf.1 /etc/motion/motion.conf # Config /etc/raspimjpeg - cp etc/raspimjpeg/raspimjpeg.1 /etc/raspimjpeg + G_EXEC cp etc/raspimjpeg/raspimjpeg.1 /etc/raspimjpeg # Setup /var/www/rpicam - mkdir -p /var/www/rpicam - cp -dR www/. /var/www/rpicam/ - mknod /var/www/rpicam/FIFO p - mknod /var/www/rpicam/FIFO1 p + G_EXEC mkdir -p /var/www/rpicam + G_EXEC cp -dR www/. /var/www/rpicam/ + G_EXEC mknod /var/www/rpicam/FIFO p + G_EXEC mknod /var/www/rpicam/FIFO1 p # Symlink cam preview and status - ln -sf /run/shm/mjpeg/cam.jpg /var/www/rpicam/cam.jpg - ln -sf /run/shm/mjpeg/status_mjpeg.txt /var/www/rpicam/status_mjpeg.txt + G_EXEC ln -sf /run/shm/mjpeg/cam.jpg /var/www/rpicam/cam.jpg + G_EXEC ln -sf /run/shm/mjpeg/status_mjpeg.txt /var/www/rpicam/status_mjpeg.txt # Setup Raspimjpeg binary - cp bin/raspimjpeg /opt/vc/bin/raspimjpeg - chmod +x /opt/vc/bin/raspimjpeg - ln -s /opt/vc/bin/raspimjpeg /usr/bin/raspimjpeg + # - Use Stretch binary on Stretch + (( $G_DISTRO < 5 )) && G_EXEC mv bin/raspimjpeg{-stretch,} + G_EXEC cp bin/raspimjpeg /opt/vc/bin/raspimjpeg + G_EXEC chmod +x /opt/vc/bin/raspimjpeg + G_EXEC ln -sf /opt/vc/bin/raspimjpeg /usr/bin/raspimjpeg # Cleanup / remove extracted source G_EXEC cd /tmp/$G_PROGRAM_NAME - rm -R RPi_Cam* + G_EXEC_NOFAIL=1 G_EXEC rm -R RPi_Cam_Web_Interface-master fi @@ -4170,61 +4280,121 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-c4-kodi.conf Banner_Installing Download_Install 'https://github.com/afaqurk/linux-dash/archive/master.tar.gz' - mkdir -p /var/www/linuxdash - cp -a linux-dash-master/* /var/www/linuxdash/ - rm -R linux-dash-master + G_EXEC mkdir -p /var/www/linuxdash + G_EXEC cp -a linux-dash-master/* /var/www/linuxdash/ + G_EXEC_NOHALT=1 G_EXEC rm -R linux-dash-master fi - software_id=93 # Pi-hole - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + software_id=182 # Unbound + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Installing + + G_DIETPI-NOTIFY 2 'Pre-configuring Unbound to avoid port binding conflicts' + + # Download/update list of root hints + Download_Install 'https://www.internic.net/domain/named.root' /var/lib/unbound/root.hints + + # Create monthly cron job to keep root hints updated + echo -e '#!/bin/dash\n# Update Unbound root hints\ncurl -sSfL https://www.internic.net/domain/named.root -o /var/lib/unbound/root.hints' > /etc/cron.monthly/dietpi-unbound + G_EXEC chmod +x /etc/cron.monthly/dietpi-unbound + + # Download base configuration if it does not exist yet + [[ -f '/etc/unbound/unbound.conf.d/dietpi.conf' ]] || dps_index=$software_id Download_Install 'unbound.conf' /etc/unbound/unbound.conf.d/dietpi.conf + + # Toggle IPv6 preference based on dietpi.txt settings + if grep -q 'CONFIG_ENABLE_IPV6=0' /boot/dietpi.txt + then + G_CONFIG_INJECT 'do-ip6:[[:blank:]]' ' do-ip6: no' /etc/unbound/unbound.conf.d/dietpi.conf + + elif grep -q 'CONFIG_PREFER_IPV4=0' /boot/dietpi.txt + then + G_CONFIG_INJECT 'prefer-ip6:[[:blank:]]' ' prefer-ip6: yes' /etc/unbound/unbound.conf.d/dietpi.conf + fi + + # Stretch: Remove incompatile setting + (( $G_DISTRO < 5 )) && sed -i '/log-replies/d' /etc/unbound/unbound.conf.d/dietpi.conf + + # Since IP binding might be used, start after network interfaces have been configured, not when they just start to be configured + G_EXEC mkdir -p /etc/systemd/system/unbound.service.d + G_EXEC eval "echo -e '[Unit]\nWants=network-online.target\nAfter=network-online.target' > /etc/systemd/system/unbound.service.d/dietpi.conf" + # Pi-hole part 1 + if (( ${aSOFTWARE_INSTALL_STATE[93]} > 0 )) && grep -q '^[[:blank:]]*port:[[:blank:]][[:blank:]]*53$' /etc/unbound/unbound.conf.d/dietpi.conf + then + G_DIETPI-NOTIFY 2 'Configuring Unbound to work for Pi-hole' + grep '^[[:blank:]]*nameserver[[:blank:]]' /etc/resolv.conf | grep -qvE '[[:blank:]]127.0.0.1(:53)?$' || echo 'nameserver 9.9.9.9' >> /etc/resolv.conf # Failsafe + G_CONFIG_INJECT 'port:[[:blank:]]' ' port: 5335' /etc/unbound/unbound.conf.d/dietpi.conf + G_CONFIG_INJECT 'interface:[[:blank:]]' ' interface: 127.0.0.1' /etc/unbound/unbound.conf.d/dietpi.conf + fi + + [[ -f '/lib/systemd/system/unbound.service' ]] && G_EXEC systemctl restart unbound + G_AGI unbound + G_EXEC systemctl enable --now unbound # failsafe + + # Pi-hole part 2 + if (( ${aSOFTWARE_INSTALL_STATE[93]} == 2 )) + then + G_DIETPI-NOTIFY 2 'Configuring Pi-hole to use Unbound' + if [[ -f '/etc/dnsmasq.d/01-pihole.conf' ]] + then + G_EXEC sed -i '/^[[:blank:]]*server=/d' /etc/dnsmasq.d/01-pihole.conf + G_CONFIG_INJECT 'server=' 'server=127.0.0.1#5335' /etc/dnsmasq.d/01-pihole.conf + systemctl -q is-active pihole-FTL && G_EXEC systemctl restart pihole-FTL + fi + if [[ -f '/etc/pihole/setupVars.conf' ]] + then + G_CONFIG_INJECT 'PIHOLE_DNS_1=' 'PIHOLE_DNS_1=127.0.0.1#5335' /etc/pihole/setupVars.conf + G_EXEC sed -i '/^[[:blank:]]*PIHOLE_DNS_2=/d' /etc/pihole/setupVars.conf + fi + fi + fi + + software_id=93 # Pi-hole + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then Banner_Installing INSTALL_URL_ADDRESS='https://install.pi-hole.net' G_CHECK_URL "$INSTALL_URL_ADDRESS" - # Check free available memory. Increase swap file size to prevent gravity running out of mem. - if (( $(free -m | mawk '/^Mem:/{print $7;exit}') < 512 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )); then - - G_DIETPI-NOTIFY 2 'Increasing swapfile size to 512 MiB for running gravity.sh, please wait...\n' + # Check free available memory. Increase swap size to prevent gravity running out of mem. + if (( $(free -m | mawk '/^Mem:/{print $7;exit}') < 512 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) + then + G_DIETPI-NOTIFY 2 'Increasing swap size to 512 MiB for running gravity.sh, please wait...\n' /boot/dietpi/func/dietpi-set_swapfile 512 - fi # Dependencies: https://github.com/pi-hole/pi-hole/blob/development/automated%20install/basic-install.sh#L250 G_AGI $PHP_NAME-xml $PHP_NAME-sqlite3 $PHP_NAME-intl - # Unbound - if (( ${aSOFTWARE_INSTALL_STATE[182]} > 1 )) && [[ ! -f '/etc/unbound/unbound.conf.d/dietpi-pihole.conf' ]] + # Unbound: Switch port to 5335 if it was installed before, else it got just configured within its install step above + if (( ${aSOFTWARE_INSTALL_STATE[182]} == 2 )) && grep -q '^[[:blank:]]*port:[[:blank:]][[:blank:]]*53$' /etc/unbound/unbound.conf.d/dietpi.conf then - G_WHIP_MSG 'You are installing Pi-hole while Unbound is already installed. The Unbound port will be changed to 5353.\n\nTo add it to Pi-hole, change one of your DNS servers to 127.0.0.1:5353.' - cat << '_EOF_' > /etc/unbound/unbound.conf.d/dietpi-pihole.conf -port: 5353 -interface: 127.0.0.1 -_EOF_ + G_WHIP_MSG 'You are installing Pi-hole while Unbound is already installed. The Unbound port will be changed to 5335.\n\nTo add it to Pi-hole, set "127.0.0.1#5335" as only custom (IPv4) upstream DNS server.' + grep '^[[:blank:]]*nameserver[[:blank:]]' /etc/resolv.conf | grep -qvE '[[:blank:]]127.0.0.1(:53)?$' || echo 'nameserver 9.9.9.9' >> /etc/resolv.conf # Failsafe + G_CONFIG_INJECT 'port:[[:blank:]]' ' port: 5335' /etc/unbound/unbound.conf.d/dietpi.conf + G_CONFIG_INJECT 'interface:[[:blank:]]' ' interface: 127.0.0.1' /etc/unbound/unbound.conf.d/dietpi.conf G_EXEC systemctl restart unbound fi # Install - curl -sSfL "$INSTALL_URL_ADDRESS" -o install.sh - chmod +x install.sh - # - Skip Lighttpd install, since we allow to choose and install prior to Pi-hole + G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o install.sh + G_EXEC chmod +x install.sh + # - Skip web server install, since we allow to choose and install it prior to Pi-hole # - Skip supported OS check. We do not support Debian testing suite but we are testing it already now. export PIHOLE_SKIP_OS_CHECK=true G_EXEC_NOEXIT=1 G_EXEC_OUTPUT=1 G_EXEC ./install.sh --disable-install-webserver || aSOFTWARE_INSTALL_STATE[$software_id]=0 - rm install.sh - + G_EXEC_NOHALT=1 G_EXEC rm install.sh fi software_id=33 # Airsonic if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/airsonic/airsonic/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" local fallback_url='https://github.com/airsonic/airsonic/releases/download/v10.6.2/airsonic.war' - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*\.war"' | cut -d \" -f 4)" /mnt/dietpi_userdata/airsonic/airsonic.war + Download_Install "$(curl -sSfL 'https://api.github.com/repos/airsonic/airsonic/releases/latest' | mawk -F\" '/"browser_download_url": .*\/airsonic\.war"/{print $4}')" /mnt/dietpi_userdata/airsonic/airsonic.war fi @@ -4241,8 +4411,6 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/remoteit/installer/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" # ARMv6/7 local arch='armhf' @@ -4259,9 +4427,8 @@ _EOF_ fi - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*connectd_.*_$arch\.deb" | cut -d \" -f 4) local fallback_url="https://github.com/remoteit/installer/releases/download/v2.5.38/connectd_2.5.38_$arch.deb" - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/remoteit/installer/releases/latest' | grep "\"browser_download_url\": .*/connectd_[^\"/]*_$arch\.deb\"" | cut -d \" -f 4)" fi @@ -4280,6 +4447,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing + + [[ -d '/usr/local/bin' ]] || G_EXEC mkdir -p /usr/local/bin # RPi if (( $G_HW_MODEL < 10 )); then @@ -4303,11 +4472,12 @@ _EOF_ mv wiringPi* wiringPi &> /dev/null # eg: RPi, wiringPi-HEAD-8d188fa G_EXEC cd wiringPi - chmod +x build - ./build - + G_EXEC chmod +x build + G_EXEC_OUTPUT=1 G_EXEC ./build G_EXEC cd /tmp/$G_PROGRAM_NAME - mv wiringPi /root/ + + G_EXEC rm -Rf /root/wiringPi + G_EXEC mv wiringPi /root/ fi @@ -4322,16 +4492,44 @@ _EOF_ software_id=122 # Node-RED if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing + Banner_Installing # Pre-configure user and data directory to allow a local service user install + + # Data dir + G_EXEC mkdir -p /mnt/dietpi_userdata/node-red + + # User + Create_User -G gpio,i2c -d /mnt/dietpi_userdata/node-red nodered + # - Allow sudo calls + echo 'nodered ALL=NOPASSWD: ALL' > /etc/sudoers.d/nodered + # Permissions + G_EXEC chown -R nodered:nodered /mnt/dietpi_userdata/node-red + + # Service + cat << '_EOF_' > /etc/systemd/system/node-red.service +[Unit] +Description=Node-RED (DietPi) + +[Service] +User=nodered +ExecStart=/mnt/dietpi_userdata/node-red/node_modules/.bin/node-red -u /mnt/dietpi_userdata/node-red + +[Install] +WantedBy=multi-user.target +_EOF_ # Pre-reqs - local apackages=('python' 'python3') + local apackages=('python3') # - RPi: GPIO control for Node-RED - (( $G_HW_MODEL < 10 )) && apackages+=('python-rpi.gpio') + (( $G_HW_MODEL > 9 )) || apackages+=('python3-rpi.gpio') G_AGI "${apackages[@]}" - # Serialport fails to build unless below flags are provided - npm i -g --unsafe-perm node-red + # Install as local instance for "nodered" user + G_EXEC cd /mnt/dietpi_userdata/node-red + G_EXEC_OUTPUT=1 G_EXEC sudo -u nodered npm i node-red + G_EXEC cd /tmp/$G_PROGRAM_NAME + + # CLI alias + echo "alias node-red-admin='sudo -u nodered /mnt/dietpi_userdata/node-red/node_modules/.bin/node-red-admin'" > /etc/bashrc.d/dietpi-node-red.sh fi @@ -4360,18 +4558,11 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/blynkkk/blynk-server/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # On Stretch and ARMv6 (RPi 1/Zero) use Java 8, else most current - local java='[^a].' # Exclude "a" from jav[a]8 but allow "8" as this can be from version string - (( $G_DISTRO < 5 || G_HW_ARCH == 1 )) && java='java8' - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*$java\.jar" | cut -d \" -f 4) - - local fallback_url='https://github.com/blynkkk/blynk-server/releases/download/v0.41.14/server-0.41.14.jar' - (( $G_DISTRO < 5 || G_HW_ARCH == 1 )) && fallback_url='https://github.com/blynkkk/blynk-server/releases/download/v0.41.14/server-0.41.14-java8.jar' + local fallback_url='https://github.com/blynkkk/blynk-server/releases/download/v0.41.15/server-0.41.15.jar' java= + (( $G_DISTRO < 5 || G_HW_ARCH == 1 )) && fallback_url='https://github.com/blynkkk/blynk-server/releases/download/v0.41.15/server-0.41.15-java8.jar' java='-java8' - DEPS_LIST='python' no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /mnt/dietpi_userdata/blynk/blynkserver.jar + DEPS_LIST='python' Download_Install "$(curl -sSfL 'https://api.github.com/repos/blynkkk/blynk-server/releases/latest' | grep "\"browser_download_url\": .*/server-[0-9.]*$java\.jar\"" | cut -d \" -f 4)" /mnt/dietpi_userdata/blynk/blynkserver.jar # Install Blynk JS libary npm i -g --unsafe-perm onoff @@ -4406,7 +4597,7 @@ _EOF_ # Get latest version: No Bullseye packages available yet local distro=$G_DISTRO_NAME (( $G_DISTRO > 5 )) && distro='buster' - local package=$(curl -sSfL "$url/$distro/" | sed -n "/networkaudiod_.*_$arch.deb/{s/^[^\"]*\"//;s/\".*$//p}" | tail -1) + local package=$(curl -sSfL "$url/$distro/" | sed -n "/href=\"networkaudiod_[^\"]*_$arch.deb\"/{s/^[^\"]*\"//;s/\".*$//p}" | tail -1) # Check final URL before applying debconf settings G_CHECK_URL "$url/$distro/$package" @@ -4442,7 +4633,7 @@ _EOF_ G_EXEC cd WebIOPi-0.7.1 # Automate Weaved prompt - sed -i '/read response/c\response="n"' setup.sh + G_EXEC sed -i '/read response/c\response="n"' setup.sh # Run setup script G_EXEC_OUTPUT=1 G_EXEC ./setup.sh @@ -4486,18 +4677,15 @@ _EOF_ software_id=35 # Logitech Media Server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - Banner_Installing # http://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.2 + Banner_Installing # https://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.2 # Grab architecture local arch='arm' (( $G_HW_ARCH == 10 )) && arch='amd64' - # Grab URL for the latest package - INSTALL_URL_ADDRESS="https://www.mysqueezebox.com/update/?version=7.9&geturl=1&os=deb$arch" - G_CHECK_URL "$INSTALL_URL_ADDRESS" - - # Install, failsafe checking this URL again - Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS")" + # Grab latest package URL: Force HTTPS! + local fallback_url="https://downloads.slimdevices.com/LogitechMediaServer_v8.1.1/logitechmediaserver_8.1.1_$arch.deb" + Download_Install "$(curl -sSfL "https://www.mysqueezebox.com/update/?version=8.1&geturl=1&os=deb$arch" | sed 's|^http://|https://|')" fi @@ -4507,8 +4695,6 @@ _EOF_ Banner_Installing Download_Install 'https://wordpress.org/latest.tar.gz' /var/www - G_EXEC chown -R www-data:www-data /var/www/wordpress - fi software_id=38 # FreshRSS @@ -4620,7 +4806,7 @@ _EOF_ # ARMv6: Install package manually since repo is not compatible: https://grafana.com/grafana/download?platform=arm if (( $G_HW_ARCH == 1 )); then - Download_Install 'https://dl.grafana.com/oss/release/grafana-rpi_7.3.5_armhf.deb' + Download_Install 'https://dl.grafana.com/oss/release/grafana-rpi_7.4.3_armhf.deb' # Else use official APT repo: https://grafana.com/docs/grafana/latest/installation/debian/#install-from-apt-repository else @@ -4646,8 +4832,16 @@ _EOF_ Banner_Installing - Download_Install 'https://github.com/phpsysinfo/phpsysinfo/archive/master.tar.gz' /var/www - mv /var/www/phpsysinfo-* /var/www/phpsysinfo + # Download + Download_Install 'https://github.com/phpsysinfo/phpsysinfo/archive/master.tar.gz' + + # Clean reinstall, but preserve previous config + if [[ -d '/var/www/phpsysinfo' ]] + then + G_EXEC mv /var/www/phpsysinfo/phpsysinfo.ini phpsysinfo-master/phpsysinfo.ini + G_EXEC rm -R /var/www/phpsysinfo + fi + G_EXEC mv phpsysinfo-master /var/www/phpsysinfo fi @@ -4668,12 +4862,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - - INSTALL_URL_ADDRESS='https://api.github.com/repos/gotson/komga/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - - local fallback_url='https://github.com/gotson/komga/releases/download/v0.64.6/komga-0.64.6.jar' - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*komga-[0-9.]*\.jar/{print $4;quit}')" /mnt/dietpi_userdata/komga/komga.jar + local fallback_url='https://github.com/gotson/komga/releases/download/v0.69.2/komga-0.69.2.jar' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/"browser_download_url": .*\/komga-[^"\/]*\.jar"/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi @@ -4790,7 +4980,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # RPi elif (( $G_HW_MODEL < 10 )); then - # Install bootloader package as well to assure we have a corretly booting system with intended kernel + # Install bootloader package as well to assure we have a correctly booting system with intended kernel apackages=('raspberrypi-kernel' 'raspberrypi-kernel-headers' 'raspberrypi-bootloader') # Odroid XU4 @@ -4831,10 +5021,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # - Known as issue currently on Odroid C2/N1/N2, check for new build system if linux-/ holds current headers instead of linux-source-/: https://dietpi.com/meveric/pool/c2/l/ for i in /lib/modules/* do - [[ -d $i/build ]] && continue [[ -d /usr/src/linux-headers-${i##*/} ]] && ln -sfv "/usr/src/linux-headers-${i##*/}" "$i/build" - done # If existing install, reconfigure to rebuild WireGuard kernel module against current kernel + headers @@ -4856,7 +5044,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- Download_Install 'https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip' /etc/openvpn - mkdir -p /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn + G_EXEC mkdir -p /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn G_WHIP_MSG '[ INFO ] DietPi-NordVPN has been installed.\n\nOnce DietPi-Software has finished all other installations, you can run the GUI using the following command:\n - dietpi-nordvpn' @@ -4894,7 +5082,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- if (( $WIFIHOTSPOT_RTL8188C_DEVICE && $WIFIHOTSPOT_RTL8188C_PACKAGE )); then # shellcheck disable=SC2086 - G_AGI ${DEPS_LIST/hostapd/hostapt-realtek} + G_AGI ${DEPS_LIST/hostapd/hostapd-realtek} # RTL8188C* without special Realtek hostapd package: On non-RPi ARM, install our binaries with "rtl1871xdrv" driver. On RPi, a RTL8188C*-compatible hostapd package is shipped. elif (( $WIFIHOTSPOT_RTL8188C_DEVICE && $G_HW_MODEL > 9 && $G_HW_ARCH < 4 )); then @@ -5061,14 +5249,11 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/sabre-io/Baikal/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # APT deps: https://github.com/sabre-io/Baikal/wiki/Baïkal-dependencies DEPS_LIST="$PHP_NAME-xml $PHP_NAME-mbstring $PHP_NAME-mysql" - local fallback_url='https://github.com/sabre-io/Baikal/releases/download/0.7.2/baikal-0.7.2.zip' - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url":/{print $4;exit}')" + local fallback_url='https://github.com/sabre-io/Baikal/releases/download/0.8.0/baikal-0.8.0.zip' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/sabre-io/Baikal/releases/latest' | mawk -F\" '/"browser_download_url": .*\/baikal-[^"\/]*\.zip"/{print $4}')" # Reinstall: https://sabre.io/baikal/upgrade/ if [[ -d '/var/www/baikal' ]]; then @@ -5095,9 +5280,6 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- Banner_Installing - INSTALL_URL_ADDRESS='https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # ARMv7 local arch='armhf' @@ -5113,10 +5295,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi - local fallback_url="https://github.com/MediaBrowser/Emby.Releases/releases/download/4.5.3.0/emby-server-deb_4.5.3.0_$arch.deb" - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*emby-server-deb_.*_$arch\.deb" | cut -d \" -f 4)" - - unset -v arch + local fallback_url="https://github.com/MediaBrowser/Emby.Releases/releases/download/4.5.4.0/emby-server-deb_4.5.4.0_$arch.deb" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest' | grep "\"browser_download_url\": .*/emby-server-deb_[^\"/]*_$arch\.deb\"" | cut -d \" -f 4)" fi @@ -5237,9 +5417,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi local fallback_url="https://github.com/gogs/gogs/releases/download/v0.12.3/gogs_0.12.3_linux_$arch.tar.gz" - G_CHECK_URL 'https://api.github.com/repos/gogs/gogs/releases/latest' - INSTALL_URL_ADDRESS=$(curl -sf 'https://api.github.com/repos/gogs/gogs/releases/latest' | grep -m1 "browser_download_url.*linux_$arch.tar.gz" | cut -d \" -f 4) - local no_check_url=1 # G_CHECK_URL faces 403 + INSTALL_URL_ADDRESS=$(curl -sSfL 'https://api.github.com/repos/gogs/gogs/releases/latest' | grep "\"browser_download_url\": .*/gogs_[^\"/]*_linux_$arch.tar.gz\"" | cut -d \" -f 4) fi @@ -5277,9 +5455,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # Install ruTorrent: Web UI for rTorrent # - Grab current version - INSTALL_URL_ADDRESS='https://api.github.com/repos/Novik/ruTorrent/releases/latest' - local version=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/^[[:blank:]]*"tag_name":/{print $4;exit}') - Download_Install "https://github.com/Novik/ruTorrent/archive/${version:-v3.9}.tar.gz" + local version=$(curl -sSfL 'https://api.github.com/repos/Novik/ruTorrent/releases/latest' | mawk -F\" '/"tag_name": /{print $4}') + [[ $version ]] || { version='v3.10'; G_DIETPI-NOTIFY 1 "Automatic latest ruTorrent version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + Download_Install "https://github.com/Novik/ruTorrent/archive/$version.tar.gz" # - Reinstall if [[ -d '/var/www/rutorrent' ]]; then @@ -5290,13 +5468,13 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- 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-* + G_EXEC cp -a ruTorrent-*/. /var/www/rutorrent/ + G_EXEC rm -R ruTorrent-* # - Fresh install else - mv ruTorrent-* /var/www/rutorrent + G_EXEC mv ruTorrent-* /var/www/rutorrent fi @@ -5363,10 +5541,6 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- else - # Get latest version from GitHub - INSTALL_URL_ADDRESS='https://api.github.com/repos/syncthing/syncthing/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # ARMv6/7 local arch='arm' @@ -5382,9 +5556,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.12.0/syncthing-linux-$arch-v1.12.0.tar.gz" - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "browser_download_url.*linux-$arch-v[0-9.]*tar\.gz" | cut -d \" -f 4)" - mv syncthing-* /opt/syncthing + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.13.1/syncthing-linux-$arch-v1.13.1.tar.gz" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/syncthing/syncthing/releases/latest' | grep "\"browser_download_url\": .*/syncthing-linux-$arch-[^\"/]*\.tar\.gz\"" | cut -d \" -f 4)" + G_EXEC mv syncthing-* /opt/syncthing fi @@ -5421,6 +5595,39 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi + software_id=137 # mjpg-streamer + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Installing + + # Build dependencies + DEPS_LIST='make cmake gcc libc6-dev libjpeg-dev' + # - On RPi, add RPi Camera support by default + (( $G_HW_MODEL > 9 )) || DEPS_LIST+=' libraspberrypi-dev' + + # Download sources + Download_Install 'https://github.com/jacksonliam/mjpg-streamer/archive/master.tar.gz' + + # Compile + G_EXEC cd mjpg-streamer-master/mjpg-streamer-experimental + G_EXEC_OUTPUT=1 G_EXEC make CFLAGS='-g0 -O3' -j "$(nproc)" + G_EXEC strip --remove-section=.comment --remove-section=.note _build/mjpg_streamer + + # Move all plugin libraries into the executable's directory to avoid the need for LD_LIBRARY_PATH + G_EXEC mv _build/plugins/*/*.so _build/ + + # Remove all left build files + G_EXEC rm -R _build/{{,C,c}[Mm]ake*,plugins} + + # Install to system, in case remove previous installs + [[ -d '/opt/mjpg-streamer' ]] && G_EXEC rm -R /opt/mjpg-streamer + G_EXEC mv _build /opt/mjpg-streamer + + # Cleanup + G_EXEC cd /tmp/$G_PROGRAM_NAME + G_EXEC rm -R mjpg-streamer-master + fi + software_id=138 # VirtualHere if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -5461,23 +5668,28 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- # APT deps DEPS_LIST='par2 p7zip-full' # - Pre-compiling required on ARM - (( $G_HW_ARCH < 10 )) && DEPS_LIST+=' libffi-dev libssl-dev' + (( $G_HW_ARCH > 9 )) || DEPS_LIST+=' libffi-dev libssl-dev' - Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/master.tar.gz' + # Stretch: SABnzbd v3.2.0 raised the Python dependency to v3.6: https://github.com/sabnzbd/sabnzbd/tree/3.2.0 + local version='master' + (( $(python3 -V | tr -cd '0-9') < 360 )) && version='3.1.1' + + # Download + Download_Install "https://github.com/sabnzbd/sabnzbd/archive/$version.tar.gz" # Reinstall: Remove old install dir if [[ -d '/etc/sabnzbd' ]]; then # Preserve old config file - [[ -f '/etc/sabnzbd/sabnzbd.ini' ]] && G_EXEC mv /etc/sabnzbd/sabnzbd.ini sabnzbd-master/sabnzbd.ini + [[ -f '/etc/sabnzbd/sabnzbd.ini' ]] && G_EXEC mv /etc/sabnzbd/sabnzbd.ini sabnzbd-$version/sabnzbd.ini G_EXEC rm -R /etc/sabnzbd fi - # Install new files - G_EXEC mv sabnzbd-master /etc/sabnzbd + # Install + G_EXEC mv sabnzbd-$version /etc/sabnzbd - # Required Python modules + # Python deps G_EXEC cd /etc/sabnzbd G_EXEC_OUTPUT=1 G_EXEC pip3 install -Ur requirements.txt G_EXEC cd /tmp/$G_PROGRAM_NAME @@ -5517,23 +5729,23 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- DEPS_LIST='pkg-config libssl-dev' # Download - INSTALL_URL_ADDRESS='https://api.github.com/repos/dani-garcia/bitwarden_rs/releases/latest' - local version=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/^[[:blank:]]*"tag_name":/{print $4;exit}') - Download_Install "https://github.com/dani-garcia/bitwarden_rs/archive/${version:=1.17.0}.tar.gz" + local version=$(curl -sSfL 'https://api.github.com/repos/dani-garcia/bitwarden_rs/releases/latest' | mawk -F\" '/"tag_name": /{print $4}') + [[ $version ]] || { version='1.19.0'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + Download_Install "https://github.com/dani-garcia/bitwarden_rs/archive/$version.tar.gz" # Replace old instance on reinstall [[ -d '/opt/bitwarden_rs' ]] && G_EXEC rm -R /opt/bitwarden_rs G_EXEC mv "bitwarden_rs-$version" /opt/bitwarden_rs - # Assure 2 GiB overall memory (-100 MiB to avoid tiny swap space) is available and limit concurrent cargo build jobs to 2 if less than 3 GiB memory are available. - local memory=$(free -tm | mawk '/^Total:/{print $2;exit}') jobs= - if (( $memory < 1948 )) + # Assure 2 GiB overall memory (-100 MiB to avoid tiny swap space) is available and limit concurrent cargo build jobs to 2 if less than 3 GiB memory is available. + local jobs= + if (( $RAM_TOTAL < 1948 )) then - G_DIETPI-NOTIFY 2 'Bitwaden_RS build requires at least 2 GiB memory. We will now increase your swap file size to satisfy this requirement.' + G_DIETPI-NOTIFY 2 'Bitwaden_RS build requires at least 2 GiB memory. We will now increase your swap size to satisfy this requirement.' /boot/dietpi/func/dietpi-set_swapfile 1 (( $G_HW_CPU_CORES > 2 )) && jobs=2 - elif (( $memory < 3072 && $G_HW_CPU_CORES > 2 )) + elif (( $RAM_TOTAL < 3072 && $G_HW_CPU_CORES > 2 )) then jobs=2 fi @@ -5554,7 +5766,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- G_EXEC_NOHALT=1 G_EXEC rm rustup-init.sh G_EXEC . .cargo/env - # Build: Don't run multiple jobs concurrently, as one job can require > 500 MiB memory and can utilize all cores as well. + # Build G_EXEC cd /opt/bitwarden_rs G_EXEC_OUTPUT=1 G_EXEC cargo build ${jobs:+-j $jobs} --features sqlite --release G_EXEC cd /tmp/$G_PROGRAM_NAME @@ -5566,10 +5778,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- HOME='/root' # Install web vault - INSTALL_URL_ADDRESS='https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - local fallback_url='https://github.com/dani-garcia/bw_web_builds/releases/download/v2.17.1/bw_web_v2.17.1.tar.gz' - no_check_url=1 Download_Install "$(curl -sfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*\.tar\.gz\"/{print $4;exit}')" /mnt/dietpi_userdata/bitwarden_rs + local fallback_url='https://github.com/dani-garcia/bw_web_builds/releases/download/v2.18.1b/bw_web_v2.18.1b.tar.gz' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' | mawk -F\" '/"browser_download_url": .*\/bw_web_[^"\/]*\.tar\.gz"/{print $4}')" /mnt/dietpi_userdata/bitwarden_rs fi @@ -5577,9 +5787,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - INSTALL_URL_ADDRESS='https://github.com/Fornoth/spotify-connect-web/releases' # Full path fails wget spider test... - G_CHECK_URL "$INSTALL_URL_ADDRESS" - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS/download/0.0.4-alpha/spotify-connect-web_0.0.4-alpha.tar.gz" /mnt/dietpi_userdata + Download_Install 'https://github.com/Fornoth/spotify-connect-web/releases/download/0.0.4-alpha/spotify-connect-web_0.0.4-alpha.tar.gz' /mnt/dietpi_userdata fi @@ -5591,8 +5799,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- DEPS_LIST='libffi-dev libssl-dev python-lxml python-pip python-dev' Download_Install 'https://github.com/CouchPotato/CouchPotatoServer/archive/master.tar.gz' - [[ -d /etc/couchpotato ]] && rm -R /etc/couchpotato - mv CouchPotato* /etc/couchpotato + [[ -d '/etc/couchpotato' ]] && rm -R /etc/couchpotato + G_EXEC mv CouchPotatoServer-master /etc/couchpotato pip2 install -U pip setuptools wheel pip2 install -U pyopenssl @@ -5610,9 +5818,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- DEPS_LIST="python libpng-dev $PHP_NAME-bcmath $PHP_NAME-json $PHP_NAME-mbstring $PHP_NAME-xml" # Grab latest release - INSTALL_URL_ADDRESS='https://api.github.com/repos/koel/koel/releases/latest' - local version=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/^[[:blank:]]*"tag_name":/{print $4;exit}') - Download_Install "https://github.com/koel/koel/archive/${version:-v4.4.0}.tar.gz" + local fallback_url='https://github.com/koel/koel/releases/download/v5.0.2/koel-v5.0.2.tar.gz' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/koel/koel/releases/latest' | mawk -F\" '/"browser_download_url": .*\/koel-[^"\/]*\.tar\.gz"/{print $4}')" # Reinstall: Clear previous install, but keep existing config file if [[ -d '/mnt/dietpi_userdata/koel' ]]; then @@ -5621,7 +5828,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- G_EXEC rm -R /mnt/dietpi_userdata/koel fi - mv koel-* /mnt/dietpi_userdata/koel + G_EXEC mv koel-* /mnt/dietpi_userdata/koel # Download external assets manually, not included in download archive: https://github.com/koel/koel/tree/master/resources # - NB: We pull master archive, but this might not match to Koel latest release. Requires testing, else we need to switch to git clone. @@ -5713,35 +5920,32 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- - If you need to reinstall (e.g. broken instance), please manually remove the install dir \"/opt/radarr\" and rerun \"dietpi-software reinstall $software_id\"." else - INSTALL_URL_ADDRESS='https://api.github.com/repos/Radarr/Radarr/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - # ARMv6 if (( $G_HW_ARCH == 1 )) then - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux\.tar\.gz/{print $4;exit}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*linux\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.2.4552/Radarr.master.3.0.2.4552.linux.tar.gz' - # ARMv/ + # ARMv7 elif (( $G_HW_ARCH == 2 )) then - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux-core-arm\.tar\.gz/{print $4;exit}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux-core-arm.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*linux-core-arm\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.2.4552/Radarr.master.3.0.2.4552.linux-core-arm.tar.gz' # ARMv8 elif (( $G_HW_ARCH == 3 )) then - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux-core-arm64\.tar\.gz/{print $4;exit}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux-core-arm64.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*linux-core-arm64\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.2.4552/Radarr.master.3.0.2.4552.linux-core-arm64.tar.gz' # x86_64 elif (( $G_HW_ARCH == 10 )) then - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | mawk -F\" '/browser_download_url.*linux-core-x64\.tar\.gz/{print $4;exit}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.1.4259/Radarr.master.3.0.1.4259.linux-core-x64.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL "$INSTALL_URL_ADDRESS" | mawk -F\" '/"browser_download_url": .*linux-core-x64\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v3.0.2.4552/Radarr.master.3.0.2.4552.linux-core-x64.tar.gz' fi - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" + Download_Install "$INSTALL_URL_ADDRESS" G_EXEC mv Radarr /opt/radarr fi fi @@ -5760,13 +5964,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- else - INSTALL_URL_ADDRESS='https://api.github.com/repos/Lidarr/Lidarr/releases' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*linux\.tar\.gz' | cut -d \" -f 4) local fallback_url='https://github.com/lidarr/Lidarr/releases/download/v0.7.2.1878/Lidarr.master.0.7.2.1878.linux.tar.gz' - - DEPS_LIST='mediainfo' - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt + DEPS_LIST='mediainfo' Download_Install "$(curl -sSfL 'https://api.github.com/repos/Lidarr/Lidarr/releases/latest' | mawk -F\" '/"browser_download_url": .*linux\.tar\.gz"/{print $4}')" /opt fi @@ -5832,12 +6031,10 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- Banner_Installing # Grab latest version download link - INSTALL_URL_ADDRESS='https://api.github.com/repos/Jackett/Jackett/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" # - ARMv6: Requires Mono: https://github.com/Jackett/Jackett#installation-on-linux-armv6-or-below - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 'browser_download_url.*Jackett\.Binaries\.Mono\.tar\.gz' | cut -d \" -f 4) - local fallback_url='https://github.com/Jackett/Jackett/releases/download/v0.17.50/Jackett.Binaries.Mono.tar.gz' + INSTALL_URL_ADDRESS=$(curl -sSfL 'https://api.github.com/repos/Jackett/Jackett/releases/latest' | mawk -F\" '/"browser_download_url": .*\/Jackett\.Binaries\.Mono\.tar\.gz"/{print $4}') + local fallback_url='https://github.com/Jackett/Jackett/releases/download/v0.17.513/Jackett.Binaries.Mono.tar.gz' # - ARMv7 if (( $G_HW_ARCH == 2 )); then @@ -5877,18 +6074,17 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- fi fi - # Download: wget --spider/curl -IL return 403 - no_check_url=1 Download_Install "$INSTALL_URL_ADDRESS" /opt + Download_Install "$INSTALL_URL_ADDRESS" /opt # Move existing configs to unpacked install dir - [[ -d '/opt/jackett/Jackett' ]] && mv /opt/jackett/Jackett /opt/Jackett/ - [[ -d '/opt/jackett/.mono' ]] && mv /opt/jackett/.mono /opt/Jackett/ + [[ -d '/opt/jackett/Jackett' ]] && G_EXEC mv /opt/jackett/Jackett /opt/Jackett/ + [[ -d '/opt/jackett/.mono' ]] && G_EXEC mv /opt/jackett/.mono /opt/Jackett/ # Remove existing install dir - [[ -d '/opt/jackett' ]] && rm -R /opt/jackett + [[ -d '/opt/jackett' ]] && G_EXEC rm -R /opt/jackett # Move unpacked install dir in place - mv /opt/Jackett /opt/jackett + G_EXEC mv /opt/Jackett /opt/jackett fi @@ -6002,24 +6198,28 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u Banner_Installing - # Enable foreign i386 architecture, since Steam is i386-only: https://packages.debian.org/steam - if [[ $(dpkg --print-foreign-architectures) != *'i386'* ]]; then - - dpkg --add-architecture i386 - G_AGUP + # Allow non-interactive install + G_EXEC eval "debconf-set-selections <<< 'steam steam/question select I AGREE'" + # x86_64: Install Debian i386 package + if [[ $G_HW_ARCH == 10 ]] + then + # Add i386 arch: https://packages.debian.org/bullseye/steam + [[ $(dpkg --print-foreign-architectures) == *'i386'* ]] || { G_EXEC dpkg --add-architecture i386; G_AGUP; } + # Add Nvidia i386 driver libs, if Nvidia driver is detected + local nvidia + [[ -e '/sys/module/nvidia/version' ]] && nvidia='nvidia-driver-libs:i386' + G_AGI steam $nvidia + + # ARM: Install repacked Debian i386 package for armhf + elif [[ $G_HW_ARCH == 2 ]] + then + Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/steam_$G_HW_ARCH_NAME.deb" fi - # Add Nvidia i386 driver libs, if Nvidia driver is installed - local nvidia= - dpkg-query -s nvidia-driver &> /dev/null && nvidia='nvidia-driver-libs-i386' - - debconf-set-selections <<< 'steam steam/question select I AGREE' - G_AGI steam $nvidia - fi - software_id=158 # Minio + software_id=158 # MinIO if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6062,13 +6262,31 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u Banner_Installing - # Offical installer - INSTALL_URL_ADDRESS='https://get.docker.com' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o DockerInstall.sh - G_EXEC chmod +x DockerInstall.sh - G_EXEC_DESC='Running Docker installer' G_EXEC_OUTPUT=1 G_EXEC ./DockerInstall.sh - G_EXEC_NOFAIL=1 G_EXEC rm DockerInstall.sh + # Detect distro + local distro='debian' + (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )) && distro='raspbian' + + # Install APT repo key + G_EXEC eval "curl -sSfL 'https://download.docker.com/linux/$distro/gpg' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-docker.gpg --yes" + + # Install APT repo list + G_EXEC eval "echo 'deb https://download.docker.com/linux/$distro/ ${G_DISTRO_NAME/bullseye/buster} stable' > /etc/apt/sources.list.d/docker.list" + G_AGUP + + # Install Docker + G_AGI docker-ce + + fi + + software_id=134 # Docker Compose + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing + + # Python build dependencies for aarch64 + (( $G_HW_ARCH == 3 )) && G_AGI make gcc + + G_EXEC_OUTPUT=1 G_EXEC pip3 install docker-compose fi @@ -6109,12 +6327,8 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u Banner_Installing - # Grab latest version from GitHub - INSTALL_URL_ADDRESS='https://api.github.com/repos/go-gitea/gitea/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" # wget --spider fails on binary URL - # Binary + data dir - mkdir -p /mnt/dietpi_userdata/gitea/gitea-repositories + G_EXEC mkdir -p /mnt/dietpi_userdata/gitea/gitea-repositories # ARMv6 + ARMv7 since as of v1.8 there are issues with ARMv7 binaries on Raspbian which are hence not provided anymore: https://github.com/MichaIng/DietPi/issues/2959 (Troubleshooting) local arch='arm-6' @@ -6131,10 +6345,8 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u fi - INSTALL_URL_ADDRESS=$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 "\"browser_download_url.*gitea-[0-9.]*-linux-$arch\"" | cut -d \" -f 4) - # - Fallback URL - [[ $INSTALL_URL_ADDRESS ]] || INSTALL_URL_ADDRESS="https://github.com/go-gitea/gitea/releases/download/v1.11.3/gitea-1.11.3-linux-$arch" - G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o /mnt/dietpi_userdata/gitea/gitea + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.13.2/gitea-1.13.2-linux-$arch" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/go-gitea/gitea/releases/latest' | grep "\"browser_download_url\": .*/gitea-[^\"/]*-linux-$arch\"" | cut -d \" -f 4)" /mnt/dietpi_userdata/gitea/gitea fi @@ -6261,7 +6473,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u G_EXEC eval "echo 'mycroft ALL=NOPASSWD: ALL' > /etc/sudoers.d/mycroft" # Assure 2 GiB overall memory (-100 MiB to avoid tiny swap space) is available - if (( $(free -tm | mawk '/^Total:/{print $2;exit}') < 1948 )); then + if (( $RAM_TOTAL < 1948 )); then G_DIETPI-NOTIFY 2 '\e[33m[WARNING] Insufficient overall memory size: Mycroft AI requires at least 2 GiB memory on first start. We will now attempt to increase your swap size to satisfy this requirement.' /boot/dietpi/func/dietpi-set_swapfile 1 @@ -6304,9 +6516,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u G_EXEC eval "curl -sSfL '$INSTALL_URL_ADDRESS' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg --yes" # Install APT repo - local distro='debian' - (( $G_HW_ARCH == 1 )) && distro='raspbian' - echo "deb https://repo.jellyfin.org/$distro/ $G_DISTRO_NAME main" > /etc/apt/sources.list.d/dietpi-jellyfin.list + echo "deb https://repo.jellyfin.org/debian/ $G_DISTRO_NAME main" > /etc/apt/sources.list.d/dietpi-jellyfin.list G_AGUP # Install Jellyfin + FFmpeg implementation @@ -6314,6 +6524,50 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u fi + software_id=62 # Box86 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Installing + + # APT deps + DEPS_LIST='cmake python3-minimal' + + # Download + local version=$(curl -sSfL 'https://api.github.com/repos/ptitSeb/box86/tags' | mawk -F\" '/"name": /{print $4;exit}') + [[ $version ]] || { version='v0.2.0'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + Download_Install "https://github.com/ptitSeb/box86/archive/$version.tar.gz" + + # Build + G_EXEC mkdir box86-${version#v}/build + G_EXEC cd box86-${version#v}/build + # - RPi 2 + if [[ $G_HW_MODEL == 2 ]] + then + G_EXEC cmake .. -DRPI2=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - RPi 3 + elif [[ $G_HW_MODEL == 3 ]] + then + G_EXEC cmake .. -DRPI3=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - RPi 4 + elif [[ $G_HW_MODEL == 4 ]] + then + G_EXEC cmake .. -DRPI4=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - Odroids + elif (( $G_HW_MODEL < 20 )) + then + G_EXEC cmake .. -DODROID=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + # - Others + else + G_EXEC cmake .. -DARM_DYNAREC=ON -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + fi + G_EXEC_OUTPUT=1 G_EXEC make CFLAGS='-g0 -O3' "-j$(nproc)" + G_EXEC strip --remove-section=.comment --remove-section=.note box86 + G_EXEC make install + + # Reload binfmt to have i386 binaries executed via box86 automatically from now on + (( $G_HW_ARCH < 10 )) && G_EXEC systemctl restart systemd-binfmt + fi + software_id=27 # TasmoAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -6395,7 +6649,7 @@ If you want to update ${aSOFTWARE_NAME[$software_id]}, please use its internal u local ha_user='homeassistant' local ha_home="/home/$ha_user" local ha_pyenv_activation=". $ha_home/pyenv-activate.sh" - local ha_python_version='3.8.6' + local ha_python_version='3.8.8' G_DIETPI-NOTIFY 2 "Home Assistant user: $ha_user" G_DIETPI-NOTIFY 2 "Home Assistent home: $ha_home" @@ -6458,16 +6712,22 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi software_id=181 # PaperMC - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) - then + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + Banner_Installing # Make sure user agrees to the EULA G_WHIP_BUTTON_OK_TEXT='YES' G_WHIP_BUTTON_CANCEL_TEXT='NO' - if G_WHIP_YESNO 'Do you agree to the Minecraft EULA found at:\n\nhttps://account.mojang.com/documents/minecraft_eula' + if [[ -f '/mnt/dietpi_userdata/papermc/eula.txt' ]] || G_WHIP_YESNO 'Do you agree to the Minecraft EULA found at:\n\nhttps://account.mojang.com/documents/minecraft_eula' then - Download_Install 'https://papermc.io/ci/job/Paper-1.16/lastStableBuild/artifact/paperclip.jar' /opt/papermc/paperclip.jar + # Collect latest version of PaperMC + local url='https://papermc.io/api/v2/projects/paper' + local version=$(curl -sSfL "$url"); version=${version%\"*} version=${version##*\"} + local build=$(curl -sSfL "$url/versions/$version"); build=${build%]*} build=${build##*[,[]} + #local file=$(curl -sSfL "$url/versions/$version/builds/$build"); file=${file##*\"name\":\"} file=${file%%\"*} + # Download and install PaperMC + Download_Install "$url/versions/$version/builds/$build/downloads/paper-$version-$build.jar" /opt/papermc/paperclip.jar G_EXEC mkdir -p /mnt/dietpi_userdata/papermc G_EXEC eval 'echo "eula=true" > /mnt/dietpi_userdata/papermc/eula.txt' else @@ -6478,6 +6738,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas software_id=140 # Domoticz if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + + Banner_Installing # APT deps DEPS_LIST='libusb-0.1 libcurl3-gnutls' @@ -6530,24 +6792,20 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi - software_id=6 # Xserver + software_id=6 # X.Org X server if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing - # Composition manager: Xfce has one integrated with xfwm4, which is blocked by xcompmgr, breaking settings and leading to ugly results: https://github.com/MichaIng/DietPi/issues/3665 - local composition_manager= - (( ${aSOFTWARE_INSTALL_STATE[25]} > 0 )) || composition_manager='xcompmgr' + # Generic X server + Mesa OpenGL libraries and utilities + DEPS_LIST='xserver-xorg-core xserver-xorg-input-libinput xinit dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra' - # Generic Xserver + Mesa OpenGL libraries and utilities - G_AGI xserver-xorg xinit $composition_manager xterm dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra + # On VM, add VMware display driver, which offers slightly better performance. VirtualBox can emulate it as well, which es even the nowadays recommended default. + (( $G_HW_MODEL == 20 )) && DEPS_LIST+=' xserver-xorg-video-vmware' # Disable DPMS and screen blanking dps_index=$software_id Download_Install '98-dietpi-disable_dpms.conf' /etc/X11/xorg.conf.d/98-dietpi-disable_dpms.conf - # Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions - (( ${aSOFTWARE_INSTALL_STATE[25]} > 0 )) || dps_index=$software_id Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop - # RK3399 if (( $G_HW_CPUID == 3 )); then @@ -6597,7 +6855,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas elif (( $G_HW_MODEL == 40 )); then Download_Install 'https://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb' - mv /usr/local/lib/libUMP* /usr/lib/ + G_EXEC mv /usr/local/lib/libUMP* /usr/lib/ Download_Install 'https://dietpi.com/downloads/binaries/all/xf86-video-fbturbo_1-1_arm64.deb' G_BACKUP_FP /etc/X11/xorg.conf dps_index=$software_id Download_Install 'xorg_pine64.conf' /etc/X11/xorg.conf @@ -6678,7 +6936,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi - software_id=4 + software_id=4 # Vifm if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6726,7 +6984,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi - software_id=3 + software_id=3 # MC if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing @@ -6796,7 +7054,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing # Remove Information file - [[ -f '/mnt/samba/readme.txt' ]] && rm /mnt/samba/readme.txt + [[ -f '/mnt/samba/readme.txt' ]] && G_EXEC rm /mnt/samba/readme.txt G_AGI smbclient cifs-utils @@ -6808,7 +7066,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing # Remove information file - [[ -f '/mnt/nfs_client/readme.txt' ]] && rm /mnt/nfs_client/readme.txt + [[ -f '/mnt/nfs_client/readme.txt' ]] && G_EXEC rm /mnt/nfs_client/readme.txt # "netbase" is needed for mounting NFSv3: https://github.com/MichaIng/DietPi/issues/1898#issuecomment-406247814 G_AGI nfs-common netbase @@ -6824,7 +7082,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas INDEX_SSHSERVER_TARGET=-1 # Stop OpenSSH service to unbind port 22 - systemctl -q is-active ssh && systemctl stop ssh + systemctl -q is-active ssh && G_EXEC systemctl stop ssh # On Stretch + Buster Dropbear packages have been split, install "dropbear-run" only, to have active service, but skip "dropbear-initramfs" # On Bullseye+ "dropbear-run" has become a transitional dummy package for "dropbear" which does not include "dropbear-initramfs" anymore. @@ -6842,7 +7100,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas G_CONFIG_INJECT 'NO_START=' 'NO_START=0' /etc/default/dropbear # Failsafe: Enable Dropbear service - systemctl enable dropbear + G_EXEC systemctl enable dropbear + aSTART_SERVICES+=('dropbear') # Mark OpenSSH for uninstall and update choice system dpkg-query -s 'openssh-server' &> /dev/null && aSOFTWARE_INSTALL_STATE[105]=-1 && UNINSTALL_REQUIRED=1 @@ -6859,7 +7118,7 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas INDEX_SSHSERVER_TARGET=-2 # Stop Dropbear service to unbind port 22 - systemctl -q is-active dropbear && systemctl stop dropbear + systemctl -q is-active dropbear && G_EXEC systemctl stop dropbear # SSH server package pulls client as dependency. Mark client hence as installed and mark it explicitly so that it is not autoremoved with the server but must be marked for uninstall instead. G_AGI openssh-server openssh-client @@ -6872,7 +7131,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas systemctl reload ssh # Failsafe: Enable OpenSSH service - systemctl enable ssh + G_EXEC systemctl enable ssh + aSTART_SERVICES+=('ssh') # Mark Dropbear for uninstall and update choice system grep -q '^dropbear[^[:blank:]]*[[:blank:]]' <<< "$(dpkg --get-selections)" && aSOFTWARE_INSTALL_STATE[104]=-1 && UNINSTALL_REQUIRED=1 @@ -6919,9 +7179,9 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Installing # Workaround for dpkg failure on 1st install if service is already running but APT not installed: https://github.com/MichaIng/DietPi/pull/2277/#issuecomment-441460925 - systemctl stop rsyslog &> /dev/null + systemctl stop rsyslog 2> /dev/null G_AGI rsyslog - systemctl start rsyslog &> /dev/null + G_EXEC systemctl enable --now rsyslog fi @@ -6970,10 +7230,14 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Installing + + # Create piwheels config file for ARMv6 and ARMv7 + [[ $G_HW_ARCH != [12] || -f '/etc/pip.conf' ]] || G_EXEC eval "echo -e '[global]\nextra-index-url=https://www.piwheels.org/simple/' > /etc/pip.conf" + + # Perform pip3 installation INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/get-pip.py' - G_CHECK_URL "$INSTALL_URL_ADDRESS" - G_AGI python3-dev - G_EXEC curl -sSfL "$INSTALL_URL_ADDRESS" -o get-pip.py + (( $G_DISTRO > 4 )) || INSTALL_URL_ADDRESS='https://bootstrap.pypa.io/3.5/get-pip.py' # https://pip.pypa.io/en/stable/news/#id1 + DEPS_LIST='python3-dev' Download_Install "$INSTALL_URL_ADDRESS" G_EXEC_OUTPUT=1 G_EXEC python3 ./get-pip.py G_EXEC_NOHALT=1 G_EXEC rm get-pip.py @@ -7023,14 +7287,6 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas fi - software_id=182 # Unbound - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) - then - Banner_Installing - G_AGI unbound - G_DIETPI-NOTIFY 2 'It is possible that Unbound just gave an error. This is safe to ignore.' - fi - } Apply_SSHServer_Choices(){ @@ -7143,15 +7399,10 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas } - Apply_Webserver_Preference(){ - - if (( $INDEX_WEBSERVER_TARGET != $INDEX_WEBSERVER_CURRENT )); then - - # Update current webserver index - INDEX_WEBSERVER_CURRENT=$INDEX_WEBSERVER_TARGET - - fi - + Apply_Webserver_Preference() + { + # Update current webserver index + INDEX_WEBSERVER_CURRENT=$INDEX_WEBSERVER_TARGET } # Configure marked software titles @@ -7165,12 +7416,11 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration # Openbox + PCmanFM + panel configs - mkdir -p /root/.config/{openbox,pcmanfm/LXDE,lxpanel/LXDE/panels} - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml -o /root/.config/openbox/lxde-rc.xml - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf -o /root/.config/pcmanfm/LXDE/pcmanfm.conf - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm-desktopitems.conf -o /root/.config/pcmanfm/LXDE/desktop-items-0.conf - G_THREAD_START curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel -o /root/.config/lxpanel/LXDE/panels/panel - + G_EXEC mkdir -p /etc/xdg/{openbox/LXDE,pcmanfm/LXDE,lxpanel/LXDE/panels} + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/lxde-rc.xml" -o /etc/xdg/openbox/LXDE/rc.xml + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/pcmanfm.conf" -o /etc/xdg/pcmanfm/LXDE/pcmanfm.conf + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/lxde/panel" -o /etc/xdg/lxpanel/LXDE/panels/panel + # Remove LXRandR menu item (monitor configuration tool as we set res in dietpi-config) [[ -f '/usr/share/applications/lxrandr.desktop' ]] && G_EXEC rm /usr/share/applications/lxrandr.desktop @@ -7189,10 +7439,8 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Create_Desktop_Shared_Items - # File manager desktop icon - G_EXEC ln -sf /usr/share/applications/pcmanfm.desktop /root/Desktop/pcmanfm.desktop - - G_THREAD_WAIT + # Composition manager: Enable limited server-side composition + dps_index=6 Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop fi @@ -7202,12 +7450,9 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration Create_Desktop_Shared_Items - - # File manager desktop icon - ln -sf /usr/share/applications/caja.desktop /root/Desktop/caja.desktop - + # Odroid C2, define default pulseaudio sink: https://github.com/MichaIng/DietPi/issues/415 - (( $G_HW_MODEL == 12 )) && G_CONFIG_INJECT 'set-default-sink[[:blank:]]' 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa + [[ $G_HW_MODEL == 12 && -f '/etc/pulse/default.pa' ]] && G_CONFIG_INJECT 'set-default-sink[[:blank:]]' 'set-default-sink alsa_output.platform-odroid_hdmi.37.analog-stereo' /etc/pulse/default.pa fi @@ -7217,16 +7462,20 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration # Configs - Download_Install "https://github.com/MichaIng/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /root/.config + Download_Install "https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /etc/xdg/ + # Disable trash # - Skip on Buster since trash seems to be implemented differently: https://github.com/MichaIng/DietPi/issues/1918#issuecomment-488085982 (( $G_DISTRO < 5 )) && G_CONFIG_INJECT 'use_trash=' 'use_trash=0' /etc/xdg/libfm/libfm.conf Create_Desktop_Shared_Items + # Composition manager: LXQt has one integrated with xfwm4, which is blocked by xcompmgr, breaking settings and leading to ugly results: https://github.com/MichaIng/DietPi/issues/3665 + [[ -f '/etc/xdg/autostart/xcompmgr.desktop' ]] && G_EXEC rm /etc/xdg/autostart/xcompmgr.desktop + fi - software_id=26 # GNUStep + software_id=26 # GNUstep if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -7240,6 +7489,9 @@ exec sudo -u $ha_user dash -c '$ha_pyenv_activation; exec pip3 install -U homeas Banner_Configuration Create_Desktop_Shared_Items + # Composition manager: Xfce has one integrated with xfwm4, which is blocked by xcompmgr, breaking settings and leading to ugly results: https://github.com/MichaIng/DietPi/issues/3665 + [[ -f '/etc/xdg/autostart/xcompmgr.desktop' ]] && G_EXEC rm /etc/xdg/autostart/xcompmgr.desktop + fi software_id=83 # Apache @@ -7388,7 +7640,7 @@ _EOF_ # - Nginx: https://github.com/MichaIng/DietPi/issues/546 => https://github.com/MichaIng/DietPi/blob/dev/.conf/dps_85/nginx.conf # Cache settings - local target_php_cachesize=$(( $RAM_TOTAL / 30 )) + local target_php_cachesize=$(( $RAM_PHYS / 30 )) (( $target_php_cachesize < 10 )) && target_php_cachesize=10 # - OPcache G_CONFIG_INJECT 'opcache.enable[[:blank:]]*=' 'opcache.enable=1' $target_php_ini @@ -7883,7 +8135,7 @@ location = /.well-known/caldav { grep -q "^[[:blank:]]*'maintenance' => true," $config_php || occ maintenance:mode --on # On <1 GiB devices assure at least 512 MiB swap space are available to stand 512 MiB file uploads + increased PHP cache and session file usage: https://github.com/MichaIng/DietPi/issues/2293 - (( $RAM_TOTAL < 924 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) && /boot/dietpi/func/dietpi-set_swapfile 512 + (( $RAM_PHYS < 924 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) && /boot/dietpi/func/dietpi-set_swapfile 512 fi @@ -8144,7 +8396,7 @@ The install script will now exit. After applying one of the the above, rerun die grep -q "^[[:blank:]]*'maintenance' => true," $config_php || ncc maintenance:mode --on # On <1 GiB devices assure at least 512 MiB swap space are available to stand 512 MiB file uploads + increased PHP cache and session file usage: https://github.com/MichaIng/DietPi/issues/2293 - (( $RAM_TOTAL < 924 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) && /boot/dietpi/func/dietpi-set_swapfile 512 + (( $RAM_PHYS < 924 && $(free -m | mawk '/^Swap:/{print $2;exit}') < 512 )) && /boot/dietpi/func/dietpi-set_swapfile 512 fi @@ -8163,7 +8415,7 @@ The install script will now exit. After applying one of the the above, rerun die [[ -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 + G_EXEC mkdir -p /etc/systemd/system/coturn.service.d echo -e "[Service]\nExecStart=\n$(grep -m1 "^[[:blank:]]*ExecStart=" /lib/systemd/system/coturn.service) -l stdout --no-stdout-log --simple-log" > /etc/systemd/system/coturn.service.d/dietpi-logging.conf # Stretch: sysvinit service @@ -8690,123 +8942,6 @@ _EOF_ fi - software_id=182 # Unbound - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - # Download list of root hints - Download_Install https://www.internic.net/domain/named.root /var/lib/unbound/root.hints - - cat << _EOF_ > /etc/unbound/unbound.conf.d/dietpi.conf -server: - verbosity: 0 - - interface: 0.0.0.0 - port: 53 - do-ip4: yes - do-udp: yes - do-tcp: yes - - do-ip6: yes - - prefer-ip6: no - - root-hints: "/var/lib/unbound/root.hints" - - harden-glue: yes - harden-large-queries: yes - - harden-dnssec-stripped: yes - - use-caps-for-id: yes - - edns-buffer-size: 1472 - - rrset-roundrobin: yes - - cache-min-ttl: 300 - cache-max-ttl: 86400 - - serve-expired: yes - - harden-algo-downgrade: yes - - harden-short-bufsize: yes - - hide-identity: yes - - identity: "Server" - - hide-version: yes - - do-daemonize: no - - neg-cache-size: 4M - - qname-minimisation: yes - - minimal-responses: yes - - prefetch: yes - prefetch-key: yes - - num-threads: 1 - - msg-cache-size: 50m - rrset-cache-size: 100m - - so-reuseport: yes - - so-rcvbuf: 4m - so-sndbuf: 4m - - unwanted-reply-threshold: 10000 - - ratelimit: 1000 - - log-queries: no - log-replies: no - logfile: '' - - access-control: 0.0.0.0/0 refuse - access-control: 127.0.0.1 allow - access-control: $(hostname -I | grep -o '192.168.[[:digit:]]').0/24 allow - - private-address: 192.168.0.0/16 - private-address: 169.254.0.0/16 - private-address: 172.16.0.0/12 - private-address: 10.0.0.0/8 - private-address: fd00::/8 - private-address: fe80::/10 -_EOF_ - # Configuration - if grep -q 'CONFIG_ENABLE_IPV6=0' /boot/dietpi.txt - then - G_CONFIG_INJECT 'do-ip6:[[:blank:]]' ' do-ip6: no' /etc/unbound/unbound.conf.d/dietpi.conf - - elif grep -q 'CONFIG_PREFER_IPV4=0' /boot/dietpi.txt - then - G_CONFIG_INJECT 'prefer-ip6:[[:blank:]]' ' prefer-ip6: yes' /etc/unbound/unbound.conf.d/dietpi.conf - fi - - (( $G_DISTRO < 5 )) && sed -i '/log-replies/d' /etc/unbound/unbound.conf.d/dietpi.conf - - if (( ${aSOFTWARE_INSTALL_STATE[93]} > 0 )) - then - G_DIETPI-NOTIFY 2 'Configuring Unbound to work with Pi-hole' - cat << '_EOF_' > /etc/unbound/unbound.conf.d/dietpi-pihole.conf -port: 5353 -interface: 127.0.0.1 -_EOF_ - G_CONFIG_INJECT 'PIHOLE_DNS_1=' 'PIHOLE_DNS_1=127.0.0.1#5353' /etc/pihole/setupVars.conf - G_CONFIG_INJECT 'PIHOLE_DNS_2=' 'PIHOLE_DNS_2=' /etc/pihole/setupVars.conf - fi - - G_EXEC systemctl restart unbound - - fi - software_id=32 # ympd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -8873,36 +9008,6 @@ _EOF_ fi - software_id=122 # Node-RED - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then - - Banner_Configuration - - # Data dir - mkdir -p /mnt/dietpi_userdata/node-red - - # User - Create_User -G gpio,i2c -d /mnt/dietpi_userdata/node-red nodered - # - Allow sudo calls - echo 'nodered ALL=NOPASSWD: ALL' > /etc/sudoers.d/nodered - - # Service - cat << _EOF_ > /etc/systemd/system/node-red.service -[Unit] -Description=Node-RED (DietPi) - -[Service] -User=nodered -ExecStart=$(command -v node-red) -u /mnt/dietpi_userdata/node-red - -[Install] -WantedBy=multi-user.target -_EOF_ - # Permissions - chown -R nodered:nodered /mnt/dietpi_userdata/node-red - - fi - software_id=125 # Tomcat8 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -9009,13 +9114,17 @@ _EOF_ # Run Kodi as root [[ -f '/etc/default/kodi' ]] && G_CONFIG_INJECT 'USER=' 'USER=root' /etc/default/kodi + # Desktop entry + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png" -o /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop" -o /usr/share/applications/kodi.desktop + # Copy udev rules, probably not needed for root, but we'll do it anyway dps_index=$software_id Download_Install '99-dietpi-kodi.rules' /etc/udev/rules.d/99-dietpi-kodi.rules - # Create .desktop symlink - mkdir -p /root/Desktop - G_EXEC curl -sSfL https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop -o /usr/share/applications/kodi.desktop - ln -sf /usr/share/applications/kodi.desktop /root/Desktop/kodi.desktop + # Desktop shortcut + Create_Desktop_Shortcut kodi + + G_THREAD_WAIT fi @@ -9028,9 +9137,11 @@ _EOF_ Create_User -g dietpi -G minidlna -d /var/lib/minidlna minidlna # Remove obsolete service files - [[ -f '/etc/init.d/minidlna' ]] && rm -v /etc/init.d/minidlna - update-rc.d -f minidlna remove - [[ -f '/lib/systemd/system/minidlna.service' ]] && rm -v /lib/systemd/system/minidlna.service + [[ -f '/etc/init.d/minidlna' ]] && G_EXEC rm /etc/init.d/minidlna + G_EXEC update-rc.d -f minidlna remove + [[ -f '/lib/systemd/system/minidlna.service' ]] && G_EXEC rm /lib/systemd/system/minidlna.service + [[ -f '/etc/default/minidlna' ]] && G_EXEC rm /etc/default/minidlna + [[ -d '/var/log/minidlna' ]] && G_EXEC rm -R /var/log/minidlna # Service cat << _EOF_ > /etc/systemd/system/minidlna.service @@ -9042,7 +9153,7 @@ After=network-online.target dietpi-boot.service [Service] User=minidlna RuntimeDirectory=minidlna -ExecStart=$(command -v minidlnad) -SR -f /etc/minidlna.conf +ExecStart=$(command -v minidlnad) -S -R -f /etc/minidlna.conf [Install] WantedBy=multi-user.target @@ -9052,8 +9163,8 @@ _EOF_ dps_index=$software_id Download_Install 'minidlna.conf' /etc/minidlna.conf # Cache - mkdir -p /mnt/dietpi_userdata/.MiniDLNA_Cache - chown -R minidlna:dietpi /mnt/dietpi_userdata/.MiniDLNA_Cache + G_EXEC mkdir -p /mnt/dietpi_userdata/.MiniDLNA_Cache + G_EXEC chown -R minidlna:dietpi /mnt/dietpi_userdata/.MiniDLNA_Cache Download_Test_Media @@ -9091,7 +9202,7 @@ _EOF_ Banner_Configuration # Reinstall: Remove obsolete config file: https://github.com/midwan/amiberry/releases/tag/v2.25 - [[ -f '/mnt/dietpi_userdata/amiberry/conf/adfdir.conf' ]] && rm /mnt/dietpi_userdata/amiberry/conf/adfdir.conf + [[ -f '/mnt/dietpi_userdata/amiberry/conf/adfdir.conf' ]] && G_EXEC rm /mnt/dietpi_userdata/amiberry/conf/adfdir.conf # Service cat << '_EOF_' > /etc/systemd/system/amiberry.service @@ -9113,27 +9224,27 @@ _EOF_ fi - software_id=112 # DDX-Rebirth + software_id=112 # DXX-Rebirth if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration # Symlink savegames to root # - Remove existing syslinks - rm -Rf /root/.d{1,2}x-rebirth + G_EXEC rm -Rf /root/.d{1,2}x-rebirth - ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_1_profiles /root/.d1x-rebirth - ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_2_profiles /root/.d2x-rebirth + G_EXEC ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_1_profiles /root/.d1x-rebirth + G_EXEC ln -sf /mnt/dietpi_userdata/dxx-rebirth/descent_2_profiles /root/.d2x-rebirth # +exe - chmod +x -R /mnt/dietpi_userdata/dxx-rebirth/* + G_EXEC chmod -R +x /mnt/dietpi_userdata/dxx-rebirth/* - # Create .Desktop SymLinks - mkdir -p /root/Desktop - mkdir -p /usr/share/applications + # Desktop menu entry + G_EXEC mkdir -p /usr/share/applications + G_EXEC ln -sf /mnt/dietpi_userdata/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop - ln -s /mnt/dietpi_userdata/dxx-rebirth/dxx-rebirth.desktop /root/Desktop/dxx-rebirth.desktop - ln -s /mnt/dietpi_userdata/dxx-rebirth/dxx-rebirth.desktop /usr/share/applications/dxx-rebirth.desktop + # Desktop shortcut + Create_Desktop_Shortcut dxx-rebirth fi @@ -9142,15 +9253,17 @@ _EOF_ Banner_Configuration + # Desktop menu entry + G_THREAD_START curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/apps/opentyrian.desktop" -o /usr/share/applications/opentyrian.desktop + # Copy the DietPi run file for OpenTyrian dps_index=$software_id Download_Install 'run' /usr/games/opentyrian/run - chmod +x /usr/games/opentyrian/run + G_EXEC chmod +x /usr/games/opentyrian/run - # Create .Desktop SymLinks - mkdir -p /root/Desktop - rm /usr/share/applications/opentyrian.desktop &> /dev/null - G_EXEC curl -sSfL 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 /root/Desktop/opentyrian.desktop + # Desktop shortcut + Create_Desktop_Shortcut opentyrian + + G_THREAD_WAIT fi @@ -9160,18 +9273,17 @@ _EOF_ Banner_Configuration # raspimjpeg conf - ln -s /etc/raspimjpeg /var/www/rpicam/raspimjpeg + G_EXEC ln -sf /etc/raspimjpeg /var/www/rpicam/raspimjpeg # Motion conf - chgrp www-data /etc/motion/motion.conf - chown motion:www-data /etc/motion/motion.conf - chmod 664 /etc/motion/motion.conf - usermod -aG video www-data + G_EXEC chown motion:www-data /etc/motion/motion.conf + G_EXEC chmod 664 /etc/motion/motion.conf + G_EXEC usermod -aG video www-data # raspimjpeg/php schedule startup and control script dps_index=$software_id Download_Install 'raspimjpeg.sh' /var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh - chmod +x /var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh - cat << _EOF_ > /etc/systemd/system/raspimjpeg.service + G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/raspimjpeg.sh + cat << '_EOF_' > /etc/systemd/system/raspimjpeg.service [Unit] Description=Raspimjpeg (DietPi) @@ -9186,21 +9298,21 @@ _EOF_ # Replace confs with /var/www to /var/www/rpicam, once if ! grep -q '/rpicam' /etc/raspimjpeg; then - sed -i 's#/var/www#/var/www/rpicam#g' /etc/raspimjpeg - sed -i 's#/var/www#/var/www/rpicam#g' /etc/motion/motion.conf + G_EXEC sed -i 's#/var/www#/var/www/rpicam#g' /etc/raspimjpeg + G_EXEC sed -i 's#/var/www#/var/www/rpicam#g' /etc/motion/motion.conf fi # Setup Data directory - mkdir -p /mnt/dietpi_userdata/rpicam - rm -Rf /var/www/rpicam/media - ln -s /mnt/dietpi_userdata/rpicam /var/www/rpicam/media + G_EXEC mkdir -p /mnt/dietpi_userdata/rpicam + G_EXEC rm -Rf /var/www/rpicam/media + G_EXEC ln -s /mnt/dietpi_userdata/rpicam /var/www/rpicam/media # Enable RPi camera /boot/dietpi/func/dietpi-set_hardware rpi-camera enable # Permissions - chown -R www-data:www-data /var/www/rpicam /mnt/dietpi_userdata/rpicam + G_EXEC chown -R www-data:www-data /var/www/rpicam /mnt/dietpi_userdata/rpicam fi @@ -9340,11 +9452,11 @@ _EOF_ elif (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then # Enable required modules - a2enmod headers + G_EXEC a2enmod headers # Add and enable Pi-hole config dps_index=$software_id Download_Install 'apache.pihole.conf' /etc/apache2/sites-available/dietpi-pihole.conf - a2ensite dietpi-pihole + G_EXEC a2ensite dietpi-pihole # Optional config to block public access to admin panel dps_index=$software_id Download_Install 'apache.block_public_admin.conf' /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf @@ -9373,49 +9485,30 @@ You can always enable/disable this at a later point using the commands: - $disable_cmd\n Do you want to block public access to the admin panel now?" && eval "$enable_cmd" - # Create symlinks to align Pi-hole admin and blocking page relative to webroot + # Create symlinks to align Pi-hole admin and 404 page relative to webroot G_EXEC cd /var/www # - Move existing files/dirs out of the way - [[ ! -L 'admin' && -e 'admin' ]] && mv -v admin admin.bak - ln -vsf html/admin admin - [[ ! -L 'pihole' && -e 'pihole' ]] && mv -v pihole pihole.bak - ln -vsf html/pihole pihole + [[ ! -L 'admin' && -e 'admin' ]] && G_EXEC mv admin admin.bak + G_EXEC ln -sf html/admin admin + [[ ! -L 'pihole' && -e 'pihole' ]] && G_EXEC mv pihole pihole.bak + G_EXEC ln -sf html/pihole pihole - # Pi-hole v5: Add webserver user to dietpi group to allow gravity.db access: https://github.com/MichaIng/DietPi/issues/3391 + # Pi-hole v5: Add webserver user to pihole group to allow gravity.db access from web UI: https://github.com/MichaIng/DietPi/issues/3391 G_EXEC usermod -aG pihole www-data - # Ask user whether to show blocking page - G_WHIP_BUTTON_OK_TEXT='YES' - G_WHIP_BUTTON_CANCEL_TEXT='NO' - if G_WHIP_YESNO 'Pi-hole can show a blocking page, when clients access a blocked website. This allows you to whitelist domains directly from the blocking page and prevents the need to access the admin page or use the Pi-hole CLI for this.\n -The downside is additional traffic and less performance compared to a silent request block. Additional info can be found at: https://docs.pi-hole.net/ftldns/blockingmode/\n -Do you want to enable the Pi-hole blocking page?'; then - - G_CONFIG_INJECT 'BLOCKINGMODE=' 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf - # Enable 404 handler to rewrite all non-existent ad URL paths to blocking page - [[ -f '/etc/apache2/sites-available/dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'ErrorDocument 404' 'ErrorDocument 404 /html/pihole/index.php' /etc/apache2/sites-available/dietpi-pihole.conf - [[ -f '/etc/nginx/sites-dietpi/dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'error_page 404' 'error_page 404 /html/pihole/index.php;' /etc/nginx/sites-dietpi/dietpi-pihole.conf - [[ -f '/etc/lighttpd/conf-available/99-dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'server.error-handler-404' 'server.error-handler-404 = "/html/pihole/index.php"' /etc/lighttpd/conf-available/99-dietpi-pihole.conf - # Backup default index page to rewrite webroot ad URL paths to blocking page - [[ -f 'index.html' ]] && mv index.html index.html.bak - [[ -f 'index.lighttpd.html' ]] && mv index.lighttpd.html index.lighttpd.html.bak - [[ -f 'index.nginx-debian.html' ]] && mv index.nginx-debian.html index.nginx-debian.html.bak - - else - - G_CONFIG_INJECT 'BLOCKINGMODE=' 'BLOCKINGMODE=NULL' /etc/pihole/pihole-FTL.conf - - fi + # Apply most resource friendly and officially recommended NULL blocking: https://docs.pi-hole.net/ftldns/blockingmode/ + G_CONFIG_INJECT 'BLOCKINGMODE=' 'BLOCKINGMODE=NULL' /etc/pihole/pihole-FTL.conf # Failsafe: Reset permissions - cd /var/www/html/admin && git reset --hard HEAD + G_EXEC cd /var/www/html/admin + G_EXEC git reset --hard HEAD G_EXEC cd /tmp/$G_PROGRAM_NAME # Disable non-required dhcpcd, which is installed by Pi-hole installer systemctl disable --now dhcpcd # Disable pihole.log query logging: https://github.com/pi-hole/FTL/issues/614#issuecomment-510564476 - pihole -l off + G_EXEC pihole -l off # Set web interface PW: https://github.com/MichaIng/DietPi/issues/662 pihole -a -p "$GLOBAL_PW" @@ -9431,7 +9524,7 @@ Do you want to enable the Pi-hole blocking page?'; then Create_User -g dietpi -G audio -d /mnt/dietpi_userdata/airsonic airsonic # Optimise memory limit - local memory_limit=$(( $RAM_TOTAL / 5 )) + local memory_limit=$(( $RAM_PHYS / 5 )) (( $memory_limit < 200 )) && memory_limit=200 # Service @@ -9472,7 +9565,7 @@ _EOF_ # Config # - Optimise memory limit - local memory_limit=$(( $RAM_TOTAL / 5 )) + local memory_limit=$(( $RAM_PHYS / 5 )) (( $memory_limit < 200 )) && memory_limit=200 G_CONFIG_INJECT 'SUBSONIC_USER=' 'SUBSONIC_USER=subsonic' /etc/default/subsonic G_CONFIG_INJECT 'SUBSONIC_ARGS=' "SUBSONIC_ARGS='--quiet --pidfile=/run/subsonic.pid --max-memory=$memory_limit --default-music-folder=/mnt/dietpi_userdata/Music --default-podcast-folder=/mnt/dietpi_userdata/Music --default-playlist-folder=/mnt/dietpi_userdata/Music'" /etc/default/subsonic @@ -9584,7 +9677,7 @@ _EOF_ [[ -f '/etc/default/logitechmediaserver' ]] && rm /etc/default/logitechmediaserver # Grant user access to DietPi media files - usermod -aG dietpi squeezeboxserver + G_EXEC usermod -aG dietpi squeezeboxserver # systemd service cat << _EOF_ > /etc/systemd/system/logitechmediaserver.service @@ -9610,6 +9703,9 @@ _EOF_ Banner_Configuration + # Permissions + G_EXEC chown -R www-data:www-data /var/www/wordpress + # Create MariaDB database /boot/dietpi/func/create_mysql_db wordpress wordpress "$GLOBAL_PW" @@ -9672,6 +9768,7 @@ _EOF_ (( ${aSOFTWARE_INSTALL_STATE[28]} == 1 )) && software_id=28 || software_id=120 Banner_Configuration + # Service cat << '_EOF_' > /etc/systemd/system/vncserver.service [Unit] Description=Manage VNC Server (DietPi) @@ -9690,8 +9787,9 @@ ExecStop=/usr/local/bin/vncserver stop [Install] WantedBy=multi-user.target _EOF_ - systemctl daemon-reload - systemctl enable vncserver + G_EXEC systemctl daemon-reload + G_EXEC systemctl enable vncserver + aSTART_SERVICES+=('vncserver') cat << '_EOF_' > /usr/local/bin/vncserver #!/bin/bash @@ -9761,41 +9859,41 @@ esac exit 0 _EOF_ - chmod +x /usr/local/bin/vncserver + G_EXEC chmod +x /usr/local/bin/vncserver # Stretch + TigerVNC: Disable Localhost only by default # shellcheck disable=SC2016 [[ -f '/etc/vnc.conf' ]] && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/vnc.conf local cmd_launch_desktop= - # DESKTOP_LXDE + # LXDE if (( ${aSOFTWARE_INSTALL_STATE[23]} > 0 )); then cmd_launch_desktop='lxsession -s LXDE -e LXDE' - # DESKTOP_MATE + # MATE elif (( ${aSOFTWARE_INSTALL_STATE[24]} > 0 )); then cmd_launch_desktop='mate-session' - # DESKTOP_GNUSTEP + # GNUstep elif (( ${aSOFTWARE_INSTALL_STATE[26]} > 0 )); then cmd_launch_desktop='x-window-manager' - # DESKTOP_XFCE + # Xfce elif (( ${aSOFTWARE_INSTALL_STATE[25]} > 0 )); then cmd_launch_desktop='xfce4-session' - # DESKTOP_LXQT + # LXQt elif (( ${aSOFTWARE_INSTALL_STATE[173]} > 0 )); then cmd_launch_desktop='startlxqt' fi - mkdir -p /root/.vnc + G_EXEC mkdir -p /root/.vnc cat << _EOF_ > /root/.vnc/xstartup #!/bin/dash export SHELL='/bin/bash' @@ -9805,7 +9903,7 @@ xsetroot -solid grey vncconfig -iconic & exec $cmd_launch_desktop _EOF_ - chmod +x /root/.vnc/xstartup + G_EXEC chmod +x /root/.vnc/xstartup # TigerVNC: Set control + read-only passwords (RealVNC uses UNIX user authentication by default, does not support the "-f" option and uses different files!) if command -v tigervncpasswd > /dev/null; then @@ -9814,7 +9912,7 @@ _EOF_ $GLOBAL_PW $GLOBAL_PW _EOF_ - chmod 600 /root/.vnc/passwd + G_EXEC chmod 600 /root/.vnc/passwd fi @@ -9887,7 +9985,7 @@ _EOF_ G_EXEC ln -s /var/log/ubooquity /mnt/dietpi_userdata/ubooquity/logs # Optimise memory limit - local memory_limit=$(( $RAM_TOTAL / 5 )) + local memory_limit=$(( $RAM_PHYS / 5 )) (( $memory_limit < 200 )) && memory_limit=200 # Service @@ -9951,7 +10049,7 @@ spring: url: jdbc:h2:/mnt/dietpi_userdata/komga/database.h2 _EOF_ # Optimise memory limit - local memory_limit=$(( $RAM_TOTAL / 5 )) + local memory_limit=$(( $RAM_PHYS / 5 )) (( $memory_limit < 200 )) && memory_limit=200 # Service @@ -9981,9 +10079,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration - - G_BACKUP_FP /var/www/phpsysinfo/phpsysinfo.ini - dps_index=$software_id Download_Install 'phpsysinfo.ini' /var/www/phpsysinfo/phpsysinfo.ini + [[ -f '/var/www/phpsysinfo/phpsysinfo.ini' ]] || dps_index=$software_id Download_Install 'phpsysinfo.ini' /var/www/phpsysinfo/phpsysinfo.ini fi @@ -10092,17 +10188,15 @@ _EOF_ # Download latest easy-rsa from GitHub G_DIETPI-NOTIFY 2 'Downloading latest easy-rsa for certificate and key generation...' - INSTALL_URL_ADDRESS='https://api.github.com/repos/OpenVPN/easy-rsa/releases/latest' - G_CHECK_URL "$INSTALL_URL_ADDRESS" local fallback_url='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.8/EasyRSA-3.0.8.tgz' - no_check_url=1 Download_Install "$(curl -sf "$INSTALL_URL_ADDRESS" | grep -m1 '"browser_download_url.*EasyRSA-.*\.tgz' | cut -d \" -f 4)" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/OpenVPN/easy-rsa/releases/latest' | mawk -F\" '/"browser_download_url": .*\/EasyRSA-[^"\/]*\.tgz"/{print $4}')" [[ -d '/etc/openvpn/easy-rsa' ]] && rm -R /etc/openvpn/easy-rsa - mv EasyRSA-* /etc/openvpn/easy-rsa + G_EXEC mv EasyRSA-* /etc/openvpn/easy-rsa # Cert and key generation via easy-rsa G_DIETPI-NOTIFY 2 'Generating unique OpenVPN certificates and keys. Please wait...\n' G_EXEC cd /etc/openvpn/easy-rsa - cat << _EOF_ > vars + cat << '_EOF_' > vars set_var EASYRSA_REQ_COUNTRY "UK" set_var EASYRSA_REQ_PROVINCE "DietPi" set_var EASYRSA_REQ_CITY "DietPi" @@ -10120,7 +10214,7 @@ _EOF_ # Server config cp -a pki/{ca.crt,dh.pem,issued/DietPi_OpenVPN_Server.crt,private/DietPi_OpenVPN_Server.key} /etc/openvpn/ G_EXEC cd /etc/openvpn - cat << _EOF_ > server.conf + cat << '_EOF_' > server.conf port 1194 proto udp dev tun @@ -10150,7 +10244,7 @@ verb 3 _EOF_ # Client config - cat << _EOF_ > DietPi_OpenVPN_Client.ovpn + cat << '_EOF_' > DietPi_OpenVPN_Client.ovpn client proto udp dev tun @@ -10178,9 +10272,9 @@ _EOF_ \n$(" >> DietPi_OpenVPN_Client.ovpn # - Copy to userdata - cp DietPi_OpenVPN_Client.ovpn /mnt/dietpi_userdata/ + G_EXEC cp DietPi_OpenVPN_Client.ovpn /mnt/dietpi_userdata/ # - and /boot partition - cp DietPi_OpenVPN_Client.ovpn /boot/ + G_EXEC cp DietPi_OpenVPN_Client.ovpn /boot/ G_EXEC cd /tmp/$G_PROGRAM_NAME break # Always break loop which is only for single wildcard file detection @@ -10194,11 +10288,15 @@ _EOF_ # Web Fowarding (Setup IPtables, must also be run during boot) #iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o "$(mawk 'NR==3' /run/dietpi/.network)" -j MASQUERADE + aSTART_SERVICES+=('openvpn') + fi software_id=172 # WireGuard if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + Banner_Configuration + # Try to enable module, if it fails, a reboot is required local module_active=0 modprobe wireguard 2> /dev/null && module_active=1 @@ -10372,13 +10470,13 @@ If no WireGuard (auto)start is included, but you require it, please do the follo fi - (( $module_active )) || { [[ $DISABLE_REBOOT == 1 ]] && G_WHIP_MSG '[ INFO ] WireGuard install finished\n\nNB: WireGuard has been successfully installed, but a reboot is required, before it can be started.'; } + (( $module_active )) || G_WHIP_MSG '[ INFO ] WireGuard install finished\n\nNB: WireGuard has been successfully installed, but a reboot is required, before it can be started.' unset -v module_active choice_required domain port invalid_text server_ip fi - software_id=60 # WiFi Hostspot + software_id=60 # WiFi Hotspot if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -10388,7 +10486,7 @@ If no WireGuard (auto)start is included, but you require it, please do the follo # DHCPD Config G_BACKUP_FP /etc/dhcp/dhcpd.conf - cat << _EOF_ > /etc/dhcp/dhcpd.conf + cat << '_EOF_' > /etc/dhcp/dhcpd.conf ddns-update-style none; default-lease-time 600; max-lease-time 7200; @@ -10408,7 +10506,7 @@ _EOF_ echo "INTERFACESv4=\"wlan$wifi_index\"" > /etc/default/isc-dhcp-server # Remove all entries below wlan, so we can recreate them - sed -i '/allow-hotplug wlan/q0' /etc/network/interfaces + G_EXEC sed -i '/allow-hotplug wlan/q0' /etc/network/interfaces # Enable up wlan G_CONFIG_INJECT 'allow-hotplug wlan' "allow-hotplug wlan$wifi_index" /etc/network/interfaces @@ -10425,7 +10523,6 @@ wireless-power off # IP tables up iptables-restore < /etc/iptables.ipv4.nat _EOF_ - # Assign static IP for wlan now ip a add 192.168.42.1 dev "wlan$wifi_index" @@ -10446,7 +10543,6 @@ wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP _EOF_ - # Check for RTL8188C* device, use the patched driver with compiled binary: https://github.com/pritambaral/hostapd-rtl871xdrv#why # - Stay with default driver on RPi, where the issue seems to have been resolved differently and "rtl871xdrv" is not supported: https://github.com/MichaIng/DietPi/issues/2531#issuecomment-650810121 (( $WIFIHOTSPOT_RTL8188C_DEVICE && $G_HW_MODEL > 9 && $G_HW_ARCH < 4 || $WIFIHOTSPOT_RTL8188C_PACKAGE )) && G_CONFIG_INJECT 'driver=' 'driver=rtl871xdrv' /etc/hostapd/hostapd.conf @@ -11166,7 +11262,7 @@ _EOF_ # - 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 /mnt/dietpi_userdata/rtorrent + G_EXEC mkdir -p /mnt/dietpi_userdata/rtorrent [[ -f '/mnt/dietpi_userdata/rtorrent/.rtorrent.rc' ]] || cat << _EOF_ > /mnt/dietpi_userdata/rtorrent/.rtorrent.rc ### Miscellaneous settings #system.daemon.set = true @@ -11180,7 +11276,7 @@ schedule2 = session_save, 240, 300, ((session.save)) schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace, 1000M)) system.umask.set = 002 # Max memory mapping size, not max physical RAM usage! -pieces.memory.max.set = ${RAM_TOTAL}M +pieces.memory.max.set = ${RAM_PHYS}M pieces.hash.on_completion.set = no ### Connection settings @@ -11405,7 +11501,12 @@ _EOF_ # Service: https://github.com/pymedusa/Medusa/blob/master/runscripts/init.systemd G_EXEC cp /mnt/dietpi_userdata/medusa/runscripts/init.systemd /etc/systemd/system/medusa.service - G_EXEC sed -i 's/^[[:blank:]]*Group=/#Group=/' /etc/systemd/system/medusa.service + # - Prevent unlimited restarts on failure: Permit up to three restarts in 10 minutes + G_CONFIG_INJECT 'StartLimitIntervalSec=' 'StartLimitIntervalSec=600' /etc/systemd/system/medusa.service '\[Unit\]' + G_CONFIG_INJECT 'StartLimitBurst=' 'StartLimitBurst=3' /etc/systemd/system/medusa.service 'StartLimitIntervalSec=' + # - Remove "Group=medusa" which does not exist, instead fallback to prinmary group "dietpi" + G_EXEC sed -i '/^[[:blank:]]*Group=/d' /etc/systemd/system/medusa.service + # - Launch from our install and data directory G_CONFIG_INJECT 'ExecStart=' "ExecStart=$(command -v python3) /mnt/dietpi_userdata/medusa/start.py -q --nolaunch --datadir=/mnt/dietpi_userdata/medusa" /etc/systemd/system/medusa.service # Permissions @@ -11450,18 +11551,22 @@ _EOF_ export_options+='"' - mkdir -p /etc/chromium.d + G_EXEC mkdir -p /etc/chromium.d echo "$export_options" > /etc/chromium.d/custom_flags # Chromium 60+ - cp /etc/chromium.d/custom_flags /root/.chromium-browser.init + G_EXEC 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 /root/Desktop/chromium.desktop + # Desktop shortcut: chromium-browser.desktop on RPi + if (( $G_HW_MODEL > 9 )) + then + Create_Desktop_Shortcut chromium + else + Create_Desktop_Shortcut chromium-browser + fi # 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 + 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 /root/.chromium-browser.init (and /etc/chromium.d/custom_flags) for additional egl/gl init options @@ -11472,29 +11577,29 @@ _EOF_ # --ash-host-window-bounds="400,300" # Resolution to use for kiosk mode, should ideally match current system resolution -RES_X=\$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) -RES_Y=\$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_Y=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +RES_X=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_X=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +RES_Y=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_RES_Y=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) -CHROMIUM_OPTS="--kiosk --test-type --window-size=\$RES_X,\$RES_Y --start-fullscreen --start-maximized --window-position=0,0" +CHROMIUM_OPTS="--kiosk --test-type --window-size=$RES_X,$RES_Y --start-fullscreen --start-maximized --window-position=0,0" # If you want tablet mode, uncomment the next line. #CHROMIUM_OPTS+=' --force-tablet-mode --tablet-ui' # Add URL for first run: -URL=\$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) -CHROMIUM_OPTS+=" --homepage \$URL" +URL=$(sed -n '/^[[:blank:]]*SOFTWARE_CHROMIUM_AUTOSTART_URL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +CHROMIUM_OPTS+=" --homepage $URL" # Find absolute filepath location of Chromium binary. -FP_CHROMIUM=\$(command -v chromium) -if [[ ! \$FP_CHROMIUM ]]; then +FP_CHROMIUM=$(command -v chromium) +if [[ ! $FP_CHROMIUM ]]; then # Assume RPi - FP_CHROMIUM="\$(command -v chromium-browser)" + FP_CHROMIUM="$(command -v chromium-browser)" fi -xinit \$FP_CHROMIUM \$CHROMIUM_OPTS +xinit $FP_CHROMIUM $CHROMIUM_OPTS _EOF_ - chmod +x /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh + G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh fi @@ -11697,6 +11802,50 @@ _EOF_ fi + software_id=137 # mjpg-streamer + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )) + then + Banner_Configuration + + # User + Create_User -g video -d /opt/mjpg-streamer mjpg-streamer + + # Service + # - On RPi, if the RPi camera module is enabled already, use it by default. + local input='input_uvc.so -d /dev/video0' + [[ $G_HW_MODEL -gt 9 || -f '/etc/modprobe.d/dietpi-disable_rpi_camera.conf' ]] || input='input_raspicam.so' + cat << _EOF_ > /etc/systemd/system/mjpg-streamer.service +[Unit] +Description=mjpg-streamer (DietPi) +Documentation=https://github.com/jacksonliam/mjpg-streamer/tree/master/mjpg-streamer-experimental +Wants=network-online.target +After=network-online.target dietpi-boot.service + +[Service] +User=mjpg-streamer +WorkingDirectory=/opt/mjpg-streamer +ExecStart=/opt/mjpg-streamer/mjpg_streamer -i '$input' -o 'output_http.so -p 8082 -n' + +# Hardening +ProtectSystem=strict +PrivateTmp=true +ProtectHome=true +ProtectKernelTunables=true +ProtectControlGroups=true + +[Install] +WantedBy=multi-user.target +_EOF_ + # OctoPrint: Configure it to use mjpg-streamer, if installed + if [[ ${aSOFTWARE_INSTALL_STATE[153]} == 2 && -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] + then + G_DIETPI-NOTIFY 2 'Configuring OctoPrint to use mjpg-streamer for webcam support' + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(mawk 'NR==4' /run/dietpi/.network):8082/?action=stream" + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" + fi + fi + software_id=138 # VirtualHere if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then @@ -11751,25 +11900,14 @@ _EOF_ G_EXEC mkdir -p /var/log/sabnzbd G_EXEC chown -R sabnzbd:root /{etc,var/log}/sabnzbd - # Create config + # Config # - Touch only if it does not yet exist, assume reinstall otherwise and preserve custom changes # - API keys and initial config are only generated during 1st run # - We need to launch program, then apply our config tweaks, else, wizard setup in web interface simply loops without API keys. if [[ ! -f '/etc/sabnzbd/sabnzbd.ini' ]]; then - G_DIETPI-NOTIFY 2 'Generating initial config, please wait...' - G_EXEC systemctl daemon-reload - G_EXEC systemctl start sabnzbd - until [[ -f '/etc/sabnzbd/sabnzbd.ini' ]] - do - - sleep 0.5 - - done - sleep 2 - - G_EXEC_NOHALT=1 G_EXEC systemctl stop sabnzbd - sleep 2 # Additional wait, config being overwritten after below changes: https://dietpi.com/phpbb/viewtopic.php?p=7082#p7082 + Create_Config /etc/sabnzbd/sabnzbd.ini sabnzbd + sleep 1 # Additional wait, config being overwritten after below changes: https://dietpi.com/phpbb/viewtopic.php?p=7082#p7082 G_CONFIG_INJECT 'download_dir =' 'download_dir = /mnt/dietpi_userdata/downloads/incomplete' /etc/sabnzbd/sabnzbd.ini G_CONFIG_INJECT 'complete_dir =' 'complete_dir = /mnt/dietpi_userdata/downloads/complete' /etc/sabnzbd/sabnzbd.ini @@ -11841,7 +11979,6 @@ ReadWritePaths=/mnt/dietpi_userdata/firefox-sync [Install] WantedBy=multi-user.target _EOF_ - # Permissions G_EXEC chown -R ffsync:ffsync /mnt/dietpi_userdata/firefox-sync @@ -11852,6 +11989,7 @@ _EOF_ Banner_Configuration + # User Create_User -d /mnt/dietpi_userdata/bitwarden_rs bitwarden_rs # Data and config dir @@ -11863,7 +12001,7 @@ _EOF_ G_EXEC cp /opt/bitwarden_rs/.env.template /mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env G_CONFIG_INJECT 'DATA_FOLDER=' 'DATA_FOLDER=/mnt/dietpi_userdata/bitwarden_rs' /mnt/dietpi_userdata/bitwarden_rs/bitwarden_rs.env # Create TLS certificate for web vault: Currently only RSA is supported. Add SAN with local IP and hostname, required for the client to accept the connection. - G_EXEC_OUTPUT=1 G_EXEC openssl req -reqexts SAN -subj '/CN=DietPi Bitwarden_RS' -config <(cat /etc/ssl/openssl.cnf <(echo -ne "[SAN]\nsubjectAltName=DNS:$( /etc/systemd/system/bitwarden_rs.service [Unit] Description=Bitwarden Server (Rust Edition) @@ -11934,7 +12072,6 @@ ExecStart=/mnt/dietpi_userdata/spotify-connect-web/spotify-connect-web [Install] WantedBy=multi-user.target _EOF_ - fi software_id=142 # CouchPotato @@ -12392,7 +12529,7 @@ _EOF_ Description=OctoPrint (DietPi) Documentation=https://dietpi.com/docs/software/printing/#octoprint Wants=network-online.target -After=network-online.target dietpi-boot.service +After=network-online.target dietpi-boot.service mjpg-streamer.service [Service] Environment="LC_ALL=C.UTF-8" "LANG=C.UTF-8" @@ -12410,6 +12547,15 @@ _EOF_ G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.serverRestartCommand 'sudo systemctl restart octoprint' G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemRestartCommand 'sudo reboot' G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemShutdownCommand 'sudo poweroff' + + # mjpg-streamer: Configure OctoPrint to use it, if installed + if (( ${aSOFTWARE_INSTALL_STATE[137]} > 0 )) + then + G_DIETPI-NOTIFY 2 'Configuring OctoPrint to use mjpg-streamer for webcam support' + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(mawk 'NR==4' /run/dietpi/.network):8082/?action=stream" + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' + G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" + fi fi software_id=154 # Roon Server @@ -12444,20 +12590,21 @@ _EOF_ Banner_Configuration # Move data dir to dietpi_userdata - if [[ -d '/mnt/dietpi_userdata/steam' ]]; then - - rm -Rf /root/.steam - - elif [[ -d '/root/.steam' ]]; then + if [[ -d '/mnt/dietpi_userdata/steam' ]] + then + G_EXEC rm -Rf /root/.steam - mv /root/.steam /mnt/dietpi_userdata/steam + elif [[ -d '/root/.steam' ]] + then + G_EXEC mv /root/.steam /mnt/dietpi_userdata/steam else - - mkdir -p /mnt/dietpi_userdata/steam - + G_EXEC mkdir -p /mnt/dietpi_userdata/steam fi - ln -s /mnt/dietpi_userdata/steam /root/.steam + G_EXEC ln -s /mnt/dietpi_userdata/steam /root/.steam + + # Desktop shortcut + Create_Desktop_Shortcut steam fi @@ -12499,13 +12646,15 @@ _EOF_ software_id=140 # Domoticz: https://www.domoticz.com/wiki/Linux if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then + Banner_Configuration + # Data dir - mkdir -p /mnt/dietpi_userdata/domoticz + G_EXEC mkdir -p /mnt/dietpi_userdata/domoticz # Config file if [[ ! -f '/mnt/dietpi_userdata/domoticz/domoticz.conf' ]]; then - cp /opt/domoticz/scripts/domoticz.conf /mnt/dietpi_userdata/domoticz/domoticz.conf + G_EXEC cp /opt/domoticz/scripts/domoticz.conf /mnt/dietpi_userdata/domoticz/domoticz.conf G_CONFIG_INJECT 'http_port=' 'http_port=8124' /mnt/dietpi_userdata/domoticz/domoticz.conf G_CONFIG_INJECT 'ssl_port=' 'ssl_port=8424' /mnt/dietpi_userdata/domoticz/domoticz.conf G_CONFIG_INJECT 'ssl_cert=' 'ssl_cert=/opt/domoticz/server_cert.pem' /mnt/dietpi_userdata/domoticz/domoticz.conf @@ -12523,14 +12672,17 @@ _EOF_ Create_User -G dialout -d /mnt/dietpi_userdata/domoticz domoticz # Permissions - chown -R domoticz:domoticz /opt/domoticz /mnt/dietpi_userdata/domoticz + G_EXEC chown -R domoticz:domoticz /opt/domoticz /mnt/dietpi_userdata/domoticz + + # Copy scripts directory to data dir: https://dietpi.com/phpbb/viewtopic.php?t=8627 + G_EXEC cp -a /opt/domoticz/scripts /mnt/dietpi_userdata/domoticz/ # Service cat << '_EOF_' > /etc/systemd/system/domoticz.service [Unit] Description=Domoticz (DietPi) Wants=network-online.target -After=network-online.target +After=network-online.target dietpi-boot.service [Service] User=domoticz @@ -12542,7 +12694,7 @@ _EOF_ fi - software_id=158 # Minio + software_id=158 # MinIO if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then Banner_Configuration @@ -12551,7 +12703,7 @@ _EOF_ [[ -f '/etc/default/minio' ]] || cat << '_EOF_' > /etc/default/minio # Default file path MINIO_VOLUMES="/mnt/dietpi_userdata/minio-data" -# Use if you want to run Minio on a custom port. +# Use if you want to run MinIO on a custom port. #MINIO_OPTS="--address :9199" # Access key of the server. #MINIO_ACCESS_KEY=Server-Access-Key @@ -12565,17 +12717,17 @@ _EOF_ Banner_Configuration - # Set docker service to 'simple': https://github.com/MichaIng/DietPi/issues/2238#issuecomment-439474766 - mkdir -p /lib/systemd/system/docker.service.d + # Set Docker service to "simple": https://github.com/MichaIng/DietPi/issues/2238#issuecomment-439474766 + G_EXEC mkdir -p /lib/systemd/system/docker.service.d echo -e '[Service]\nType=simple' > /lib/systemd/system/docker.service.d/dietpi-simple.conf # Config: https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file - # - Move docker containers to dietpi_userdata + # - Move Docker containers to dietpi_userdata # - Log to systemd-journald (journalctl) by default with reduced log level: https://github.com/MichaIng/DietPi/issues/2388 # + containerd: https://github.com/docker/docker.github.io/issues/9091 G_CONFIG_INJECT '\[debug\]' '[debug]' /etc/containerd/config.toml GCI_PRESERVE=1 G_CONFIG_INJECT 'level[[:blank:]]*=' ' level = "warn"' /etc/containerd/config.toml '^\[debug\]' - mkdir -p /mnt/dietpi_userdata/docker-data + G_EXEC mkdir -p /mnt/dietpi_userdata/docker-data if [[ -f '/etc/docker/daemon.json' ]]; then GCI_PRESERVE=1 G_CONFIG_INJECT '"data-root":' ' "data-root": "/mnt/dietpi_userdata/docker-data",' /etc/docker/daemon.json '^\{([[:space:]]|$)' @@ -12585,7 +12737,7 @@ _EOF_ else - mkdir -p /etc/docker + G_EXEC mkdir -p /etc/docker echo '{ "data-root": "/mnt/dietpi_userdata/docker-data", "log-driver": "journald", @@ -12610,8 +12762,8 @@ _EOF_ # Check for existing portainer installation if [[ -d '/mnt/dietpi_userdata/docker-data/volumes/portainer_data' ]]; then G_DIETPI-NOTIFY 2 'Portainer detected, container will be dropped before reinstallation.' - G_EXEC docker rm "$(docker ps -a | mawk '/portainer\/portainer-ce/{print $1}')" --force - G_EXEC docker rmi "$(docker images -a | mawk '/portainer\/portainer-ce/{print $3}')" + G_EXEC docker rm "$(docker ps -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $1}')" --force + G_EXEC docker rmi "$(docker images -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $3}')" else # Create data directory G_EXEC docker volume create portainer_data @@ -12915,6 +13067,19 @@ _EOF_ # Permissions G_EXEC chown -R papermc:papermc /{mnt/dietpi_userdata,var/log}/papermc + # Assure 1.5 GiB overall memory (-100 MiB to avoid tiny swap space) is available. + local heap_size='512' + if (( $RAM_TOTAL < 1436 )) + then + G_DIETPI-NOTIFY 2 'Stable PaperMC operation requires at least 1.5 GiB system memory. We will now increase your swap size to satisfy this requirement.' + /boot/dietpi/func/dietpi-set_swapfile $(( 1536 - $RAM_PHYS )) + + # On 2 GiB+ physical RAM devices, apply 1 GiB heap size by default + elif (( $RAM_PHYS > 1848 )) + then + heap_size='1024' + fi + # Service cat << _EOF_ > /etc/systemd/system/papermc.service [Unit] @@ -12925,7 +13090,7 @@ Documentation=https://paper.readthedocs.io/ User=papermc SyslogIdentifier=papermc WorkingDirectory=/mnt/dietpi_userdata/papermc -ExecStart=$(command -v java) -jar /opt/papermc/paperclip.jar --nogui --noconsole +ExecStart=$(command -v java) -Xmx${heap_size}m -jar /opt/papermc/paperclip.jar --nogui --noconsole [Install] WantedBy=multi-user.target @@ -12933,10 +13098,10 @@ _EOF_ # Config if [[ -f '/mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot.jar' && -f '/mnt/dietpi_userdata/papermc/plugins/floodgate-bukkit.jar' ]] then - Create_Config /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml papermc 180 && + Create_Config /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml papermc 1800 1 && G_CONFIG_INJECT 'auth-type:[[:blank:]]' 'auth-type: floodgate' /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml else - Create_Config /mnt/dietpi_userdata/papermc/permissions.yml papermc + Create_Config /mnt/dietpi_userdata/papermc/permissions.yml papermc 1800 1 fi G_CONFIG_INJECT 'enable-rcon=' 'enable-rcon=true' /mnt/dietpi_userdata/papermc/server.properties GCI_PASSWORD=1 G_CONFIG_INJECT 'rcon.password=' "rcon.password=$GLOBAL_PW" /mnt/dietpi_userdata/papermc/server.properties @@ -13158,7 +13323,7 @@ _EOF_ fi - software_id=175 # Xfce4 Power + software_id=175 # Xfce Power Manager if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13171,11 +13336,11 @@ _EOF_ Banner_Uninstalling apt-mark auto upower policykit-1 firefox-esr - G_AGP mate-desktop-environment-core + G_AGP mate-desktop-environment-core mate-media fi - software_id=26 # GNUStep + software_id=26 # GNUstep if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13350,6 +13515,18 @@ _EOF_ fi + software_id=62 # Box86 + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then + Banner_Uninstalling + [[ -f '/usr/local/bin/box86' ]] && rm -v /usr/local/bin/box86 + [[ -f '/etc/binfmt.d/box86.conf' ]] && rm -v /etc/binfmt.d/box86.conf + [[ -f '/usr/lib/i386-linux-gnu/libstdc++.so.6' ]] && rm -v /usr/lib/i386-linux-gnu/libstdc++.so.6 + [[ -f '/usr/lib/i386-linux-gnu/libstdc++.so.5' ]] && rm -v /usr/lib/i386-linux-gnu/libstdc++.so.5 + [[ -f '/usr/lib/i386-linux-gnu/libgcc_s.so.1' ]] && rm -v /usr/lib/i386-linux-gnu/libgcc_s.so.1 + [[ -d '/usr/lib/i386-linux-gnu' ]] && rmdir --ignore-fail-on-non-empty /usr/lib/i386-linux-gnu + fi + software_id=27 # TasmoAdmin if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -13365,7 +13542,7 @@ _EOF_ fi - software_id=83 + software_id=83 # Apache2 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13373,7 +13550,7 @@ _EOF_ fi - software_id=85 + software_id=85 # Nginx if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13381,7 +13558,7 @@ _EOF_ fi - software_id=84 + software_id=84 # Lighttpd if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -13390,7 +13567,7 @@ _EOF_ # Remove certbot renewal hook [[ -f 'etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf' ]] && rm /etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf # Remove hook directory if empty - rmdir --ignore-fail-on-non-empty /etc/systemd/system/certbot.service.d + [[ -d '/etc/systemd/system/certbot.service.d' ]] && rmdir --ignore-fail-on-non-empty /etc/systemd/system/certbot.service.d fi @@ -13547,6 +13724,8 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling + + # Service if [[ -f '/etc/systemd/system/node-red.service' ]]; then systemctl disable --now node-red @@ -13554,14 +13733,23 @@ _EOF_ fi [[ -d '/etc/systemd/system/node-red.service.d' ]] && rm -R /etc/systemd/system/node-red.service.d - npm r -g --unsafe-perm node-red + + # User getent passwd nodered > /dev/null && userdel nodered getent group nodered > /dev/null && groupdel nodered - [[ -f '/etc/sudoers.d/nodered' ]] && rm /etc/sudoers.d/nodered - [[ -d '/mnt/dietpi_userdata/node-red' ]] && rm -R /mnt/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 - rm -Rf /{root,home/*}/.node-red # Pre-v6.25 + + # Configs + [[ -f '/etc/sudoers.d/nodered' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /etc/sudoers.d/nodered + [[ -f '/etc/bashrc.d/dietpi-node-red.sh' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /etc/bashrc.d/dietpi-node-red.sh + + # Data + [[ -d '/mnt/dietpi_userdata/node-red' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /mnt/dietpi_userdata/node-red + G_EXEC_NOEXIT=1 G_EXEC rm -Rf /{root,home/*}/.node-red # Pre-v6.25 + + # Pre-v7.0 + npm r -g --unsafe-perm node-red + [[ -f '/usr/local/bin/node-red' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /usr/local/bin/node-red + [[ -f '/usr/local/bin/node-red-pi' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /usr/local/bin/node-red-pi fi @@ -13634,6 +13822,7 @@ _EOF_ rm -R /etc/systemd/system/blynkserver.service* fi + [[ -d '/etc/systemd/system/blynkserver.service.d' ]] && rm -R /etc/systemd/system/blynkserver.service.d getent passwd blynk > /dev/null && userdel blynk getent group blynk > /dev/null && groupdel blynk # Pre-v6.33 [[ -d '/mnt/dietpi_userdata/blynk' ]] && rm -R /mnt/dietpi_userdata/blynk @@ -13653,6 +13842,7 @@ _EOF_ rm -R /etc/systemd/system/aria2.service* fi + [[ -d '/etc/systemd/system/aria2.service.d' ]] && rm -R /etc/systemd/system/aria2.service.d G_AGP aria2 getent passwd aria2 > /dev/null && userdel aria2 getent group aria2 > /dev/null && groupdel aria2 @@ -13728,6 +13918,20 @@ _EOF_ fi + software_id=137 # mjpg-streamer + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then + Banner_Uninstalling + if [[ -f '/etc/systemd/system/mjpg-streamer.service' ]] + then + systemctl disable --now mjpg-streamer + rm -R /etc/systemd/system/mjpg-streamer.service* + fi + [[ -d '/etc/systemd/system/mjpg-streamer.service.d' ]] && rm -R /etc/systemd/system/mjpg-streamer.service.d + getent passwd mjpg-streamer > /dev/null && userdel mjpg-streamer + [[ -d '/opt/mjpg-streamer' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /opt/mjpg-streamer + fi + software_id=138 # VirtualHere if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then @@ -13804,25 +14008,33 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - rm -R /mnt/dietpi_userdata/spotify-connect-web - rm /etc/systemd/system/spotify-connect-web.service + if [[ -f '/etc/systemd/system/spotify-connect-web.service' ]]; then - fi + systemctl disable --now spotify-connect-web + rm -R /etc/systemd/system/spotify-connect-web.service* - software_id=182 # Unbound - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + fi + [[ -d '/etc/systemd/system/spotify-connect-web.service.d' ]] && rm -R /etc/systemd/system/spotify-connect-web.service.d + [[ -d '/mnt/dietpi_userdata/spotify-connect-web' ]] && rm -R /mnt/dietpi_userdata/spotify-connect-web - Banner_Uninstalling + fi - G_AGP unbound - [[ -d '/etc/unbound' ]] && rm -R /etc/unbound + software_id=182 # Unbound + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then + Banner_Uninstalling - if [[ -f '/etc/pihole/setupVars.conf' ]] && grep -q 'PIHOLE_DNS_1=127.0.0.1#5353' /etc/pihole/setupVars.conf + # Pi-hole: Assure that it does not resolve via Unbound anymore + if [[ -f '/etc/dnsmasq.d/01-pihole.conf' ]] && grep -q '^[[:blank:]]*server=127.0.0.1' /etc/dnsmasq.d/01-pihole.conf then G_WHIP_MSG 'The Pi-hole upstream DNS server has been changed to Quad9 due to Unbound being uninstalled.' - G_CONFIG_INJECT 'PIHOLE_DNS_1=' "PIHOLE_DNS_1=9.9.9.9" /etc/pihole/setupVars.conf + G_CONFIG_INJECT 'server=127.0.0.1' 'server=9.9.9.9' /etc/dnsmasq.d/01-pihole.conf + systemctl -q is-active pihole-FTL && G_EXEC systemctl restart pihole-FTL fi + [[ -f '/etc/pihole/setupVars.conf' ]] && grep -q '^[[:blank:]]*PIHOLE_DNS_1=127.0.0.1' /etc/pihole/setupVars.conf && G_CONFIG_INJECT 'PIHOLE_DNS_1=' 'PIHOLE_DNS_1=9.9.9.9' /etc/pihole/setupVars.conf + G_AGP unbound + [[ -d '/etc/unbound' ]] && rm -R /etc/unbound fi software_id=142 # CouchPotato @@ -14103,22 +14315,19 @@ _EOF_ fi software_id=156 # Steam - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then Banner_Uninstalling G_AGP steam - rm -Rf /{root,home/*}/.steam /mnt/dietpi_userdata/steam - + rm -Rf /{root,home/*}/{.steam{,path,pid},Desktop/steam.desktop} /mnt/dietpi_userdata/steam fi software_id=119 # CAVA - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then Banner_Uninstalling G_AGP cava - rm -Rf /{root,home/*}/.config/cava - rm -f /{root,home/*}/cava.psf - + rm -Rf /{root,home/*}/{.config/cava,cava.psf} fi software_id=118 # Mopidy @@ -14154,7 +14363,6 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - G_AGP minidlna if [[ -f '/etc/systemd/system/minidlna.service' ]]; then systemctl disable --now minidlna @@ -14162,6 +14370,7 @@ _EOF_ fi [[ -d '/etc/systemd/system/minidlna.service.d' ]] && rm -R /etc/systemd/system/minidlna.service.d + G_AGP minidlna getent passwd minidlna > /dev/null && userdel minidlna getent group minidlna > /dev/null && groupdel minidlna [[ -d '/mnt/dietpi_userdata/.MiniDLNA_Cache' ]] && rm -R /mnt/dietpi_userdata/.MiniDLNA_Cache @@ -14172,19 +14381,10 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - if (( $G_HW_MODEL > 9 )) || (( ! $G_RASPBIAN )); then - - G_AGP opentyrian - - else - - G_AGP ibsdl1.2debian libsdl-net1.2 + apt-mark auto libsdl1.2debian libsdl-net1.2 - fi - - rm /usr/share/applications/opentyrian.desktop - rm /root/Desktop/opentyrian.desktop - rm -R /usr/games/opentyrian + rm -f /{usr/share/applications,{root,home/*}/Desktop}/opentyrian.desktop + [[ -d '/usr/games/opentyrian' ]] && rm -R /usr/games/opentyrian fi @@ -14289,7 +14489,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - pihole uninstall + command -v pihole > /dev/null && pihole uninstall # pihole-FTL service+binary if [[ -f '/etc/init.d/pihole-FTL' ]]; then @@ -14427,7 +14627,7 @@ _EOF_ Banner_Uninstalling systemctl start mariadb mysqladmin drop wordpress -f - mysql -e "drop user 'wordpress'@'localhost'" + mysql -e 'drop user wordpress@localhost' rm -R /var/www/wordpress fi @@ -14949,20 +15149,18 @@ _EOF_ fi software_id=116 # Medusa - if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then - + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) + then Banner_Uninstalling - if [[ -f '/etc/systemd/system/medusa.service' ]]; then - + if [[ -f '/etc/systemd/system/medusa.service' ]] + then systemctl disable --now medusa rm -R /etc/systemd/system/medusa.service* - fi [[ -d '/etc/systemd/system/medusa.service.d' ]] && rm -R /etc/systemd/system/medusa.service.d [[ -d '/mnt/dietpi_userdata/medusa' ]] && rm -R /mnt/dietpi_userdata/medusa getent passwd medusa > /dev/null && userdel medusa getent group medusa > /dev/null && groupdel medusa # Pre-v6.33 - fi software_id=107 # rTorrent @@ -14988,6 +15186,7 @@ _EOF_ rm -R /etc/systemd/system/rtorrent.service* fi + [[ -d '/etc/systemd/system/rtorrent.service.d' ]] && rm -R /etc/systemd/system/rtorrent.service.d G_AGP rtorrent getent passwd rtorrent && userdel rtorrent getent group rtorrent && groupdel rtorrent # pre-v6.29 @@ -15007,6 +15206,7 @@ _EOF_ rm -R /etc/systemd/system/amiberry.service* fi + [[ -d '/etc/systemd/system/amiberry.service.d' ]] && rm -R /etc/systemd/system/amiberry.service.d # Files [[ -d '/mnt/dietpi_userdata/amiberry' ]] && rm -R /mnt/dietpi_userdata/amiberry # Autostart index: If currently Amiberry, revert to console login @@ -15014,19 +15214,20 @@ _EOF_ fi + # DXX-Rebirth software_id=112 if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - rm /mnt/dietpi_userdata/dxx-rebirth/* + rm -f /mnt/dietpi_userdata/dxx-rebirth/* rm -R /mnt/dietpi_userdata/dxx-rebirth/descent_1_game rm -R /mnt/dietpi_userdata/dxx-rebirth/descent_2_game # Remove symlinks - rm /root/.d1x-rebirth - rm /root/.d2x-rebirth - rm /root/Desktop/dxx-rebirth.desktop - rm /usr/share/applications/dxx-rebirth.desktop + rm -f /root/.d1x-rebirth + rm -f /root/.d2x-rebirth + rm -f /{root,home/*}/Desktop/dxx-rebirth.desktop + rm -f /usr/share/applications/dxx-rebirth.desktop fi @@ -15077,6 +15278,7 @@ _EOF_ rm -R /etc/systemd/system/domoticz.service* fi + [[ -d '/etc/systemd/system/domoticz.service.d' ]] && rm -R /etc/systemd/system/domoticz.service.d getent passwd domoticz > /dev/null && userdel domoticz getent group domoticz > /dev/null && groupdel domoticz [[ -d '/opt/domoticz' ]] && rm -R /opt/domoticz @@ -15088,13 +15290,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - # Remove systemd unit + # Remove service if [[ -f '/etc/systemd/system/gitea.service' ]]; then systemctl disable --now gitea rm -R /etc/systemd/system/gitea.service* fi + [[ -d '/etc/systemd/system/gitea.service.d' ]] && rm -R /etc/systemd/system/gitea.service.d # Delete data [[ -d '/mnt/dietpi_userdata/gitea' ]] && rm -R /mnt/dietpi_userdata/gitea @@ -15117,6 +15320,7 @@ _EOF_ rm -R /etc/systemd/system/pi-spc.service* fi + [[ -d '/etc/systemd/system/pi-spc.service.d' ]] && rm -R /etc/systemd/system/pi-spc.service.d rm -R /var/lib/dietpi/dietpi-software/installed/pi-spc sed -i '/^[[:blank:]]*dtoverlay=gpio-shutdown/d' /boot/config.txt @@ -15182,7 +15386,7 @@ _EOF_ fi - software_id=158 # Minio + software_id=158 # MinIO if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling @@ -15242,18 +15446,19 @@ _EOF_ # Remove docker, all its unused dependencies and custom repository G_AGP docker-ce docker-ce-cli docker-engine - [[ -f '/etc/apt/sources.list.d/docker.list' ]] && rm /etc/apt/sources.list.d/docker.list + [[ -f '/etc/apt/sources.list.d/docker.list' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /etc/apt/sources.list.d/docker.list + [[ -f '/etc/apt/trusted.gpg.d/dietpi-docker.gpg' ]] && G_EXEC_NOEXIT=1 G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-docker.gpg # Remove service adjustments - [[ -d '/lib/systemd/system/docker.service.d' ]] && rm -R /lib/systemd/system/docker.service.d + [[ -d '/lib/systemd/system/docker.service.d' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /lib/systemd/system/docker.service.d # Delete data files - dietpi - [[ -d '/mnt/dietpi_userdata/docker-data' ]] && rm -R /mnt/dietpi_userdata/docker-data + [[ -d '/mnt/dietpi_userdata/docker-data' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /mnt/dietpi_userdata/docker-data # Remove default unused folder - [[ -d '/var/lib/docker' ]] && rm -R /var/lib/docker + [[ -d '/var/lib/docker' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /var/lib/docker # Remove configuration file - [[ -d '/etc/docker' ]] && rm -R /etc/docker + [[ -d '/etc/docker' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /etc/docker - # Set portainer as not installed + # Set Portainer as not installed aSOFTWARE_INSTALL_STATE[185]=0 fi @@ -15270,21 +15475,32 @@ _EOF_ G_EXEC systemctl restart docker # Remove portainer container, image & volume - G_EXEC docker rm "$(docker ps -a | mawk '/portainer\/portainer-ce/{print $1}')" --force - G_EXEC docker rmi "$(docker images -a | mawk '/portainer\/portainer-ce/{print $3}')" + G_EXEC docker rm "$(docker ps -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $1}')" --force + G_EXEC docker rmi "$(docker images -a | mawk '/portainer\/portainer(-ce)?( |$)/{print $3}')" G_EXEC docker volume rm portainer_data fi fi - software_id=164 + software_id=134 # Docker Compose + if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then + + Banner_Uninstalling + G_EXEC_NOEXIT=1 G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y docker-compose + + fi + + software_id=164 # Nukkit if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then Banner_Uninstalling - # Remove Service file - [[ -f '/etc/systemd/system/nukkit.service' ]] && rm /etc/systemd/system/nukkit.service + if [[ -f '/etc/systemd/system/nukkit.service' ]]; then - # Remove nukkit java file/folder + systemctl disable --now nukkit + rm -R /etc/systemd/system/nukkit.service* + + fi + [[ -d '/etc/systemd/system/nukkit.service.d' ]] && rm -R /etc/systemd/system/nukkit.service.d [[ -e '/usr/local/bin/nukkit' ]] && rm -R /usr/local/bin/nukkit fi @@ -15428,7 +15644,7 @@ _EOF_ Banner_Uninstalling G_AGP jellyfin jellyfin-ffmpeg - rm -f /usr/bin/jellyfin # Symlink created but left on package purge + rm -f /usr/bin/jellyfin # Symlink created but left on package purge: https://github.com/jellyfin/jellyfin/pull/3690 [[ -f '/etc/apt/sources.list.d/dietpi-jellyfin.list' ]] && G_EXEC_NOHALT=1 G_EXEC rm /etc/apt/sources.list.d/dietpi-jellyfin.list [[ -f '/etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg' ]] && G_EXEC_NOHALT=1 G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-jellyfin.gpg [[ -d '/etc/systemd/system/jellyfin.service.d' ]] && G_EXEC_NOHALT=1 G_EXEC rm -R /etc/systemd/system/jellyfin.service.d @@ -15606,6 +15822,7 @@ _EOF_ Banner_Uninstalling G_AGP alsa-utils + [[ -d '/etc/systemd/system/alsa-state.service.d' ]] && G_EXEC_NOEXIT=1 G_EXEC rm -R /etc/systemd/system/alsa-state.service.d fi @@ -15779,6 +15996,7 @@ _EOF_ Banner_Uninstalling pip3 uninstall -y pip G_AGP python3-pip # Pre-v6.32 + [[ -f '/etc/pip.conf' ]] && rm /etc/pip.conf fi @@ -15849,16 +16067,11 @@ _EOF_ # Generate userdata folders Create_UserContent_Folders #------------------------------------------------------------ - # Update & upgrade APT - Banner_Apt_Update + # Update package cache G_AGUP - G_AGUG - # - Full upgrade on first run installs: https://github.com/MichaIng/DietPi/issues/3098 - (( $G_DIETPI_INSTALL_STAGE == 1 )) && G_AGDUG - # Generate dir for dietpi-software installed "non-service" based control scripts - G_EXEC mkdir -p /var/lib/dietpi/dietpi-software/services - G_EXEC chmod -R +x /var/lib/dietpi/dietpi-software/services + # Full package upgrade on first run installs: https://github.com/MichaIng/DietPi/issues/3098 + (( $G_DIETPI_INSTALL_STAGE == 1 )) && G_AGDUG # Disable software installation for automated installs, if user input is required Install_Disable_Requires_UserInput @@ -15887,22 +16100,41 @@ _EOF_ # Apply Uninstall script, if required by e.g. DietPi choice system (( $UNINSTALL_REQUIRED )) && Uninstall_Software - # Apply DietPi configurations and optimizations + # Apply DietPi configurations and optimisations /boot/dietpi/dietpi-services stop - Banner_Configs Install_Apply_Configs - # Apply autostart index - local autostart_current=0 - [[ -f '/boot/dietpi/.dietpi-autostart_index' ]] && autostart_current=$(&1 | tee $fp_log if (( ${PIPESTATUS[0]} )); then @@ -15966,7 +16198,7 @@ _EOF_ fi - rm /root/AUTO_CustomScript.sh + G_EXEC rm /root/AUTO_CustomScript.sh fi @@ -15995,6 +16227,7 @@ _EOF_ AUTOINSTALL_WEBSERVERINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_WEB_SERVER_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) AUTOINSTALL_CUSTOMSCRIPTURL=$(sed -n '/^[[:blank:]]*AUTO_SETUP_CUSTOM_SCRIPT_EXEC=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) AUTOINSTALL_TIMESYNCMODE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + AUTOINSTALL_RESTORE=$(sed -n '/^[[:blank:]]*AUTO_SETUP_BACKUP_RESTORE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) # Else set defaults [[ $AUTOINSTALL_ENABLED ]] || AUTOINSTALL_ENABLED=0 [[ $AUTOINSTALL_AUTOSTARTTARGET ]] || AUTOINSTALL_AUTOSTARTTARGET=0 @@ -16004,6 +16237,7 @@ _EOF_ [[ $AUTOINSTALL_WEBSERVERINDEX ]] || AUTOINSTALL_WEBSERVERINDEX=0 [[ $AUTOINSTALL_CUSTOMSCRIPTURL ]] || AUTOINSTALL_CUSTOMSCRIPTURL=0 [[ $AUTOINSTALL_TIMESYNCMODE ]] || AUTOINSTALL_TIMESYNCMODE=2 + [[ $AUTOINSTALL_RESTORE ]] || AUTOINSTALL_RESTORE=0 } @@ -16020,14 +16254,10 @@ _EOF_ # Find all software entries of AUTO_SETUP_INSTALL_SOFTWARE_ID= in dietpi.txt. Then set to state 1 for installation. while read -r software_id do - # Flag for installation - if [[ ${aSOFTWARE_NAME[$software_id]} ]]; then - - aSOFTWARE_INSTALL_STATE[$software_id]=1 - G_DIETPI-NOTIFY 2 "Automation: ${aSOFTWARE_NAME[$software_id]}. Flagged for installation." - - fi + [[ ${aSOFTWARE_NAME[$software_id]} ]] || continue + aSOFTWARE_INSTALL_STATE[$software_id]=1 + G_DIETPI-NOTIFY 2 "Automation: ${aSOFTWARE_NAME[$software_id]}. Flagged for installation." done <<< "$(grep '^[[:blank:]]*AUTO_SETUP_INSTALL_SOFTWARE_ID=' /boot/dietpi.txt | mawk '{print $1}' | sed 's/[^0-9]*//g')" @@ -16049,124 +16279,114 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// Input_Modes(){ - local input=$* - input=${input#*[[:blank:]]} - # Process software and exit if [[ $1 == 'install' || $1 == 'reinstall' || $1 == 'uninstall' ]]; then G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Automated $1" # Make sure we have at least one entry - if [[ -z $input ]]; then - - G_DIETPI-NOTIFY 1 'Please enter at least one software index ID or choice system INDEX_*_TARGET=-?' - - else - - # Uninstall | Stop services prior - [[ $1 == 'uninstall' && $G_SERVICE_CONTROL != 0 ]] && /boot/dietpi/dietpi-services stop - - # Process inputs - for i in $input - do + [[ $2 ]] || { G_DIETPI-NOTIFY 1 'Please enter at least one software ID to process'; return 1; } - # Check if input software ID exists, install state was defined - if disable_error=1 G_CHECK_VALIDINT "$i" 0 && disable_error=1 G_CHECK_VALIDINT "${aSOFTWARE_INSTALL_STATE[$i]}"; then - - if [[ $1 == 'uninstall' ]]; then + # Process software IDs + local command=$1 + shift + for i in "$@" + do + # Check if input software ID exists, install state was defined + if disable_error=1 G_CHECK_VALIDINT "$i" 0 && disable_error=1 G_CHECK_VALIDINT "${aSOFTWARE_INSTALL_STATE[$i]}"; then - if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )); then + if [[ $command == 'uninstall' ]]; then - aSOFTWARE_INSTALL_STATE[$i]=-1 - G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" + if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )); then - elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != -1 )); then + aSOFTWARE_INSTALL_STATE[$i]=-1 + UNINSTALL_REQUIRED=1 + G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" - G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed" - G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" + elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != -1 )); then - fi + G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed" + G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" - elif [[ $1 == 'reinstall' ]]; then + fi - (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) && continue + elif [[ $command == 'reinstall' ]]; then - if (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then + (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) && continue - G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed" - G_DIETPI-NOTIFY 2 "Use \"dietpi-software install $i\" to install ${aSOFTWARE_NAME[$i]}." - G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" + if (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then - elif (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then + G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed" + G_DIETPI-NOTIFY 2 "Use \"dietpi-software install $i\" to install ${aSOFTWARE_NAME[$i]}." + G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_NAME systems." + elif (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then - elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_NAME systems." - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_NAME." + elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then - elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_NAME." - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}." + elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then - else + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}." - aSOFTWARE_INSTALL_STATE[$i]=1 - GOSTARTINSTALL=1 # Set install start flag - G_DIETPI-NOTIFY 0 "Reinstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" + else - fi + aSOFTWARE_INSTALL_STATE[$i]=1 + GOSTARTINSTALL=1 # Set install start flag + G_DIETPI-NOTIFY 0 "Reinstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" - elif [[ $1 == 'install' ]]; then + fi - (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) && continue + elif [[ $command == 'install' ]]; then - if (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then + (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )) && continue - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_NAME systems." + if (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then - elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_NAME systems." - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_NAME." + elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then - elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_NAME." - G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}." + elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then - elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then + G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}." - aSOFTWARE_INSTALL_STATE[$i]=1 - GOSTARTINSTALL=1 # Set install start flag - G_DIETPI-NOTIFY 0 "Installing ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" + elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then - else + aSOFTWARE_INSTALL_STATE[$i]=1 + GOSTARTINSTALL=1 # Set install start flag + G_DIETPI-NOTIFY 0 "Installing ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" - G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is already installed" - G_DIETPI-NOTIFY 2 "Use \"dietpi-software reinstall $i\" to force rerun of installation and configuration steps for ${aSOFTWARE_NAME[$i]}." - G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" + else - fi + G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is already installed" + G_DIETPI-NOTIFY 2 "Use \"dietpi-software reinstall $i\" to force rerun of installation and configuration steps for ${aSOFTWARE_NAME[$i]}." + G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}" fi fi - done + fi - # Reinstall, prompt for backup - if [[ $1 == 'reinstall' ]]; then + done - (( $GOSTARTINSTALL )) && G_PROMPT_BACKUP + # Reinstall, prompt for backup + if [[ $1 == 'reinstall' ]]; then - # Uninstall | Finish up and clear non-required packages - elif [[ $1 == 'uninstall' ]]; then + (( $GOSTARTINSTALL )) && G_PROMPT_BACKUP - Uninstall_Software - Write_InstallFileList - [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services start + # Uninstall | Finish up and clear non-required packages + elif [[ $1 == 'uninstall' ]]; then - fi + (( $UNINSTALL_REQUIRED )) || return 0 + Uninstall_Software + Write_InstallFileList fi @@ -16212,7 +16432,7 @@ _EOF_ fi # - Online docs - [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] && string+=" | \e[90m$FP_ONLINEDOC_URL${aSOFTWARE_ONLINEDOC_URL[$i]}\e[0m" + [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] && string+=" | \e[90m${aSOFTWARE_ONLINEDOC_URL[$i]}\e[0m" # - Convert string to lowercase echo -e "${string,,}" @@ -16365,7 +16585,7 @@ _EOF_ G_WHIP_SIZE_X_MAX=95 # Assure this is enough to show full software descriptions + scroll bar G_WHIP_BUTTON_CANCEL_TEXT='Back' - G_WHIP_CHECKLIST "Please use the spacebar to select the software you wish to install.\n - Software and usage details: https://dietpi.com/software + G_WHIP_CHECKLIST "Please use the spacebar to select the software you wish to install.\n - Software and usage details: https://dietpi.com/docs/software/ - NB: Pressing 'ESC' or selecting 'Back' will clear all changed selections" # Reset Choices made flag @@ -16374,15 +16594,10 @@ _EOF_ # Check for matching results (selected items) for i in $G_WHIP_RETURNED_VALUE do - # Enable - if disable_error=1 G_CHECK_VALIDINT "$i" && (( ${aSOFTWARE_INSTALL_STATE[$i]} == 0 )); then - - INSTALL_SOFTWARE_CHOICESMADE=1 - aSOFTWARE_INSTALL_STATE[$i]=1 - - fi - + (( ${aSOFTWARE_INSTALL_STATE[$i]} == 0 )) || continue + INSTALL_SOFTWARE_CHOICESMADE=1 + aSOFTWARE_INSTALL_STATE[$i]=1 done #----------------------------------------------------------------------------- @@ -16396,6 +16611,26 @@ _EOF_ fi + # PaperMC: Inform user about long install/startup time and possible swap file usage + if (( ${aSOFTWARE_INSTALL_STATE[181]} == 1 )) + then + local swap_info= + (( $RAM_PHYS < 924 )) && swap_info='\n\nThe server will be started with with minimal required memory usage, but a swap file will be created to assure that no out-of-memory crash can happen. +On servers with less than 1 GiB physical memory, we strongly recommend to move the swap file to an external drive, if your system runs on an SD card, since during normal PaperMC operation this swap space will be heavily used.' + G_WHIP_MSG "PaperMC will be started during install to allow pre-configuring it's default configuration files. Especially on smaller SBCs, like Raspberry Pi Zero, this can take a long time. +We allow it to take up to 30 minutes, it's process can be followed, please be patient.$swap_info" + fi + + # mjpg-streamer: Warn about unprotected stream and inform about additional plugins + (( ${aSOFTWARE_INSTALL_STATE[137]} == 1 )) && G_WHIP_MSG '[ WARN ] The mjpg-streamer camera stream will be accessible unprotected at port 8082 by default. +\nYou can configure a password protection, but this will break embedding the stream into other web interfaces, like OctoPrint. +\nWe hence recommend to not forward port 8082 through your NAT and/or block public access via firewall. +\nIf you require access from outside your local network to a web interface that embeds the camera stream, we recommend to setup a VPN connection for this. +\nRead more about this matter and how to configure mjpg-streamer at our online documentation: https://dietpi.com/docs/software/camera/#mjpg-streamer +\n[ INFO ] mjpg-streamer will not be compiled with all available plugins by default. +\nIf you require other input or output plugins, simply install the required dependencies. Plugins will be compiled automatically if dependencies are met. +\nFor available plugins and their dependencies, watch the info printed during the build and check out the official GitHub repository: https://github.com/jacksonliam/mjpg-streamer' + # Gogs: Requires OpenSSH for ssh-keygen binary: https://github.com/MichaIng/DietPi/issues/442 if (( ${aSOFTWARE_INSTALL_STATE[49]} == 1 && $INDEX_SSHSERVER_TARGET != -2 )); then @@ -16553,7 +16788,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[68]} == 1 )); then G_WHIP_MSG 'Remot3.it requires you to create an online account, and, link it this device. -\nOnce DietPi has completed your software installations, and rebooted, please follow the First Run tutorial link below:\nhttps://dietpi.com/phpbb/viewtopic.php?p=188#p188' +\nOnce DietPi has completed your software installations, and rebooted, please follow the First Run tutorial link below:\nhttps://dietpi.com/docs/software/remote_desktop/#remot3it' fi @@ -16561,8 +16796,14 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[92]} == 1 )); then G_WHIP_MSG 'The DietPi installation of Certbot supports all offered web servers.\n\nOnce the installation has finished, you can setup your free SSL cert with: - - DietPi-LetsEncrypt\n\nThis is a easy to use frontend for Certbot and allows integration into DietPi systems.\n\nMore information:\n - https://dietpi.com/phpbb/viewtopic.php?p=1062#p1062' + - DietPi-LetsEncrypt\n\nThis is a easy to use frontend for Certbot and allows integration into DietPi systems.\n\nMore information:\n - https://dietpi.com/docs/software/system_security/#lets-encrypt' + + fi + # Box86 warning + if (( ${aSOFTWARE_INSTALL_STATE[156]} == 1 && $G_HW_ARCH == 2 )) + then + G_WHIP_MSG 'WARNING: The piece of software you are about to install is meant for the x86 platform.\n\nBox86 will be used to run it on ARM, however there may be performance and compatibility issues.' fi # dietpi-config can be used to install/configure the following software. Ask user. @@ -16570,7 +16811,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[67]} == 1 )); then if G_WHIP_YESNO 'No-IP can be setup and configured by using DietPi-Config. Would you like to complete this now?\n\n - Once finished, exit DietPi-Config to resume setup. -\n - More information:\nhttps://dietpi.com/phpbb/viewtopic.php?p=58#p58'; then +\n - More information:\nhttps://dietpi.com/docs/software/advanced_networking/#no-ip'; then # Write installed states to temp Write_InstallFileList temp @@ -16595,26 +16836,6 @@ _EOF_ fi - # Boot Choices - if (( ${aSOFTWARE_INSTALL_STATE[23]} == 1 || - ${aSOFTWARE_INSTALL_STATE[24]} == 1 || - ${aSOFTWARE_INSTALL_STATE[25]} == 1 || - ${aSOFTWARE_INSTALL_STATE[26]} == 1 || - ${aSOFTWARE_INSTALL_STATE[31]} == 1 || - ${aSOFTWARE_INSTALL_STATE[51]} == 1 || - ${aSOFTWARE_INSTALL_STATE[108]} == 1 || - ${aSOFTWARE_INSTALL_STATE[112]} == 1 || - ${aSOFTWARE_INSTALL_STATE[119]} == 1 || - ${aSOFTWARE_INSTALL_STATE[155]} == 1 || - ${aSOFTWARE_INSTALL_STATE[173]} == 1 )); then - - # Set Boot Order - G_WHIP_YESNO 'Would you like to configure the auto boot options for DietPi? -\nThis will allow you to choose which program loads automatically, after the system has booted up, e.g.: - - Console\n - Desktop\n - Kodi' && /boot/dietpi/dietpi-autostart - - fi - fi } @@ -16819,7 +17040,7 @@ _EOF_ \n- None: Select this option if you do NOT require a method of accessing files and folders on this device, over a network. \n- ProFTPD (Recommended for RPi v1): Allows you to access/share files on this device efficiently with minimal cpu usage. Uses FTP protocol. \n- Samba (Recommended for RPi v2): Allows you to easily access/share files on this device, at the cost of higher cpu usage. -\nMore info: https://dietpi.com/phpbb/viewtopic.php?p=19#p19'; then +\nMore info: https://dietpi.com/docs/dietpi_tools/#quick-selections'; then # Assign target index if [[ $G_WHIP_RETURNED_VALUE == 'None' ]]; then @@ -16932,7 +17153,7 @@ _EOF_ G_WHIP_BUTTON_CANCEL_TEXT='Back' if G_WHIP_MENU 'Choose where to store your user data. User data includes software such as ownCloud data store, BitTorrent downloads etc. -\nMore information on user data in DietPi:\n- https://dietpi.com/phpbb/viewtopic.php?p=2087 +\nMore information on user data in DietPi:\n- https://dietpi.com/docs/dietpi_tools/#quick-selections \n- DietPi-Drive_Manager: Launch DietPi-Drive_Manager to setup external drives, and, move user data to different locations.'; then # DriveMan @@ -17004,7 +17225,7 @@ _EOF_ G_WHIP_DEFAULT_ITEM=$index_webserver_text G_WHIP_BUTTON_CANCEL_TEXT='Back' - if G_WHIP_MENU 'Please select a Webserver preference, more info https://dietpi.com/phpbb/viewtopic.php?p=1549#p1549: + if G_WHIP_MENU 'Please select a Webserver preference, more info https://dietpi.com/docs/software/webserver_stack/#stacks-for-web-development: \n- Apache2: Feature-rich and popular. Recommended for beginners and users who are looking to follow Apache2 based guides. \n- Nginx: Lightweight alternative to Apache2. Nginx claims faster webserver performance compared to Apache2. \n- Lighttpd: Extremely lightweight and is generally considered to offer the \"best\" webserver performance for SBCs. Recommended for users who expect low webserver traffic.'; then @@ -17094,30 +17315,24 @@ _EOF_ Welcome to DietPi: ─────────────────────────────────────────────────────────────── Use PageUp/Down or Arrow Up/Down to scroll this help screen. -Press ESC, or TAB then enter to exit this help screen.\n +Press ESC, or TAB then ENTER to exit this help screen.\n Easy to follow, step by step guides for installing DietPi: -https://dietpi.com/phpbb/viewtopic.php?f=8&t=9\n +https://dietpi.com/docs/getting_started/\n For a list of all installation options and their details: -https://dietpi.com/software\n +https://dietpi.com/docs/dietpi_optimised_software/\n ─────────────────────────────────────────────────────────────── -List of installed software and their URL links for online docs: +List of installed software and their online documentation URLs: ───────────────────────────────────────────────────────────────\n' # Installed software for i in "${!aSOFTWARE_INSTALL_STATE[@]}" do - - if (( ${aSOFTWARE_INSTALL_STATE[i]} > 0 )) && [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]]; then - - string+="\n${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}\n$FP_ONLINEDOC_URL${aSOFTWARE_ONLINEDOC_URL[$i]}\n" - - fi - + [[ ${aSOFTWARE_INSTALL_STATE[i]} -gt 0 && ${aSOFTWARE_ONLINEDOC_URL[$i]} ]] || continue + string+="\n${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}\n${aSOFTWARE_ONLINEDOC_URL[$i]}\n" done G_WHIP_SIZE_X_MAX=70 G_WHIP_MSG "$string" - unset string ;; @@ -17196,7 +17411,6 @@ List of installed software and their URL links for online docs: \nDo you wish to continue with DietPi as a pure minimal image?' || return 0 TARGETMENUID=-1 # Exit menu loop - DISABLE_REBOOT=1 # Skip reboot as no software will be installed GOSTARTINSTALL=1 # Set install start flag # After first run setup has finished, abort install without any selections @@ -17242,29 +17456,20 @@ List of installed software and their URL links for online docs: local output_string='The following software will be REMOVED from your system:' for i in $G_WHIP_RETURNED_VALUE do - output_string+="\n - ${aSOFTWARE_NAME[$i]} (ID=$i): ${aSOFTWARE_DESC[$i]}" UNINSTALL_REQUIRED=1 - done (( $UNINSTALL_REQUIRED )) || return 0 - [[ $G_SERVICE_CONTROL == 0 ]] || output_string+='\n\nNB: Software services will be STOPPED by DietPi during this process. Please inform connected users, before continuing. SSH and VNC is not affected.' - G_WHIP_YESNO "$output_string \nNB: Uninstalling usually PURGES any related userdata and configs. If you only need to repair or update software, please use \"dietpi-software reinstall \" instead. \nDo you wish to continue?" || { UNINSTALL_REQUIRED=0; return 0; } - # Stop services - [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services stop - # Mark for uninstall for i in $G_WHIP_RETURNED_VALUE do - aSOFTWARE_INSTALL_STATE[$i]=-1 - done # Run uninstall @@ -17273,9 +17478,6 @@ List of installed software and their URL links for online docs: # Save install states Write_InstallFileList - # Start services - [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services start - G_WHIP_MSG 'Uninstall completed' fi @@ -17288,46 +17490,9 @@ List of installed software and their URL links for online docs: # Banner Print #///////////////////////////////////////////////////////////////////////////////////// - Banner_Installing(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Installing ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}" - - } - - Banner_Configuration(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Configuring ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}" - - } - - Banner_Uninstalling(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Uninstalling ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}" - - } - - Banner_Apt_Update(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Update & upgrade APT' - - } - - Banner_Reboot(){ - - local delay=3 - G_WHIP_MSG 'DietPi-Software installation is complete, however a reboot is required to finalise the installation.\n\nPlease select "Ok" to continue and reboot the system.' - G_DIETPI-NOTIFY 0 "System rebooting in $delay seconds to finalise DietPi-Software installations. Please wait..." - sleep $delay - - } - - Banner_Configs(){ - - G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Optimise and configure software' - G_DIETPI-NOTIFY 2 "Applying DietPi optimisations and configurations for $G_HW_MODEL_NAME, please wait...\n" - - } - + Banner_Installing(){ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Installing ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"; } + Banner_Configuration(){ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Configuring ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"; } + Banner_Uninstalling(){ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Uninstalling ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"; } Banner_Aborted(){ # 1st run abort @@ -17359,7 +17524,6 @@ List of installed software and their URL links for online docs: if [[ $1 ]]; then Input_Modes "$@" - DISABLE_REBOOT=1 # Skip reboot on automated (re)installs #-------------------------------------------------------------------------------------- # Standard launch @@ -17371,6 +17535,88 @@ List of installed software and their URL links for online docs: # Load all automation vars FirstRun_Automation_Init + # Restore DietPi-Backup + if (( $AUTOINSTALL_RESTORE )); then + + # Reboot only when backup restore succeeded + restore_succeeded=0 + + G_DIETPI-NOTIFY 2 'DietPi-Backup restore selected, scanning and mounting attached drives...' + i=0 + while read -r line + do + # Mount drives to temporary mount points + mkdir -p "/mnt/dietpi-backup$i" && mount "$line" "/mnt/dietpi-backup$i" + ((i++)) + + done < <(lsblk -rnpo NAME,UUID,MOUNTPOINT | mawk '$2 && ! $3 {print $1}') + + G_DIETPI-NOTIFY 2 'Searching all drives for DietPi-Backup instances...' + mapfile -t alist < <(find /mnt -type f -name '.dietpi-backup_stats') + + # Interactive restore + if [[ $AUTOINSTALL_RESTORE == 1 ]]; then + + # Do we have any results? + if [[ ${alist[0]} ]]; then + + # Create List for Whiptail + G_WHIP_MENU_ARRAY=() + for i in "${alist[@]}" + do + last_backup_date=$(sed -n '/ompleted/s/^.*: //p' "$i" | tail -1) # Date of last backup for this backup + backup_directory=${i%/.dietpi-backup_stats} # Backup directory (minus the backup file), that we can use for target backup directory. + G_WHIP_MENU_ARRAY+=("$backup_directory" ": $last_backup_date") + done + + export G_DIETPI_SERVICES_DISABLE=1 + G_WHIP_MENU 'Please select a previous backup to restore:' && /boot/dietpi/dietpi-backup -1 "$G_WHIP_RETURNED_VALUE" && restore_succeeded=1 + unset -v G_DIETPI_SERVICES_DISABLE + + else + + G_WHIP_MSG 'No previous backups were found in /mnt/*. Install will continue like normal.' + + fi + + # Non-interactive restore + elif [[ $AUTOINSTALL_RESTORE == 2 ]]; then + + # Do we have any results? + if [[ ${alist[0]} ]]; then + + # Restore first found backup + export G_DIETPI_SERVICES_DISABLE=1 + /boot/dietpi/dietpi-backup -1 "${alist[0]%/.dietpi-backup_stats}" && restore_succeeded=1 + unset -v G_DIETPI_SERVICES_DISABLE + + else + + G_DIETPI-NOTIFY 1 'DietPi-Backup auto-restore was selected but no backup has been found in /mnt/*. Install will continue like normal.' + + fi + + # Downgrade dietpi.txt option + G_CONFIG_INJECT 'AUTO_SETUP_BACKUP_RESTORE=' 'AUTO_SETUP_BACKUP_RESTORE=1' /boot/dietpi.txt + + fi + + # Remove mounted drives and mount points + findmnt /mnt/dietpi-backup[0-9]* > /dev/null && umount /mnt/dietpi-backup[0-9]* + [[ -d '/mnt/dietpi-backup0' ]] && rmdir /mnt/dietpi-backup[0-9]* + + # Reboot on successful restore + if (( $restore_succeeded )); then + + G_DIETPI-NOTIFY 2 'The system will now reboot into the restored system' + sync # Failsafe + sleep 3 + reboot + + fi + + fi + # Global PW # - Automation, apply as per dietpi.txt if (( $AUTOINSTALL_ENABLED )); then @@ -17439,10 +17685,8 @@ List of installed software and their URL links for online docs: # Start DietPi Menu until (( $TARGETMENUID < 0 )) do - G_TERM_CLEAR Menu_Main - done fi @@ -17465,12 +17709,14 @@ List of installed software and their URL links for online docs: # Start installations for software Run_Installations - # Unmask systemd-logind if set in dietpi.txt / libpam-systemd was installed / Kodi + # Unmask systemd-logind if Kodi is installed, it's set in dietpi.txt or libpam-systemd was installed if [[ $(readlink /etc/systemd/system/systemd-logind.service) == '/dev/null' ]] && - { grep -q '^[[:blank:]]*AUTO_UNMASK_LOGIND=1' /boot/dietpi.txt || dpkg-query -s 'libpam-systemd' &> /dev/null || (( ${aSOFTWARE_INSTALL_STATE[31]} > 0 )); }; then + { [[ ${aSOFTWARE_INSTALL_STATE[31]} == 1 ]] || grep -q '^[[:blank:]]*AUTO_UNMASK_LOGIND=1' /boot/dietpi.txt || dpkg-query -s 'libpam-systemd' &> /dev/null; }; then # dbus is required for systemd-logind to start dpkg-query -s dbus &> /dev/null || G_AGI dbus + G_EXEC systemctl unmask dbus + G_EXEC systemctl start dbus G_EXEC systemctl unmask systemd-logind G_EXEC systemctl start systemd-logind @@ -17482,18 +17728,17 @@ List of installed software and their URL links for online docs: G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Installation completed' - if (( $DISABLE_REBOOT )); then - - # Start services (restart to reload configs of possible running services) - [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services restart - - else - - # Reboot - sync - Banner_Reboot - reboot + # Start services (restart to reload configs of possible running services) + [[ $G_SERVICE_CONTROL == 0 ]] || /boot/dietpi/dietpi-services restart + # Start installed services, not controlled by DietPi-Services + if [[ ${aSTART_SERVICES[0]} ]] + then + G_DIETPI-NOTIFY 2 'Starting installed services, not controlled by DietPi-Services' + for i in "${aSTART_SERVICES[@]}" + do + G_EXEC_NOHALT=1 G_EXEC systemctl start "$i" + done fi fi diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey index 708ad0ae9b..af3dd16b14 100644 --- a/dietpi/dietpi-survey +++ b/dietpi/dietpi-survey @@ -15,7 +15,7 @@ # - Runs after every dietpi-update and dietpi-software install, if user opted in # - Summary can be visited at: https://dietpi.com/survey/ # - Allows the DietPi project to focus development based on popularity - # - Further info: https://dietpi.com/phpbb/viewtopic.php?p=34#p34 + # - Further info: https://dietpi.com/docs/dietpi_tools/#dietpi-survey # # Usage: # - /boot/dietpi/dietpi-survey Interactive menu to opt in or out diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync index 26d1de7f28..a9655fb1c9 100644 --- a/dietpi/dietpi-sync +++ b/dietpi/dietpi-sync @@ -325,7 +325,7 @@ _EOF_ For example: If we want to duplicate (sync) the data on our external USB HDD to another location, we simply select the USB HDD as the source, then, select a target location. The target location can be anything from a networked samba fileserver, or even an FTP server.\n Each sync includes a leading dry run, after which you can check the expected result before deciding if you want to continue with the actual sync.\n -More information:\n - https://dietpi.com/phpbb/viewtopic.php?p=256#p256' +More information:\n - https://dietpi.com/docs/dietpi_tools/#dietpi-sync' ;; diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 78d86930b4..5724c59fe8 100644 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -43,108 +43,102 @@ #///////////////////////////////////////////////////////////////////////////////////// readonly FP_LOG='/var/tmp/dietpi/logs/dietpi-update.log' - CHANGELOG_DOWNLOADED=0 # Prevent redownload of changelog if already done in this session - + # Git repo to update from GITOWNER_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) GITOWNER_TARGET=${GITOWNER_TARGET:-MichaIng} GITBRANCH_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) GITBRANCH_TARGET=${GITBRANCH_TARGET:-master} - COREVERSION_SERVER=0 - SUBVERSION_SERVER=0 - RCVERSION_SERVER=0 - + # Remote version variables + # - Available DietPi version + G_REMOTE_VERSION_CORE= + G_REMOTE_VERSION_SUB= + G_REMOTE_VERSION_RC= + # - Minimum DietPi version to allow update + G_MIN_VERSION_CORE= + G_MIN_VERSION_SUB= + # - Alternative Git branch to automatically migrate to when version is too low + G_OLD_VERSION_BRANCH= + # - Minimum Debian version to allow update + G_MIN_DEBIAN= + # - Alternative Git branch to automatically migrate to when Debian version is too low + G_OLD_DEBIAN_BRANCH= + + # Version info to print to console INFO_CURRENT_VERSION= INFO_SERVER_VERSION= INFO_VERSIONS_UPDATE(){ INFO_CURRENT_VERSION="Current version : v$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC" - INFO_SERVER_VERSION="Latest version : v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER" + INFO_SERVER_VERSION="Latest version : v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC" - if [[ $G_GITBRANCH != "$GITBRANCH_TARGET" || $G_GITOWNER != "$GITOWNER_TARGET" ]]; then + # Show Git repo, when it changed + [[ $G_GITBRANCH != "$GITBRANCH_TARGET" || $G_GITOWNER != "$GITOWNER_TARGET" ]] || return - INFO_CURRENT_VERSION+=" (branch: $G_GITOWNER/$G_GITBRANCH)" - INFO_SERVER_VERSION+=" (branch: $GITOWNER_TARGET/$GITBRANCH_TARGET)" - - fi + INFO_CURRENT_VERSION+=" (branch: $G_GITOWNER/$G_GITBRANCH)" + INFO_SERVER_VERSION+=" (branch: $GITOWNER_TARGET/$GITBRANCH_TARGET)" } - URL_MIRROR_INDEX=0 - aURL_MIRROR_SERVERVERSION=( - - "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/server_version-6" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/server_version-6" - - ) - - aURL_MIRROR_PREPATCH=( - - "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/pre-patch_file" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/pre-patch_file" - - ) - - aURL_MIRROR_ARCHIVE=( - - "https://github.com/$GITOWNER_TARGET/DietPi/archive/$GITBRANCH_TARGET.tar.gz" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/DietPi-$GITBRANCH_TARGET.tar.gz" - - ) - - aURL_MIRROR_CHANGELOG=( - - "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/CHANGELOG.txt" - "https://dietpi.com/downloads/dietpi-update_mirror/$GITBRANCH_TARGET/CHANGELOG.txt" - - ) - Get_Server_Version(){ - local i - for i in "${!aURL_MIRROR_SERVERVERSION[@]}" - do - - G_DIETPI-NOTIFY 2 "Checking mirror: ${aURL_MIRROR_SERVERVERSION[$i]}" - if curl -sSfL "${aURL_MIRROR_SERVERVERSION[$i]}" > server_version; then + local url="https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/version" - # Get server version - COREVERSION_SERVER=$(mawk 'NR==1' server_version) - SUBVERSION_SERVER=$(mawk 'NR==2' server_version) - RCVERSION_SERVER=$(mawk 'NR==3' server_version) + G_DIETPI-NOTIFY 2 "Getting repository version: $url" + if curl -sSfL "$url" -o version; then - # Check if server version contains valid intergers - if disable_error=1 G_CHECK_VALIDINT "$COREVERSION_SERVER" && - disable_error=1 G_CHECK_VALIDINT "$SUBVERSION_SERVER" && - disable_error=1 G_CHECK_VALIDINT "$RCVERSION_SERVER"; then + # Source file + . version - G_DIETPI-NOTIFY 0 "Using update server: ${aURL_MIRROR_SERVERVERSION[$i]}" - URL_MIRROR_INDEX=$i - return 0 + # Check if remote version consists of valid integers + if disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_CORE" && + disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_SUB" && + disable_error=1 G_CHECK_VALIDINT "$G_REMOTE_VERSION_RC"; then - else - - G_DIETPI-NOTIFY 2 "Invalid server version string: ${COREVERSION_SERVER:-NULL}.${SUBVERSION_SERVER:-NULL}.${RCVERSION_SERVER:-NULL}" - - fi + G_DIETPI-NOTIFY 0 'Got valid repository version' + return 0 else - G_DIETPI-NOTIFY 2 "No valid response from: ${aURL_MIRROR_SERVERVERSION[$i]} ($( /boot/dietpi/.install_stage; } + Check_Git_Migration() + { + # Automatically migrate to alternative branch if Debian or DietPi version is too low. + if (( $G_DISTRO < $G_MIN_DEBIAN )) + then + G_DIETPI-NOTIFY 2 "Your Debian version is too low to update to the current branch: $G_DISTRO_NAME ($G_DISTRO)" + G_DIETPI-NOTIFY 2 "We're switching to an alternative branch: $G_OLD_DEBIAN_BRANCH" + GITBRANCH_TARGET=$G_OLD_DEBIAN_BRANCH + Get_Server_Version || return 1 + G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$GITBRANCH_TARGET" /boot/dietpi.txt + + elif (( $G_DIETPI_VERSION_CORE < $G_MIN_VERSION_CORE || ( $G_DIETPI_VERSION_CORE == $G_MIN_VERSION_CORE && $G_DIETPI_VERSION_SUB < $G_MIN_VERSION_SUB ) )) + then + G_DIETPI-NOTIFY 2 "Your DietPi version is too low to update to the current branch: v$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB" + G_DIETPI-NOTIFY 2 "We're switching to an alternative branch: $G_OLD_VERSION_BRANCH" + GITBRANCH_TARGET=$G_OLD_VERSION_BRANCH + Get_Server_Version || return 1 + G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$GITBRANCH_TARGET" /boot/dietpi.txt + fi + } + Check_DietPi_Update(){ # If requested, reduce current subversion by 1 to reapply last update @@ -160,14 +154,14 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss local result=1 # Update available - if (( $G_DIETPI_VERSION_CORE < $COREVERSION_SERVER || - ( $G_DIETPI_VERSION_CORE == $COREVERSION_SERVER && ( $G_DIETPI_VERSION_SUB < $SUBVERSION_SERVER || - ( $G_DIETPI_VERSION_SUB == $SUBVERSION_SERVER && $G_DIETPI_VERSION_RC < $RCVERSION_SERVER ) ) ) )); then + if (( $G_DIETPI_VERSION_CORE < $G_REMOTE_VERSION_CORE || + ( $G_DIETPI_VERSION_CORE == $G_REMOTE_VERSION_CORE && ( $G_DIETPI_VERSION_SUB < $G_REMOTE_VERSION_SUB || + ( $G_DIETPI_VERSION_SUB == $G_REMOTE_VERSION_SUB && $G_DIETPI_VERSION_RC < $G_REMOTE_VERSION_RC ) ) ) )); then result=0 # Write available update version to flag file - echo "$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER" > /run/dietpi/.update_available + echo "$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC" > /run/dietpi/.update_available G_DIETPI-NOTIFY 0 'Update available:' @@ -198,7 +192,7 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss Run_DietPi_Update(){ # RC-only update: Reapply last subversion patches - if (( $G_DIETPI_VERSION_CORE == $COREVERSION_SERVER && $G_DIETPI_VERSION_SUB == $SUBVERSION_SERVER )); then + if (( $G_DIETPI_VERSION_CORE == $G_REMOTE_VERSION_CORE && $G_DIETPI_VERSION_SUB == $G_REMOTE_VERSION_SUB )); then ((G_DIETPI_VERSION_SUB--)) G_DIETPI_VERSION_RC=0 @@ -207,14 +201,29 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss fi G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying pre-patches' - G_EXEC_DESC='Downloading pre-patch file' G_EXEC curl -sSfL "${aURL_MIRROR_PREPATCH[$URL_MIRROR_INDEX]}" -o pre-patch_file - G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patch_file - if ! ./pre-patch_file $G_DIETPI_VERSION_SUB; then - G_DIETPI-NOTIFY 1 "An error occured during pre-patch $?. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." - exit 1 + # DietPi v6 pre-patches, required for DietPi pre-v6.17 systems, which have DietPi-Update restarted before having these pre-patches applied. + if (( $G_DIETPI_VERSION_CORE == 6 )) + then + G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/pre-patch_file" + G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patch_file + if ! ./pre-patch_file $G_DIETPI_VERSION_SUB + then + G_DIETPI-NOTIFY 1 "An error occured during pre-patch $?. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." + exit 1 + fi + # DietPi v6 pre-patches internally apply DietPi v7 pre-patches, hence do not apply then separately. + else + G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/pre-patches" + G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patches + if ! ./pre-patches + then + G_DIETPI-NOTIFY 1 "An error occured during pre-patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." + exit 1 + fi fi + G_DIETPI-NOTIFY 0 'Successfully applied pre-patches' G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Upgrading APT packages' @@ -222,21 +231,16 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss G_AGUG G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Installing new DietPi code' - G_EXEC_DESC='Downloading update archive' G_EXEC curl -sSfL "${aURL_MIRROR_ARCHIVE[$URL_MIRROR_INDEX]}" -o update.tar.gz - - G_EXEC_DESC='Unpacking update archive' G_EXEC tar xf update.tar.gz - rm update.tar.gz + G_EXEC_DESC='Downloading update archive' G_EXEC curl -sSfLO "https://github.com/$GITOWNER_TARGET/DietPi/archive/$GITBRANCH_TARGET.tar.gz" + G_EXEC_DESC='Unpacking update archive' G_EXEC tar xf "$GITBRANCH_TARGET.tar.gz" + rm "$GITBRANCH_TARGET.tar.gz" # Remove files from Git archive that are not to be installed on client - rm DietPi-"$GITBRANCH_TARGET"/dietpi/{pre-patch_file,server_version*} + rm "DietPi-$GITBRANCH_TARGET/dietpi/"{pre-patch_file,server_version-6} - # Remove old code before updating, so we dont need to patch for removals - # - https://github.com/MichaIng/DietPi/issues/905#issuecomment-298241622 - #rm -R /boot/dietpi/{func,misc,dietpi-*} - - G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -Rf DietPi-"$GITBRANCH_TARGET"/dietpi /boot/ - G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -Rf DietPi-"$GITBRANCH_TARGET"/rootfs/. / - G_EXEC_DESC='Setting execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi + G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -Rf "DietPi-$GITBRANCH_TARGET/dietpi" /boot/ + G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -Rf "DietPi-$GITBRANCH_TARGET/rootfs/." / + G_EXEC_DESC='Setting execute permissions for DietPi scripts' G_EXEC chmod -R +x /boot/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi "DietPi-$GITBRANCH_TARGET/.update/patches" # Save version + Git info now for sub scripts to pull from correct branch G_GITOWNER=$GITOWNER_TARGET @@ -251,8 +255,10 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss fi - # Failsafe: Sync changes to disk + # Failsafe: Force sync to disk sync + + # Reload systemd units systemctl daemon-reload G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying incremental patches' @@ -260,21 +266,32 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION" G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION" - if ! /boot/dietpi/patch_file; then + # DietPi v6 incremental patches + if (( $G_DIETPI_VERSION_CORE == 6 )) && ! /boot/dietpi/patch_file; then G_DIETPI-NOTIFY 1 "An error occured during incremental patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." exit 1 fi - G_DIETPI_VERSION_CORE=$COREVERSION_SERVER - G_DIETPI_VERSION_SUB=$SUBVERSION_SERVER - G_DIETPI_VERSION_RC=$RCVERSION_SERVER - G_VERSIONDB_SAVE + # - Remove patch_file + rm /boot/dietpi/patch_file - G_DIETPI-NOTIFY 0 "Incremental patching to v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER completed" + if ! "DietPi-$G_GITBRANCH/.update/patches"; then - # Remove patch_file - rm /boot/dietpi/patch_file + G_DIETPI-NOTIFY 1 "An error occured during incremental patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." + exit 1 + + fi + + # Autoremove possibly obsolete DEB packages and reload systemd units + G_AGA + systemctl daemon-reload + + G_DIETPI_VERSION_CORE=$G_REMOTE_VERSION_CORE + G_DIETPI_VERSION_SUB=$G_REMOTE_VERSION_SUB + G_DIETPI_VERSION_RC=$G_REMOTE_VERSION_RC + G_VERSIONDB_SAVE + G_DIETPI-NOTIFY 0 "Incremental patching to v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC completed" } @@ -283,34 +300,8 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss #///////////////////////////////////////////////////////////////////////////////////// Get_View_Changelog(){ - local i fp_changelog='CHANGELOG.txt' - - (( $CHANGELOG_DOWNLOADED )) || for i in "${!aURL_MIRROR_CHANGELOG[@]}" - do - - G_DIETPI-NOTIFY 2 "Checking mirror: ${aURL_MIRROR_CHANGELOG[$i]}" - if curl -sSfL "${aURL_MIRROR_CHANGELOG[$i]}" > $fp_changelog; then - - CHANGELOG_DOWNLOADED=1 - break - - else - - G_DIETPI-NOTIFY 2 "No response from: ${aURL_MIRROR_CHANGELOG[$i]}" - - fi - - done - - if (( $CHANGELOG_DOWNLOADED )); then - - G_WHIP_VIEWFILE $fp_changelog - - else - - G_WHIP_MSG 'Failed to download the changelog, please try again.' - - fi + [[ -f 'CHANGELOG.txt' ]] || G_EXEC_NOEXIT=1 G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/CHANGELOG.txt" || return 1 + G_WHIP_VIEWFILE CHANGELOG.txt } @@ -323,7 +314,7 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss G_WHIP_MENU_ARRAY=( '' '●─ Update DietPi ' - 'Update' ": Apply update to: v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER" + 'Update' ": Apply update to: v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC" '' '●─ Additional Options ' 'Changelog' ': View recent changelog and patch notes.' 'Backup' ': Create a system backup before updating.' @@ -342,7 +333,7 @@ Please select 'Update' option to apply the update."; then - A potential downside is: We can't possibly accommodate or predict all modification to Linux configurations files by the end user, outside of DietPi programs, during updates.\n Although we test the updates thoroughly, if you have made any custom changes to Linux configuration files outside of the DietPi programs, an update may trigger a potential issue. >--------------------------------------------------------------------------<\n -Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER?" && return 0 +Do you wish to continue and update DietPi to v$G_REMOTE_VERSION_CORE.$G_REMOTE_VERSION_SUB.$G_REMOTE_VERSION_RC?" && return 0 elif [[ $G_WHIP_RETURNED_VALUE == 'Changelog' ]]; then @@ -371,7 +362,7 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Checking for available DietPi update' #---------------------------------------------------------------- # Check for DietPi update and in case store result to /run/dietpi/.update_available for use by DietPi-Banner - if Get_Server_Version && Check_DietPi_Update; then + if Get_Server_Version && Check_Git_Migration && Check_DietPi_Update; then # Exit if check-only input (( $INPUT == 2 )) && exit 0 @@ -421,7 +412,7 @@ Do you wish to continue and update DietPi to v$COREVERSION_SERVER.$SUBVERSION_SE fi #---------------------------------------------------------------- # Desktop run, exit key prompt - pgrep 'lxsession' > /dev/null && read -rp 'Press any key to exit DietPi-Update...' + [[ $DISPLAY ]] && read -rp 'Press any key to exit DietPi-Update...' # Else, check for and in case apply APT updates based on input mode and dietpi.txt choice else diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 173e2f536c..7a125a5b4e 100644 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -13,13 +13,13 @@ # - Checks /run/dietpi/.update_available, /run/dietpi/.apt_updates, /run/dietpi/.network, /run/dietpi/.dietpi_motd and /boot/dietpi/.prep_info # # Usage: + # - dietpi-banner = banner customisation menu # - dietpi-banner 0 = top section + LAN IP # - dietpi-banner 1 = clear terminal + top section + chosen entries + credits - # - dietpi-banner 2 = banner customisation menu #//////////////////////////////////// # Grab input - [[ $1 == [12] ]] && INPUT=$1 || INPUT=0 + [[ $1 == [01] ]] && INPUT=$1 || INPUT=2 # Import DietPi-Globals -------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals @@ -126,15 +126,7 @@ # DietPi update available? if Check_DietPi_Update; then - if [[ $AVAILABLE_UPDATE == '-1' ]]; then - - local text_update_available_date="${aCOLOUR[3]}Image available" - - else - - local text_update_available_date="${aCOLOUR[3]}Update available" - - fi + local text_update_available_date="${aCOLOUR[3]}Update available" # APT update available? elif Check_APT_Updates; then @@ -167,6 +159,7 @@ $GREEN_LINE" [[ -f '/boot/dietpi/.prep_info' ]] && mawk 'NR==1 {sub(/^0$/,"DietPi Core Team");a=$0} NR==2 {print " Image : "a" (pre-image: "$0")"}' /boot/dietpi/.prep_info echo -e " Web : https://dietpi.com | https://twitter.com/DietPi_ + Patreon Legends : Camry2731 Donate : https://dietpi.com/#donate DietPi Hosting : Powered by https://myvirtualserver.com$COLOUR_RESET\n" @@ -212,7 +205,7 @@ $GREEN_LINE" # LAN IP [5] Print_Local_Ip # WAN IP + location info: Move this to /run/dietpi/.network? - (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(curl -sSfLm 2 https://ifconfig.co/json 2>&1 | mawk -F\" '/"ip"/{o=$4}/"country"/{c=$4}/"region_name"/{c=$4"-"c}END{if(c){o=o" "c}if(o){print o;exit}{print}}')" + (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(curl -sSfLm 3 https://ifconfig.co/json 2>&1 | mawk -F\" '/"ip"/{o=$4}/"country"/{c=$4}/"region_name"/{c=$4"-"c}END{if(c){o=o" "c}if(o){print o;exit}{print}}')" # DietPi-NordVPN connection status (( ${aENABLED[13]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[13]} $GREEN_SEPARATOR $(/boot/dietpi/misc/dietpi-nordvpn status 2>&1)" # Freespace (RootFS) @@ -220,28 +213,15 @@ $GREEN_LINE" # Freespace (DietPi userdata) (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" # Weather - (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 2 https://wttr.in/?format=4 2>&1)" + (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 3 https://wttr.in/?format=4 2>&1)" # Custom [[ ${aENABLED[10]} == 1 && -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash $FP_CUSTOM 2>&1)" # MOTD if (( ${aENABLED[12]} == 1 )); then local motd fp_motd='/run/dietpi/.dietpi_motd' - # shellcheck disable=SC2015 - [[ -f $fp_motd ]] && [[ -s $fp_motd || ! -w $fp_motd ]] || curl -sSfLm 2 https://dietpi.com/motd > $fp_motd - if [[ -f $fp_motd ]]; then - - if . $fp_motd &> /dev/null && [[ $motd ]]; then - - echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" - - elif [[ -w $fp_motd ]]; then - - rm $fp_motd - - fi - - fi + [[ -f $fp_motd ]] || curl -sSfLm 3 https://dietpi.com/motd -o $fp_motd + [[ -f $fp_motd ]] && . $fp_motd &> /dev/null && [[ $motd ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" fi echo -e "$GREEN_LINE\n" diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index f559dcbb3c..4a16b874f2 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -64,9 +64,9 @@ # DietPi version and Git branch [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback - [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=6 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=34 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=3 + [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=7 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=2 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch @@ -722,6 +722,7 @@ $grey───────────────────────── G_WHIP_YESNO(){ local result=1 + [[ ${G_WHIP_DEFAULT_ITEM,,} == 'yes' || ${G_WHIP_DEFAULT_ITEM,,} == 'ok' ]] && result=0 if (( $G_INTERACTIVE )); then @@ -864,7 +865,7 @@ $grey───────────────────────── # - $G_ECEC_ARRAY_ACTION[] | Associative array, containing uneven $G_EXEC_ARRAY_TEXT[] values as keys and related commands as values G_EXEC(){ - local exit_code fp_log='/tmp/G_EXEC_LOG' attempt=1 acommand=("$@") + local exit_code fp_log='/tmp/G_EXEC_LOG' attempt=1 acommand=("$@") ecommand=${*//\\/\\\\} # Enter retry loop while : @@ -877,7 +878,7 @@ $grey───────────────────────── if [[ $G_EXEC_OUTPUT == 1 ]]; then # Print $G_EXEC_DESC if given, else raw input command string and show current non-interactive attempt count if $G_EXEC_RETRIES is given - G_DIETPI-NOTIFY 2 "${G_EXEC_DESC:-$*}, please wait...${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" + G_DIETPI-NOTIFY 2 "${G_EXEC_DESC:-$ecommand}, please wait...${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" [[ $G_EXEC_OUTPUT_COL ]] && echo -ne "$G_EXEC_OUTPUT_COL" "${acommand[@]}" 2>&1 | tee $fp_log exit_code=${PIPESTATUS[0]} @@ -886,7 +887,7 @@ $grey───────────────────────── # - Else print animated processing message only else - G_DIETPI-NOTIFY -2 "${G_EXEC_DESC:-$*}${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" + G_DIETPI-NOTIFY -2 "${G_EXEC_DESC:-$ecommand}${G_EXEC_RETRIES:+ ($attempt/$((G_EXEC_RETRIES+1)))}" "${acommand[@]}" &> $fp_log exit_code=$? @@ -898,7 +899,7 @@ $grey───────────────────────── [[ $G_EXEC_NOFAIL == 1 ]] && exit_code=0 ### Success: Print OK and exit retry loop - [[ $exit_code == 0 ]] && { G_DIETPI-NOTIFY 0 "${G_EXEC_DESC:-$*}"; break; } + [[ $exit_code == 0 ]] && { G_DIETPI-NOTIFY 0 "${G_EXEC_DESC:-$ecommand}"; break; } ### Error @@ -906,7 +907,7 @@ $grey───────────────────────── [[ $attempt -le $G_EXEC_RETRIES ]] && { ((attempt++)) && continue; } # Print FAILED, append raw command string if $G_EXEC_DESC is given - G_DIETPI-NOTIFY 1 "${G_EXEC_DESC:+$G_EXEC_DESC\n - Command: }$*" + G_DIETPI-NOTIFY 1 "${G_EXEC_DESC:+$G_EXEC_DESC\n - Command: }$ecommand" # Exit retry loop if $G_EXEC_NOHALT=1 is given [[ $G_EXEC_NOHALT == 1 ]] && break @@ -1018,7 +1019,7 @@ $log_content" || break # Exit error handler menu loop on cancel \nNB: Please only use this solution if you know for sure that it will not cause follow up issues from the originating script. It will e.g. allow you to continue a certain software install, but if you edit the download link, the originating script might expect files which are not present. \nUse this work caution!'; then - G_DIETPI-NOTIFY 2 "Executing alternative command: $G_WHIP_RETURNED_VALUE" + G_DIETPI-NOTIFY 2 "Executing alternative command: ${G_WHIP_RETURNED_VALUE//\\/\\\\}" $G_WHIP_RETURNED_VALUE exit_code=$? G_DIETPI-NOTIFY -1 $exit_code 'Alternative command execution' @@ -1469,7 +1470,7 @@ $log_content" || break # Exit error handler menu loop on cancel # Read CPU temp from file local temp # - 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 + if [[ $G_HW_MODEL == 70 || $G_HW_MODEL == 52 ]]; then [[ -f '/sys/class/thermal/thermal_zone1/temp' ]] && temp=$( 9 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-RPi + + if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then + + # config.txt + G_CONFIG_INJECT 'dtparam=spi=' 'dtparam=spi=on' /boot/config.txt + + # Enable in runtime seems to be possible? + #dtparam spi=on + + elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then + + # config.txt + G_CONFIG_INJECT 'dtparam=spi=' 'dtparam=spi=off' /boot/config.txt + G_EXEC sed -i '/^[[:blank:]]*dtoverlay=spi[0-9]-[0-9]cs/d' /boot/config.txt # Alternative SPI interfaces and chip select lines + + # Disable in runtime seems to be possible? + #dtparam spi=off + + else + + Unknown_Input_Mode + + fi + + } + #///////////////////////////////////////////////////////////////////////////////////// # Bluetooth #///////////////////////////////////////////////////////////////////////////////////// @@ -1067,7 +1100,7 @@ _EOF_ if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )); then systemctl disable --now hciuart 2> /dev/null - # Disable onboard BT via dtoverlay + # Disable onboard Bluetooth via device tree overlay G_CONFIG_INJECT 'dtoverlay=disable-bt' 'dtoverlay=disable-bt' /boot/config.txt # ASUS TB @@ -1084,12 +1117,12 @@ _EOF_ systemctl disable --now bluetooth 2> /dev/null - # Unload and blacklist modules, bluetooth last + # Unload and blacklist kernel modules, bluetooth last > /etc/modprobe.d/dietpi-disable_bluetooth.conf for ((i=$(( ${#aBLUETOOTH_MODULES[@]} - 1 )); i>=0; i--)) do - modprobe -rf "${aBLUETOOTH_MODULES[$i]}" 2> /dev/null + modprobe -r "${aBLUETOOTH_MODULES[$i]}" 2> /dev/null echo "blacklist ${aBLUETOOTH_MODULES[$i]}" >> /etc/modprobe.d/dietpi-disable_bluetooth.conf done @@ -1104,10 +1137,10 @@ _EOF_ elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - # Remove module blacklist - [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && rm /etc/modprobe.d/dietpi-disable_bluetooth.conf + # Remove kernel module blacklist + [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && G_EXEC rm /etc/modprobe.d/dietpi-disable_bluetooth.conf - # Pre-Reqs + # RPi if (( $G_HW_MODEL < 10 )) && (( $G_HW_ONBOARD_WIFI )); then # Login console on ttyAMA0 must be disabled: https://github.com/MichaIng/DietPi/issues/2607#issuecomment-470523194 @@ -1120,7 +1153,7 @@ Do you want to continue and disable the serial login console?' || return 1 fi # Remove dtoverlay - sed -i '/^[[:blank:]]*dtoverlay=disable-bt/d' /boot/config.txt + G_EXEC sed -i '/^[[:blank:]]*dtoverlay=disable-bt/d' /boot/config.txt G_AG_CHECK_INSTALL_PREREQ pi-bluetooth @@ -1128,14 +1161,14 @@ Do you want to continue and disable the serial login console?' || return 1 # ROCK Pi S: https://wiki.radxa.com/RockpiS/Debian#Bluetooth local rockpis - (( $G_HW_MODEL == 73 )) && apt-cache show rtl8723ds-firmware &> /dev/null && rockpis=rtl8723ds-firmware + (( $G_HW_MODEL == 73 )) && apt-cache show rtl8723ds-firmware &> /dev/null && rockpis='rtl8723ds-firmware' # bluez-firmware: BCM203x dongles: https://packages.debian.org/bluez-firmware G_AG_CHECK_INSTALL_PREREQ bluez bluez-firmware $rockpis fi - # Load modules, bluetooth first + # Load kernel modules, bluetooth first for i in "${aBLUETOOTH_MODULES[@]}" do @@ -1143,7 +1176,7 @@ Do you want to continue and disable the serial login console?' || return 1 done - # Failsafe, unblock all Bluetooth adapters + # Failsafe: Unblock all Bluetooth adapters if rfkill is installed command -v rfkill > /dev/null && rfkill unblock bluetooth # Broadcom-based models that need brcm_patchram_plus @@ -1156,7 +1189,7 @@ Do you want to continue and disable the serial login console?' || return 1 G_EXEC systemctl enable --now bluetooth # RPi - (( $G_HW_MODEL > 9 )) || (( ! $G_HW_ONBOARD_WIFI )) || G_EXEC systemctl enable --now hciuart + (( $G_HW_MODEL > 9 )) || (( ! $G_HW_ONBOARD_WIFI )) || G_EXEC systemctl enable hciuart else @@ -1508,10 +1541,6 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 [[ ! -f $FP_UENV ]] || grep -q "console=$INPUT_ADDITIONAL" $FP_UENV && return 0 echo "console=$INPUT_ADDITIONAL,115200n8" >> $FP_UENV - #elif (( $G_HW_MODEL == 70 )); then - - # grep -q "console=$INPUT_ADDITIONAL" $FP_UENV || sed -i "/bootargs=/s/$/ console=$INPUT_ADDITIONAL,115200n8/" $FP_UENV - fi # Enable for all detected Serial/UART devices @@ -1579,10 +1608,6 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 sed -i "/^[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*[[:blank:]]*$/d" $FP_UENV # New style: One variable each line sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" $FP_UENV # Old style: Multiple variables possible each line - #elif (( $G_HW_MODEL == 70 )); then - - # sed -i "s/[[:blank:]]*console=${INPUT_ADDITIONAL}[^\"[:blank:]]*//" $FP_UENV - fi # Disable for all detected Serial/UART devices @@ -1629,6 +1654,8 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 # Disable all sound cards and reset all settings Soundcard_Reset_All(){ + G_DIETPI-NOTIFY 2 'Resetting all sound card settings...' + # All SOUNDCARD_TARGET_CARD=0 SOUNDCARD_TARGET_DEVICE=0 @@ -1636,13 +1663,13 @@ Do you want to continue and DISABLE Bluetooth now?' || return 1 ALSA_EQ_ENABLED=0 # - Remove previous asound.conf - [[ -f '/etc/asound.conf' ]] && rm /etc/asound.conf + [[ -f '/etc/asound.conf' ]] && G_EXEC rm /etc/asound.conf # - Remove stored amixer state - [[ -f '/var/lib/alsa/asound.state' ]] && rm /var/lib/alsa/asound.state + [[ -f '/var/lib/alsa/asound.state' ]] && G_EXEC rm /var/lib/alsa/asound.state # - Reset active amixer state - [[ $INPUT_DEVICE_VALUE == 'none' ]] || alsactl -g init + [[ $INPUT_DEVICE_VALUE != 'none' && -f '/proc/asound/cards' && $( /etc/systemd/system/alsa-state.service.d/dietpi.conf } @@ -2259,6 +2285,10 @@ _EOF_ I2c_Main + elif [[ $INPUT_DEVICE_NAME == 'spi' ]]; then + + SPI_Main + elif [[ $INPUT_DEVICE_NAME == 'lcdpanel' ]]; then Lcd_Panel_Main diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 0f02a2b1f8..e8d97b173f 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -450,7 +450,7 @@ _EOF_ if G_CHECK_URL "$url"; then G_DIETPI-NOTIFY -2 'Channing dietpi.txt for missing entries' - G_EXEC_DESC='Downloading current dietpi.txt' G_EXEC wget "$url" -O dietpi.txt_patch + G_EXEC_DESC='Downloading current dietpi.txt' G_EXEC curl -sSfL "$url" -o dietpi.txt_patch sed -Ei '/^[[:blank:]]*(#|$)/d' dietpi.txt_patch local entry value diff --git a/dietpi/func/dietpi-set_swapfile b/dietpi/func/dietpi-set_swapfile index 26688c9bef..51e5758cfb 100644 --- a/dietpi/func/dietpi-set_swapfile +++ b/dietpi/func/dietpi-set_swapfile @@ -38,14 +38,15 @@ SWAP_SIZE=$(mawk '$2=="file" {printf "%.0f",$3/1024;exit}' /proc/swaps) && disable_error=1 G_CHECK_VALIDINT "$SWAP_SIZE" || SWAP_SIZE=1 fi - # - Path: Store current saved (only absolute paths to exclude zram) and active paths for later use - SWAP_PATH_CURRENT=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=\//{s/^[^=]*=//p;q}' /boot/dietpi.txt) + # - Path: Store dietpi.txt entry (excluding zram-swap) and active swap files for disabling and removal before creating a new swap space + SWAP_PATH=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) read -ra SWAP_FILES_ACTIVE < <(mawk '$2=="file" {print $1}' /proc/swaps) + [[ $SWAP_PATH == '/'* && $SWAP_PATH != '/dev/zram0' ]] && SWAP_FILES_ACTIVE+=("$SWAP_PATH") if [[ $2 == '/'* || $2 == 'zram' || $2 == 'zram0' ]]; then SWAP_PATH=$2 - elif SWAP_PATH=$SWAP_PATH_CURRENT; [[ $SWAP_PATH != '/'* && $SWAP_PATH != 'zram' && $SWAP_PATH != 'zram0' ]]; then + elif [[ $SWAP_PATH != '/'* && $SWAP_PATH != 'zram' && $SWAP_PATH != 'zram0' ]]; then SWAP_PATH=$(mawk '$2=="file" {print $1;exit}' /proc/swaps) && [[ $SWAP_PATH == '/'* || $SWAP_PATH == 'zram' || $SWAP_PATH == 'zram0' ]] || SWAP_PATH='/var/swap' @@ -79,7 +80,7 @@ G_DIETPI-NOTIFY 2 'Disabling and deleting all existing swap files' G_EXEC_NOHALT=1 G_EXEC swapoff -a - rm -fv "$SWAP_PATH_CURRENT" "${SWAP_FILES_ACTIVE[@]}" + rm -fv "${SWAP_FILES_ACTIVE[@]}" sed -i '/[[:blank:]]swap[[:blank:]]/d' /etc/fstab # zram-swap [[ -f '/etc/modules-load.d/dietpi-zram-swap.conf' ]] && rm -v /etc/modules-load.d/dietpi-zram-swap.conf diff --git a/dietpi/patch_file b/dietpi/patch_file index 194ce80679..e10016286f 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -66,8 +66,7 @@ fi - # Whether to schedule a DietPi-Update restart, with or without system reboot - RESTART= + # Whether to schedue a reboot after DietPi-Update REBOOT= # Pre-v6.29: DietPi-RAMdisk removal needs to be done before loading DietPi-Globals, else /boot/dietpi still contains the old code @@ -88,9 +87,6 @@ # Failsafe sync - # DietPi-Update restart required since old version calls DietPi-RAMdisk forcefully and error-handled - RESTART=1 - fi # - Pre-create new DietPi runtime dir for later used scripts, created via /etc/tmpfiles.d/dietpi.conf from next boot on [[ -d '/run/dietpi' ]] || { mkdir -p /run/dietpi; chmod 777 /run/dietpi; } @@ -109,7 +105,6 @@ elif [[ ! -f '/boot/dietpi/.version' ]] || ! grep -q '^G_GITOWNER=' /boot/dietpi/.version; then rm /boot/dietpi/.version - RESTART=1 fi @@ -127,7 +122,7 @@ _EOF_ # Pre-v6.29: Assure that C.UTF-8 locale is available if ! locale -a | grep -qiE '^C.UTF-?8'; then - apt-get -qq install --reinstall locales libc-bin + apt-get -qq install --reinstall libc-bin # libc-bin ships C.UTF-8 as static locale already but let's add it to memory-mapped archive as well localedef --add-to-archive /usr/lib/locale/C.UTF-8 @@ -136,7 +131,7 @@ _EOF_ # Import DietPi-Globals -------------------------------------------------------------- /boot/dietpi/func/dietpi-obtain_hw_model # Always update . /boot/dietpi/func/dietpi-globals - G_PROGRAM_NAME='DietPi-Patch' + readonly G_PROGRAM_NAME='DietPi-Patch' G_INIT # Import DietPi-Globals -------------------------------------------------------------- @@ -144,8 +139,8 @@ _EOF_ # - DietPi-Update includes G_VERSIONDB_SAVE after every subversion patch from v6.27 on. (( $1 )) && G_DIETPI_VERSION_SUB=$1 - # Migrate newly supported SBCs from dev to master branch - if (( $G_DIETPI_VERSION_SUB < 29 )) && [[ -f '/etc/.dietpi_hw_model_identifier' ]]; then + # Pre-v6.29: Migrate newly supported SBCs from dev to master branch + if [[ $G_DIETPI_VERSION_SUB -lt 29 && -f '/etc/.dietpi_hw_model_identifier' ]]; then # NanoPi M4v2 (58) # Pine H64 (45) @@ -159,9 +154,6 @@ _EOF_ fi - # Pre-v6.29: Restart DietPi-Update in any case, to apply single-call patch_file change - (( $G_DIETPI_VERSION_SUB > 28 || $(pgrep -c patch_file) > 1 )) || RESTART=1 - # Pre-v6.20: New $G_DIETPI_INSTALL_STAGE system # - As loaded pre-v6.20 dietpi-update will recreate ".update_stage", we need to rerun dietpi-update. if [[ -f '/boot/dietpi/.update_stage' ]]; then @@ -180,12 +172,10 @@ _EOF_ fi - RESTART=1 - fi - # Restart DietPi-Update if scheduled - if [[ $RESTART == 1 ]]; then + # Restart DietPi-Update when not yet done, to migrate to v7 + if (( $(pgrep -c patch_file) < 2 )); then # Save current version to rerun patch on next launch G_VERSIONDB_SAVE @@ -279,10 +269,10 @@ _EOF_ #------------------------------------------------------------------------------- # locale rework/reset: https://github.com/MichaIng/DietPi/issues/1430#issuecomment-364763302 - [[ -f '/etc/environment' ]] && mv /etc/environment /mnt/dietpi_userdata/environment.bak + [[ -f '/etc/environment' ]] && G_EXEC mv /etc/environment{,.bak} > /etc/environment /boot/dietpi/func/dietpi-set_software locale C.UTF-8 - G_WHIP_MSG '[ INFO ] Locales reset\n\nTo resolve broken locales, they have been reset to "C.UTF-8".\n\nIf you had a different locale configured on this system, please use "dietpi-config" at a later date to re-configure.\n\nIn relation to that, DietPi does not use "/etc/environment" anymore, thus it is cleaned. In case you manually edited it, a backup was created: /mnt/dietpi_userdata/environment.bak' + G_WHIP_MSG '[ INFO ] Locales reset\n\nTo resolve broken locales, they have been reset to "C.UTF-8".\n\nIf you had a different locale configured on this system, please use "dietpi-config" at a later date to re-configure.\n\nIn relation to that, DietPi does not use "/etc/environment" anymore, thus it is cleaned. In case you manually edited it, a backup was created: /etc/environment.bak' #------------------------------------------------------------------------------ # Removed control from DietPi-Services: https://github.com/MichaIng/DietPi/issues/1501 systemctl enable --now dnsmasq 2> /dev/null @@ -324,8 +314,8 @@ _EOF_ systemctl enable dietpi-postboot if [[ -f '/etc/rc.local' ]]; then - G_WHIP_MSG 'DietPi will not use "/etc/rc.local" for its own scripts anymore.\n\nHowever, in case you manually added something, we safe a backup to "/mnt/dietpi_userdata/rc.local.bak", from where you can copy & paste back to the cleaned "/etc/rc.local".\n\nIt will work as before.' - mv /etc/rc.local /mnt/dietpi_userdata/rc.local.bak + G_WHIP_MSG 'DietPi will not use "/etc/rc.local" for its own scripts anymore.\n\nHowever, in case you manually added something, we safe a backup to "/etc/rc.local.bak", from where you can copy & paste back to the cleaned "/etc/rc.local".\n\nIt will work as before.' + G_EXEC mv /etc/rc.local{,.bak} cat << '_EOF_' > /etc/rc.local #!/bin/sh -e # @@ -359,16 +349,16 @@ APT::AutoRemove::SuggestsImportant "false"; _EOF_' #------------------------------------------------------------------------------- # Reinstalls: - # v6.5 Shairport-sync 3.1.7 + # v6.5 Shairport Sync 3.1.7 # RPi Cam # v6.26 Aria2 for .conf addition: https://github.com/MichaIng/DietPi/issues/1575#issuecomment-370248708 # v6.34 Sonarr/Radarr: https://github.com/MichaIng/DietPi/issues/1566#issuecomment-369334473 if (( $G_DIETPI_INSTALL_STAGE == 2 )); then # RPi cam pre-patch - [[ -d '/var/www/dietpicam' ]] && mv /var/www/dietpicam /var/www/rpicam - [[ -d '/mnt/dietpi_userdata/dietpicam' ]] && mv /mnt/dietpi_userdata/dietpicam /mnt/dietpi_userdata/rpicam - [[ -e '/var/www/rpicam/media' ]] && rm /var/www/rpicam/media + [[ -d '/var/www/dietpicam' ]] && G_EXEC mv /var/www/dietpicam /var/www/rpicam + [[ -d '/mnt/dietpi_userdata/dietpicam' ]] && G_EXEC mv /mnt/dietpi_userdata/dietpicam /mnt/dietpi_userdata/rpicam + [[ -e '/var/www/rpicam/media' ]] && G_EXEC rm -R /var/www/rpicam/media echo 59 >> /var/tmp/dietpi/dietpi-update_reinstalls @@ -377,7 +367,7 @@ _EOF_' # Add certificate combining for Lighttpd to Certbot auto renewal: https://github.com/MichaIng/DietPi/pull/1553 if [[ -f '/boot/dietpi/.dietpi-letsencrypt' ]]; then - # Switch Minio to new certbot.service.d/ hook: + # Switch MinIO to new certbot.service.d/ hook: [[ -f '/etc/systemd/system/certbot.service' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[158\]=2' /boot/dietpi/.installed && rm /etc/systemd/system/certbot.service # Overall settings and config renewal, skip DietPi-Services: G_DIETPI_SERVICES_DISABLE=1 /boot/dietpi/dietpi-letsencrypt 1 @@ -489,12 +479,7 @@ _EOF_' [[ -f '/etc/cron.d/make_nas_processes_faster' ]] && rm /etc/cron.d/make_nas_processes_faster #------------------------------------------------------------------------------- # Add Dropbear ecdsa and dss host keys, if missing: https://github.com/MichaIng/DietPi/issues/1670 - if command -v dropbearkey > /dev/null; then - - [[ -f '/etc/dropbear/dropbear_ecdsa_host_key' ]] || dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key - [[ -f '/etc/dropbear/dropbear_dss_host_key' ]] || dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key - - fi + command -v dropbearkey > /dev/null && [[ ! -f '/etc/dropbear/dropbear_ecdsa_host_key' ]] && dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key #------------------------------------------------------------------------------- # Reinstall firmware-misc-nonfree by default (Ralink): https://github.com/MichaIng/DietPi/issues/1675 (( $G_HW_MODEL == 21 )) || dpkg-query -s wpasupplicant &> /dev/null && G_AGI firmware-misc-nonfree @@ -691,11 +676,13 @@ _EOF_' then if [[ ! -d '/mnt/dietpi_userdata/sonarr' && -d '/root/.config/NzbDrone' ]] then + G_EXEC mkdir -p /mnt/dietpi_userdata G_EXEC mv /root/.config/NzbDrone /mnt/dietpi_userdata/sonarr G_WHIP_MSG 'INFO:\n\nSonarr userdata has been moved to the DietPi userdata directory:\n\n - /root/.config/NzbDrone > /mnt/dietpi_userdata/sonarr' fi if [[ ! -d '/mnt/dietpi_userdata/radarr' && -d '/root/.config/Radarr' ]] then + G_EXEC mkdir -p /mnt/dietpi_userdata G_EXEC mv /root/.config/Radarr /mnt/dietpi_userdata/radarr G_WHIP_MSG 'INFO:\n\nRadarr userdata has been moved to the DietPi userdata directory:\n\n - /root/.config/Radarr > /mnt/dietpi_userdata/radarr' fi @@ -746,8 +733,9 @@ _EOF_' # Move Koel from /var/www to /mnt/dietpi_userdata: https://github.com/MichaIng/DietPi/pull/1954 if [[ -d '/var/www/koel' ]]; then + G_EXEC mkdir -p /mnt/dietpi_userdata G_EXEC mv /var/www/koel /mnt/dietpi_userdata/koel - chown -R koel:dietpi /mnt/dietpi_userdata/koel + G_EXEC chown -R koel:dietpi /mnt/dietpi_userdata/koel [[ -f '/etc/systemd/system/koel.service' ]] && sed -i 's|/var/www|/mnt/dietpi_userdata|g' /etc/systemd/system/koel.service G_WHIP_MSG 'INFO:\n\nKoel has been moved to the DietPi userdata directory:\n\n - /var/www/koel > /mnt/dietpi_userdata/koel' @@ -802,13 +790,15 @@ _EOF_' # Encrypt and secure GLOBAL_PW used by DietPi-Software: https://github.com/MichaIng/DietPi/issues/2021 if [[ ! -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then - local pw_dietpi_software=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - # Failsafe, should never occur - [[ $pw_dietpi_software ]] || pw_dietpi_software='dietpi' - - G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /boot/dietpi.txt + G_WHIP_MSG '[ INFO ] For security reasons your global software password will be removed from dietpi.txt and instead ecrypted and saved to: + - /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin +\nDietPi-Software will decrypt and use it as default for software installs. You can change it via: + - dietpi-config > Security Options > Change Passwords' + G_EXEC mkdir -p /var/lib/dietpi/dietpi-software - mkdir -p /var/lib/dietpi/dietpi-software # Should already exist, failsafe + local pw_dietpi_software=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + G_EXEC sed -i '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/c\#AUTO_SETUP_GLOBAL_PASSWORD= # Password has been ecrypted and saved to rootfs' /boot/dietpi.txt + [[ $pw_dietpi_software ]] || pw_dietpi_software='dietpi' # Fallback to default # Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213 local pbkdf2=() @@ -1136,11 +1126,11 @@ We strongly recommend you select "0 : Re-enable IPv6 on kernel level". By doing if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[131\]=2' /boot/dietpi/.installed && [[ -d '/mnt/dietpi_userdata/blynk' && ! -d '/mnt/dietpi_userdata/blynk/data' ]]; then - mv /mnt/dietpi_userdata/blynk /mnt/dietpi_userdata/blynk_bak - mv /etc/blynkserver /mnt/dietpi_userdata/blynk - mv /mnt/dietpi_userdata/blynk/server.jar /mnt/dietpi_userdata/blynk/blynkserver.jar - mv /mnt/dietpi_userdata/blynk_bak/server.properties /mnt/dietpi_userdata/blynk/ - mv /mnt/dietpi_userdata/blynk_bak /mnt/dietpi_userdata/blynk/data + G_EXEC mv /mnt/dietpi_userdata/blynk /mnt/dietpi_userdata/blynk_bak + G_EXEC mv /etc/blynkserver /mnt/dietpi_userdata/blynk + G_EXEC mv /mnt/dietpi_userdata/blynk/server.jar /mnt/dietpi_userdata/blynk/blynkserver.jar + G_EXEC mv /mnt/dietpi_userdata/blynk_bak/server.properties /mnt/dietpi_userdata/blynk/ + G_EXEC mv /mnt/dietpi_userdata/blynk_bak /mnt/dietpi_userdata/blynk/data G_CONFIG_INJECT 'data.folder=' 'data.folder=/mnt/dietpi_userdata/blynk/data' /mnt/dietpi_userdata/blynk/server.properties fi @@ -1281,7 +1271,7 @@ Also have a look at "Sonarr", another alternative TV show manager, available for rm -f /etc/bashrc.d/dietpi-*.sh #------------------------------------------------------------------------------- # Mopidy fix: https://github.com/MichaIng/DietPi/issues/2536 - getent passwd mopidy &> /dev/null && usermod -aG dietpi,audio -d /mnt/dietpi_userdata/mopidy mopidy + getent passwd mopidy > /dev/null && usermod -aG dietpi,audio -d /mnt/dietpi_userdata/mopidy mopidy #------------------------------------------------------------------------------- # Removed dependency on "p7zip-full", use "7zr" (p7zip) instead: https://github.com/MichaIng/DietPi/pull/2559 G_AGI p7zip @@ -1299,9 +1289,10 @@ Do you still want to keep "p7zip-full"?'; then fi #------------------------------------------------------------------------------- # Fix Pi-hole permissions to allow "pihole -up" - if [[ -d '/var/www/html/pihole' ]]; then + if [[ -d '/var/www/html/pihole' && -d '/var/www/html/admin' ]]; then - cd /var/www/html/admin && git reset --hard HEAD + G_EXEC cd /var/www/html/admin + git reset --hard HEAD G_EXEC cd /tmp/$G_PROGRAM_NAME fi @@ -1395,23 +1386,22 @@ Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites- reinstall_indices+=' 107' G_CONFIG_INJECT 'system.umask.set[[:blank:]=]' 'system.umask.set = 002' /root/.rtorrent.rc - mkdir -p /mnt/dietpi_userdata/rtorrent - mv /root/.rtorrent.rc /mnt/dietpi_userdata/rtorrent/ + G_EXEC mkdir -p /mnt/dietpi_userdata/rtorrent + G_EXEC mv /root/.rtorrent.rc /mnt/dietpi_userdata/rtorrent/ fi - if grep -q '^aSOFTWARE_INSTALL_STATE\[45\]=2' /boot/dietpi/.installed && - getent passwd deluge &> /dev/null; then # Only do this once, regardless of re-patches + if grep -q '^aSOFTWARE_INSTALL_STATE\[45\]=2' /boot/dietpi/.installed && getent passwd deluge > /dev/null; then # Only do this once, regardless of re-patches reinstall_indices+=' 45' G_AGP deluge-webui - [[ -e ~deluge ]] && mv ~deluge /mnt/dietpi_userdata/deluge_home_backup - userdel -rf deluge - rm -Rf /{root,home/*}/.config/deluge - mkdir -p /var/log/deluged - [[ -f '/var/log/deluged.log' ]] && mv /var/log/deluged.log /var/log/deluged/daemon.log - [[ -f '/var/log/deluge-web.log' ]] && mv /var/log/deluge-web.log /var/log/deluged/web.log + G_EXEC mkdir -p /var/log/deluged /mnt/dietpi_userdata + [[ -e ~deluge ]] && G_EXEC mv ~deluge /mnt/dietpi_userdata/deluge_home_backup + G_EXEC userdel -rf deluge + G_EXEC rm -Rf /{root,home/*}/.config/deluge + [[ -f '/var/log/deluged.log' ]] && G_EXEC mv /var/log/deluged.log /var/log/deluged/daemon.log + [[ -f '/var/log/deluge-web.log' ]] && G_EXEC mv /var/log/deluge-web.log /var/log/deluged/web.log G_WHIP_MSG '[ INFO ] Deluge rework\n Our Deluge installer has been reworked to match Debian APT package defaults and official documentations. This also resolves an issue when attempting to access "deluge-console". @@ -1553,12 +1543,12 @@ Further info and usage: https://dietpi.com/phpbb/viewtopic.php?t=5828' G_WHIP_MSG "[ INFO ] PHP upgrade\n Your PHP instance will be upgraded to ${PHP_NAME^^}. This enhances security and performance of your web applications and is required to run some of the latest web application versions, e.g. Nextcloud 17, ownCloud 10.3, phpBB 3.3 and others.\n -We will update webserver configurations and backup the whole /etc/php directory to /mnt/dietpi_userdata/php_bak, so you can recover custom settings.\n +We will update webserver configurations and backup the whole /etc/php directory to /etc/php_bak, so you can recover custom settings.\n NB: For any custom PHP-dependent web applications, which you have installed manually (outside of DietPi-Software), you might need to adjust the used socket to: /run/php/$PHP_NAME-fpm.sock NBB: Reinstall manually installed PHP modules via: G_AGI $PHP_NAME-" # Backup config - [[ -d '/etc/php' ]] && G_EXEC cp -a /etc/php /mnt/dietpi_userdata/php_bak + [[ -d '/etc/php' ]] && G_EXEC cp -a /etc/php{,_bak} # Update PHP socket # - Lighttpd @@ -1629,7 +1619,7 @@ NBB: Reinstall manually installed PHP modules via: G_AGI $PHP_NAME-" if [[ -f '/usr/share/applications/dietpi-process_tool.desktop' ]]; then rm /usr/share/applications/dietpi-process_tool.desktop - G_EXEC wget https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/apps/dietpi-services.desktop -O /usr/share/applications/dietpi-services.desktop + G_EXEC curl -sSfL https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/apps/dietpi-services.desktop -o /usr/share/applications/dietpi-services.desktop chmod +x /usr/share/applications/dietpi-services.desktop fi @@ -1685,20 +1675,17 @@ Use "dietpi-config" to adjust these settings to your needs.' fi #------------------------------------------------------------------------------- - # Update x86_64 kernel module settings + # x86_64: Cleanup config files to disable nouveau if (( $G_HW_ARCH == 10 )); then - # Cleanup nouveau disabling rm -f /etc/modprobe.d/*nouveau* - cat << _EOF_ > /etc/modprobe.d/dietpi-disable_nouveau.conf + cat << '_EOF_' > /etc/modprobe.d/dietpi-disable_nouveau.conf blacklist nouveau blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off alias lbm-nouveau off _EOF_ - # Apply usb-storage quirks to disable UAS for unsupported drives (Seagate ST5000LM000-2AN170): https://github.com/MichaIng/DietPi/issues/2905 - echo 'options usb-storage quirks=0bc2:ab30:u' > /etc/modprobe.d/dietpi-usb-storage_quirks.conf # Update initramfs with above changes if command -v update-tirfs > /dev/null; then @@ -1715,7 +1702,7 @@ _EOF_ # RPi Buster: Re-apply firmware Buster-only repo, remove Stretch branch, reinstall raspi-copies-and-fills (on ARMv6/7 models) which is now compatible if (( $G_HW_MODEL < 10 && $G_DISTRO > 4 )); then - echo 'deb https://archive.raspberrypi.org/debian/ buster main ui' > /etc/apt/sources.list.d/raspi.list + echo 'deb https://archive.raspberrypi.org/debian/ buster main' > /etc/apt/sources.list.d/raspi.list G_AGUP (( $G_HW_ARCH == 3 )) || G_AGI raspi-copies-and-fills @@ -1774,13 +1761,7 @@ A backup will be created to "/etc/mympd/mympd.conf.bak_DDMMYYY_N" from where you # RPi: Remove invalid I2C baudrate entries from config.txt. Do no apply any value to preserve current system state (default): https://github.com/MichaIng/DietPi/issues/2966 # RPi: Remove obsolete camera module entry, which is loaded by default since kernel 4.19, instead add a blacklist entry if camera is disabled. # RPi: Further config.txt fixes: https://github.com/MichaIng/DietPi/pull/3000 - if [[ -f '/var/lib/dietpi/postboot.d/sparky_unmute.sh' ]]; then - - alsactl store - systemctl restart alsa-restore - rm /var/lib/dietpi/postboot.d/sparky_unmute.sh - - fi + [[ -f '/var/lib/dietpi/postboot.d/sparky_unmute.sh' ]] && rm /var/lib/dietpi/postboot.d/sparky_unmute.sh [[ -f '/etc/systemd/system/rpi-bcm2835_forced_3.5mm.service' ]] && rm /etc/systemd/system/rpi-bcm2835_forced_3.5mm.service if (( $G_HW_MODEL < 10 )); then @@ -1885,8 +1866,8 @@ Do you want to have the recommended "initial_turbo=20" re-added to your config.t [[ -L '/var/www/index.php' && $(readlink -f '/var/www/index.php') == '/var/www/html/pihole/index.php' ]] && rm /var/www/index.php if command -v a2ensite > /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[83\]=2' /boot/dietpi/.installed; then - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.block_public_admin.conf" -O /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.pihole.conf" -O /etc/apache2/sites-available/dietpi-pihole.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.block_public_admin.conf" -o /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.pihole.conf" -o /etc/apache2/sites-available/dietpi-pihole.conf a2ensite dietpi-pihole if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then @@ -1898,8 +1879,8 @@ Do you want to have the recommended "initial_turbo=20" re-added to your config.t fi if command -v lighttpd-enable-mod > /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[84\]=2' /boot/dietpi/.installed; then - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.block_public_admin.conf" -O /etc/lighttpd/conf-available/99-dietpi-pihole-block_public_admin.conf - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.pihole.conf" -O /etc/lighttpd/conf-available/99-dietpi-pihole.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.block_public_admin.conf" -o /etc/lighttpd/conf-available/99-dietpi-pihole-block_public_admin.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.pihole.conf" -o /etc/lighttpd/conf-available/99-dietpi-pihole.conf lighttpd-enable-mod dietpi-pihole if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then @@ -1913,9 +1894,9 @@ Do you want to have the recommended "initial_turbo=20" re-added to your config.t # Update Nginx default vhost, which is required to assure access restrictions for Pi-hole G_BACKUP_FP /etc/nginx/sites-available/default - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_85/nginx.default" -O /etc/nginx/sites-available/default - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.block_public_admin.conf" -O /etc/nginx/sites-dietpi/dietpi-pihole-block_public_admin.off - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.pihole.conf" -O /etc/nginx/sites-dietpi/dietpi-pihole.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_85/nginx.default" -o /etc/nginx/sites-available/default + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.block_public_admin.conf" -o /etc/nginx/sites-dietpi/dietpi-pihole-block_public_admin.off + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.pihole.conf" -o /etc/nginx/sites-dietpi/dietpi-pihole.conf if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then [[ -f '/var/www/index.html' ]] && mv /var/www/index.html /var/www/index.html.bak @@ -1931,7 +1912,7 @@ Do you want to have the recommended "initial_turbo=20" re-added to your config.t if (( $G_HW_MODEL == 12 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[6\]=2' /boot/dietpi/.installed; then G_BACKUP_FP /etc/X11/xorg.conf - G_EXEC wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_6/xorg_c2.conf" -O /etc/X11/xorg.conf + G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_6/xorg_c2.conf" -o /etc/X11/xorg.conf apt-mark auto xf86-video-mali-odroid # Kodi: Remove PulseAudio, not required by Kodi anymore, but ask user first if grep -q '^aSOFTWARE_INSTALL_STATE\[31\]=2' /boot/dietpi/.installed; then @@ -1989,7 +1970,7 @@ Would you like to switch back to the Nginx authentication method now?' && certbo # If aria2.conf exists on new location, it must have been installed with new code already, thus old file is obsolete. if [[ -f '/mnt/dietpi_userdata/aria2/aria2.conf' ]]; then - rm /var/lib/dietpi/dietpi-software/installed/aria2.conf + G_EXEC rm /var/lib/dietpi/dietpi-software/installed/aria2.conf else @@ -1999,8 +1980,8 @@ Would you like to switch back to the Nginx authentication method now?' && certbo GCI_PRESERVE=1 G_CONFIG_INJECT 'save-session=' "save-session=$fp_input" /var/lib/dietpi/dietpi-software/installed/aria2.conf GCI_PRESERVE=1 G_CONFIG_INJECT 'save-session-interval=' 'save-session-interval=60' /var/lib/dietpi/dietpi-software/installed/aria2.conf # Move aria2.conf to new location - mkdir -p /mnt/dietpi_userdata/aria2 - mv /var/lib/dietpi/dietpi-software/installed/aria2.conf /mnt/dietpi_userdata/aria2/ + G_EXEC mkdir -p /mnt/dietpi_userdata/aria2 + G_EXEC mv /var/lib/dietpi/dietpi-software/installed/aria2.conf /mnt/dietpi_userdata/aria2/ fi @@ -2170,7 +2151,7 @@ _EOF_ rm -fv /boot/dietpi/{.,func/}dietpi-led_control #------------------------------------------------------------------------------- G_DIETPI-NOTIFY 2 'Installing vmtouch as replacement for DietPi-RAMdisk' # https://github.com/MichaIng/DietPi/issues/3288 - G_EXEC wget "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vmtouch_$G_HW_ARCH_NAME.deb" + G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vmtouch_$G_HW_ARCH_NAME.deb" G_AGI "./vmtouch_$G_HW_ARCH_NAME.deb" rm "vmtouch_$G_HW_ARCH_NAME.deb" #------------------------------------------------------------------------------- @@ -2352,7 +2333,7 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" #------------------------------------------------------------------------------- # Make userdata dir world-executable so service users don't need to be in dietpi group to access their data dir: https://github.com/MichaIng/DietPi/pull/3536#issuecomment-628515444 - G_EXEC chmod a+x /mnt/dietpi_userdata + [[ -d '/mnt/dietpi_userdata' ]] && G_EXEC chmod a+x /mnt/dietpi_userdata #------------------------------------------------------------------------------- # Assure /media exists to fulfil FHS, fix htpdate service startup and probably other issues: https://github.com/MichaIng/DietPi/issues/3558 [[ -d '/media' ]] || G_EXEC mkdir /media @@ -2442,18 +2423,6 @@ To reinstall now, run: "dietpi-software reinstall 106 144 145" fi #------------------------------------------------------------------------------- - # https://github.com/jirka-h/haveged/pull/7 https://github.com/MichaIng/DietPi/issues/3689#issuecomment-678322767 - if [[ $G_DISTRO == 5 && $G_HW_ARCH == [23] && $G_HW_MODEL -gt 9 ]] && dpkg-query -s haveged &> /dev/null; then - - G_DIETPI-NOTIFY 2 'Upgrading haveged entropy daemon to fix an issue on ARM:' - G_DIETPI-NOTIFY 2 ' - https://github.com/jirka-h/haveged/pull/7' - G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/libhavege2_$G_HW_ARCH_NAME.deb" - G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/haveged_$G_HW_ARCH_NAME.deb" - G_AGI "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" - G_EXEC_NOHALT=1 G_EXEC rm "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" - - fi - #------------------------------------------------------------------------------- elif (( $G_DIETPI_VERSION_SUB == 32 )); then @@ -2537,6 +2506,7 @@ opcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.sav - /etc/cubrite > /mnt/dietpi_userdata/cuberite \nFor this, it will be reinstalled. A backup is stored at: - /mnt/dietpi_userdata/cuberite_bak' + G_EXEC mkdir -p /mnt/dietpi_userdata G_EXEC mv /etc/cubrite /mnt/dietpi_userdata/cuberite G_EXEC cp -a /mnt/dietpi_userdata/cuberite{,_bak} echo 52 >> /var/tmp/dietpi/dietpi-update_reinstalls @@ -2737,8 +2707,45 @@ _EOF_ G_CONFIG_INJECT 'memory_limit[[:blank:]]*=' 'memory_limit=512M' "$i" done #------------------------------------------------------------------------------- - # Last subversion patch completed - # - Apply reinstalls + + elif (( $G_DIETPI_VERSION_SUB == 34 )); then + + #------------------------------------------------------------------------------- + # Unbound: Merge dietpi-pihole.conf into dietpi.conf + if [[ -f '/etc/unbound/unbound.conf.d/dietpi-pihole.conf' && -f '/etc/unbound/unbound.conf.d/dietpi.conf' ]] + then + G_DIETPI-NOTIFY 2 'Unbound: Merging dietpi-pihole.conf into dietpi.conf' + local interface=$(mawk '/^[ \t]*interface:/{print $2;exit}' /etc/unbound/unbound.conf.d/dietpi-pihole.conf) + local port=$(mawk '/^[ \t]*port:/{print $2;exit}' /etc/unbound/unbound.conf.d/dietpi-pihole.conf) + G_CONFIG_INJECT 'interface:[[:blank:]]' " interface: $interface" /etc/unbound/unbound.conf.d/dietpi.conf + G_CONFIG_INJECT 'port:[[:blank:]]' " port: $port" /etc/unbound/unbound.conf.d/dietpi.conf + G_EXEC rm /etc/unbound/unbound.conf.d/dietpi-pihole.conf + fi + #------------------------------------------------------------------------------- + # ReadyMedia: Fix database rebuild on service start + [[ -f '/etc/systemd/system/minidlna.service' ]] && G_EXEC sed -i '/^ExecStart=/s/ -SR / -S -R /' /etc/systemd/system/minidlna.service + #------------------------------------------------------------------------------- + # https://github.com/jirka-h/haveged/pull/7 https://github.com/MichaIng/DietPi/issues/3689#issuecomment-678322767 + if [[ $G_DISTRO == 5 && $G_HW_ARCH == [23] && $G_HW_MODEL -gt 9 ]] && dpkg-query -s haveged &> /dev/null; then + + G_DIETPI-NOTIFY 2 'Upgrading haveged entropy daemon to fix an issue on ARM:' + G_DIETPI-NOTIFY 2 ' - https://github.com/jirka-h/haveged/pull/7' + G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/libhavege2_$G_HW_ARCH_NAME.deb" + G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/haveged_$G_HW_ARCH_NAME.deb" + G_AGI "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" + G_EXEC_NOHALT=1 G_EXEC rm "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" + + fi + #------------------------------------------------------------------------------- + # Raspberry Pi Microsoft VS Code repo: https://github.com/MichaIng/DietPi/issues/4083 + [[ $G_HW_MODEL -le 9 && -f '/etc/apt/sources.list.d/vscode.list' ]] && { G_WHIP_BUTTON_OK_TEXT='Keep it' G_WHIP_BUTTON_CANCEL_TEXT='Remove it' G_WHIP_YESNO 'The Microsoft Visual Studio Code APT repository has been found on your system. +\nThis repository was added by the "raspberrypi-sys-mods" package from the Raspberry Pi Foundation, to support development around the new Raspberry Pi Pico. +\nIf you do no VS Code development, we suggest to remove this APT repository and its key from your system.' || G_EXEC rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg /etc/apt/preferences.d/3rd_parties.pref; } + #------------------------------------------------------------------------------- + # Remove obsolete directory + [[ -d '/var/lib/dietpi/dietpi-software/services' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /var/lib/dietpi/dietpi-software/services + #------------------------------------------------------------------------------- + # Last subversion patch completed: Apply reinstalls if [[ -f '/var/tmp/dietpi/dietpi-update_reinstalls' ]] then # Coders NB: Assigning to array is not easily possible here since we need to split at newline AND space. @@ -2746,12 +2753,6 @@ _EOF_ (( $G_DIETPI_INSTALL_STAGE == 2 )) && { /boot/dietpi/dietpi-software reinstall $( 34 )) do G_DIETPI-NOTIFY 2 "Patching $G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB to $G_DIETPI_VERSION_CORE.$(( $G_DIETPI_VERSION_SUB + 1 ))" Subversion_Patch || exit 1 diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file index 17aceb02fe..ae3cc600c0 100644 --- a/dietpi/pre-patch_file +++ b/dietpi/pre-patch_file @@ -76,18 +76,9 @@ fi #------------------------------------------------------------------------------- - # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656 # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings if (( $G_DIETPI_VERSION_SUB < 23 )); then - if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 4 | Hardening Debian Sid repo usage to prevent accidental distro upgrades but allow auto-upgrades for WireGuard packages' - echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n -Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard || exit 4 - - fi - grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=10' >> /DietPi/dietpi.txt || exit 5 grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=2' >> /DietPi/dietpi.txt || exit 5 @@ -276,6 +267,23 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin- curl -sSfL https://apt.radxa.com/buster-stable/public.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-radxa.gpg --yes || exit 24 fi #------------------------------------------------------------------------------- + # Pre-patch 25: Run DietPi v7 pre-patches as part of DietPi v6 pre-patches, to assure they run before APT. + echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 25 | Running DietPi v7 pre-patches' + # - Obtain target Git repo + if [[ -f '/DietPi/dietpi.txt' ]] + then + GIT_OWNER=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + GIT_BRANCH=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) + else + GIT_OWNER=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + GIT_BRANCH=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + fi + [[ $GIT_OWNER ]] || GIT_OWNER='MichaIng' + [[ $GIT_BRANCH ]] || GIT_BRANCH='master' + curl -sSfLO "https://raw.githubusercontent.com/$GIT_OWNER/DietPi/$GIT_BRANCH/.update/pre-patches" || exit 26 + chmod +x pre-patches || exit 26 + ./pre-patches || exit 26 + #------------------------------------------------------------------------------- # Finished exit 0 #------------------------------------------------------------------------------- diff --git a/dietpi/server_version b/dietpi/server_version deleted file mode 100644 index c76772f8fe..0000000000 --- a/dietpi/server_version +++ /dev/null @@ -1,2 +0,0 @@ -160 -6 diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index bd1f64ef78..cac48e00cc 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 -34 -3 +35 +0 diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash index 8d54602fab..0bb2a6e6c1 100644 --- a/rootfs/etc/bashrc.d/dietpi.bash +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -41,18 +41,18 @@ alias dietpi-logclear='/boot/dietpi/func/dietpi-logclear' alias dietpi-survey='/boot/dietpi/dietpi-survey' alias dietpi-explorer='/boot/dietpi/dietpi-explorer' - alias dietpi-banner='/boot/dietpi/func/dietpi-banner 2' + alias dietpi-banner='/boot/dietpi/func/dietpi-banner' alias dietpi-justboom='/boot/dietpi/misc/dietpi-justboom' alias dietpi-led_control='/boot/dietpi/dietpi-led_control' alias dietpi-wifidb='/boot/dietpi/func/dietpi-wifidb' alias dietpi-optimal_mtu='/boot/dietpi/func/dietpi-optimal_mtu' alias dietpi-cloudshell='/boot/dietpi/dietpi-cloudshell' + alias dietpi-nordvpn='/boot/dietpi/misc/dietpi-nordvpn' alias cpu='/boot/dietpi/dietpi-cpuinfo' # - Optional DietPi software aliases - [[ -f '/etc/systemd/system/dietpi-nordvpn.service' ]] && alias dietpi-nordvpn='/boot/dietpi/misc/dietpi-nordvpn' [[ -d '/mnt/dietpi_userdata/sonarr' || -d '/mnt/dietpi_userdata/radarr' || -d '/mnt/dietpi_userdata/lidarr' ]] && alias dietpi-arr_to_RAM='/boot/dietpi/misc/dietpi-arr_to_RAM' command -v kodi > /dev/null && alias startkodi='/boot/dietpi/misc/start_kodi' - [[ -f '/usr/local/games/opentyrian/run' ]] && alias opentyrian='/usr/local/games/opentyrian/run' + [[ -f '/usr/games/opentyrian/run' ]] && alias opentyrian='/usr/games/opentyrian/run' [[ -f '/mnt/dietpi_userdata/dxx-rebirth/run.sh' ]] && alias dxx-rebirth='/mnt/dietpi_userdata/dxx-rebirth/run.sh' # - 1337 moments ;) alias 1337='echo Indeed, you are =\)' diff --git a/rootfs/etc/cron.daily/dietpi b/rootfs/etc/cron.daily/dietpi index 5ab033ed16..1196b44ce1 100644 --- a/rootfs/etc/cron.daily/dietpi +++ b/rootfs/etc/cron.daily/dietpi @@ -38,7 +38,8 @@ # Refresh DietPi MOTD if [[ -f '/boot/dietpi/.dietpi-banner' ]] && grep -q '^[[:blank:]]*aENABLED\[12\]=1' /boot/dietpi/.dietpi-banner then - curl -sSfL https://dietpi.com/motd > /run/dietpi/.dietpi_motd + [[ -f '/run/dietpi/.dietpi_motd' ]] && rm /run/dietpi/.dietpi_motd + curl -sSfL https://dietpi.com/motd -o /run/dietpi/.dietpi_motd fi #---------------------------------------------------------------- # DietPi-Sync daily diff --git a/rootfs/etc/systemd/system/dietpi-boot.service b/rootfs/etc/systemd/system/dietpi-boot.service index e4d6982a83..30138dde98 100644 --- a/rootfs/etc/systemd/system/dietpi-boot.service +++ b/rootfs/etc/systemd/system/dietpi-boot.service @@ -2,7 +2,7 @@ Description=DietPi-Boot # Order 3 Requisite=dietpi-preboot.service -After=dietpi-preboot.service network.target +After=dietpi-preboot.service network-pre.target Before=getty-pre.target getty@tty1.service getty.target ssh.service dropbear.service [Service] diff --git a/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf b/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf new file mode 100644 index 0000000000..f168af15b5 --- /dev/null +++ b/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf @@ -0,0 +1,4 @@ +# Override service type to give network(-online).target more meaning and remove obsolete ifquery call: https://github.com/MichaIng/DietPi/issues/4121#issuecomment-782057374 +[Service] +Type=oneshot +ExecStart=ifup --allow=hotplug %I diff --git a/rootfs/etc/udev/rules.d/10-wifi-disable-powermanagement.rules b/rootfs/etc/udev/rules.d/10-wifi-disable-powermanagement.rules deleted file mode 100644 index bb9e43bb49..0000000000 --- a/rootfs/etc/udev/rules.d/10-wifi-disable-powermanagement.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEM=="net", KERNEL=="wlan*", ACTION=="add", RUN+="/sbin/iwconfig %k power off"