Fix episode highlight save: preserve structured show-notes fields; v2.0.40
Publish Container / docker (push) Successful in 15m47s

sanitizeFeaturedLinks was silently dropping showNotesSummary, showNotesThemes,
showNotesScripture, showNotesQuotes, and showNotesResources on every save — only
the legacy showNotes string was kept. Added sanitization for all five new fields
and updated the keep-filter to include them.

Also removed set -e from entrypoint.sh and made seed/merge steps non-fatal so a
permissions error on the mounted data volume no longer crash-loops the container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-09-21 07:51:37 -04:00
1 parent c79589b311
commit 600c450eff
3 files changed
+22 -8

No files matched your search

+6 -7
View File
@@ -1,11 +1,10 @@
#!/bin/sh
set -e
DATA_DIR=${SITEFORGE_DATA_DIR:-/app/data}
SEED_DIR=/app/data-seed
# Ensure the data directory exists (in case the volume was not mounted)
mkdir -p "$DATA_DIR"
mkdir -p "$DATA_DIR" || true
# Seed each default JSON file only when missing.
# This runs on first boot or a fresh volume, but never overwrites existing data.
@@ -18,7 +17,7 @@ if [ -d "$SEED_DIR" ]; then
if [ ! -f "$target_file" ]; then
echo "[siteforge] No $base_name found. Seeding from image defaults..."
cp "$seed_file" "$target_file"
cp "$seed_file" "$target_file" || echo "[siteforge] Warning: could not seed $base_name — check volume permissions on $DATA_DIR"
fi
done
fi
@@ -99,8 +98,8 @@ console.log(`[siteforge] Merged seeded platform links into ${targetFile}`)
NODE
}
merge_seed_platform_links "$DATA_DIR/admin-content.json" "$SEED_DIR/admin-content.json"
merge_seed_platform_links "$DATA_DIR/admin-content-draft.json" "$SEED_DIR/admin-content-draft.json"
merge_seed_platform_links "$DATA_DIR/admin-content.json" "$SEED_DIR/admin-content.json" || true
merge_seed_platform_links "$DATA_DIR/admin-content-draft.json" "$SEED_DIR/admin-content-draft.json" || true
# Backfill missing lesson releasedAt values from seeded defaults on upgrades.
# This keeps persistent volumes compatible with release-date access gating.
@@ -207,8 +206,8 @@ console.log(`[siteforge] Backfilled missing releasedAt values in ${targetFile}`)
NODE
}
merge_seed_study_release_dates "$DATA_DIR/admin-content.json" "$SEED_DIR/admin-content.json"
merge_seed_study_release_dates "$DATA_DIR/admin-content-draft.json" "$SEED_DIR/admin-content-draft.json"
merge_seed_study_release_dates "$DATA_DIR/admin-content.json" "$SEED_DIR/admin-content.json" || true
merge_seed_study_release_dates "$DATA_DIR/admin-content-draft.json" "$SEED_DIR/admin-content-draft.json" || true
export SITEFORGE_DATA_DIR="$DATA_DIR"
exec node server.js