mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-12 01:45:56 -05:00
[PR #5591] RFC: AWS Serverless Support #7275
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/dani-garcia/vaultwarden/pull/5591
Author: @txase
Created: 2/14/2025
Status: 🔄 Open
Base:
main← Head:main📝 Commits (5)
3e886e6AWS Aurora DSQL support9a9786eAdd AWS S3 support for non-temporary filesed26fa3Add AWS SES for sending emailsbdab7b4Copy add_manage migration for DSQLf4a40cbBuild and deploy support for AWS📊 Changes
36 files changed (+3172 additions, -191 deletions)
View changed files
➕
.github/workflows/lambda.yml(+49 -0)📝
Cargo.lock(+897 -11)📝
Cargo.toml(+10 -0)➕
CargoLambda.toml(+7 -0)➕
aws/.gitignore(+3 -0)➕
aws/README.md(+53 -0)➕
aws/deploy.sh(+9 -0)➕
aws/samconfig.toml(+12 -0)➕
aws/template.yaml(+582 -0)📝
build.rs(+13 -1)➕
migrations/dsql/2024-12-30-100000_create_tables/metadata.toml(+1 -0)➕
migrations/dsql/2024-12-30-100000_create_tables/up.sql(+281 -0)➕
migrations/dsql/2025-01-09-172300_add_manage/down.sql(+0 -0)➕
migrations/dsql/2025-01-09-172300_add_manage/metadata.toml(+1 -0)➕
migrations/dsql/2025-01-09-172300_add_manage/up.sql(+8 -0)📝
src/api/admin.rs(+4 -4)📝
src/api/core/ciphers.rs(+23 -24)📝
src/api/core/emergency_access.rs(+1 -1)📝
src/api/core/organizations.rs(+7 -6)📝
src/api/core/sends.rs(+27 -18)...and 16 more files
📄 Description
This draft PR contains a POC of support for deploying an instance of Vaultwarden into an AWS account using entirely "serverless" services (likely falling within the free-tier usage limits as well). I'm looking for feedback and agreement by Vaultwarden maintainers on whether these contributions could be merged into vaultwarden (with further refinement).
Architecture
All of this is implemented in the PR behind feature flags:
dsql,s3, andses. All three can be enabled together via theawsfeature flag.Unimplemented Functionality
I believe all functionality, except as listed below, is functional. But I'm new to vaultwarden and may have missed something along the way. I've not found any significant issues with my own usage due to this missing functionality, however.
Open Questions / Concerns
POSTinstead of S3'sPUTto upload, and although S3 also supportsPOSTwith signed URLs the data must be form-encoded. This means existing Bitwarden clients cannot upload directly to S3, and must instead upload through the API Lambda Function. Unfortunately, the AWS Lambda service has a 6 MB size limit for request payloads. Note: This only applies to uploads, downloads are streamed from S3 directly via signedGETURLs which do not have a size limit.Deployment Instructions
See the aws/README.md file in this PR.
Proposed Plan of Attack
This PR is too large to attempt to review and merge with sanity. With agreement from Vaultwarden maintainers in comments below, I propose developing and merging the following as separate PRs in sequence:
persistent_fsmodule, migrating existing filesystem functionality into a "local" backend implementation. Seesrc/persistent_fs/mod.rsandsrc/persistent_fs/local.rs. This would not change any functionality; it would simply rearchitect file access in preparation for the addition of an S3 backend.dsql-beta)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.