Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43fd7df098 | ||
|
|
768ccd7739 | ||
|
|
321a86acf8 | ||
|
|
b5f4f67813 | ||
|
|
697a9416e8 | ||
|
|
d005ae1d88 | ||
|
|
3d8e20de8f |
+2
-1
@@ -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
@@ -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",
|
||||
|
||||
+11
-2
@@ -6,6 +6,7 @@ only bridges cista's config-derived JWT secret into it and wires the
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import mediapreview.office
|
||||
@@ -20,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()
|
||||
@@ -36,4 +37,12 @@ def setup_docker(confdir: Path | None = None) -> str:
|
||||
}
|
||||
)
|
||||
configure()
|
||||
return mediapreview.office.setup_docker()
|
||||
try:
|
||||
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,28 +0,0 @@
|
||||
services:
|
||||
onlyoffice:
|
||||
build:
|
||||
context: ./mediapreview/mediapreview/docker
|
||||
args:
|
||||
ONLYOFFICE_VERSION: "9.3.1"
|
||||
container_name: onlyoffice
|
||||
ports:
|
||||
- "8080:80"
|
||||
environment:
|
||||
# Number of converter workers (default 8).
|
||||
# Set to your CPU count or slightly below.
|
||||
- WORKERS
|
||||
# JWT secret shared with Cista.
|
||||
# OnlyOffice reads it as JWT_SECRET; Cista reads it as ONLYOFFICE_JWT_SECRET.
|
||||
# We use ONLYOFFICE_JWT_SECRET as the canonical name so you only set one variable.
|
||||
- JWT_SECRET=${ONLYOFFICE_JWT_SECRET}
|
||||
- JWT_ENABLED=true
|
||||
- JWT_HEADER=Authorization
|
||||
volumes:
|
||||
# Persist fonts and generated caches across restarts
|
||||
- onlyoffice-data:/var/www/onlyoffice/Data
|
||||
- onlyoffice-lib:/var/lib/onlyoffice
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
onlyoffice-data:
|
||||
onlyoffice-lib:
|
||||
+1
-1
@@ -33,7 +33,7 @@ dependencies = [
|
||||
"html5tagger>=1.3.0",
|
||||
"httpx>=0.28.0",
|
||||
"inotify>=0.2.12",
|
||||
"mediapreview[standard]>=0.2.0",
|
||||
"mediapreview[standard]>=0.2.3",
|
||||
"msgspec>=0.19.0",
|
||||
"natsort>=8.4.0",
|
||||
"numpy>=2.3.2",
|
||||
|
||||
Reference in New Issue
Block a user