wrolpi/pi-gen/stage2/04-wrolpi
Roland 19f4958fb5 zim: ship a default fallback Zim and honor the configured Zim directory
Two related gaps in how WROLPi serves Kiwix content:

1. A fresh WROLPi (or one whose zims are all corrupt/absent) showed a blank
   Kiwix.  Every image now ships a small built-in default Zim that Kiwix falls
   back to, telling the user to download real Zim files.

2. The startup scripts hardcoded the `/zims` directory, ignoring wrolpi.yaml's
   `zims_destination` (which the Python side already honors).

Changes:
- New wrolpi/scripts/read_config_value.sh: a zero-dependency (awk) reader so
  non-Python scripts can reliably read top-level wrolpi.yaml scalars.  Also a
  config_value() wrapper in wrolpi/scripts/lib.sh.
- New wrolpi/scripts/default_zim/: HTML source + a reproducible builder
  (ghcr.io/openzim/zim-tools) that outputs the committed wrolpi/blobs/default.zim.
- New wrolpi/blobs/: any committed blob here is copied to /opt/wrolpi-blobs by
  the pi-gen and debian-live builds; the Docker zim image bakes it in.
- start_kiwix_serve.sh honors zims_destination and falls back to the default
  Zim when no functioning zim is found.
- docker/zim/entrypoint.sh gains the same default-Zim fallback.  It needs no
  config read: it already scans the whole mounted media dir, and
  zims_destination is always a subdirectory of that mount.
- Changing zims_destination via the settings API now restarts Kiwix so it
  serves the new directory without a reboot.

Tests: new test_read_config_value.py, extended test_start_kiwix_serve.py
(configured dir + default-Zim fallback), and a root_api test for the restart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 19:09:57 -06:00
..
files Key changes: 2026-04-04 13:48:19 -06:00
00-run-chroot.sh Updating pi-gen build to use bookworm-arm64 branch. 2026-02-11 17:38:04 -07:00
01-packages-nr Bake tippecanoe into the Raspberry Pi image (#537) 2026-07-15 15:48:25 -06:00
02-run.sh Creating script in pi-gen directory which creates the WROLPi Raspberry Pi OS images. 2023-10-12 18:33:51 -06:00
03-run-chroot.sh image builds: reset repo to HEAD before stamping the app build 2026-07-18 13:39:50 -06:00
04-run-chroot.sh zim: ship a default fallback Zim and honor the configured Zim directory 2026-07-20 19:09:57 -06:00