|
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 @@ |
4 | 4 | [ -z "$(ls -A "$1/")" ] |
5 | 5 | } |
6 | 6 |
|
|
15 | 15 | # Execute all executable files in a given directory in alphanumeric order |
16 | 16 | run_path() { |
17 | 17 | 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 @@ |
19 | 24 |
|
20 | 25 | echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\"" |
21 | 26 | found=$((found+1)) |
22 | | -- run_as "${script_file_path}" || return_code="$?" |
| 27 | +- run_as "${script_file_path}" || { |
| 28 | +- return_code="$?" |
23 | 29 | + |
| 30 | ++ return_code=0 |
24 | 31 | + if [ "$(id -u)" = 0 ]; then |
25 | 32 | + su -p "$user" -s /bin/sh "${script_file_path}" || return_code="$?" |
26 | 33 | + else |
27 | 34 | + "${script_file_path}" || return_code="$?" |
28 | 35 | + fi |
29 | | - |
30 | | - if [ "${return_code}" -ne "0" ]; then |
| 36 | ++ |
| 37 | ++ if [ "${return_code}" -ne "0" ]; then |
31 | 38 | 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 @@ |
42 | 55 | echo "Starting nextcloud installation" |
43 | 56 | max_retries=10 |
44 | 57 | try=0 |
|
47 | 60 | do |
48 | 61 | echo "Retrying install..." |
49 | 62 | try=$((try+1)) |
50 | | -@@ -256,7 +253,7 @@ |
| 63 | +@@ -274,7 +273,7 @@ |
51 | 64 | NC_TRUSTED_DOMAIN_IDX=1 |
52 | 65 | for DOMAIN in ${NEXTCLOUD_TRUSTED_DOMAINS}; do |
53 | 66 | DOMAIN=$(echo "${DOMAIN}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') |
|
56 | 69 | NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1)) |
57 | 70 | done |
58 | 71 | set +f # turn glob back on |
59 | | -@@ -274,9 +271,9 @@ |
| 72 | +@@ -292,7 +291,7 @@ |
60 | 73 | else |
61 | 74 | run_path pre-upgrade |
62 | 75 |
|
63 | 76 | - run_as 'php /var/www/html/occ upgrade' |
64 | 77 | + occ upgrade |
65 | 78 |
|
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 @@ |
72 | 82 |
|
73 | 83 | # Update htaccess after init if requested |
74 | 84 | if [ -n "${NEXTCLOUD_INIT_HTACCESS+x}" ] && [ "$installed_version" != "0.0.0.0" ]; then |
|
0 commit comments