diff --git a/dangerzone/conversion/doc_to_pixels.py b/dangerzone/conversion/doc_to_pixels.py index 9d5b79b..786f25f 100644 --- a/dangerzone/conversion/doc_to_pixels.py +++ b/dangerzone/conversion/doc_to_pixels.py @@ -309,10 +309,6 @@ async def main() -> int: except Exception as e: converter.update_progress(str(e), error=True) error_code = errors.UnexpectedConversionError.error_code - if not running_on_qubes(): - # Write debug information (containers version) - with open("/tmp/dangerzone/captured_output.txt", "wb") as container_log: - container_log.write(converter.captured_output) return error_code diff --git a/dangerzone/conversion/pixels_to_pdf.py b/dangerzone/conversion/pixels_to_pdf.py index f8c670a..2217e00 100644 --- a/dangerzone/conversion/pixels_to_pdf.py +++ b/dangerzone/conversion/pixels_to_pdf.py @@ -97,17 +97,10 @@ async def main() -> int: try: await converter.convert(ocr_lang) - error_code = 0 # Success! - + return 0 except (RuntimeError, TimeoutError, ValueError) as e: converter.update_progress(str(e), error=True) - error_code = 1 - - if not running_on_qubes(): - # Write debug information (containers version) - with open("/safezone/captured_output.txt", "wb") as container_log: - container_log.write(converter.captured_output) - return error_code + return 1 if __name__ == "__main__": diff --git a/dangerzone/isolation_provider/container.py b/dangerzone/isolation_provider/container.py index 2d51e58..27bd988 100644 --- a/dangerzone/isolation_provider/container.py +++ b/dangerzone/isolation_provider/container.py @@ -296,14 +296,6 @@ class Container(IsolationProvider): ] ret = self.exec_container(document, command, extra_args) - if getattr(sys, "dangerzone_dev", False): - log_path = pixel_dir / "captured_output.txt" - with open(log_path, "r", encoding="ascii", errors="replace") as f: - untrusted_log = f.read(MAX_CONVERSION_LOG_CHARS) - log.info( - f"Conversion output (doc to pixels):\n{self.sanitize_conversion_str(untrusted_log)}" - ) - if ret != 0: log.error("documents-to-pixels failed") @@ -348,16 +340,6 @@ class Container(IsolationProvider): # We did it success = True - if getattr(sys, "dangerzone_dev", False): - log_path = safe_dir / "captured_output.txt" - if log_path.exists(): # If first stage failed this may not exist - with open(log_path, "r", encoding="ascii", errors="replace") as f: - text = ( - f"Container output: (pixels to PDF)\n" - f"{PIXELS_TO_PDF_LOG_START}\n{f.read()}{PIXELS_TO_PDF_LOG_END}" - ) - log.info(text) - return success def get_max_parallel_conversions(self) -> int: