diff options
author | nachoparker <nacho@ownyourbits.com> | 2021-11-09 20:54:18 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2022-03-03 00:53:24 +0300 |
commit | 9bf5ff032c351bf7ef74828b967dff0bcfba78b2 (patch) | |
tree | 47f41441489a89e92eed584236112bd5d013b236 | |
parent | dd8fc3dd7d663faf5d916039ee042ef049aaf728 (diff) |
update to Debian 11 Bullseyev1.45.0
Signed-off-by: nachoparker <nacho@ownyourbits.com>
32 files changed, 79 insertions, 145 deletions
@@ -18,7 +18,7 @@ Find the full documentation at [docs.nextcloudpi.com](http://docs.nextcloudpi.co * Debian/Raspbian 10 Buster * Nextcloud 22.2.2 * Apache 2.4.25, with HTTP2 enabled - * PHP 7.3 + * PHP 7.4 * MariaDB 10 * Redis memory cache * ncp-config for easy setup ( RAM logs, USB drive and more ) diff --git a/bin/ncp-diag b/bin/ncp-diag index c9cd89cb..bed4cfe4 100644 --- a/bin/ncp-diag +++ b/bin/ncp-diag @@ -56,7 +56,7 @@ fi # Services echo "HTTPD service|$( pgrep -c apache2 &>/dev/null && echo up || echo down )" echo "PHP service|$( pgrep -c php-fpm &>/dev/null && echo up || echo down )" -echo "MariaDB service|$( pgrep -c mysqld &>/dev/null && echo up || echo down )" +echo "MariaDB service|$( (pgrep -c mysqld || pgrep -c mariadb) &>/dev/null && echo up || echo down )" echo "Redis service|$( pgrep -c redis-server &>/dev/null && echo up || echo down )" echo "HPB service|$( ncc notify_push:self-test &>/dev/null && echo up || echo down )" echo "Postfix service|$( pgrep -fc postfix &>/dev/null && echo up || echo down )" diff --git a/bin/ncp-dist-upgrade b/bin/ncp-dist-upgrade index 9a5e7efe..576fca57 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 @@ -56,6 +59,8 @@ apt-get dist-upgrade -y # install latest PHP version release_new=$(jq -r '.release' < "${new_cfg}") +# the default repo in bullseye is bullseye-security +release_new="${release_new}-security" php_ver_new=$(jq -r '.php_version' < "${new_cfg}") $APTINSTALL -t ${release_new} php${php_ver_new} php${php_ver_new}-curl php${php_ver_new}-gd php${php_ver_new}-fpm php${php_ver_new}-cli php${php_ver_new}-opcache \ @@ -65,8 +70,13 @@ $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 +sleep 2 # avoid systemd thinking that PHP is in a crash/restart loop $APTINSTALL -t ${release_new} php${php_ver_new}-exif +sleep 2 # avoid systemd thinking that PHP is in a crash/restart loop +$APTINSTALL -t ${release_new} php${php_ver_new}-bcmath +sleep 2 # avoid systemd thinking that PHP is in a crash/restart loop +$APTINSTALL -t ${release_new} php${php_ver_new}-gmp #$APTINSTALL -t ${release_new} imagemagick php${php_ver_new}-imagick ghostscript apt-get autoremove -y @@ -114,6 +124,7 @@ is_active_app unattended-upgrades && run_app unattended-upgrades || true # mark as successful mv "${new_cfg}" "${old_cfg}" +source /usr/local/etc/library.sh # refresh NCPCFG RELEASE PHPVER run_app nc-limits restore_maintenance_mode diff --git a/bin/ncp/CONFIG/nc-datadir.sh b/bin/ncp/CONFIG/nc-datadir.sh index 79aae121..835cb6ca 100644 --- a/bin/ncp/CONFIG/nc-datadir.sh +++ b/bin/ncp/CONFIG/nc-datadir.sh @@ -17,12 +17,11 @@ is_active() install() { - apt_install btrfs-tools + apt_install btrfs-progs } 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 9487dc85..e5d0cc05 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 @@ -25,7 +23,7 @@ configure() echo "Setting up database..." # launch mariadb if not already running - if ! pgrep -c mysqld &>/dev/null; then + if ! [[ -f /run/mysqld/mysqld.pid ]]; then echo "Starting mariaDB" mysqld & local db_pid=$! @@ -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 @@ -202,6 +202,7 @@ EOF # dettach mysql during the build if [[ "${db_pid}" != "" ]]; then + echo "Shutting down mariaDB (${db_pid})" mysqladmin -u root shutdown wait "${db_pid}" fi diff --git a/bin/ncp/CONFIG/nc-limits.sh b/bin/ncp/CONFIG/nc-limits.sh index 1597bb79..c9fbf87e 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 )) @@ -48,7 +46,7 @@ configure() echo "Using $AUTOMEM memory for the database" [[ "$CURRENT_DB_MEM" != "$AUTOMEM" ]] && { sed -i "s|^innodb_buffer_pool_size =.*|innodb_buffer_pool_size = $AUTOMEM|" "$CONF" - service mysql restart + service mariadb restart } # RESTART PHP diff --git a/bin/ncp/CONFIG/nc-nextcloud.sh b/bin/ncp/CONFIG/nc-nextcloud.sh index 795ffafa..0d1ce12d 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}-bcmath # for LDAP $APTINSTALL -t $RELEASE php${PHPVER}-gmp # for bookmarks - $APTINSTALL -t $RELEASE php-bcmath # for LDAP #$APTINSTALL -t imagemagick php${PHPVER}-imagick ghostscript # for gallery @@ -149,15 +152,12 @@ configure() ## RE-CREATE DATABASE TABLE # launch mariadb if not already running (for docker build) - if ! pgrep -c mysqld &>/dev/null; then + if ! [[ -f /run/mysqld/mysqld.pid ]]; then echo "Starting mariaDB" mysqld & local db_pid=$! fi - # wait for mariadb - pgrep -x mysqld &>/dev/null || echo "mariaDB process not found" - while :; do [[ -S /var/run/mysqld/mysqld.sock ]] && break sleep 0.5 @@ -260,6 +260,7 @@ EOF # dettach mysql during the build if [[ "${db_pid}" != "" ]]; then + echo "Shutting down mariaDB (${db_pid})" mysqladmin -u root shutdown wait "${db_pid}" fi diff --git a/bin/ncp/NETWORKING/nc-static-IP.sh b/bin/ncp/NETWORKING/nc-static-IP.sh index 9b3988f6..63ce705f 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/SYSTEM/nc-hdd-monitor.sh b/bin/ncp/SYSTEM/nc-hdd-monitor.sh index 8d61de3f..15317252 100644 --- a/bin/ncp/SYSTEM/nc-hdd-monitor.sh +++ b/bin/ncp/SYSTEM/nc-hdd-monitor.sh @@ -24,8 +24,7 @@ configure() } [[ "$ACTIVE" != yes ]] && { - systemctl disable smartd - service smartd stop + systemctl disable --now smartd echo "HDD monitor disabled" return 0 } @@ -70,8 +69,7 @@ EOF done - systemctl enable smartd - service smartd start + systemctl enable --now smartd echo "HDD monitor enabled" } diff --git a/bin/ncp/SYSTEM/nc-hdd-test.sh b/bin/ncp/SYSTEM/nc-hdd-test.sh index ced4a597..8e063d43 100644 --- a/bin/ncp/SYSTEM/nc-hdd-test.sh +++ b/bin/ncp/SYSTEM/nc-hdd-test.sh @@ -12,12 +12,8 @@ install() { - apt-get update - apt-get install --no-install-recommends -y smartmontools - [[ "$DOCKERBUILD" == 1 ]] || { - systemctl disable smartd - systemctl stop smartd - } + apt_install smartmontools + systemctl disable smartd return } diff --git a/bin/ncp/SYSTEM/nc-wifi.sh b/bin/ncp/SYSTEM/nc-wifi.sh deleted file mode 100644 index 9c88239a..00000000 --- a/bin/ncp/SYSTEM/nc-wifi.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# Data dir configuration script for NextCloudPi -# -# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com> -# GPL licensed (see end of file) * Use at your own risk! -# -# More at https://ownyourbits.com/ -# - - -install() -{ - apt-get update - apt install -y --no-install-recommends wicd-curses - systemctl disable wicd -} - -configure() -{ - [[ $ACTIVE != "yes" ]] && { - systemctl stop wicd - systemctl disable wicd - systemctl start dhcpcd - systemctl enable dhcpcd - ip link set down dev wlan0 - systemctl start nextcloud-domain - return; - } - - ip link set up dev wlan0 - systemctl stop dhcpcd - systemctl disable dhcpcd - systemctl enable wicd - systemctl start wicd - - wicd-curses - clear - - systemctl start nextcloud-domain -} - -# License -# -# This script is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This script is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this script; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place, Suite 330, -# Boston, MA 02111-1307 USA - diff --git a/bin/ncp/UPDATES/nc-autoupdate-nc.sh b/bin/ncp/UPDATES/nc-autoupdate-nc.sh index 0d27a729..613e7803 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 66eefad1..0819db78 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 6b70fdbd..24d7fe38 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/build/armbian/armbian.sh b/build/armbian/armbian.sh index 85e5f742..231ae804 100644 --- a/build/armbian/armbian.sh +++ b/build/armbian/armbian.sh @@ -21,8 +21,6 @@ cd /tmp/overlay NCPCFG=etc/ncp.cfg source etc/library.sh # sets RELEASE -[[ "$ARMBIAN_RELEASE" != "$RELEASE" ]] && { echo "Only $RELEASE is supported by NextCloudPi" >&2; exit 1; } - # need sudo access that does not expire during build chage -d -1 root diff --git a/build/batch.sh b/build/batch.sh index 5aefed7f..bb093b27 100755 --- a/build/batch.sh +++ b/build/batch.sh @@ -55,6 +55,7 @@ IMG="$(ls -1t tmp/*.img | head -1)" build/build-SD-berryboot.sh "$IMG" # Armbian +export LIB_TAG=master # if we want to pin down a specific armbian version build/build-SD-armbian.sh odroidxu4 OdroidHC2 build/build-SD-armbian.sh rockpro64 RockPro64 build/build-SD-armbian.sh rock64 Rock64 diff --git a/build/build-LXD.sh b/build/build-LXD.sh index 9f12718f..5793a26e 100755 --- a/build/build-LXD.sh +++ b/build/build-LXD.sh @@ -32,7 +32,7 @@ prepare_dirs # tmp cache output ## BUILD NCP lxc delete -f ncp 2>/dev/null || true -systemd-run --user --scope -p "Delegate=yes" lxc launch images:debian/buster ncp +systemd-run --user --scope -p "Delegate=yes" lxc launch images:debian/bullseye ncp lxc config device add ncp buildcode disk source="$(pwd)" path=/build lxc exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done' lxc exec ncp -- bash -c 'CODE_DIR=/build bash /build/install.sh' diff --git a/build/build-SD-armbian.sh b/build/build-SD-armbian.sh index 155ade91..ad72c790 100755 --- a/build/build-SD-armbian.sh +++ b/build/build-SD-armbian.sh @@ -46,10 +46,10 @@ CONF=armbian/userpatches/config-ncp.conf # default parameters cat > "$CONF" <<EOF BOARD="$BOARD" -BRANCH=legacy -RELEASE=$RELEASE +BRANCH=current +RELEASE=${RELEASE%%-security} KERNEL_ONLY=no -KERNEL_CONFIGURE=no +KERNEL_CONFIGURE=prebuilt BUILD_DESKTOP=no BUILD_MINIMAL=yes USE_CCACHE=yes diff --git a/build/build-SD-rpi.sh b/build/build-SD-rpi.sh index 25d6204a..910aabf5 100755 --- a/build/build-SD-rpi.sh +++ b/build/build-SD-rpi.sh @@ -13,7 +13,7 @@ source build/buildlib.sh echo -e "\e[1m\n[ Build NCP Raspberry Pi ]\e[0m" -URL="https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2021-11-08/2021-10-30-raspios-bullseye-arm64-lite.zip" +URL="https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-01-28/2022-01-28-raspios-bullseye-arm64-lite.zip" SIZE=4G # Raspbian image size #CLEAN=0 # Pass this envvar to skip cleaning download cache IMG="NextCloudPi_RPi_$( date "+%m-%d-%y" ).img" @@ -61,6 +61,9 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ #$APTINSTALL rpi-update #echo -e "y\n" | PRUNE_MODULES=1 rpi-update + # this image comes without resolv.conf ?? + echo 'nameserver 1.1.1.1' >> /etc/resolv.conf + # install NCP cd /tmp/ncp-build || exit 1 CODE_DIR="$(pwd)" bash install.sh @@ -82,8 +85,9 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ cfg="$(jq '.params[3].value = "raspberry"' <<<"$cfg")" echo "$cfg" > /usr/local/etc/ncp-config.d/SSH.cfg - $ cleanup + # cleanup source etc/library.sh && run_app_unsafe post-inst.sh + rm /etc/resolv.conf rm -rf /tmp/ncp-build EOFCHROOT diff --git a/build/build-docker.sh b/build/build-docker.sh index e0709f31..41e8d56c 100755 --- a/build/build-docker.sh +++ b/build/build-docker.sh @@ -20,10 +20,10 @@ function build_arch() echo -e "\e[1m\n[ Build NCP Docker ${arch} ]\e[0m" - docker_build -f build/docker/debian-ncp/Dockerfile -t ownyourbits/debian-ncp-${ncp_tag}:latest --pull --build-arg release=${release} --build-arg arch=${arch} --build-arg arch_qemu=${arch_qemu} - docker_build -f build/docker/lamp/Dockerfile -t ownyourbits/lamp-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} - docker_build -f build/docker/nextcloud/Dockerfile -t ownyourbits/nextcloud-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} - docker_build -f build/docker/nextcloudpi/Dockerfile -t ownyourbits/nextcloudpi-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} --build-arg ncp_ver=${version} + docker_build -f build/docker/debian-ncp/Dockerfile -t ownyourbits/debian-ncp-${ncp_tag}:latest --pull --build-arg release=${release} --build-arg arch=${arch} --build-arg arch_qemu=${arch_qemu} + docker_build -f build/docker/lamp/Dockerfile -t ownyourbits/lamp-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} --build-arg arch_qemu=${arch_qemu} + docker_build -f build/docker/nextcloud/Dockerfile -t ownyourbits/nextcloud-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} --build-arg arch_qemu=${arch_qemu} + docker_build -f build/docker/nextcloudpi/Dockerfile -t ownyourbits/nextcloudpi-${ncp_tag}:latest --build-arg release=${release} --build-arg arch=${ncp_tag} --build-arg arch_qemu=${arch_qemu} --build-arg ncp_ver=${version} docker tag ownyourbits/debian-ncp-${ncp_tag}:latest ownyourbits/debian-ncp-${ncp_tag}:"${version}" docker tag ownyourbits/lamp-${ncp_tag}:latest ownyourbits/lamp-${ncp_tag}:"${version}" diff --git a/build/docker/debian-ncp/Dockerfile b/build/docker/debian-ncp/Dockerfile index c2196d94..35f319f8 100644 --- a/build/docker/debian-ncp/Dockerfile +++ b/build/docker/debian-ncp/Dockerfile @@ -1,12 +1,10 @@ ARG arch=armhf ARG arch_qemu=arm -ARG release=buster +ARG release=bullseye FROM debian:${release}-slim AS qemu RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends qemu-user-static -ARG release -ARG arch_qemu FROM ${arch}/debian:${release}-slim ARG arch_qemu diff --git a/build/docker/lamp/Dockerfile b/build/docker/lamp/Dockerfile index 61c5eb4b..4ed99602 100644 --- a/build/docker/lamp/Dockerfile +++ b/build/docker/lamp/Dockerfile @@ -1,8 +1,9 @@ # syntax=docker/dockerfile:experimental ARG arch=armhf +ARG arch_qemu=arm -FROM ownyourbits/debian-ncp-${arch} +FROM --platform=linux/${arch_qemu} ownyourbits/debian-ncp-${arch} LABEL maintainer="Ignacio Núñez Hernanz <nacho@ownyourbits.com>" diff --git a/build/docker/nextcloud/Dockerfile b/build/docker/nextcloud/Dockerfile index 9da1223b..cde0cd48 100644 --- a/build/docker/nextcloud/Dockerfile +++ b/build/docker/nextcloud/Dockerfile @@ -1,8 +1,9 @@ # syntax=docker/dockerfile:experimental ARG arch=armhf +ARG arch_qemu=arm -FROM ownyourbits/lamp-${arch} +FROM --platform=linux/${arch_qemu} ownyourbits/lamp-${arch} LABEL maintainer="Ignacio Núñez Hernanz <nacho@ownyourbits.com>" diff --git a/build/docker/nextcloudpi/Dockerfile b/build/docker/nextcloudpi/Dockerfile index 88c737a9..e5920548 100644 --- a/build/docker/nextcloudpi/Dockerfile +++ b/build/docker/nextcloudpi/Dockerfile @@ -1,8 +1,9 @@ # syntax=docker/dockerfile:experimental ARG arch=armhf +ARG arch_qemu=arm -FROM ownyourbits/nextcloud-${arch} +FROM --platform=linux/${arch_qemu} ownyourbits/nextcloud-${arch} ARG ncp_ver=v0.0.0 diff --git a/changelog.md b/changelog.md index 4e696d20..87641a3e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ +<<<<<<< HEAD [v1.46.7](https://github.com/nextcloud/nextcloudpi/commit/0da8dcd) (2021-12-13) letsencrypt: fix invalid arithmetic operator error +======= +[v1.45.0](https://github.com/nextcloud/nextcloudpi/commit/b0379f1) (2021-11-09) update to Debian 11 Bullseye +>>>>>>> 41f692c (update to Debian 11 Bullseye) [v1.44.6 ](https://github.com/nextcloud/nextcloudpi/commit/26a7778) (2021-12-06) notify_push: fix service not restarting on binary update (#1398) diff --git a/etc/library.sh b/etc/library.sh index 35787806..1d083814 100644 --- a/etc/library.sh +++ b/etc/library.sh @@ -8,11 +8,14 @@ # More at ownyourbits.com # -export NCPCFG=${NCPCFG:-/usr/local/etc/ncp.cfg} export CFGDIR=/usr/local/etc/ncp-config.d export BINDIR=/usr/local/bin/ncp export NCDIR=/var/www/nextcloud export ncc=/usr/local/bin/ncc +export NCPCFG=${NCPCFG:-etc/ncp.cfg} + +[[ -f "$NCPCFG" ]] || export NCPCFG=/usr/local/etc/ncp.cfg +[[ -f "$NCPCFG" ]] || { echo "$NCPCFG not found" >2; exit 1; } #unset TRUSTED_DOMAINS #declare -A TRUSTED_DOMAINS @@ -27,11 +30,11 @@ command -v jq &>/dev/null || { apt-get install -y --no-install-recommends jq } -[[ -f "$NCPCFG" ]] && { - NCLATESTVER=$(jq -r .nextcloud_version < "$NCPCFG") - PHPVER=$( jq -r .php_version < "$NCPCFG") - RELEASE=$( jq -r .release < "$NCPCFG") -} +NCLATESTVER=$(jq -r .nextcloud_version < "$NCPCFG") +PHPVER=$( jq -r .php_version < "$NCPCFG") +RELEASE=$( jq -r .release < "$NCPCFG") +# the default repo in bullseye is bullseye-security +RELEASE="${RELEASE}-security" command -v ncc &>/dev/null && NCVER="$(ncc status 2>/dev/null | grep "version:" | awk '{ print $3 }')" function configure_app() diff --git a/etc/ncp-config.d/nc-wifi.cfg b/etc/ncp-config.d/nc-wifi.cfg deleted file mode 100644 index 1303d582..00000000 --- a/etc/ncp-config.d/nc-wifi.cfg +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "nc-wifi", - "name": "Nc-wifi", - "title": "nc-wifi", - "description": "Configure your Wi-Fi connection", - "info": "\n0) Write 'yes' to activate wifi, and 'no' to disable it\n1) Select a Wi-Fi network\n2) Press right arrow ->\n3) Enter the passphrase for your Wi-Fi\n4) Make sure to select 'connect automatically'\n5) F10 to save\n6) C to connect", - "infotitle": "Instructions to configure Wi-Fi", - "params": [ - { - "id": "ACTIVE", - "name": "Active", - "value": "no", - "type": "bool" - } - ] -} diff --git a/etc/ncp.cfg b/etc/ncp.cfg index 2c38724c..2f355891 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" } @@ -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 @@ -142,7 +140,7 @@ EOF # launch mariadb if not already running - if ! pgrep -c mysqld &>/dev/null; then + if ! [[ -f /run/mysqld/mysqld.pid ]]; then echo "Starting mariaDB" mysqld & fi diff --git a/post-inst.sh b/post-inst.sh index b7b0cf60..9867c49f 100644 --- a/post-inst.sh +++ b/post-inst.sh @@ -15,13 +15,14 @@ configure() # stop services pkill -x redis-server - pgrep -x mysqld &>/dev/null && mysqladmin -u root shutdown + [[ -f /run/mysqld/mysqld.pid ]] && mysqladmin -u root shutdown [[ -f /run/crond.pid ]] && kill "$(cat /run/crond.pid)" pkill -f php-fpm pkill -f notify_push + killall postdrop + killall sendmail # 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 diff --git a/tests/system_tests.py b/tests/system_tests.py index baf9525d..35f07fe4 100755 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -24,7 +24,7 @@ from subprocess import run, getstatusoutput, PIPE processes_must_be_running = [ 'apache2', 'cron', - 'mysqld', + 'mariadb', 'php-fpm', 'postfix', 'redis-server', @@ -32,6 +32,7 @@ nc-snapshot-sync nc-restore-snapshot nc-audit nc-hdd-monitor +nc-hdd-test nc-zram SSH fail2ban @@ -202,8 +203,8 @@ chmod +x /etc/update-motd.d/30ncp-dist-upgrade # Remove redundant opcache configuration. # Related to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815968 # Bug #416 reappeared after we moved to php7.3 and debian buster packages. -[[ "$( ls -l /etc/php/7.3/fpm/conf.d/*-opcache.ini | wc -l )" -gt 1 ]] && rm "$( ls /etc/php/7.3/fpm/conf.d/*-opcache.ini | tail -1 )" -[[ "$( ls -l /etc/php/7.3/cli/conf.d/*-opcache.ini | wc -l )" -gt 1 ]] && rm "$( ls /etc/php/7.3/cli/conf.d/*-opcache.ini | tail -1 )" +[[ "$( ls -l /etc/php/"${PHPVER}"/fpm/conf.d/*-opcache.ini | wc -l )" -gt 1 ]] && rm "$( ls /etc/php/"${PHPVER}"/fpm/conf.d/*-opcache.ini | tail -1 )" +[[ "$( ls -l /etc/php/"${PHPVER}"/cli/conf.d/*-opcache.ini | wc -l )" -gt 1 ]] && rm "$( ls /etc/php/"${PHPVER}"/cli/conf.d/*-opcache.ini | tail -1 )" exit 0 |