Repository navigation
[Enhancement]: Azure Blob Storage private container support #6704
Replies: 4 comments 6 replies
|
I've thought about this, and it adds some complexity to the project. You would need to make it "provider-agnostic" at least with the route definition and go from there with dependency injection in mind. I think it would be better as an adapter to the existing methods when creating the URL, and even better as an addition to that, best served as an independent API external to LibreChat, as proxying externally is preferable and gives you the maximum amount of customization for your use case, and necessary code changes to LibreChat would be minimal in this regard. This won't be on my radar to tackle for a while but PR's are always welcome. |
|
@anttip1 @danny-avila I wanted to share how we approached a similar issue where private access to Azure Blob Storage was required, maybe this can work for you as well. Instead of implementing an authenticated proxy as suggested, we leveraged Azure's built-in features to achieve the desired level of security. Here's how we set it up:
With this setup, we were able to configure Azure Blob Storage to operate in private mode. The LibreChat pod running in our AKS (Azure Kubernetes Service) cluster can still access the storage using the "azure_blob" strategy, as all traffic stays within the private network. This approach solved the problem for us, eliminated the need to introduce a proxy endpoint, and kept things secure using Azure's native capabilities. Additionally, it simplified our implementation by avoiding code-level changes in file handling operations as outlined in your proposal. |
|
On our end, We wanted to keep our container access private, so what we we did was:
Line 10: From: const { AZURE_STORAGE_PUBLIC_ACCESS = 'true', AZURE_CONTAINER_NAME = 'files' } = process.env;To: const {
AZURE_STORAGE_PUBLIC_ACCESS = 'true',
AZURE_CONTAINER_NAME = 'files',
AZURE_SAS_TOKEN = 'none',
} = process.env;Adjusted the const blobPath = file.filepath.split(`${AZURE_CONTAINER_NAME}/`)[1];To: const blobPath =
AZURE_SAS_TOKEN === 'none'
? file.filepath.split(`${AZURE_CONTAINER_NAME}/`)[1]
: file.filepath.split(`?${AZURE_SAS_TOKEN}`)[0].split(`${AZURE_CONTAINER_NAME}/`)[1];Without the patch to @danny-avila Is this something we might want a PR for? |
|
I have added a PR for this. Any idea on timeline @danny-avila for getting this merged in if it all looks good? Feature PR: #11137 |
Uh oh!
There was an error while loading. Please reload this page.
What features would you like to see added?
I'd like LibreChat to support a private access mode for Azure Blob Storage containers. Currently, files stored in Azure Blob Storage need to be public and are accessed via direct URLs. This feature would add an option to store files in private containers and serve them through an authenticated proxy endpoint, improving security.
More details
The implementation would need to:
The proxy endpoint authentication could work like this:
Which components are impacted by your request?
Other
Pictures
No response
Code of Conduct
All reactions