3 Commits

Author SHA1 Message Date
fc92b963d4 Release: v0.2 2022-06-07 00:01:35 +02:00
9acbd5dccf Add .gitignore 2022-06-07 00:00:54 +02:00
87ebc137d5 shared/gui: Add LOOQS_DISABLE_SANDBOX env to allow disabling sandboxing
Mainly for devs to check whether a problem is caused by sandboxing.
2022-06-06 23:23:07 +02:00
8 changed files with 43 additions and 2 deletions

11
.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
.user
.o
*.user
*.o
*.a
moc_*.cpp
moc_*.h
Makefile
cli/looqs
gui/looqs-gui
qrc_*

View File

@ -1,5 +1,10 @@
# looqs: Release notes # looqs: Release notes
## 2022-06-07 - v0.2
CHANGES:
- Sandboxing: Add environment variable `LOOQS_DISABLE_SANDBOXING` to disable sandboxing. This is intended for troubleshooting
- Sandboxing: Fix issue where activation failed on kernels without landlock
## 2022-06-06 - v0.1 ## 2022-06-06 - v0.1
The first release comes with basic functionality. It's a start that can be considered useful to some degree. The first release comes with basic functionality. It's a start that can be considered useful to some degree.

View File

@ -12,6 +12,8 @@ The architecture ensures that the parsing of documents and the preview generatio
Qt code is considered trusted in this model. While one may critize this, it was the only practical solution. looqs uses its serialization mechanism and other classes to communicate between the non-sandboxed GUI process and the sandboxed processes. Qt code is considered trusted in this model. While one may critize this, it was the only practical solution. looqs uses its serialization mechanism and other classes to communicate between the non-sandboxed GUI process and the sandboxed processes.
Set the enviornment variable `LOOQS_DISABLE_SANDBOX=1` to disable sandboxing. It's intended for troublehshooting.
## Database ## Database
The heart is sqlite, with the FTS5 extensions behind the full-text search. I definitly did not The heart is sqlite, with the FTS5 extensions behind the full-text search. I definitly did not
want to run some heavy Java based solutions. I explored other options like Postgresql, I've discard them due to some limitations back then. want to run some heavy Java based solutions. I explored other options like Postgresql, I've discard them due to some limitations back then.

View File

@ -30,7 +30,7 @@ There is no need to write the long form of filters. There are also booleans avai
## Current status ## Current status
Last version: 2022-06-06, v0.1 Last version: 2022-06-07, v0.2
Please see [Changelog](CHANGELOG.md) for a human readable list of changes. Please see [Changelog](CHANGELOG.md) for a human readable list of changes.

View File

@ -58,7 +58,14 @@ int main(int argc, char *argv[])
if(arg == "ipc") if(arg == "ipc")
{ {
Common::setupAppInfo(); Common::setupAppInfo();
enableIpcSandbox(); if(Common::noSandboxModeRequested())
{
qInfo() << "Launching with no sandbox!" << Qt::endl;
}
else
{
enableIpcSandbox();
}
QApplication a(argc, argv); QApplication a(argc, argv);
IpcServer *ipcserver = new IpcServer(); IpcServer *ipcserver = new IpcServer();

View File

@ -157,6 +157,16 @@ QString Common::databasePath()
return env; return env;
} }
bool Common::noSandboxModeRequested()
{
QString env = getenv("LOOQS_DISABLE_SANDBOX");
if(env == "1")
{
return true;
}
return false;
}
QString Common::ipcSocketPath() QString Common::ipcSocketPath()
{ {
return "/tmp/.looqs/looqs-ipc-socket"; return "/tmp/.looqs/looqs-ipc-socket";

View File

@ -15,6 +15,7 @@ QStringList excludedPaths();
QStringList mountPaths(); QStringList mountPaths();
bool isTextFile(QFileInfo fileInfo); bool isTextFile(QFileInfo fileInfo);
bool isMountPath(QString path); bool isMountPath(QString path);
bool noSandboxModeRequested();
QString versionText(); QString versionText();
} // namespace Common } // namespace Common
#endif #endif

View File

@ -27,6 +27,11 @@ static QMap<QString, Processor *> processors{
void SandboxedProcessor::enableSandbox(QString readablePath) void SandboxedProcessor::enableSandbox(QString readablePath)
{ {
if(Common::noSandboxModeRequested())
{
qInfo() << "Sandbox is disabled!" << Qt::endl;
return;
}
struct exile_policy *policy = exile_init_policy(); struct exile_policy *policy = exile_init_policy();
if(policy == NULL) if(policy == NULL)
{ {