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 <noreply@anthropic.com>
37 lines
1.1 KiB
Bash
Executable file
37 lines
1.1 KiB
Bash
Executable file
#!/bin/sh
|
|
# seed-data.sh — first-boot seed of /core/data with Dragon Fork
|
|
# landing page artifacts (index.html, whep-player.html).
|
|
#
|
|
# Runs from the entrypoint before bin/core. Skips itself if any of the
|
|
# target files already exist, so user-supplied content (or content from
|
|
# a previous deploy that they edited) is never clobbered.
|
|
#
|
|
# Source dir: /core/static (baked by the Dockerfile)
|
|
# Target dir: /core/data (operator-mounted; what Core serves at /)
|
|
|
|
set -e
|
|
|
|
SRC=/core/static
|
|
DST="${CORE_STORAGE_DISK_DIR:-/core/data}"
|
|
|
|
if [ ! -d "$SRC" ]; then
|
|
# No static dir baked — nothing to seed. Fall through silently.
|
|
exit 0
|
|
fi
|
|
|
|
if [ ! -d "$DST" ]; then
|
|
mkdir -p "$DST"
|
|
fi
|
|
|
|
# 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 -Rp "$f" "$DST/$name"
|
|
echo "seed-data: copied $name -> $DST/$name"
|
|
fi
|
|
done
|