diff --git a/.github/workflows/build-sd-images.yml b/.github/workflows/build-sd-images.yml index a44780818..bb518ca54 100644 --- a/.github/workflows/build-sd-images.yml +++ b/.github/workflows/build-sd-images.yml @@ -151,12 +151,12 @@ jobs: steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3 -# - name: Set up QEMU -# run: | -# sudo apt-get update -# sudo apt-get install -y binfmt-support -# docker run --rm --privileged tonistiigi/binfmt:latest --install all -# docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + - name: Set up QEMU + run: | + sudo apt-get update + sudo apt-get install -y binfmt-support + docker run --rm --privileged tonistiigi/binfmt:latest --install all + docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes # sudo systemctl disable apparmor # sudo mkdir -p /etc/binfmt # for conf in qemu-{aarch64,arm}-static.conf @@ -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: | @@ -208,13 +208,13 @@ jobs: sudo systemd-nspawn --boot -D ./raspbian_root/ -M ncp --hostname=nextcloudpi |& awk "{ print \"${LOG_GUEST} \" \$0 }" & sleep 60 - CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait) + CONTAINER_CMD=(sudo systemd-run --machine=ncp -P --wait) success=false for attempt in {1..30} do echo -e "${LOG_CICD} == Wait until container network is available (attempt $attempt/30) ==" - ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')" + ip="$("${CONTAINER_CMD[@]}" bash -c '. /usr/local/etc/library.sh > /dev/null; get_ip')" [[ -n "$ip" ]] && curl -k "https://$ip/activate/" > /dev/null || { sleep 6; continue; } success=true break @@ -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 confi g 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..bc69fb900 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,11 +133,13 @@ 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]); fclose($pipes[2]); + + $this->logger->error("STDERR: $stderr") return [proc_close($proc), $stdout, $stderr]; } } 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" ]] && {