From 85fb128eea1b1159641ad54540d3212cce884cb7 Mon Sep 17 00:00:00 2001 From: Conor Schaefer Date: Thu, 4 Mar 2021 09:26:55 -0500 Subject: [PATCH] First draft on per-source DispVMs See discussion in https://github.com/freedomofpress/securedrop-workstation/issues/333 --- securedrop_client/__init__.py | 2 +- securedrop_client/logic.py | 11 +++++++++-- setup.py | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/securedrop_client/__init__.py b/securedrop_client/__init__.py index 6a9beea82..3d26edf77 100644 --- a/securedrop_client/__init__.py +++ b/securedrop_client/__init__.py @@ -1 +1 @@ -__version__ = "0.4.0" +__version__ = "0.4.1" diff --git a/securedrop_client/logic.py b/securedrop_client/logic.py index bee5f41f9..ff6d3564e 100644 --- a/securedrop_client/logic.py +++ b/securedrop_client/logic.py @@ -855,9 +855,16 @@ def on_file_open(self, file: db.File) -> None: if not self.qubes: return - command = "qvm-open-in-vm" - args = ["--view-only", "$dispvm:sd-viewer", file.location(self.data_dir)] + vm_prep_cmd = "qrexec-client-vm" + source_name = file.source.journalist_filename + dispvm_name = f"sd-viewer-{source_name}" + vm_prep_args = ["dom0", f"securedrop.CreateSourceDispVM+{source_name}"] process = QProcess(self) + logger.info("Creating DispVM: {}".format(dispvm_name)) + process.execute(vm_prep_cmd, vm_prep_args) + logger.info("Opening file in DispVM: {}".format(dispvm_name)) + command = "qvm-open-in-vm" + args = ["--view-only", f"sd-viewer-{source_name}", file.location(self.data_dir)] process.start(command, args) def run_printer_preflight_checks(self): diff --git a/setup.py b/setup.py index 485fb9c85..1fd7b6985 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setuptools.setup( name="securedrop-client", - version="0.4.0", + version="0.4.1", author="Freedom of the Press Foundation", author_email="securedrop@freedom.press", description="SecureDrop Workstation client application",