Link POI popups to offline Wikipedia via kiwix-serve
CI / check (push) Successful in 40s
CI / deploy (push) Successful in 12s

lib/maptool/kiwix.rb: a small reachability check for an external
kiwix-serve instance. GET /api/kiwix reports it (same optional-
integration pattern as offline-tiles/terrain-tiles); the frontend
adds a "Nearby on Wikipedia" link to a point's popup pointing straight
at kiwix-serve's own geo search (GET /search?latitude=&longitude=
&distance=, confirmed from libkiwix's actual source rather than
guessed) — linked to directly, not proxied/embedded, since it already
has a full search UI of its own.

docker-compose.yaml: new `kiwix` service (ghcr.io/kiwix/kiwix-serve)
on the default network, KIWIX_URL wired to reach it by service name.
The ZIM itself isn't part of the repo (large, self-contained archive)
— data/kiwix/ gitignored same as the *.pmtiles files, setup steps in
docs/development.adoc.

No kiwix-serve/ZIM available here to test end-to-end — verified the
app side against a stand-in local HTTP server (GET /api/kiwix flips
available correctly) and confirmed the generated popup link matches
the real geo-search query shape. docker-compose.yaml validated with
`docker-compose config`. Full test suite: 118 runs, 0 failures.
This commit is contained in:
randy committed 2026-09-09 13:44:37 +02:00
1 parent 7cd3171998
commit 24ac5931f8
13 files changed
+150 -9

No files matched your search

+5 -3
View File
@@ -35,9 +35,11 @@ expect this to flip the other way, `/srv/docker` symlinked to
below) — `Dockerfile`, `docker-compose.yaml`, application code.
`podman compose` reads the same `docker-compose.yaml` — no
Podman-specific compose file needed.
* `data/`, *not* part of that sync — uploaded GPX files and
`offline.pmtiles`. Persisted via a bind mount (`./data:/app/data` in
`docker-compose.yaml`), so a redeploy never touches it.
* `data/`, *not* part of that sync — uploaded GPX files,
`offline.pmtiles`, `terrain.pmtiles`, and `kiwix/wikipedia.zim` (see
`docs/development.adoc` for each). Persisted via a bind mount
(`./data:/app/data` in `docker-compose.yaml`), so a redeploy never
touches it.
== The native deploy runner
+26
View File
@@ -72,6 +72,32 @@ something the running app calls itself — drop the output into
mapped as a way/relation, e.g. a supermarket traced as a building
outline rather than a single point).
== Offline Wikipedia (kiwix-serve)
A point popup's "Nearby on Wikipedia" link needs
https://github.com/kiwix/kiwix-tools[kiwix-serve] running with a
Wikipedia https://library.kiwix.org[ZIM] loaded — set `KIWIX_URL` to
wherever it's reachable (`docker-compose.yaml` already runs a `kiwix`
service pointed at `data/kiwix/wikipedia.zim` and wires `KIWIX_URL` to
it; blank/unset disables the link, same as every other optional
integration here). Not part of the repo — a ZIM is a large,
self-contained archive, obtain one locally:
* https://library.kiwix.org/#lang=eng&category=wikipedia[Kiwix's own
library] has pre-built Wikipedia ZIMs — a `_maxi` variant per
language/region includes images, `_nopic` is much smaller if
browsing images offline doesn't matter here.
* Download it to `data/kiwix/wikipedia.zim` (the exact filename
`docker-compose.yaml`'s `kiwix` service expects — rename after
downloading, Kiwix's own filenames are much more specific).
Once it's there, `docker compose up -d kiwix` (or a full restart)
picks it up — `GET /api/kiwix` reports `available: true` and the
"Nearby on Wikipedia" link appears. kiwix-serve's own geo search
(`GET /search?pattern=&latitude=&longitude=&distance=`,
`lib/maptool/kiwix.rb`'s docstring) is linked to directly, not
proxied/embedded — it already has a full search UI of its own.
== GNSS position (gpsd)
The "GNSS" control needs https://gpsd.io[gpsd] running and pointed at