wrolpi/scripts
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
..
build_app.sh Bake the app build into images; rebuild on-device only when stale (#536) 2026-07-15 15:19:25 -06:00
cleanup_orphaned_tags.py Creating script to clean up orphaned tag files. 2026-02-28 17:05:02 -07:00
delete_downloads.py Many fixes split out from the feature/unified-query branch. Installing diagnostic tools in the built images. Displaying video comment statistics. Echoing error when install.sh fails. 2024-04-14 13:13:30 -06:00
delete_similarly_named_videos.py Refactoring videos and archives UI paths for consistent scheme. 2026-03-20 15:38:32 -06:00
dev_build.sh Postgres -> SQLite hard cutover: the database moves into the media directory. 2026-07-12 14:09:37 -06:00
find_and_convert_srt_to_vtt.py Adding option to ignore errors in find_and_convert_srt_to_vtt.py. 2023-08-04 08:36:30 -06:00
find_and_rename_orphan_video_files.py Bumping version for new feature. 2022-12-07 18:15:28 -07:00
find_corrupt_videos.py Postgres -> SQLite hard cutover: the database moves into the media directory. 2026-07-12 14:09:37 -06:00
fix_media_permissions.sh File permissions fix script checks for exfat and other file systems before trying to repair, displays a warning and gives advice on how to fix the issue. 2026-03-05 18:18:53 -07:00
generate_certificates.sh Certificates: only include SANs permitted by the Root CA name constraints. 2026-07-05 12:38:08 -06:00
generate_subtitles.py Creating script which finds all SRT files and converts them to VTT. 2023-08-03 22:36:11 -06:00
install_debian_12.sh Caddy install: run gpg --dearmor with --batch --yes. 2026-07-05 13:03:11 -06:00
install_help_service.sh Replacing Tag names with escaped tag names to avoid errors in Tags Directory. 2024-10-16 18:56:10 -06:00
install_protomaps.sh Remove stale Postgres references after SQLite cutover. 2026-07-18 13:28:54 -06:00
install_raspberrypios.sh Caddy install: run gpg --dearmor with --batch --yes. 2026-07-05 13:03:11 -06:00
renew_certificates.sh Certificates: help.sh validates the CA and leaf certs; fix renew exec bit. 2026-07-09 16:00:43 -06:00
reset_api_db.sh Postgres -> SQLite hard cutover: the database moves into the media directory. 2026-07-12 14:09:37 -06:00
reset_tags.sh Postgres -> SQLite hard cutover: the database moves into the media directory. 2026-07-12 14:09:37 -06:00
reset_virtual_environments.sh upgrade: rebuild venvs after a Python major-version change 2026-07-20 09:08:30 -06:00
singlefile_browser_wrapper.sh Single file deno (#478) 2026-06-12 17:07:28 -06:00
singlefile_to_archive.py A Channel can be tagged with a single Tag. The Channel can be moved into a Tag Directory according to the config. 2024-10-16 18:56:19 -06:00
start_kiwix_serve.sh zim: ship a default fallback Zim and honor the configured Zim directory 2026-07-20 19:09:57 -06:00
upgrade.sh upgrade: rebuild venvs after a Python major-version change 2026-07-20 09:08:30 -06:00
upgrade_yt-dlp.sh Creating script which updates yt-dlp in the wrolpi venv to the latest available. 2025-01-23 17:46:37 -07:00
wrolpi-usb.sh Docs: recommend Raspberry Pi Imager instead of Etcher. 2026-07-03 18:58:54 -06:00