From 7136d3cc36ad2b9d598f0976f30a61cb6b87f5b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?=
<6317548+theCalcaholic@users.noreply.github.com>
Date: Sat, 25 Jul 2026 14:09:54 +0200
Subject: [PATCH 1/6] Add support for NC 34 and PHP 8.5
---
.github/workflows/build-lxd.yml | 2 +-
bin/ncp-update-nc.d/update-nc.sh | 6 ++
bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh | 66 +++++++++++++++++++
etc/ncp-config.d/nc-nextcloud.cfg | 2 +-
etc/ncp.cfg | 4 +-
lamp.sh | 2 +-
ncp-app/appinfo/info.xml | 2 +-
7 files changed, 78 insertions(+), 6 deletions(-)
create mode 100755 bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh
diff --git a/.github/workflows/build-lxd.yml b/.github/workflows/build-lxd.yml
index 1eb351d32..742371020 100644
--- a/.github/workflows/build-lxd.yml
+++ b/.github/workflows/build-lxd.yml
@@ -547,7 +547,7 @@ jobs:
echo "Running update to ${VERSION}"
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
- latest_nc_version="33.0.3"
+ latest_nc_version="34.0.2"
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
diff --git a/bin/ncp-update-nc.d/update-nc.sh b/bin/ncp-update-nc.d/update-nc.sh
index 401677fbb..6c56c0207 100755
--- a/bin/ncp-update-nc.d/update-nc.sh
+++ b/bin/ncp-update-nc.d/update-nc.sh
@@ -258,6 +258,12 @@ elif ! is_more_recent_than "29.0.0" "${NCVER}" && is_more_recent_than "8.3.0" "$
then
/usr/local/bin/ncp-update-nc.d/upgrade-php-bookworm-8.3.sh
+ # Reload library.sh to reset PHPVER
+ source /usr/local/etc/library.sh
+elif ! is_more_recent_than "34.0.0" "${NCVER}" && is_more_recent_than "8.5.0" "${PHPVER}.0" && [[ "$DEBIAN_VERSION" -ge 13 ]]
+then
+ /usr/local/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh
+
# Reload library.sh to reset PHPVER
source /usr/local/etc/library.sh
fi
diff --git a/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh b/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh
new file mode 100755
index 000000000..211a504de
--- /dev/null
+++ b/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+
+source /usr/local/etc/library.sh
+
+echo "Upgrading PHP..."
+export DEBIAN_FRONTEND=noninteractive
+PHPVER_OLD="$PHPVER"
+PHPVER_NEW="8.5"
+PHP_PACKAGES_OLD=("php${PHPVER_OLD}" \
+ "php${PHPVER_OLD}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
+PHP_PACKAGES_NEW=("php${PHPVER_NEW}" \
+ "php${PHPVER_NEW}"-{curl,gd,fpm,cli,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
+
+php_restore() {
+ trap "" INT TERM HUP ERR
+ echo "Something went wrong while upgrading PHP. Rolling back to version ${PHPVER_OLD}..."
+ set +e
+ service "php${PHPVER_NEW}-fpm" stop
+ a2disconf php${PHPVER_NEW}-fpm
+ wget -O /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
+ dpkg -i /tmp/debsuryorg-archive-keyring.deb
+ echo "deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
+ apt-get update
+ apt-get remove --purge -y "${PHP_PACKAGES_NEW[@]}"
+ apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
+ set_ncpcfg "php_version" "${PHPVER_OLD}"
+ install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
+ run_app nc-limits
+ a2enconf "php${PHPVER_OLD}-fpm"
+ service "php${PHPVER_OLD}-fpm" start
+ service apache2 restart
+ echo "PHP upgrade has been successfully reverted"
+ set -e
+}
+
+trap php_restore INT TERM HUP ERR
+
+apt-get update
+
+clear_opcache
+
+echo "Stopping apache and php-fpm..."
+service "php${PHPVER_OLD}-fpm" stop
+service apache2 stop
+
+echo "Remove old PHP (${PHPVER_OLD})..."
+a2disconf "php${PHPVER_OLD}-fpm"
+
+apt-get remove --purge -y "${PHP_PACKAGES_OLD[@]}"
+
+echo "Install PHP ${PHPVER_NEW}..."
+install_with_shadow_workaround --no-install-recommends systemd
+apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_NEW[@]}"
+
+set_ncpcfg "php_version" "${PHPVER_NEW}"
+install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
+( set -e; export PHPVER="${PHPVER_NEW}"; run_app nc-limits )
+
+a2enconf "php${PHPVER_NEW}-fpm"
+
+install_template "systemd/php-fpm.service.d.ncp.conf.sh" "/etc/systemd/system/php${PHPVER_NEW}-fpm.service.d/ncp.conf"
+
+echo "Starting apache and php-fpm..."
+service "php${PHPVER_NEW}-fpm" start
+service apache2 start
+ncc status
\ No newline at end of file
diff --git a/etc/ncp-config.d/nc-nextcloud.cfg b/etc/ncp-config.d/nc-nextcloud.cfg
index 54ab64bc7..9738ce936 100644
--- a/etc/ncp-config.d/nc-nextcloud.cfg
+++ b/etc/ncp-config.d/nc-nextcloud.cfg
@@ -9,7 +9,7 @@
{
"id": "VER",
"name": "Version",
- "value": "33.0.2"
+ "value": "34.0.2"
},
{
"id": "MAXFILESIZE",
diff --git a/etc/ncp.cfg b/etc/ncp.cfg
index 7b25528d2..26eaa9048 100644
--- a/etc/ncp.cfg
+++ b/etc/ncp.cfg
@@ -1,5 +1,5 @@
{
- "nextcloud_version": "33.0.2",
- "php_version": "8.3",
+ "nextcloud_version": "34.0.2",
+ "php_version": "8.5",
"release": "trixie"
}
diff --git a/lamp.sh b/lamp.sh
index e315ba661..dcfbc3b10 100644
--- a/lamp.sh
+++ b/lamp.sh
@@ -39,7 +39,7 @@ install()
# Create systemd users to keep uids persistent between containers
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 \
+ $APTINSTALL -t $RELEASE php${PHPVER} php${PHPVER}-curl php${PHPVER}-gd php${PHPVER}-fpm php${PHPVER}-cli \
php${PHPVER}-mbstring php${PHPVER}-xml php${PHPVER}-zip php${PHPVER}-fileinfo php${PHPVER}-ldap \
php${PHPVER}-intl php${PHPVER}-bz2 php${PHPVER}-apcu
diff --git a/ncp-app/appinfo/info.xml b/ncp-app/appinfo/info.xml
index 5931f0410..b4f0fb5bb 100644
--- a/ncp-app/appinfo/info.xml
+++ b/ncp-app/appinfo/info.xml
@@ -12,7 +12,7 @@
tools
https://github.com/nextcloud/nextcloudpi/issues
-
+
From 8e55ef7b544ca232208accd7706bccdae74dd3f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?=
<6317548+theCalcaholic@users.noreply.github.com>
Date: Sat, 25 Jul 2026 14:44:56 +0200
Subject: [PATCH 2/6] nc-init.sh,1.57.0.sh: Fix serverid out of range
---
bin/ncp/CONFIG/nc-init.sh | 2 +-
updates/1.57.0.sh | 2 +-
updates/1.59.0.sh | 7 +++++++
3 files changed, 9 insertions(+), 2 deletions(-)
create mode 100644 updates/1.59.0.sh
diff --git a/bin/ncp/CONFIG/nc-init.sh b/bin/ncp/CONFIG/nc-init.sh
index 92ec85990..dd31f005c 100644
--- a/bin/ncp/CONFIG/nc-init.sh
+++ b/bin/ncp/CONFIG/nc-init.sh
@@ -195,7 +195,7 @@ EOF
ncc config:system:set jpeg_quality --value 60
# other
- ncc config:system:set serverid --value="$((RANDOM % 1024))" --type=integer
+ ncc config:system:set serverid --value="$((RANDOM % 512))" --type=integer
ncc config:system:set overwriteprotocol --value=https
ncc config:system:set overwrite.cli.url --value="https://nextcloudpi/"
diff --git a/updates/1.57.0.sh b/updates/1.57.0.sh
index 97402f3e3..82c62e957 100644
--- a/updates/1.57.0.sh
+++ b/updates/1.57.0.sh
@@ -18,7 +18,7 @@ then
fi
echo "Configuring serverid ..."
-ncc config:system:get serverid > /dev/null || ncc config:system:set serverid --value="$((RANDOM % 1024))" --type=integer
+ncc config:system:get serverid > /dev/null || ncc config:system:set serverid --value="$((RANDOM % 512))" --type=integer
echo "Installing PHP APCU ..."
apt-get install -y php${PHPVER}-apcu
echo "Enable apache2 remoteip"
diff --git a/updates/1.59.0.sh b/updates/1.59.0.sh
new file mode 100644
index 000000000..03db550d5
--- /dev/null
+++ b/updates/1.59.0.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+echo "Configuring serverid ..."
+old_id="$(ncc config:system:get serverid)"
+[[ "$old_id" -lt 512 ]] || ncc config:system:set serverid --value="$((RANDOM % 512))" --type=integer
From f696103ee0c23d115954b4473ad247afeff0f258 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?=
<6317548+theCalcaholic@users.noreply.github.com>
Date: Sat, 25 Jul 2026 15:22:07 +0200
Subject: [PATCH 3/6] lamp.sh: Fix opcache settings installed to the wrong path
---
.github/workflows/build-lxd.yml | 4 +++-
bin/ncp-restore | 1 +
bin/ncp-update-nc.d/update-nc.sh | 2 +-
bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh | 8 +++++---
bin/ncp/CONFIG/nc-datadir.sh | 1 +
bin/ncp/CONFIG/nc-nextcloud.sh | 2 ++
etc/library.sh | 2 +-
etc/ncp-templates/php/opcache.ini.sh | 4 +++-
lamp.sh | 7 +++++++
tests/nextcloud_tests.py | 2 ++
tests/system_tests.py | 2 +-
updates/1.59.0.sh | 18 ++++++++++++++++++
12 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/build-lxd.yml b/.github/workflows/build-lxd.yml
index 742371020..43bb31df4 100644
--- a/.github/workflows/build-lxd.yml
+++ b/.github/workflows/build-lxd.yml
@@ -547,7 +547,7 @@ jobs:
echo "Running update to ${VERSION}"
current_nc_version="$(sudo "$LXC" exec ncp -- ncc status | grep "version:" | awk '{ print $3 }')"
- latest_nc_version="34.0.2"
+ latest_nc_version="33.0.2"
sudo "$LXC" exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
sudo "$LXC" exec ncp -- /usr/local/bin/ncc status
@@ -837,6 +837,8 @@ jobs:
echo "nextcloud log: "
datadir="$(sudo "$LXC" exec ncp -- ncc config:system:get datadirectory)"
sudo "$LXC" exec ncp -- cat "$datadir/nextcloud.log" || true
+ echo "opcache.interned_strings_buffer:"
+ sudo "$LXC" exec ncp -- bash -c 'grep -R opcache.interned_strings_buffer /etc/php/*/fpm/conf.d/'
exit 1
}
USE_INCUS="$USE_INCUS" ../.venv/bin/python system_tests.py --non-interactive || {
diff --git a/bin/ncp-restore b/bin/ncp-restore
index d613fdbe1..e8423fdf3 100755
--- a/bin/ncp-restore
+++ b/bin/ncp-restore
@@ -153,6 +153,7 @@ sed -i "s|'datadirectory' =>.*|'datadirectory' => '${DATADIR}',|" "${NCDIR}"/con
# Just in case we moved the opcache dir
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini"
+systemctl reload "php${PHPVER}-fpm"
# tmp upload dir
mkdir -p "$DATADIR/tmp"
diff --git a/bin/ncp-update-nc.d/update-nc.sh b/bin/ncp-update-nc.d/update-nc.sh
index 6c56c0207..a838ce4a3 100755
--- a/bin/ncp-update-nc.d/update-nc.sh
+++ b/bin/ncp-update-nc.d/update-nc.sh
@@ -260,7 +260,7 @@ then
# Reload library.sh to reset PHPVER
source /usr/local/etc/library.sh
-elif ! is_more_recent_than "34.0.0" "${NCVER}" && is_more_recent_than "8.5.0" "${PHPVER}.0" && [[ "$DEBIAN_VERSION" -ge 13 ]]
+elif ! is_more_recent_than "33.0.0" "${NCVER}" && is_more_recent_than "8.5.0" "${PHPVER}.0" && [[ "$DEBIAN_VERSION" -ge 13 ]]
then
/usr/local/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh
diff --git a/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh b/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh
index 211a504de..d5b1f7303 100755
--- a/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh
+++ b/bin/ncp-update-nc.d/upgrade-php-trixie-8.5.sh
@@ -7,9 +7,9 @@ export DEBIAN_FRONTEND=noninteractive
PHPVER_OLD="$PHPVER"
PHPVER_NEW="8.5"
PHP_PACKAGES_OLD=("php${PHPVER_OLD}" \
- "php${PHPVER_OLD}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
+ "php${PHPVER_OLD}"-{curl,gd,fpm,cli,opcache,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common,apcu})
PHP_PACKAGES_NEW=("php${PHPVER_NEW}" \
- "php${PHPVER_NEW}"-{curl,gd,fpm,cli,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common})
+ "php${PHPVER_NEW}"-{curl,gd,fpm,cli,mbstring,xml,zip,fileinfo,ldap,intl,bz2,mysql,bcmath,gmp,redis,common,apcu})
php_restore() {
trap "" INT TERM HUP ERR
@@ -24,7 +24,8 @@ php_restore() {
apt-get remove --purge -y "${PHP_PACKAGES_NEW[@]}"
apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_OLD[@]}"
set_ncpcfg "php_version" "${PHPVER_OLD}"
- install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
+ install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_OLD}/mods-available/opcache.ini"
+ phpenmod -v "${PHPVER_OLD}" -s fpm opcache
run_app nc-limits
a2enconf "php${PHPVER_OLD}-fpm"
service "php${PHPVER_OLD}-fpm" start
@@ -54,6 +55,7 @@ apt-get install -y --no-install-recommends -t "$RELEASE" "${PHP_PACKAGES_NEW[@]}
set_ncpcfg "php_version" "${PHPVER_NEW}"
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
+phpenmod -v "${PHPVER_NEW}" -s fpm opcache
( set -e; export PHPVER="${PHPVER_NEW}"; run_app nc-limits )
a2enconf "php${PHPVER_NEW}-fpm"
diff --git a/bin/ncp/CONFIG/nc-datadir.sh b/bin/ncp/CONFIG/nc-datadir.sh
index 4a2ae35a8..2516a7cc3 100644
--- a/bin/ncp/CONFIG/nc-datadir.sh
+++ b/bin/ncp/CONFIG/nc-datadir.sh
@@ -142,6 +142,7 @@ configure()
# opcache dir
create_opcache_dir
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini"
+ systemctl reload "php${PHPVER}-fpm"
# update fail2ban logpath
[[ -f /etc/fail2ban/jail.local ]] && \
diff --git a/bin/ncp/CONFIG/nc-nextcloud.sh b/bin/ncp/CONFIG/nc-nextcloud.sh
index 5582dfee4..224cdd3be 100644
--- a/bin/ncp/CONFIG/nc-nextcloud.sh
+++ b/bin/ncp/CONFIG/nc-nextcloud.sh
@@ -180,10 +180,12 @@ configure()
if [[ -z "${OPCACHEDIR}" ]]
then
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini" --defaults
+ systemctl reload "php${PHPVER}-fpm"
else
mkdir -p "$OPCACHEDIR"
chown -R www-data:www-data "$OPCACHEDIR"
install_template "php/opcache.ini.sh" "/etc/php/${PHPVER}/mods-available/opcache.ini"
+ systemctl reload "php${PHPVER}-fpm"
fi
## RE-CREATE DATABASE TABLE
diff --git a/etc/library.sh b/etc/library.sh
index 9d48133ab..8f381188f 100644
--- a/etc/library.sh
+++ b/etc/library.sh
@@ -256,7 +256,7 @@ install_template() {
local target="${2?}"
local bkp="$(mktemp)"
- echo "Installing template '$template'..."
+ echo "Installing template '$template' to '$target'..."
mkdir -p "$(dirname "$target")"
[[ -f "$target" ]] && cp -a "$target" "$bkp"
diff --git a/etc/ncp-templates/php/opcache.ini.sh b/etc/ncp-templates/php/opcache.ini.sh
index 132c8d822..b2134de08 100644
--- a/etc/ncp-templates/php/opcache.ini.sh
+++ b/etc/ncp-templates/php/opcache.ini.sh
@@ -23,10 +23,12 @@ mkdir -p "$TMP_DIR"
cat <
Date: Sun, 26 Jul 2026 23:02:15 +0200
Subject: [PATCH 4/6] build-sd-images.yml: Select php version dynamically for
php service dropins
---
.github/workflows/build-sd-images.yml | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/build-sd-images.yml b/.github/workflows/build-sd-images.yml
index 24688ad9f..293ddd94c 100644
--- a/.github/workflows/build-sd-images.yml
+++ b/.github/workflows/build-sd-images.yml
@@ -161,6 +161,8 @@ jobs:
- name: Prepare test
run: |
set -x
+
+ PHPVER="$(jq -r .php_version ./etc/ncp.cfg)"
mv "output/${ARTIFACT_FILE?}" ncp.img
sudo apt-get update
sudo apt-get install -y systemd-container
@@ -181,13 +183,15 @@ jobs:
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/redis-server.service.d/ncp-ci.conf
echo 'PrivateUsers=false' | sudo tee -a raspbian_root/etc/systemd/system/redis-server.service.d/ncp-ci.conf
- sudo mkdir -p raspbian_root/etc/systemd/system/php8.3-fpm.service.d
- echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp-ci.conf
- echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp-ci.conf
+ sudo mkdir -p raspbian_root/etc/systemd/system/php${PHPVER}-fpm.service.d
+ echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php${PHPVER}-fpm.service.d/ncp-ci.conf
+ echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php${PHPVER}-fpm.service.d/ncp-ci.conf
- name: Test image
id: test
run: |
+ PHPVER="$(jq -r .php_version ./etc/ncp.cfg)"
+
log_err() {
rc="${1?}"
msg="${2?}"
@@ -215,7 +219,7 @@ jobs:
echo -e "${LOG_CICD} Could not reach container. Aborting..."
"${CONTAINER_CMD[@]}" systemctl status --no-pager redis-server || :;
"${CONTAINER_CMD[@]}" systemctl status --no-pager mariadb || :;
- "${CONTAINER_CMD[@]}" systemctl status --no-pager php8.3-fpm || :;
+ "${CONTAINER_CMD[@]}" systemctl status --no-pager php${PHPVER}-fpm :;
exit 1
}
From 276abd50c6154566f1391bb69f5fe2d6d8052417 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?=
<6317548+theCalcaholic@users.noreply.github.com>
Date: Sun, 26 Jul 2026 23:43:47 +0200
Subject: [PATCH 5/6] nextcloud_tests.py: Improve debug output on failed
settings check
---
tests/nextcloud_tests.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/nextcloud_tests.py b/tests/nextcloud_tests.py
index da1939dc2..7181f7bec 100755
--- a/tests/nextcloud_tests.py
+++ b/tests/nextcloud_tests.py
@@ -324,7 +324,10 @@ def settings_config_check(wait, test):
test.check(True)
except Exception as e:
- print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML"))
+ try:
+ print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML"))
+ except NoSuchElementException:
+ print(driver.page_source)
test.check(e)
From e784c0ff393bf364aa3fa106526da7edb84d0e59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?=
<6317548+theCalcaholic@users.noreply.github.com>
Date: Mon, 27 Jul 2026 00:06:20 +0200
Subject: [PATCH 6/6] build-sd-images.yml: Fix armbian tests
---
.github/workflows/build-lxd.yml | 21 +++++++++++----------
.github/workflows/build-sd-images.yml | 17 ++++++++++++++++-
build/build-LXD.sh | 2 +-
tests/nextcloud_tests.py | 4 ++++
4 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/build-lxd.yml b/.github/workflows/build-lxd.yml
index 43bb31df4..dd207856b 100644
--- a/.github/workflows/build-lxd.yml
+++ b/.github/workflows/build-lxd.yml
@@ -43,7 +43,7 @@ jobs:
if [[ "${LXD_ARCH}" == "arm64" ]]
then
LXC_CMD="incus"
- RUNNER_LABEL="ubuntu-20.04-arm64"
+ RUNNER_LABEL="ubuntu-26.04-arm64"
echo "lxd_extra_profile=network" | tee -a "$GITHUB_OUTPUT"
else
LXC_CMD="incus"
@@ -71,10 +71,11 @@ jobs:
with:
ref: "${{ env.VERSION }}"
- name: Setup incus
- if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
+ if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }}
run: |
sudo apt-get update
- sudo apt-get install -y incus qemu-system incus-tools
+ sudo apt-get install -y incus qemu-system
+ sudo apt-get install -y incus-tools || sudo apt-get install -y incus-extra
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo incus admin init --auto
@@ -147,7 +148,7 @@ jobs:
echo "VERSION=$version" >> "$GITHUB_ENV"
echo "previous_version=${version}" >> $GITHUB_OUTPUT
- name: Setup incus
- if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
+ if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }}
run: |
sudo apt-get update
sudo apt-get install -y incus qemu-system incus-tools
@@ -199,7 +200,7 @@ jobs:
with:
ref: "${{ env.VERSION }}"
- name: Setup incus
- if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
+ if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }}
run: |
sudo apt-get update
sudo apt-get install -y incus qemu-system incus-tools
@@ -254,7 +255,7 @@ jobs:
. ./build/buildlib.sh
sudo "$LXC" delete -q -f ncp || true
sudo "$LXC" image import -q "./${ARTIFACT_FILE?}" --alias "ncp/test" || true
- LXC_ARGS=(-p default)
+ LXC_ARGS=(-p default -c security.nesting=true)
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
systemd-run --user --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp || \
sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp
@@ -418,7 +419,7 @@ jobs:
USE_INCUS: "${{ needs.determine-runner.outputs.lxc_cmd == 'incus' && 'yes' || 'no' }}"
steps:
- name: Setup incus
- if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
+ if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }}
run: |
sudo apt-get update
sudo apt-get install -y incus qemu-system incus-tools
@@ -474,7 +475,7 @@ jobs:
. ./build/buildlib.sh
sudo "$LXC" delete -q -f ncp || true
sudo "$LXC" image import -q "./ncp.tar.gz" --alias "ncp/update" || true
- LXC_ARGS=(-p default)
+ LXC_ARGS=(-p default -c security.nesting=true)
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
systemd-run --user --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/update" ncp || \
sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/update" ncp
@@ -739,7 +740,7 @@ jobs:
with:
ref: "${{ env.VERSION }}"
- name: Setup incus
- if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-20.04-arm64' }}
+ if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }}
run: |
sudo apt-get update
sudo apt-get install -y incus qemu-system incus-tools
@@ -794,7 +795,7 @@ jobs:
. ./build/buildlib.sh
sudo "$LXC" delete -q -f ncp || true
sudo "$LXC" image import -q "./${ARTIFACT_FILE?}" --alias "ncp/test" || true
- LXC_ARGS=(-p default)
+ LXC_ARGS=(-p default -c security.nesting=true)
[[ -z "$LXD_EXTRA_PROFILE" ]] || LXC_ARGS+=(-p "$LXD_EXTRA_PROFILE")
systemd-run --user --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp || \
sudo systemd-run --scope -p "Delegate=yes" "$LXC" launch -q "${LXC_ARGS[@]}" "ncp/test" ncp
diff --git a/.github/workflows/build-sd-images.yml b/.github/workflows/build-sd-images.yml
index 293ddd94c..ae95ef0fa 100644
--- a/.github/workflows/build-sd-images.yml
+++ b/.github/workflows/build-sd-images.yml
@@ -122,7 +122,7 @@ jobs:
test:
needs: build
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-20.04-arm64
env:
VERSION: "${{ inputs.git_ref }}"
ARTIFACT_ID: ${{ needs.build.outputs.artifact_name }}
@@ -186,6 +186,21 @@ jobs:
sudo mkdir -p raspbian_root/etc/systemd/system/php${PHPVER}-fpm.service.d
echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php${PHPVER}-fpm.service.d/ncp-ci.conf
echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php${PHPVER}-fpm.service.d/ncp-ci.conf
+
+ # Disable ImportCredential and LoadCredential directives to workaround https://gitlab.com/qemu-project/qemu/-/work_items/1962
+ # see https://github.com/systemd/systemd/issues/31219#issuecomment-2846006948
+ for i in raspbian_root/usr/lib/systemd/system/*.service
+ do
+ [[ -f $i ]] || continue
+ grep -q '^ImportCredential=' "$i" && {
+ sudo mkdir -p "${i/usr\/lib/etc}.d"
+ echo -e '[Service]\nImportCredential=' | sudo tee "${i/usr\/lib/etc}.d/unset-ImportCredential.conf"
+ }
+ grep -q '^LoadCredenital=' "$i" && {
+ sudo mkdir -p "${i/usr\/lib/etc}.d"
+ echo -e '[Service]\nLoadCredential=' | sudo tee "${i/usr\/lib/etc}.d/unset-LoadCredential.conf"
+ }
+ done
- name: Test image
id: test
run: |
diff --git a/build/build-LXD.sh b/build/build-LXD.sh
index ee5732eb3..7753ab10e 100755
--- a/build/build-LXD.sh
+++ b/build/build-LXD.sh
@@ -39,7 +39,7 @@ LXC_CMD=(lxc)
"${LXC_CMD[@]}" info || LXC_CMD=(sudo "${LXC_CMD[0]}")
"${LXC_CMD[@]}" delete -f ncp 2>/dev/null || true
-LXC_CREATE=("${LXC_CMD[@]}" init -p default)
+LXC_CREATE=("${LXC_CMD[@]}" init -p default -c security.nesting=true)
[[ -n "$LXD_EXTRA_PROFILE" ]] && LXC_CREATE+=(-p "$LXD_EXTRA_PROFILE")
if [[ -n "$LXD_ARCH" ]] && [[ "$LXD_ARCH" != "x86" ]]
then
diff --git a/tests/nextcloud_tests.py b/tests/nextcloud_tests.py
index 7181f7bec..159339814 100755
--- a/tests/nextcloud_tests.py
+++ b/tests/nextcloud_tests.py
@@ -189,6 +189,10 @@ def test_nextcloud(IP: str, nc_port: str, driver: WebDriver, skip_release_check:
wait.until(VisibilityOfElementLocatedByAnyLocator([(By.CSS_SELECTOR, "#security-warning.settings-section")]))
settings_config_check(wait, test)
except TimeoutException:
+ try:
+ print(driver.find_element(By.CSS_SELECTOR, "#security-warning").get_attribute("innerHTML"))
+ except NoSuchElementException:
+ print(driver.page_source)
settings_config_check_pre32(wait, test)
close_first_run_wizard(driver, wait_multiplier)