Skip to content

Commit

Permalink
Merge pull request #1985 from nextcloud/devel
Browse files Browse the repository at this point in the history
V1.55.2
  • Loading branch information
theCalcaholic authored Sep 24, 2024
2 parents 29e6c05 + 50e1adf commit eb835b9
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 10 deletions.
5 changes: 4 additions & 1 deletion bin/ncp-check-nc-version
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ source /usr/local/etc/library.sh # sets NCLATESTVER

CURRENT="$(nc_version)"
NEXT_VERSION="$(determine_nc_update_version "${CURRENT}" "${NCLATESTVER?}")"
[[ -n "$NEXT_VERSION" ]] || exit 0
if [[ -z "$NEXT_VERSION" ]] || [[ "$NEXT_VERSION" == "${CURRENT}" ]]
then
exit 0
fi

NOTIFIED=/var/run/.nc-version-notified

Expand Down
11 changes: 6 additions & 5 deletions bin/ncp-update-nc
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ VER="$1"
connect_to_nc_update() {
tail -n 100 -f "/var/log/ncp-update-nc.log" &
tail_pid=$!
trap "kill '$tail_pid'" EXIT
while [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]]
do
sleep 3
done

kill "$tail_pid"
if [[ "$(systemctl is-active ncp-update-nc ||:)" == "inactive" ]]
then
echo "Nextcloud update finished successfully."
return 0
elif [[ "$(systemctl is-active ncp-update-nc ||:)" == "failed" ]]
then
echo "Nextcloud update failed."
echo "Nextcloud update failed (or was installed already)."
return 1
else
echo "Nextcloud update was not found or failed (unexpected status: '$(systemctl is-active ncp-update-nc ||:)')"
Expand All @@ -52,15 +52,16 @@ then
exit $?
fi

systemctl reset-failed ncp-encrypt ||:
systemd-run -u 'ncp-update-nc' bash -c "DBG='${DBG:-}' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER}' |& tee /var/log/ncp-update-nc.log"
sleep 5
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
systemd-run -u 'ncp-update-nc' bash -c "set -o pipefail; DBG='${DBG:-}' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER}' |& tee /var/log/ncp-update-nc.log"
sleep 1

if ! [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|inactive|activating|deactivating)$ ]]
then
echo "Failed to start ncp-update-nc"
[[ -f /var/log/ncp-update-nc.log ]] && cat /var/log/ncp-update-nc.log
systemctl status --no-pager ncp-update-nc ||:
exit 1
fi

connect_to_nc_update
2 changes: 1 addition & 1 deletion bin/ncp-update-nc.d/update-nc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
TARGET_VERSION="$(determine_nc_update_version "${CURRENT?}" "${NCLATESTVER}" "${REQUESTED_VERSION}")"
[[ "$TARGET_VERSION" == "$CURRENT" ]] && {
echo "Nextcloud version ${CURRENT} is already installed. Nothing to do."
exit 0
exit 1
}
[[ -n "$TARGET_VERSION" ]] || {
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."
Expand Down
4 changes: 2 additions & 2 deletions bin/ncp/SECURITY/nc-encrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ configure()
export PASSWORD
# Just mount already encrypted data
if [[ -f "${encdir?}"/gocryptfs.conf ]]; then
systemctl reset-failed ncp-encrypt ||:
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
systemd-run -u ncp-encrypt -E PASSWORD bash -c "gocryptfs -fg -allow_other -q '${encdir}' '${datadir}' <<<\"\${PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log"

# switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web
Expand Down Expand Up @@ -88,7 +88,7 @@ configure()
mv "${datadir?}" "${tmpdir?}"

mkdir "${datadir}"
systemctl reset-failed ncp-encrypt ||:
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
systemd-run -u ncp-encrypt -E PASSWORD bash -c "gocryptfs -fg -allow_other -q '${encdir}' '${datadir}' <<<\"\${PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log"

maxtries=5
Expand Down
2 changes: 1 addition & 1 deletion bin/ncp/UPDATES/nc-autoupdate-nc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ configure()
source /usr/local/etc/library.sh
echo -e "[ncp-update-nc]" >> /var/log/ncp.log
/usr/local/bin/ncp-update-nc "$NCLATESTVER" 2>&1 | tee -a /var/log/ncp.log
/usr/local/bin/ncp-update-nc "latest" 2>&1 | tee -a /var/log/ncp.log
if [[ \${PIPESTATUS[0]} -eq 0 ]]; then
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# NextcloudPi Changelog

## [v1.55.2](https://github.com/nextcloud/nextcloudpi/tree/v1.55.2) (2024-09-24) Hotfix release

### Fixes

- Increase the maximum package size for mysqldump to 256M (fixes [#1979](https://github.com/nextcloud/nextcloudpi/issues/1979))
- Fix repeated erroneous update success messages for auto updates (fixes [#1979](https://github.com/nextcloud/nextcloudpi/issues/1979), [#1981](https://github.com/nextcloud/nextcloudpi/issues/1981))

## [v1.55.1](https://github.com/nextcloud/nextcloudpi/tree/v1.55.1) (2024-09-08) Hotfix release

### Fixes
Expand Down
3 changes: 3 additions & 0 deletions etc/ncp-templates/mysql/91-ncp.cnf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ innodb_file_per_table=1
innodb_file_format=barracuda
max_allowed_packet=256M
[mysqldump]
max_allowed_packet = 256M
[server]
# innodb settings
skip-name-resolve
Expand Down
50 changes: 50 additions & 0 deletions staged_rollouts/v1.55.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
0
1
2
3
4
5
6
9
10
13
15
26
29
30
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
51
54
55
59
60
62
63
64
68
69
70
73
74
75
76
84
89
92
96
9 changes: 9 additions & 0 deletions updates/1.55.2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

source /usr/local/etc/library.sh

run_app nc-autoupdate-nc

install_template "mysql/91-ncp.cnf.sh" "/etc/mysql/mariadb.conf.d/91-ncp.cnf"
service mariadb reload

0 comments on commit eb835b9

Please sign in to comment.