mirror of
https://github.com/open-webui/open-terminal.git
synced 2026-11-26 07:11:02 -05:00
- Text files: return JSON with content string (unchanged) - Supported binary types (image/* by default): return raw binary with proper Content-Type header - Unsupported binary types: 415 error - New env var OPEN_TERMINAL_BINARY_MIME_PREFIXES (comma-separated, default: 'image') controls which binary types are allowed
16 lines
496 B
Python
16 lines
496 B
Python
import os
|
|
|
|
API_KEY = os.environ.get("OPEN_TERMINAL_API_KEY", "")
|
|
LOG_DIR = os.environ.get(
|
|
"OPEN_TERMINAL_LOG_DIR",
|
|
os.path.join(os.path.expanduser("~"), ".open-terminal", "logs"),
|
|
)
|
|
|
|
# Comma-separated mime type prefixes for binary files that read_file will return
|
|
# as raw binary responses (e.g. "image,audio" or "image/png,image/jpeg").
|
|
BINARY_FILE_MIME_PREFIXES = [
|
|
p.strip()
|
|
for p in os.environ.get("OPEN_TERMINAL_BINARY_MIME_PREFIXES", "image").split(",")
|
|
if p.strip()
|
|
]
|