From 75bffeb53e90a80e909f2aa01f820a9580977ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Kn=C3=B6ppler?= <6317548+theCalcaholic@users.noreply.github.com> Date: Sat, 24 Aug 2024 13:10:41 +0200 Subject: [PATCH] build-sd-images.yml: Adjust php fpm fix to correct php version 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> --- .github/workflows/build-sd-images.yml | 15 ++++++++++++--- build/armbian/armbian.sh | 2 ++ ncp-app/lib/Service/SettingsService.php | 3 ++- ncp.sh | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-sd-images.yml b/.github/workflows/build-sd-images.yml index a44780818..149e43059 100644 --- a/.github/workflows/build-sd-images.yml +++ b/.github/workflows/build-sd-images.yml @@ -191,9 +191,9 @@ jobs: echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf echo 'PrivateUsers=false' | sudo tee -a raspbian_root/etc/systemd/system/redis-server.service.d/ncp.conf - sudo mkdir -p raspbian_root/etc/systemd/system/php8.2-fpm.service.d - echo '[Service]' | sudo tee raspbian_root/etc/systemd/system/php8.2-fpm.service.d/ncp.conf - echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.2-fpm.service.d/ncp.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.conf + echo 'ExecStartPre=mkdir -p /var/run/php' | sudo tee -a raspbian_root/etc/systemd/system/php8.3-fpm.service.d/ncp.conf - name: Test image id: test run: | @@ -310,6 +310,14 @@ jobs: python tests/nextcloud_tests.py --no-gui "$ip" 443 4443 |& awk "{ print \"${LOG_TEST} \" \$0 }" [[ ${PIPESTATUS[0]} -eq 0 ]] || { echo -e "${LOG_CICD} Nextcloud test failed!" + echo -e "${LOG_DIAG} /etc/os-release:" + "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /etc/os-release' + echo -e "${LOG_DIAG} /usr/local/etc/ncp.cfg:" + "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /usr/local/etc/ncp.cfg' + cat ./raspbian_root/usr/local/etc/ncp.cfg + echo -e "${LOG_DIAG} /home/ncp-app-bridge config ncp" + "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'sudo -u www-data sudo /home/www/ncp-app-bridge.sh config ncp' + sudo ls -l ./raspbian_root/home/www/ncp-app-bridge.sh echo -e "{$LOG_DIAG} Geckodriver logs:" tail -n 20 geckodriver.log >&2 |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true echo -e "${LOG_CICD} ================" @@ -319,6 +327,7 @@ jobs: echo "${LOG_DIAG} Nextcloud log: " "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'ls -l /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true "${CONTAINER_CMD[@]}" -q ncp /bin/bash -c 'cat /opt/ncdata/data/nextcloud.log' |& awk "{ print \"${LOG_DIAG} \" \$0 }" || true + cat ./raspbian_root/opt/ncdata/data/nextcloud.log |& awk "{ print \"${LOG_DIAG} \" \$0 }" sleep 12 continue } diff --git a/build/armbian/armbian.sh b/build/armbian/armbian.sh index 985121062..3d79f4340 100644 --- a/build/armbian/armbian.sh +++ b/build/armbian/armbian.sh @@ -19,6 +19,8 @@ LINUXFAMILY=$2 BOARD=$3 BUILD_DESKTOP=$4 +echo "include home dir? ${INCLUDE_HOME_DIR:-no}" + cd /tmp/overlay NCPCFG=etc/ncp.cfg source etc/library.sh # sets RELEASE diff --git a/ncp-app/lib/Service/SettingsService.php b/ncp-app/lib/Service/SettingsService.php index 4db7da964..295750de6 100644 --- a/ncp-app/lib/Service/SettingsService.php +++ b/ncp-app/lib/Service/SettingsService.php @@ -38,6 +38,7 @@ public function getConfig(string $name, array $defaults): array } if ($config == null) { $this->logger->error("Failed to retrieve ncp config (exit code: $ret)"); + $this->logger->error("ERR: $stderr") return $defaults; } return $config; @@ -132,7 +133,7 @@ private function runCommand(string $cmd): array { 2 => ["pipe", "w"] ]; - $proc = proc_open($cmd, $descriptorSpec, $pipes, "/var/www", null); + $proc = proc_open($cmd, $descriptorSpec, $pipes, "/home/www", null); $stdout = stream_get_contents($pipes[1]); fclose($pipes[1]); $stderr = stream_get_contents($pipes[2]); diff --git a/ncp.sh b/ncp.sh index c2caedcd3..875dbe3a1 100644 --- a/ncp.sh +++ b/ncp.sh @@ -128,7 +128,7 @@ EOF cat > /home/www/ncp-app-bridge.sh <<'EOF' #!/bin/bash -set -e +set -ex grep -q '[\\&#;`|*?~<>^()[{}$&]' <<< "$*" && exit 1 action="${1?}" [[ "$action" == "config" ]] && {