wrolpi/wrolpi/scripts
Roland aeebe8d833
zim: address PR review — config race, YAML null, path traversal, pinned build
Triage of Greptile findings on the default-Zim / configurable-directory PR:

- Stale config on restart (P1): settings update() only queues an async
  background_save, and the restart switch has no ordering guarantee (the switch
  worker pops LIFO), so start_kiwix_serve.sh could read the old zims_destination.
  Save the config synchronously before activating the restart switch.
- YAML null (P1): read_config_value.sh now treats an unquoted null/~ as unset
  (returns the default), matching PyYAML/the Python config layer.  A quoted
  "null" remains the literal string.
- Path traversal (P1/security): the settings API now rejects a zims_destination
  containing "..", and start_kiwix_serve.sh defends in depth by falling back to
  `zims` for any absolute/traversal/empty value, so Kiwix can never scan or
  rewrite library.xml outside the media root.
- Reproducible build (P2): pin the zim-tools image to 3.7.0 instead of :latest.

Tests added for null handling, traversal rejection (API + script).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 19:10:09 -06:00
..
default_zim zim: address PR review — config race, YAML null, path traversal, pinned build 2026-07-20 19:10:09 -06:00
build_map_regions.py Map search added to global search. Preview cards are displayed for all results in new Map tab. 2026-04-13 12:17:08 -06:00
build_map_search.py Map search added to global search. Preview cards are displayed for all results in new Map tab. 2026-04-13 12:17:08 -06:00
first_startup.sh Migrating Controller from port 8087 to 80 so that it is more discoverable. Reformatting Controller dashboard to make header at the top. Reformatting navigation bar to handle the new links which prevented Admin from being visible in some screens. 2026-04-09 15:01:05 -06:00
install_map_tools.sh install_map_tools: fix pmtiles x86_64 asset name (was 404 on amd64). 2026-07-15 16:20:53 -06:00
lib.sh zim: ship a default fallback Zim and honor the configured Zim directory 2026-07-20 19:09:57 -06:00
read_config_value.sh zim: address PR review — config race, YAML null, path traversal, pinned build 2026-07-20 19:10:09 -06:00