[PR #4242] [MERGED] Improve file limit handling #7034

Closed
opened 2026-03-07 21:09:55 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/4242
Author: @dani-garcia
Created: 1/12/2024
Status: Merged
Merged: 1/27/2024
Merged by: @dani-garcia

Base: mainHead: improve_file_limits


📝 Commits (4)

📊 Changes

26 files changed (+281 additions, -98 deletions)

View changed files

📝 .env.template (+4 -0)
📝 Cargo.lock (+26 -2)
📝 Cargo.toml (+2 -1)
migrations/mysql/2024-01-12-210182_change_attachment_size/down.sql (+0 -0)
migrations/mysql/2024-01-12-210182_change_attachment_size/up.sql (+1 -0)
migrations/postgresql/2024-01-12-210182_change_attachment_size/down.sql (+0 -0)
migrations/postgresql/2024-01-12-210182_change_attachment_size/up.sql (+3 -0)
migrations/sqlite/2024-01-12-210182_change_attachment_size/down.sql (+0 -0)
migrations/sqlite/2024-01-12-210182_change_attachment_size/up.sql (+1 -0)
📝 src/api/admin.rs (+4 -3)
📝 src/api/core/accounts.rs (+4 -2)
📝 src/api/core/ciphers.rs (+58 -20)
📝 src/api/core/emergency_access.rs (+4 -2)
📝 src/api/core/organizations.rs (+2 -3)
📝 src/api/core/sends.rs (+43 -23)
📝 src/api/core/two_factor/authenticator.rs (+2 -1)
📝 src/api/core/two_factor/mod.rs (+4 -2)
📝 src/api/core/two_factor/webauthn.rs (+2 -1)
📝 src/api/mod.rs (+0 -27)
📝 src/config.rs (+22 -0)

...and 6 more files

📄 Description

  • Add separate Send limit, previously it was using the Attachment limit, which wouldn't work correctly
  • Change file sizes in attachment to be i64, both in code and in the database, to limit the amount of number casting
  • Switched number operations to use checked operations

Haven't tested MySQL or Postgres but I think the migrations are correct.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/4242 **Author:** [@dani-garcia](https://github.com/dani-garcia) **Created:** 1/12/2024 **Status:** ✅ Merged **Merged:** 1/27/2024 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `improve_file_limits` --- ### 📝 Commits (4) - [`caca696`](https://github.com/dani-garcia/vaultwarden/commit/caca696f56eb6766f637083f1008c2f27ef910cd) Improve file limit handling - [`9247481`](https://github.com/dani-garcia/vaultwarden/commit/9247481daeda3fc52326a75c3c39aa5f8f21eb2c) Oops - [`e63db03`](https://github.com/dani-garcia/vaultwarden/commit/e63db03c288d89a4823d90b63c4950598c59c23b) Update PostgreSQL migration - [`cc9e1ab`](https://github.com/dani-garcia/vaultwarden/commit/cc9e1ab79efab15cc1dc746160656c759f700b68) Review comments ### 📊 Changes **26 files changed** (+281 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `.env.template` (+4 -0) 📝 `Cargo.lock` (+26 -2) 📝 `Cargo.toml` (+2 -1) ➕ `migrations/mysql/2024-01-12-210182_change_attachment_size/down.sql` (+0 -0) ➕ `migrations/mysql/2024-01-12-210182_change_attachment_size/up.sql` (+1 -0) ➕ `migrations/postgresql/2024-01-12-210182_change_attachment_size/down.sql` (+0 -0) ➕ `migrations/postgresql/2024-01-12-210182_change_attachment_size/up.sql` (+3 -0) ➕ `migrations/sqlite/2024-01-12-210182_change_attachment_size/down.sql` (+0 -0) ➕ `migrations/sqlite/2024-01-12-210182_change_attachment_size/up.sql` (+1 -0) 📝 `src/api/admin.rs` (+4 -3) 📝 `src/api/core/accounts.rs` (+4 -2) 📝 `src/api/core/ciphers.rs` (+58 -20) 📝 `src/api/core/emergency_access.rs` (+4 -2) 📝 `src/api/core/organizations.rs` (+2 -3) 📝 `src/api/core/sends.rs` (+43 -23) 📝 `src/api/core/two_factor/authenticator.rs` (+2 -1) 📝 `src/api/core/two_factor/mod.rs` (+4 -2) 📝 `src/api/core/two_factor/webauthn.rs` (+2 -1) 📝 `src/api/mod.rs` (+0 -27) 📝 `src/config.rs` (+22 -0) _...and 6 more files_ </details> ### 📄 Description - Add separate Send limit, previously it was using the Attachment limit, which wouldn't work correctly - Change file sizes in attachment to be i64, both in code and in the database, to limit the amount of number casting - Switched number operations to use checked operations Haven't tested MySQL or Postgres but I think the migrations are correct. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-07 21:09:55 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#7034