mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-28 07:35:27 -04:00
refactor(uploads): centralize upload byte-limits in upload_limits.py (#3364)
Move every per-route upload byte-limit into src/upload_limits.py as a validated, env-overridable constant via read_byte_limit_env: - Add GALLERY_UPLOAD_MAX_BYTES, GALLERY_TRANSFORM_UPLOAD_MAX_BYTES, MEMORY_IMPORT_MAX_BYTES, PERSONAL_UPLOAD_MAX_BYTES, EMAIL_COMPOSE_UPLOAD_MAX_BYTES, STT_MAX_AUDIO_BYTES, ICS_MAX_BYTES. - Routes import their constant instead of defining it locally: replaces 4 raw int(os.getenv(...)) and removes 3 hardcoded literals. - The 3 previously-hardcoded limits (email compose, STT audio, calendar ICS) are now env-overridable with the same ODYSSEUS_*_MAX_BYTES naming. - Defaults unchanged, so behavior is unchanged unless an env var is set; an invalid value now fails fast with a clear message instead of a bare int() ValueError. - Document all env vars in .env.example and the README. Fixes #3364
This commit is contained in:
@@ -159,6 +159,16 @@ SEARXNG_INSTANCE=http://localhost:8080
|
||||
# Example: 52428800 = 50 MB.
|
||||
# ODYSSEUS_CHAT_UPLOAD_MAX_BYTES=10485760
|
||||
|
||||
# Other per-feature upload size caps in bytes. All are validated and optional;
|
||||
# defaults shown. An invalid value (non-integer or < 1) fails fast at startup.
|
||||
# ODYSSEUS_GALLERY_UPLOAD_MAX_BYTES=104857600 # gallery image upload (100 MB)
|
||||
# ODYSSEUS_GALLERY_TRANSFORM_UPLOAD_MAX_BYTES=26214400 # gallery transform input (25 MB)
|
||||
# ODYSSEUS_MEMORY_IMPORT_MAX_BYTES=10485760 # memory import file (10 MB)
|
||||
# ODYSSEUS_PERSONAL_UPLOAD_MAX_BYTES=26214400 # personal document upload (25 MB)
|
||||
# ODYSSEUS_EMAIL_COMPOSE_UPLOAD_MAX_BYTES=26214400 # email compose attachment (25 MB)
|
||||
# ODYSSEUS_STT_MAX_AUDIO_BYTES=26214400 # speech-to-text audio (25 MB)
|
||||
# ODYSSEUS_ICS_MAX_BYTES=10485760 # calendar .ics import (10 MB)
|
||||
|
||||
# ============================================================
|
||||
# GPU support (Docker Compose)
|
||||
# ============================================================
|
||||
|
||||
Reference in New Issue
Block a user