Skip to content

Commit 746e7cb

Browse files
Merge pull request #2114 from nextcloud/devel
v1.57.1
2 parents 7f91ea0 + a567e04 commit 746e7cb

File tree

10 files changed

+87
-19
lines changed

10 files changed

+87
-19
lines changed

.github/workflows/vm-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ jobs:
234234
235235
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncc status" | grep "version:" | awk '{ print $3 }'
236236
latest_nc_version="$(cat /__w/nextcloudpi/nextcloudpi/etc/ncp.cfg | jq -r '.nextcloud_version')"
237+
current_nc_version_new="$(ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncc status" | grep "version:" | awk '{ print $3 }')"
238+
239+
if [[ "$current_nc_version_new" =~ "$latest_nc_version".* ]]
240+
then
241+
exit 0
242+
fi
237243
238244
for i in {1..10};
239245
do

bin/ncp-diag

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,11 @@ echo "Internet check|$( ping -W 2 -w 1 -q github.com &>/dev/null && echo ok || e
7070

7171
function is_port_open()
7272
{
73-
# The URL leads to an application I've deployed for NCP on https://fly.io using a Docker container I made.
74-
# The image for the container is available on Docker Hub (zendai/checkport:sanic) if you wish to deploy one yourself.
75-
# The code for the Sanic server and Docker image is available at: https://github.com/ZendaiOwl/Build/tree/master/Docker/Python/Sanic/checkport
76-
# I only have a free tier with limited outbound data per month, 100GB p/month.
77-
# If we go over 100GB outbound data in a month, I will start being charged for the data going over that limit.
78-
# I used a low level Python socket library & fortunately each request only consumes aprox. ~ 60-74 bytes p/second.
79-
# Meaning 100GB should be plenty, it should be enough to handle a little less
80-
# than 450 request p/second a month, unless my calculations are wrong.
81-
# Thank you :pray: from Victor-ray, S. https://github.com/ZendaiOwl
73+
# Checkport is deployed at fly.io by Victor-ray, S. for NextcloudPi.
74+
# Repo: https://gitbox.zendai.net.eu.org/n0rs3/checkport
75+
# docker.io/zendai/checkport:sanic
76+
# Please don't abuse it :pray:
77+
# It's deployed with free limits on my personal account and can handle a little less than 450 request p/second before I get charged extra.
8278
local -r PORTURL="https://checkport.zendai.net.eu.org/check"
8379
local TYPE="${1?}" IPType
8480
# Checks both port 80 & 443 for IPv4/IPv6 and returns the result or [N/A] [N/A]

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# NextcloudPi Changelog
22

3+
## [v1.57.1](https://github.com/nextcloud/nextcloudpi/tree/v1.57.1) (2026-04-14) Various fixes
4+
5+
### Fixes
6+
7+
- Fail gracefully when parsing invalid backup cache ([#2105](https://github.com/nextcloud/nextcloudpi/pull/2105), thanks @Dominik0101)
8+
- security: Properly escape all bash arguments in ncp-web (ncp-launcher.php)
9+
- Make sure, sury repository key is updated from pkg sources (fixes [#2104](https://github.com/nextcloud/nextcloudpi/issues/2104))
10+
- Fix broken ncp-preview-generator cronjob script (fixes [#2107](https://github.com/nextcloud/nextcloudpi/issues/2107))
11+
312
## [v1.57.0](https://github.com/nextcloud/nextcloudpi/tree/v1.57.0) (2026-04-04) Nextcloud 33, new previewgenerator, fixes
413

514
### Changes

etc/ncp-templates/cron.hourly/ncp-previewgenerator.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env bash
22

33
cat <<'EOF'
4+
#!/usr/bin/env bash
5+
set -eu
6+
47
GENERATE_JOB_ID="ncp-generate-previews"
58
69
if [[ "$(systemctl is-active "${GENERATE_JOB_ID}" ||:)" =~ ^(active|activating|deactivating)$ ]]
@@ -9,15 +12,13 @@ then
912
exit 0
1013
fi
1114
12-
#!/usr/bin/env bash
13-
set -eu
1415
source /usr/local/etc/library.sh
1516
1617
if is_app_enabled memories
1718
then
18-
ncc config:app:set --value="256 4096" previewgenerator coverWidthHeightSizes
19+
ncc config:app:set --value="256 4096" previewgenerator coverWidthHeightSizes > /dev/null
1920
else
20-
ncc config:app:set --value="" previewgenerator coverWidthHeightSizes
21+
ncc config:app:set --value="" previewgenerator coverWidthHeightSizes > /dev/null
2122
fi
2223
2324
for _ in $(seq 1 $(nproc)); do

lamp.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ install()
2626
{
2727
set -x
2828
# Setup apt repository for php 8
29-
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
30-
echo "deb https://packages.sury.org/php/ ${RELEASE%-security} main" > /etc/apt/sources.list.d/php.list
29+
wget -O /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
30+
dpkg -i /tmp/debsuryorg-archive-keyring.deb
31+
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
3132
apt-get update
3233
$APTINSTALL apt-utils cron curl
3334
ls -l /var/lock || true

ncp-web/backups.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ function filesize_compat($file)
5555
$cache_str = file_get_contents($cache_file)
5656
or exit("error opening ${cache_file}");
5757

58-
$cache = json_decode($cache_str, true) or [];
58+
$cache = json_decode($cache_str, true);
59+
if (!is_array($cache)) {
60+
$cache = [];
61+
}
5962
} else {
6063
$cache = [];
6164
}

ncp-web/ncp-launcher.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
$l10nDir = "l10n";
1717
ignore_user_abort(true);
1818

19+
function bash_escape_arg($arg): string
20+
{
21+
return "'" . str_replace("'", "\\'", $arg) . "'";
22+
}
23+
1924
//
2025
// language
2126
//
@@ -105,7 +110,7 @@
105110
echo ' "output": "" , ';
106111
echo ' "ret": ';
107112

108-
exec( 'bash -c "sudo /home/www/ncp-launcher.sh ' . $ncp_app . '"' , $output , $ret );
113+
exec( 'bash -c "sudo /home/www/ncp-launcher.sh ' . bash_escape_arg($ncp_app) . '"' , $output , $ret );
109114
echo '"' . $ret . '" }';
110115
}
111116

@@ -159,7 +164,7 @@
159164
exit('{ "output": "domain can\'t be empty", "ret": 1 }');
160165
}
161166
echo '{ "token": "' . getCSRFToken() . '",'; // Get new token
162-
exec("/usr/bin/php /var/www/nextcloud/occ config:system:set overwrite.cli.url --value '" . $_POST['url'] . "'",
167+
exec("/usr/bin/php /var/www/nextcloud/occ config:system:set overwrite.cli.url --value " . bash_escape_arg($_POST['url']),
163168
$out, $ret);
164169
echo ' "out": "' . htmlspecialchars(join("\n", $out), ENT_QUOTES, "UTF-8") . '", ';
165170
echo ' "ret": "' . $ret . '"}';

staged_rollouts/v1.57.1.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
4
2+
5
3+
7
4+
8
5+
21
6+
27
7+
30
8+
31
9+
32
10+
50
11+
64
12+
68
13+
71
14+
79
15+
81

updates/1.57.0.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,22 @@ set -eu
44

55
source /usr/local/etc/library.sh
66

7+
apt-get update
8+
9+
if [[ ! -e /usr/share/keyrings/debsuryorg-archive-keyring.gpg ]]
10+
then
11+
echo "Setup sury package repository key"
12+
curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
13+
dpkg -i /tmp/debsuryorg-archive-keyring.deb
14+
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
15+
apt-get update
16+
17+
echo "done."
18+
fi
19+
720
echo "Configuring serverid ..."
821
ncc config:system:get serverid > /dev/null || ncc config:system:set serverid --value="$((RANDOM % 1024))" --type=integer
922
echo "Installing PHP APCU ..."
10-
apt-get update
1123
apt-get install -y php${PHPVER}-apcu
1224
echo "Enable apache2 remoteip"
1325
a2enmod remoteip

updates/1.57.1.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
source /usr/local/etc/library.sh
5+
6+
echo "Reconfigure automatic preview generation (if enabled)"
7+
run_app nc-previews-auto
8+
echo "done."
9+
10+
if [[ ! -e /usr/share/keyrings/debsuryorg-archive-keyring.gpg ]]
11+
then
12+
echo "Setup sury package repository key"
13+
apt-get update
14+
curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
15+
dpkg -i /tmp/debsuryorg-archive-keyring.deb
16+
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
17+
apt-get update
18+
19+
echo "done."
20+
fi

0 commit comments

Comments
 (0)