From 474c0007a1f80416eab5c9239476f9e9a95bab6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sun, 28 Apr 2024 18:31:16 +0200 Subject: [PATCH] nc-nextcloud.sh,install.sh,lamp.sh: Fix build process for debian 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com> --- .github/workflows/build-lxd.yml | 1 - bin/ncp/CONFIG/nc-nextcloud.sh | 4 ++-- etc/ncp.cfg | 2 +- install.sh | 7 ++++++- lamp.sh | 11 ++--------- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-lxd.yml b/.github/workflows/build-lxd.yml index 90a159fb..5061610d 100644 --- a/.github/workflows/build-lxd.yml +++ b/.github/workflows/build-lxd.yml @@ -302,7 +302,6 @@ jobs: - name: Test LXD Image working-directory: ./tests run: | - lxc exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & python system_tests.py --non-interactive || { echo "System test failed!" diff --git a/bin/ncp/CONFIG/nc-nextcloud.sh b/bin/ncp/CONFIG/nc-nextcloud.sh index 635e4869..d2d1cc79 100644 --- a/bin/ncp/CONFIG/nc-nextcloud.sh +++ b/bin/ncp/CONFIG/nc-nextcloud.sh @@ -29,8 +29,8 @@ install() $APTINSTALL lbzip2 iputils-ping jq wget # 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 smbclient exfat-fuse exfatprogs # for external storage + $APTINSTALL -t $RELEASE exfat-fuse exfatprogs # 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 diff --git a/etc/ncp.cfg b/etc/ncp.cfg index ef1dddc9..bbe7137c 100644 --- a/etc/ncp.cfg +++ b/etc/ncp.cfg @@ -1,5 +1,5 @@ { "nextcloud_version": "28.0.4", "php_version": "8.1", - "release": "bullseye" + "release": "bookworm" } diff --git a/install.sh b/install.sh index 4502df30..24c051ec 100644 --- a/install.sh +++ b/install.sh @@ -30,7 +30,7 @@ type mysqld &>/dev/null && mysql -e 'use nextcloud' &>/dev/null && { echo "The ' # get dependencies apt-get update -apt-get install --no-install-recommends -y git ca-certificates sudo lsb-release wget +DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y git ca-certificates sudo lsb-release wget jq # get install code if [[ "${CODE_DIR}" == "" ]]; then @@ -63,6 +63,11 @@ cp etc/ncp.cfg /usr/local/etc/ cp -r etc/ncp-templates /usr/local/etc/ install_app lamp.sh +if [[ -d "/run/systemd/system" ]] && is_lxc +then + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y systemd-resolved + systemctl enable systemd-resolved +fi install_app bin/ncp/CONFIG/nc-nextcloud.sh run_app_unsafe bin/ncp/CONFIG/nc-nextcloud.sh rm /usr/local/etc/ncp-config.d/nc-nextcloud.cfg # armbian overlay is ro diff --git a/lamp.sh b/lamp.sh index aadff56c..7a1cdf13 100644 --- a/lamp.sh +++ b/lamp.sh @@ -37,13 +37,6 @@ install() apache2ctl -V || true # Create systemd users to keep uids persistent between containers - id -u systemd-resolve || { - addgroup --quiet --system systemd-journal - adduser --quiet -u 180 --system --group --no-create-home --home /run/systemd \ - --gecos "systemd Network Management" systemd-network - adduser --quiet -u 181 --system --group --no-create-home --home /run/systemd \ - --gecos "systemd Resolver" systemd-resolve - } install_with_shadow_workaround --no-install-recommends systemd $APTINSTALL -t $RELEASE php${PHPVER} php${PHPVER}-curl php${PHPVER}-gd php${PHPVER}-fpm php${PHPVER}-cli php${PHPVER}-opcache \ php${PHPVER}-mbstring php${PHPVER}-xml php${PHPVER}-zip php${PHPVER}-fileinfo php${PHPVER}-ldap \ @@ -67,7 +60,7 @@ install() install_template apache2/http2.conf.sh /etc/apache2/conf-available/http2.conf --defaults - # CONFIGURE PHP7 + # CONFIGURE PHP ########################################## install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini" --defaults @@ -97,7 +90,7 @@ install() # launch mariadb if not already running if ! [[ -f /run/mysqld/mysqld.pid ]]; then echo "Starting mariaDB" - mysqld & + sudo -u mysql mysqld & fi # wait for mariadb