open-webui/backend
Alexey Rybalchenko 464a2dd58d feat: add per-group knowledge base file count and size limits
Adds optional per-group (and global default) limits on the number of
files and maximum file size for knowledge base uploads, enforced both
in the backend and early in the frontend upload pipeline.

- `WorkspacePermissions` extended with `knowledge_max_count` and
  `knowledge_max_size` (nullable int) so the group permissions endpoint
  persists and returns these values
- `DEFAULT_PERMISSIONS` in `permissions.ts` gains the two nullable fields
- Group Permissions UI shows numeric inputs for both limits beneath the
  Knowledge Access toggle (0 / empty = unlimited)
- `combine_permissions` extended to handle integer-valued permissions
  using most-permissive semantics (0 = unlimited always wins, otherwise
  max across groups)
- New `get_permission_value()` utility mirrors `has_permission` but
  returns the raw value (int/bool/None) rather than a boolean
- `/api/config` resolves and exposes `knowledge.max_count` and
  `knowledge.max_size` per-user so the frontend can gate uploads before
  any processing begins
- `KnowledgeBase.svelte` and `Models/Knowledge.svelte` check limits
  before calling `uploadFile`, preventing unnecessary text-extraction
  work on oversized files
- Backend enforces limits in both `/{id}/file/add` and
  `/{id}/files/batch/add`; admins always bypass
2026-04-22 13:52:31 +02:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
open_webui feat: add per-group knowledge base file count and size limits 2026-04-22 13:52:31 +02:00
.dockerignore fix: litellm config issue 2024-02-24 22:35:11 -08:00
.gitignore refac 2024-09-06 04:59:20 +02:00
dev.sh refac 2026-03-24 19:43:30 -05:00
requirements-min.txt refac 2026-04-13 23:40:09 -05:00
requirements.txt refac 2026-04-13 23:40:09 -05:00
start.sh refac 2026-03-24 19:43:30 -05:00
start_windows.bat refac 2026-03-24 19:43:30 -05:00