Skip to content

Commit a6cf48e

Browse files
Merge pull request #1984 from nextcloud/release/v1.55.2
Release/v1.55.2
2 parents 29e6c05 + 9890d68 commit a6cf48e

File tree

8 files changed

+76
-10
lines changed

8 files changed

+76
-10
lines changed

bin/ncp-check-nc-version

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ source /usr/local/etc/library.sh # sets NCLATESTVER
88

99
CURRENT="$(nc_version)"
1010
NEXT_VERSION="$(determine_nc_update_version "${CURRENT}" "${NCLATESTVER?}")"
11-
[[ -n "$NEXT_VERSION" ]] || exit 0
11+
if [[ -z "$NEXT_VERSION" ]] || [[ "$NEXT_VERSION" == "${CURRENT}" ]]
12+
then
13+
exit 0
14+
fi
1215

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

bin/ncp-update-nc

+6-5
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ VER="$1"
2626
connect_to_nc_update() {
2727
tail -n 100 -f "/var/log/ncp-update-nc.log" &
2828
tail_pid=$!
29+
trap "kill '$tail_pid'" EXIT
2930
while [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]]
3031
do
3132
sleep 3
3233
done
3334

34-
kill "$tail_pid"
3535
if [[ "$(systemctl is-active ncp-update-nc ||:)" == "inactive" ]]
3636
then
3737
echo "Nextcloud update finished successfully."
3838
return 0
3939
elif [[ "$(systemctl is-active ncp-update-nc ||:)" == "failed" ]]
4040
then
41-
echo "Nextcloud update failed."
41+
echo "Nextcloud update failed (or was installed already)."
4242
return 1
4343
else
4444
echo "Nextcloud update was not found or failed (unexpected status: '$(systemctl is-active ncp-update-nc ||:)')"
@@ -52,15 +52,16 @@ then
5252
exit $?
5353
fi
5454

55-
systemctl reset-failed ncp-encrypt ||:
56-
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"
57-
sleep 5
55+
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
56+
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"
57+
sleep 1
5858

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

6667
connect_to_nc_update

bin/ncp-update-nc.d/update-nc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fi
3131
TARGET_VERSION="$(determine_nc_update_version "${CURRENT?}" "${NCLATESTVER}" "${REQUESTED_VERSION}")"
3232
[[ "$TARGET_VERSION" == "$CURRENT" ]] && {
3333
echo "Nextcloud version ${CURRENT} is already installed. Nothing to do."
34-
exit 0
34+
exit 1
3535
}
3636
[[ -n "$TARGET_VERSION" ]] || {
3737
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."

bin/ncp/SECURITY/nc-encrypt.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ configure()
5858
export PASSWORD
5959
# Just mount already encrypted data
6060
if [[ -f "${encdir?}"/gocryptfs.conf ]]; then
61-
systemctl reset-failed ncp-encrypt ||:
61+
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
6262
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"
6363

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

9090
mkdir "${datadir}"
91-
systemctl reset-failed ncp-encrypt ||:
91+
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
9292
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"
9393

9494
maxtries=5

bin/ncp/UPDATES/nc-autoupdate-nc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ configure()
2323
source /usr/local/etc/library.sh
2424
2525
echo -e "[ncp-update-nc]" >> /var/log/ncp.log
26-
/usr/local/bin/ncp-update-nc "$NCLATESTVER" 2>&1 | tee -a /var/log/ncp.log
26+
/usr/local/bin/ncp-update-nc "latest" 2>&1 | tee -a /var/log/ncp.log
2727
2828
if [[ \${PIPESTATUS[0]} -eq 0 ]]; then
2929

etc/ncp-templates/mysql/91-ncp.cnf.sh

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ innodb_file_per_table=1
1919
innodb_file_format=barracuda
2020
max_allowed_packet=256M
2121
22+
[mysqldump]
23+
max_allowed_packet = 256M
24+
2225
[server]
2326
# innodb settings
2427
skip-name-resolve

staged_rollouts/v1.55.2.txt

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
0
2+
1
3+
2
4+
3
5+
4
6+
5
7+
6
8+
9
9+
10
10+
13
11+
15
12+
26
13+
29
14+
30
15+
32
16+
33
17+
34
18+
35
19+
36
20+
37
21+
38
22+
39
23+
40
24+
41
25+
42
26+
43
27+
44
28+
45
29+
46
30+
47
31+
48
32+
51
33+
54
34+
55
35+
59
36+
60
37+
62
38+
63
39+
64
40+
68
41+
69
42+
70
43+
73
44+
74
45+
75
46+
76
47+
84
48+
89
49+
92
50+
96

updates/1.55.2.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source /usr/local/etc/library.sh
5+
6+
run_app nc-autoupdate-nc
7+
8+
install_template "mysql/91-ncp.cnf.sh" "/etc/mysql/mariadb.conf.d/91-ncp.cnf"
9+
service mariadb reload

0 commit comments

Comments
 (0)