mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 10:51:36 -04:00
* Bake the app build into images; rebuild on-device only when stale Previously the Raspberry Pi image shipped without app/build/ and compiled the React bundle on first boot via repair.sh -- a multi-minute, memory-hungry step that can OOM a 2GB Pi. The Debian Live ISO already baked the build in, so the two paths had drifted. Add scripts/build_app.sh as the single source of truth: it hashes the build inputs (src/, public/, package.json, package-lock.json, tsconfig.json) and runs `npm run build` (with GENERATE_SOURCEMAP=false) only when build/ is missing or those inputs changed, then writes build/.build-stamp. Wire all three call sites to it: - pi-gen 03-run-chroot.sh now builds after npm install, baking build/ into the Pi image like the Debian hook already does. - debian-live 9999-wrolpi.hook.chroot uses it so the baked build is stamped. - repair.sh uses it, so first-boot/manual-repair/install/upgrade all become no-ops when the shipped build is current. Result: fresh images ship a stamped build/, so a weak Pi never compiles on boot or repair; an on-device rebuild happens only when an upgrade actually changes app/. build_app.sh never runs npm install, so repair.sh keeps its offline guarantee. * build_app.sh: rebuild when built output is incomplete, not just missing Addresses review feedback: a matching stamp only proves the inputs are unchanged, not that the output survived. repair.sh exists to fix corruption, so a build/ with index.html + stamp but a missing JS/CSS asset must still rebuild. Verify every file referenced by build/asset-manifest.json exists (and that the manifest itself parses); rebuild otherwise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| build_app.sh | ||
| cleanup_orphaned_tags.py | ||
| delete_downloads.py | ||
| delete_similarly_named_videos.py | ||
| dev_build.sh | ||
| find_and_convert_srt_to_vtt.py | ||
| find_and_rename_orphan_video_files.py | ||
| find_corrupt_videos.py | ||
| fix_media_permissions.sh | ||
| generate_certificates.sh | ||
| generate_subtitles.py | ||
| install_debian_12.sh | ||
| install_help_service.sh | ||
| install_protomaps.sh | ||
| install_raspberrypios.sh | ||
| renew_certificates.sh | ||
| reset_api_db.sh | ||
| reset_tags.sh | ||
| reset_virtual_environments.sh | ||
| singlefile_browser_wrapper.sh | ||
| singlefile_to_archive.py | ||
| start_kiwix_serve.sh | ||
| upgrade.sh | ||
| upgrade_yt-dlp.sh | ||
| wrolpi-usb.sh | ||