From b5f4f67813de9ed3bf9094fa9da1abf033122908 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Thu, 13 Aug 2026 07:16:17 +0000 Subject: [PATCH] oosetup: return exit code, not the secret The mediapreview setup_docker() return value (the JWT secret) was passed through to main() and sys.exit(), printing it a second time on stderr with a failure exit code. The secret is already printed to stdout in the finally block; return 0 on success. --- cista/onlyoffice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cista/onlyoffice.py b/cista/onlyoffice.py index d8c198e..417a2dc 100644 --- a/cista/onlyoffice.py +++ b/cista/onlyoffice.py @@ -21,7 +21,7 @@ def configure() -> None: ) -def setup_docker(confdir: Path | None = None) -> str: +def setup_docker(confdir: Path | None = None) -> int: """Build and run the patched OnlyOffice Docker image (via mediapreview).""" if confdir is not None: os.environ["CISTA_HOME"] = confdir.as_posix() @@ -38,10 +38,11 @@ def setup_docker(confdir: Path | None = None) -> str: ) configure() try: - return mediapreview.office.setup_docker() + mediapreview.office.setup_docker() finally: # Print regardless of build outcome: the secret is deterministic # (derived from the config). sys.stdout.write( f"ONLYOFFICE_JWT_SECRET={os.environ['ONLYOFFICE_JWT_SECRET']}\n" ) + return 0