[PR #2605] [MERGED] Fall back to move_copy_to if persist_to fails while saving uploaded files. #3119

Closed
opened 2026-03-03 09:25:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/2605
Author: @ruifung
Created: 7/8/2022
Status: Merged
Merged: 7/15/2022
Merged by: @dani-garcia

Base: mainHead: main


📝 Commits (5)

  • ebe9162 Add option to make file uploads use move_copy_to instead of persist_to
  • 5c38b2c Remove option and use unwrap_or_else to fall back to copy behavior.
  • 3159588 Use match to avoid ownership issues on the TempFile / file_path variables in closures.
  • 84bcac0 Apply rustfmt.
  • bf623ee Use if let instead of a match with empty block.

📊 Changes

2 files changed (+13 additions, -7 deletions)

View changed files

📝 src/api/core/ciphers.rs (+9 -6)
📝 src/api/core/sends.rs (+4 -1)

📄 Description

This is to support scenarios where the attachments and sends folder are to be stored on a separate device from the tmp_folder (i.e. fuse-mounted S3 storage), due to having the tmp_dir on the same device being undesirable.

Example being fuse-mounted S3 storage with the reasoning that because S3 basically requires a copy+delete operations to rename files, it's inefficient to rename files on device, if it's even allowed.


🔄 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/2605 **Author:** [@ruifung](https://github.com/ruifung) **Created:** 7/8/2022 **Status:** ✅ Merged **Merged:** 7/15/2022 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (5) - [`ebe9162`](https://github.com/dani-garcia/vaultwarden/commit/ebe9162af9fac09b7800e3b1b4a24534e4d2aad3) Add option to make file uploads use move_copy_to instead of persist_to - [`5c38b2c`](https://github.com/dani-garcia/vaultwarden/commit/5c38b2c4eb67d74b33023227e4644b5f646703f1) Remove option and use unwrap_or_else to fall back to copy behavior. - [`3159588`](https://github.com/dani-garcia/vaultwarden/commit/31595888ea0ae46eb93e49fc6876bbad368ab9d1) Use match to avoid ownership issues on the TempFile / file_path variables in closures. - [`84bcac0`](https://github.com/dani-garcia/vaultwarden/commit/84bcac0112af6570563f7f174849f98b23e5284b) Apply rustfmt. - [`bf623ee`](https://github.com/dani-garcia/vaultwarden/commit/bf623eed7fc6d7184f2b794461d0d37a03731d5d) Use if let instead of a match with empty block. ### 📊 Changes **2 files changed** (+13 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/api/core/ciphers.rs` (+9 -6) 📝 `src/api/core/sends.rs` (+4 -1) </details> ### 📄 Description This is to support scenarios where the attachments and sends folder are to be stored on a separate device from the tmp_folder (i.e. fuse-mounted S3 storage), due to having the tmp_dir on the same device being undesirable. Example being fuse-mounted S3 storage with the reasoning that because S3 basically requires a copy+delete operations to rename files, it's inefficient to rename files on device, if it's even allowed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:25:57 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#3119
No description provided.