looqs/HACKING.md

30 строки
2.1 KiB
Markdown
Исходник Постоянная ссылка Обычный вид История

2022-06-06 14:49:24 +02:00
# looqs - Hacking
## Introduction
2022-10-18 16:19:25 +02:00
If you are interested on how to contribute, please see the file [CONTRIBUTING.md](CONTRIBUTING.md) which contains the instructions on how to submit patches etc.
2022-06-06 14:49:24 +02:00
## Security
2022-06-14 17:40:56 +02:00
The architecture ensures that the parsing of documents and the preview generation is sandboxed by [exile.h](https://github.com/quitesimpleorg/exile.h). looqs uses a multi-process architecture to achieve this.
2022-06-06 14:49:24 +02:00
2022-06-14 17:40:56 +02:00
Qt code is considered trusted in this model. While one may critize this, it was the only practical solution. looqs uses Qt's serialization mechanism and other classes to communicate between the non-sandboxed GUI process and the sandboxed processes.
2022-06-06 14:49:24 +02:00
Set the enviornment variable `LOOQS_DISABLE_SANDBOX=1` to disable sandboxing. It's intended for troublehshooting.
2022-06-06 14:49:24 +02:00
## Database
2022-10-18 16:19:25 +02:00
The heart is sqlite, with the FTS5 extensions behind the full-text search. While FTS may not be sqlite's strong suit, I definitely did not want to run one of those oftenly recommended heavy (Java based) solutions. I explored other options like Postgresql, I've discard them due to some limitations back then. It's also natural to use sqlite as it's
used for metadata in general.
2022-06-06 14:49:24 +02:00
Down the road, alternatives will be explored of course if sqlite should not suffice anymore.
## File format support
The pdf library is libpoppler. Files such as .odt or .docx documents are opened with libquazip. The XML files in there are not parsed,
2022-06-14 17:40:56 +02:00
looqs simply strips the tags and that seems to work fine so far. Naturally, this is not the "proper way", so there is room for improvement maybe here. However, those file formats are not a huge priortiy for me personally. libuchardet does encoding detection and conversion.
2022-06-06 14:49:24 +02:00
2022-06-14 17:40:56 +02:00
Naturally, looqs won't be able to index and render previews for everything. Such approach would create a huge bloated binary. In the future, there will be some plugin system of some sorts, either we will load .so objects or use subprocesses.
2022-06-06 14:49:24 +02:00
## Name
2022-10-18 16:19:25 +02:00
looqs looks for files. You as the user can also look inside them. The 'k' in "looks" was replaced by a 'q'. Originally, I wanted my projects to have "qs" (for quitesimple) in their name. While that quirk is abandoned now, this got us to looqs.
2022-06-06 14:49:24 +02:00