Mynij - search faster, offline

Mynij Milestone 4: Torrent sharing of Index

A user can now decide to enable torrent sharing. The Mynij PWA can become a seeder of an index. Another user with the index Magnet Uri can download the torrent from the seeding browser directly. Indexed can now be shared without having to go through a central platform subject to content sharing restrictions.
  • Last Update:2021-02-22
  • Version:001
  • Language:en

The goal of this Milestone is to implement sharing of index through Mynij users. A user can decide if he want to enable torrent sharing, when done he will become a seeder. Another user with the index Magnet Uri can download the torrent from the seeder browser directly.

Mynij uses Webtorrent to share index in the browser. WebTorrent is written completely in JavaScript and uses WebRTC for peer-to-peer transport whenever possible. No browser plugins, extensions, or installation is required to use WebTorrent in the browser.

Source code can be found in Nexedi gitlab here: https://lab.nexedi.com/Mynij/erp5/tree/Mynij/bt5/erp5_web_mynij_search.

Backgound Index Seed

When an index is built, it can be shared to others Mynij users through a torrent. Seeding an index will create a Blob of full index (which contains a zipped JSON file), this mean export all Flexsearch data, index definition and saved content, then make it available to internet.

Seed of index is enabled by checking Seed as Torrent in the index document source and click on Save. A backgound job extract required data and start to seed it. As long as the browser tab is opened, the seeder is active and available for download.

To stop seeding, user can unckeck Seed as Torrent and save the index again, this will cancel the job for the related index.

Officejs Appstore - Dashboard

Activities page show Torrent seed state, it's possible to see the Torrent size as well as the magnet URL. When a client download the torrent, the progression, the number of peers and the current download speed are updated in live, it help to see which torrent is being transferred.

Mynij App Offline installation

 

Import Index from Torrent

Importing index from torrent is same as importing from a file with the advantage that it's easy to share index with a simple link.

https://mynij.app.officejs.com/app/#/?page=mynij_torrent&magnet_uri=FULL_MAGNET_URI

Opening the link in the browser, automatically start download of index from available peers. This operation is fast than a build (crawl all URLs in the index takes time), index in the torrent is zipped which reduce considerably the size of blob to download.

Index torrent can also be imported by clicking on the menu Import Index Torrent, which opend a form where user can input the Magnet URI and start download.

When downloading the torrent, user can see download progression and file extraction information.

Become a seeder

It's possible to seed any index (thus become an index seeder). This is done by navigating to index Sources menu in Mynij app, choose the index to seed then check Seed as Torrent. A RenderJS background job loop every minutes and create a new seed from enabled index data.