feat: improve S3-compatible OpenDAL configuration via URI query params#6840
Open
g-roliveira wants to merge 16 commits intodani-garcia:mainfrom
Open
feat: improve S3-compatible OpenDAL configuration via URI query params#6840g-roliveira wants to merge 16 commits intodani-garcia:mainfrom
g-roliveira wants to merge 16 commits intodani-garcia:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves S3-compatible object storage support by parsing and applying URI query parameters for OpenDAL S3 configuration across Vaultwarden storage paths.
It keeps AWS defaults unchanged while enabling robust provider-specific overrides for MinIO, Cloudflare R2, Ceph RGW, and similar S3-compatible endpoints.
What changed
DATA_FOLDERATTACHMENTS_FOLDERICON_CACHE_FOLDERSENDS_FOLDERs3://...URIs, including:endpointregionenable_virtual_host_style(including alias handling)default_storage_class(including empty value to omit storage class)CI / tests
Docs
.env.templatewith S3-compatible parameter guidance and examples.README.mdwith practical S3-compatible usage examples.s3feature (sqlite,s3/postgresql,s3/mysql,s3).Manual validation
region=auto+ path-style.Compatibility notes
Operational notes (browser downloads on S3-compatible storage)
When attachments are stored in S3-compatible backends, Web Vault downloads use presigned URLs and are fetched directly by the browser.
To make downloads work reliably, configure both sides:
ALLOWED_CONNECT_SRCto include the object-storage origin (for examplehttps://<accountid>.r2.cloudflarestorage.com).DOMAIN) forGET/HEADand returnAccess-Control-Allow-Origin.Typical errors and causes:
violates the document's Content Security Policy-> missing/incorrectALLOWED_CONNECT_SRC.No 'Access-Control-Allow-Origin' header-> missing/incorrect bucket/provider CORS policy.Follow-up suggestion
Potential future improvement: provide an optional server-side download mode/proxy to reduce CORS setup friction for some deployments.
Trade-offs: extra traffic through Vaultwarden, higher resource usage, and different scalability characteristics.