LoRes Mesh

P2P Kiwix

in-progress
Jade
Jade
Development

P2P Kiwix

The Kiwix user interface normally displays a search-able index of the archived websites (stored as .zim files) available on this web-server.

For our LoRes version, we want to also display zims that are not actually on this web-server, but are on other nodes in the region. We want to do this in a way that doesn’t confuse the user into thinking they can access them, but we do want to show them where they can be found. Kind of like when you search for a book in a library and find that it isn’t there, but it is available at another local library.

Feature ideas

  • Zim files that aren’t present display in the list, but with dashed borders and less bold colours
  • These remote zim files also show which nodes are hosting them
  • If the internet is up, you can actually link directly through to the remote zim file on the other server

Implementation

Sharing the zim index

When a kiwix install detects that a zim has been added, it needs to share that with the region (using an app specific p2panda message). That’s how we build up a view of what is available.

The user interface

We may want the user interface to look almost exactly like the default kiwix interface, with our additions. So it doesn’t look like we’re usurping the project.

Wrapping libkiwix

Kiwix is written in C++. We are running the kiwix-serve app, but actually this is just a thin daemon wrapper around libkiwix. It’s libkiwix that produces the front end, using a C++ powered web server, some static html, and JS.

We could run this entire website, wrap it, and inject our extra stuff with some javascript. However we also need to monitor when zims are added. Also, libkiwix is designed to be used as a lib too, and built upon.

So the likely implementation path here is to implement our own web app, that uses libkiwix, and we decorate it as we like (and respond to library changes).

Ideally, we’d write this in Rust. To access libkiwix, there don’t seem to be any existing rust bindings. We may want to do this using the cxx crate.