From 92b93ed69967297cc5607f0d59d2c1f666d6a83e Mon Sep 17 00:00:00 2001 From: nachoparker Date: Tue, 9 Nov 2021 10:54:18 -0700 Subject: [PATCH] update to Debian 11 Bullseye Signed-off-by: nachoparker --- bin/ncp-dist-upgrade | 11 ++++++++--- bin/ncp/CONFIG/nc-datadir.sh | 1 - bin/ncp/CONFIG/nc-init.sh | 6 +++--- bin/ncp/CONFIG/nc-limits.sh | 2 -- bin/ncp/CONFIG/nc-nextcloud.sh | 9 ++++++--- bin/ncp/NETWORKING/nc-static-IP.sh | 2 -- bin/ncp/UPDATES/nc-autoupdate-nc.sh | 1 - bin/ncp/UPDATES/nc-update-nextcloud.sh | 1 - bin/ncp/UPDATES/unattended-upgrades.sh | 2 -- etc/ncp.cfg | 4 ++-- lamp.sh | 2 -- post-inst.sh | 1 - 12 files changed, 19 insertions(+), 23 deletions(-) diff --git a/bin/ncp-dist-upgrade b/bin/ncp-dist-upgrade index 9a5e7efec..629d567e3 100755 --- a/bin/ncp-dist-upgrade +++ b/bin/ncp-dist-upgrade @@ -42,12 +42,15 @@ apt-get purge -y php${PHPVER} php${PHPVER}-curl php${PHPVER}-gd php${PHPVER}-fpm apt-get purge -y php${PHPVER}-mysql apt-get purge -y php${PHPVER}-redis apt-get purge -y php${PHPVER}-exif +apt-get purge -y php${PHPVER}-bcmath +apt-get purge -y php${PHPVER}-gmp apt-get purge -y php${PHPVER}-imagick set -e # update sources -sed -i 's/stretch/buster/g' /etc/apt/sources.list -sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/* +sed -i 's/buster/bullseye/g' /etc/apt/sources.list +sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/* || true +sed -i 's/bullseye\/updates/bullseye-security/g' /etc/apt/sources.list rm -f /etc/apt/sources.list.d/php.list # install latest distro @@ -65,8 +68,10 @@ $APTINSTALL -t ${release_new} php${php_ver_new} php${php_ver_new}-curl php${php_ $APTINSTALL php${php_ver_new}-mysql $APTINSTALL -t ${release_new} php${php_ver_new}-redis -$APTINSTALL -t ${release_new} php-smbclient exfat-fuse exfat-utils +$APTINSTALL -t ${release_new} smbclient exfat-fuse exfat-utils $APTINSTALL -t ${release_new} php${php_ver_new}-exif +$APTINSTALL -t ${release_new} php${php_ver_new}-bcmath +$APTINSTALL -t ${release_new} php${php_ver_new}-gmp #$APTINSTALL -t ${release_new} imagemagick php${php_ver_new}-imagick ghostscript apt-get autoremove -y diff --git a/bin/ncp/CONFIG/nc-datadir.sh b/bin/ncp/CONFIG/nc-datadir.sh index 79aae121f..a31a4109f 100644 --- a/bin/ncp/CONFIG/nc-datadir.sh +++ b/bin/ncp/CONFIG/nc-datadir.sh @@ -22,7 +22,6 @@ install() configure() { - source /usr/local/etc/library.sh # sets PHPVER set -eu -o pipefail ## CHECKS diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh index eb08a241c..89d43a84b 100644 --- a/bin/ncp/CONFIG/nc-init.sh +++ b/bin/ncp/CONFIG/nc-init.sh @@ -12,8 +12,6 @@ DBADMIN=ncadmin configure() { - source /usr/local/etc/library.sh # sets PHPVER NCVER - echo "Setting up a clean Nextcloud instance... wait until message 'NC init done'" # checks @@ -160,7 +158,9 @@ EOF fi # ncp-previewgenerator - if is_more_recent_than "21.0.0" "$NCVER"; then + local ncver + ncver="$(ncc status 2>/dev/null | grep "version:" | awk '{ print $3 }')" + if is_more_recent_than "21.0.0" "${ncver}"; then local ncprev=/var/www/ncp-previewgenerator/ncp-previewgenerator-nc20 else ncc app:install notify_push diff --git a/bin/ncp/CONFIG/nc-limits.sh b/bin/ncp/CONFIG/nc-limits.sh index 1597bb797..823e768bc 100644 --- a/bin/ncp/CONFIG/nc-limits.sh +++ b/bin/ncp/CONFIG/nc-limits.sh @@ -10,8 +10,6 @@ configure() { - source /usr/local/etc/library.sh # sets PHPVER - # Set auto memory limit to 75% of the total memory local TOTAL_MEM="$( free -b | sed -n 2p | awk '{ print $2 }' )" AUTOMEM=$(( TOTAL_MEM * 75 / 100 )) diff --git a/bin/ncp/CONFIG/nc-nextcloud.sh b/bin/ncp/CONFIG/nc-nextcloud.sh index 795ffafa3..e239e1bd7 100644 --- a/bin/ncp/CONFIG/nc-nextcloud.sh +++ b/bin/ncp/CONFIG/nc-nextcloud.sh @@ -22,10 +22,13 @@ install() # Optional packets for Nextcloud and Apps apt-get update $APTINSTALL lbzip2 iputils-ping jq wget - $APTINSTALL -t $RELEASE php-smbclient exfat-fuse exfat-utils # for external storage + # NOTE: php-smbclient in sury but not in Debian sources, we'll use the binary version + # https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage/smb.html + $APTINSTALL -t $RELEASE smbclient exfat-fuse exfat-utils # for external storage + $APTINSTALL -t $RELEASE exfat-fuse exfat-utils # for external storage $APTINSTALL -t $RELEASE php${PHPVER}-exif # for gallery - $APTINSTALL -t $RELEASE php${PHPVER}-gmp # for bookmarks - $APTINSTALL -t $RELEASE php-bcmath # for LDAP + $APTINSTALL -t $RELEASE php${PHPVER}-bcmath=7.4.25-1+deb11u1 # for LDAP + $APTINSTALL -t $RELEASE php${PHPVER}-gmp=7.4.25-1+deb11u1 # for bookmarks #$APTINSTALL -t imagemagick php${PHPVER}-imagick ghostscript # for gallery diff --git a/bin/ncp/NETWORKING/nc-static-IP.sh b/bin/ncp/NETWORKING/nc-static-IP.sh index 36c18412c..07d5bb932 100644 --- a/bin/ncp/NETWORKING/nc-static-IP.sh +++ b/bin/ncp/NETWORKING/nc-static-IP.sh @@ -8,8 +8,6 @@ # More at: https://ownyourbits.com # -source /usr/local/etc/library.sh - configure() { local GW="$( ip r | grep "default via" | awk '{ print $3 }' | head -1 )" diff --git a/bin/ncp/UPDATES/nc-autoupdate-nc.sh b/bin/ncp/UPDATES/nc-autoupdate-nc.sh index 0d27a7290..613e7803f 100644 --- a/bin/ncp/UPDATES/nc-autoupdate-nc.sh +++ b/bin/ncp/UPDATES/nc-autoupdate-nc.sh @@ -9,7 +9,6 @@ # # just change NCLATESTVER and re-activate in update.sh to upgrade users -source /usr/local/etc/library.sh # sets NCLATESTVER configure() { diff --git a/bin/ncp/UPDATES/nc-update-nextcloud.sh b/bin/ncp/UPDATES/nc-update-nextcloud.sh index 66eefad1b..0819db784 100644 --- a/bin/ncp/UPDATES/nc-update-nextcloud.sh +++ b/bin/ncp/UPDATES/nc-update-nextcloud.sh @@ -8,7 +8,6 @@ # More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/ # -source /usr/local/etc/library.sh # sets NCLATESTVER LATEST="$NCLATESTVER" configure() diff --git a/bin/ncp/UPDATES/unattended-upgrades.sh b/bin/ncp/UPDATES/unattended-upgrades.sh index 6b70fdbd9..24d7fe38b 100644 --- a/bin/ncp/UPDATES/unattended-upgrades.sh +++ b/bin/ncp/UPDATES/unattended-upgrades.sh @@ -18,8 +18,6 @@ install() configure() { - source /usr/local/etc/library.sh # sets RELEASE - [[ $ACTIVE == "yes" ]] && local AUTOUPGRADE=1 || local AUTOUPGRADE=0 [[ $AUTOREBOOT == "yes" ]] && local AUTOREBOOT=true || local AUTOREBOOT=false diff --git a/etc/ncp.cfg b/etc/ncp.cfg index 2c38724ce..2f3558911 100644 --- a/etc/ncp.cfg +++ b/etc/ncp.cfg @@ -1,5 +1,5 @@ { "nextcloud_version": "22.2.2", - "php_version": "7.3", - "release": "buster" + "php_version": "7.4", + "release": "bullseye" } diff --git a/lamp.sh b/lamp.sh index 8e8cf266f..88f08d47a 100644 --- a/lamp.sh +++ b/lamp.sh @@ -19,8 +19,6 @@ # More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/ # -source /usr/local/etc/library.sh # sets PHPVER RELEASE - APTINSTALL="apt-get install -y --no-install-recommends" export DEBIAN_FRONTEND=noninteractive diff --git a/post-inst.sh b/post-inst.sh index b7b0cf60d..6f10c9a4a 100644 --- a/post-inst.sh +++ b/post-inst.sh @@ -21,7 +21,6 @@ configure() pkill -f notify_push # cleanup all NCP extras - source /usr/local/etc/library.sh find /usr/local/bin/ncp -name '*.sh' | \ while read script; do cleanup_script $script; done