mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #6773] [CLOSED] fix: S3 support for file upload and organise files under user #21954
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/6773
Author: @weixu365
Created: 11/7/2024
Status: ❌ Closed
Base:
dev← Head:main📝 Commits (10+)
2867cfcClean up local file storeage when using S3 for uploadb3b1caeSave original file info in vector db metadata63e996fSplit storage provider into multiple files15e4ef0Use async method from aioboto3c9a904fGet file using async content stream98ca452Change asyncboto3 to boto357794ffClean up configs5a155c2Delete files in uploads folderd5af495Clean up files55a55c2Ensure folder exists before upload📊 Changes
7 files changed (+238 additions, -223 deletions)
View changed files
📝
backend/open_webui/apps/retrieval/main.py(+21 -9)📝
backend/open_webui/apps/webui/routers/files.py(+25 -45)📝
backend/open_webui/config.py(+4 -2)➕
backend/open_webui/storage/base_storage_provider.py(+23 -0)➕
backend/open_webui/storage/local_storage_provider.py(+61 -0)📝
backend/open_webui/storage/provider.py(+16 -167)➕
backend/open_webui/storage/s3_storage_provider.py(+88 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
This PR fixes issue #5763 when using S3 for file upload and organises files under the user to avoid having too many files in the same folder.
Added
Added new env
USER_DATA_DIRandUSER_UPLOAD_FOLDERto save user uploaded filesNot touch in this PR, but eventually, both image caches and audio transcription should use this storage, and downloaded models use
DATA_DIR/cache/xxxThe
USER_DATA_DIRcan be a S3 bucket + prefix, so that users can control the uploaded file structure, e.g.Changed
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.