Compare commits

...
4 Commits
Author SHA1 Message Date
LeoVasanko 43fd7df098 Bump mediapreview version 2026-08-13 07:49:09 +00:00
LeoVasanko 768ccd7739 startup box: show mediapreview version next to cista version
Version comes from importlib.metadata (the package has no version
constant), making it obvious at a glance which mediapreview build the
running server resolved.
2026-08-13 07:46:29 +00:00
LeoVasanko 321a86acf8 5 min cache for auth checks to reduce spam. 2026-08-13 07:23:22 +00:00
LeoVasanko b5f4f67813 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.
2026-08-13 07:16:17 +00:00
4 changed files with 7 additions and 5 deletions

No files matched your search

+2 -1
View File
@@ -1,5 +1,6 @@
import os
import sys
from importlib.metadata import version as pkg_version
from pathlib import Path
from docopt import docopt
@@ -30,7 +31,7 @@ def create_startup_box(
*, folder, url, unix=None, dev=False, paskia_url=None, public=False
):
"""Create a framed startup box with server information."""
title = f"Cista {cista.__version__}"
title = f"Cista {cista.__version__} (mediapreview {pkg_version('mediapreview')})"
listen = unix or url
location = f"{folder} @ {listen}"
lines = [title, location]
+1 -1
View File
@@ -226,7 +226,7 @@ def hydrate_request_auth_context(request, *, source: str) -> None:
_AUTH_REALM = "cista"
_AUTH_CACHE_TTL = 10
_AUTH_CACHE_TTL = 300
_auth_cache: dict[str, tuple[float, config.User]] = {}
_WINDOWS_UA_HINTS = (
"windows",
+3 -2
View File
@@ -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
+1 -1
View File
@@ -33,7 +33,7 @@ dependencies = [
"html5tagger>=1.3.0",
"httpx>=0.28.0",
"inotify>=0.2.12",
"mediapreview[standard]>=0.2.2",
"mediapreview[standard]>=0.2.3",
"msgspec>=0.19.0",
"natsort>=8.4.0",
"numpy>=2.3.2",