Skip to content

Per removable device databases

This MR implements per removable device databases, making indexed data more perennial in these devices and useful across different computers. As a consequence, we move away from keeping this indexed data in the main database at ~/.cache.

This is implemented underneath as multiple indexer instances, managed by the same localsearch-3 process, each of them with a different database as storage. These multiple instances will coordinate themselves, so there only one active instance, with the main instance taking priority over removable device instances. They are all globally managed by the existing D-Bus interfaces to e.g. pause/resume.

This removable device indexed data is served in distinct endpoints on predictable object paths (i.e. based on the mountpoint path) at the same org.freedesktop.LocalSearch3 D-Bus name. Clients must either open specific TrackerSparqlConnection instances to these endpoints, or use the SERVICE{} SPARQL syntax to pull data from them specifically.

Besides the refactors necessary to accommodate these multiple instances, there are two substantial decisions involved:

  • In order to make the removable device indexed data universal, we cannot rely on absolute file:/// URIs, as that may change between computers. These databases will use a relative file: URI scheme instead with file: referencing the root folder of the removable mount, and e.g. file:a.txt expressing an a.txt file in it.
  • Besides potentially harmful files, we also have to deal with potentially harmful databases. This MR adds defense in depth for these scenarios, by delegating the management of the removable device database to a sandboxed process. This database is operated via a TrackerEndpoint over a private bus connection from the main localsearch-3 process, and proxied transparently to the extractor and clients accessing it.

Besides these changes, there's also some sugar for the CLI, and some documentation.

Merge request reports

Loading