Skip to content

Commit

Permalink
build-sd-images.yml: Adjust php fpm fix to correct php version
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Knöppler <[email protected]>
  • Loading branch information
theCalcaholic committed Aug 24, 2024
1 parent ef84957 commit 31d5ed9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/build-sd-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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} ================"
Expand All @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions build/armbian/armbian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion ncp-app/lib/Service/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
}
}
Expand Down
2 changes: 1 addition & 1 deletion ncp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]] && {
Expand Down

0 comments on commit 31d5ed9

Please sign in to comment.