@@ -45,21 +45,59 @@ echo "→ Running bootstrap (Apache + Nextcloud installer)…"
4545(cd /tmp && sudo -E /usr/local/bin/bootstrap.sh apache2ctl start)
4646
4747# Wait for the background installer to finish (up to 5 minutes).
48- echo " → Waiting for Nextcloud installation to complete…"
48+ # Fun messages are printed every 10 seconds to keep the developer entertained.
49+ FUN_TASKS=(
50+ " Summoning PHP 8.3 🐘"
51+ " Cloning Nextcloud ${SERVER_BRANCH:- master} 🌿"
52+ " Setting up the database 🗄️"
53+ " Running maintenance:install 🔧"
54+ " Enabling apps 🧩"
55+ " Configuring Apache 🪁"
56+ " Calibrating Xdebug 🔍"
57+ " Feeding the RSS gnomes 📰"
58+ " Polishing the user interface ✨"
59+ " Teaching owls to hoot 🦉"
60+ " Brewing extra coffee ☕"
61+ " Checking for gremlins 🐛"
62+ " Untangling spaghetti code 🍝"
63+ " Counting database rows 🔢"
64+ " Crossing fingers 🤞"
65+ " Chanting install mantras 🙏"
66+ " Bribing the build gods ⚡"
67+ " Asking the PHP fairy nicely 🧚"
68+ " Definitely almost done ⏳"
69+ )
70+ TASK_INDEX=0
4971TIMEOUT=300
5072ELAPSED=0
73+
74+ echo " → Waiting for Nextcloud installation to complete…"
75+ echo " "
76+
5177until sudo -u www-data php " $WEBROOT /occ" status 2> /dev/null | grep -q " installed: true" ; do
5278 if [ " $ELAPSED " -ge " $TIMEOUT " ]; then
79+ echo " "
5380 echo " ✘ Timed out waiting for Nextcloud installation" >&2
5481 exit 1
5582 fi
5683 sleep 5
5784 ELAPSED=$(( ELAPSED + 5 ))
58- printf " \r %ds / %ds…" " $ELAPSED " " $TIMEOUT "
85+ # Print a new "completed task" every 10 seconds to entertain the developer.
86+ if [ " $ELAPSED " -gt " 0" ] && [ " $(( ELAPSED % 10 )) " -eq " 0" ]; then
87+ printf " ✔ %s\n" " ${FUN_TASKS[$TASK_INDEX]} "
88+ TASK_INDEX=$(( (TASK_INDEX + 1 ) % ${# FUN_TASKS[@]} ))
89+ fi
5990done
6091echo " "
6192echo " ✔ Nextcloud installed"
6293
94+ # Disable the profiler. The dev base image enables it by default; it must be
95+ # turned off after the installer finishes writing config.php (any earlier
96+ # attempt races against the background installer and gets overwritten).
97+ echo " → Disabling Nextcloud profiler…"
98+ sudo -u www-data php " $WEBROOT /occ" config:system:set profiler --value=false --type=bool
99+ echo " ✔ Profiler disabled"
100+
63101# Fix ownership so the vscode developer can read/write these directories
64102# without sudo. Apache (www-data) retains access via group membership.
65103echo " → Fixing permissions for development…"
@@ -70,4 +108,11 @@ for dir in config data apps-writable apps-extra apps-shared; do
70108 sudo chmod -R g+rwX " $target "
71109done
72110
73- echo " ✔ Nextcloud is ready at http://localhost (admin / admin)"
111+ # Bootstrap runs as root (via sudo -E), so any Nextcloud temp files it created
112+ # in /tmp are owned by root. Remove them so the vscode user can recreate them
113+ # with the correct owner on the first `./occ` run (otherwise FileSequence
114+ # finds a root-owned directory that exists but is not writable).
115+ sudo find /tmp -maxdepth 1 -type d -user root \( -name ' oc_*' -o -name ' nc_*' \) \
116+ -exec rm -rf {} + 2> /dev/null || true
117+
118+ echo " ✔ Nextcloud is ready at http://localhost (admin / admin)"
0 commit comments