From 10f3e20a6ab2784d99a3703038262dfff5b51f85 Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Sun, 3 May 2026 13:01:51 +0000 Subject: [PATCH] fix(deploy): make seed-data.sh recursive for directory entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Restreamer UI bundle includes subdirectories (_player, _playersite, static, locales) and the Dockerfile copies the whole tree into /core/static. seed-data.sh on first boot was using flat 'cp -p' which errors on directories with 'omitting directory ...'; set -e then exits, the container restarts forever in a crash loop, and Core never starts. Fix: 'cp -Rp' so directories are copied as trees. The no-clobber check on the top-level name still keeps operator-edited content safe — if /core/data/_player exists we don't replace it, even if its internals diverge from the bundled version. Also defends against dotfiles via the second glob. Co-Authored-By: Claude Opus 4.7 --- deploy/truenas/core/seed-data.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy/truenas/core/seed-data.sh b/deploy/truenas/core/seed-data.sh index 3d05a52..6b883fa 100755 --- a/deploy/truenas/core/seed-data.sh +++ b/deploy/truenas/core/seed-data.sh @@ -23,11 +23,15 @@ if [ ! -d "$DST" ]; then mkdir -p "$DST" fi -for f in "$SRC"/*; do +# Iterate over both files and directories. The Restreamer UI bundle +# ships subdirectories (_player, _playersite, static) so this needs +# the recursive flag; the no-clobber check on the top-level name keeps +# operator-edited content safe. +for f in "$SRC"/* "$SRC"/.[!.]*; do [ -e "$f" ] || continue name=$(basename "$f") if [ ! -e "$DST/$name" ]; then - cp -p "$f" "$DST/$name" + cp -Rp "$f" "$DST/$name" echo "seed-data: copied $name -> $DST/$name" fi done