Proxy kiwix-serve through this app instead of linking to it directly
CI / check (push) Successful in 39s
CI / deploy (push) Successful in 12s

map.priesol.net sits behind a reverse proxy that only forwards to
maptool itself, so the previous approach (publish kiwix-serve's port,
link the browser straight at it) had no address a real browser could
ever reach — not just a Docker-internal hostname as first assumed, but
no host/port combination at all works from outside.

GET /kiwix/* now proxies to kiwix-serve (Kiwix.proxy in
lib/maptool/kiwix.rb, a plain Net::HTTP passthrough), and the kiwix
service runs with --urlRootLocation=/kiwix so every link/asset it
emits already carries that same prefix and needs no rewriting
(confirmed against libkiwix/internalServer.cpp, which strips this
exact prefix off incoming requests). Drops the port-publishing
approach from the previous commit entirely.
This commit is contained in:
randy committed 2026-09-09 15:29:08 +02:00
1 parent 9997a8a8c0
commit 5ff9b113d9
7 files changed
+107 -51

No files matched your search

+4
View File
@@ -28,6 +28,10 @@ class AppTest < Minitest::Test
assert_equal({ "available" => false, "url" => "" }, json_body(response))
end
def test_kiwix_proxy_404s_when_no_url_configured
assert_equal 404, request.get("/kiwix/search").status
end
def test_gnss_position_unavailable_with_no_fix
response = request.get("/api/gnss/position", **logged_in_env)
assert_equal({ "available" => false }, json_body(response))