Skip to content

Commit a1e48df

Browse files
committed
Update docker-nc-entrypoint patch following upstream
1 parent 99b6229 commit a1e48df

1 file changed

Lines changed: 35 additions & 25 deletions

File tree

patch/usr/local/bin/docker-nc-entrypoint.patch

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
--- docker-nc-entrypoint.old 2025-04-19 00:50:10.420321172 +0200
2-
+++ docker-nc-entrypoint.new 2025-04-19 00:48:54.401021232 +0200
3-
@@ -11,14 +11,6 @@
1+
--- docker-nc-entrypoint.old 2026-03-27 11:39:04.909244789 +0100
2+
+++ docker-nc-entrypoint.new 2026-03-27 17:03:19.919603895 +0100
3+
@@ -11,18 +11,10 @@
44
[ -z "$(ls -A "$1/")" ]
55
}
66

@@ -15,30 +15,43 @@
1515
# Execute all executable files in a given directory in alphanumeric order
1616
run_path() {
1717
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
18-
@@ -42,7 +34,12 @@
18+
- local found=0
19+
+ local found=0 return_code
20+
21+
echo "=> Searching for hook scripts (*.sh) to run, located in the folder \"${hook_folder_path}\""
22+
23+
@@ -41,11 +33,18 @@
1924

2025
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
2126
found=$((found+1))
22-
- run_as "${script_file_path}" || return_code="$?"
27+
- run_as "${script_file_path}" || {
28+
- return_code="$?"
2329
+
30+
+ return_code=0
2431
+ if [ "$(id -u)" = 0 ]; then
2532
+ su -p "$user" -s /bin/sh "${script_file_path}" || return_code="$?"
2633
+ else
2734
+ "${script_file_path}" || return_code="$?"
2835
+ fi
29-
30-
if [ "${return_code}" -ne "0" ]; then
36+
+
37+
+ if [ "${return_code}" -ne "0" ]; then
3138
echo "==> Failed at executing script \"${script_file_path}\". Exit code: ${return_code}"
32-
@@ -178,7 +175,7 @@
33-
exit 1
34-
fi
35-
echo "Upgrading nextcloud from $installed_version ..."
36-
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
37-
+ occ app:list | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_before
38-
fi
39-
if [ "$(id -u)" = 0 ]; then
40-
rsync_options="-rlDog --chown $user:$group"
41-
@@ -240,7 +237,7 @@
39+
exit 1
40+
- }
41+
+ fi
42+
43+
echo "==> Finished executing the script: \"${script_file_path}\""
44+
done
45+
@@ -82,7 +81,7 @@
46+
}
47+
48+
get_enabled_apps() {
49+
- run_as 'php /var/www/html/occ app:list' \
50+
+ occ app:list \
51+
| sed -n '/^Enabled:$/,/^Disabled:$/p' \
52+
| sed '1d;$d' \
53+
| sed -n 's/^ - \([^:]*\):.*/\1/p' \
54+
@@ -258,7 +257,7 @@
4255
echo "Starting nextcloud installation"
4356
max_retries=10
4457
try=0
@@ -47,7 +60,7 @@
4760
do
4861
echo "Retrying install..."
4962
try=$((try+1))
50-
@@ -256,7 +253,7 @@
63+
@@ -274,7 +273,7 @@
5164
NC_TRUSTED_DOMAIN_IDX=1
5265
for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do
5366
DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
@@ -56,19 +69,16 @@
5669
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
5770
done
5871
set +f # turn glob back on
59-
@@ -274,9 +271,9 @@
72+
@@ -292,7 +291,7 @@
6073
else
6174
run_path pre-upgrade
6275

6376
- run_as 'php /var/www/html/occ upgrade'
6477
+ occ upgrade
6578

66-
- run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
67-
+ occ app:list | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
68-
echo "The following apps have been disabled:"
69-
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
70-
rm -f /tmp/list_before /tmp/list_after
71-
@@ -289,7 +286,7 @@
79+
get_enabled_apps > /tmp/list_after
80+
disabled_apps="$(comm -23 /tmp/list_before /tmp/list_after || true)"
81+
@@ -310,7 +309,7 @@
7282

7383
# Update htaccess after init if requested
7484
if [ -n "${NEXTCLOUD_INIT_HTACCESS+x}" ] && [ "$installed_version" != "0.0.0.0" ]; then

0 commit comments

Comments
 (0)