Support templating name of files stored via Rclone backend #4606
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.
What problem are we solving?
Although the Rclone backend implemented in #4402 works fine, the current implementation has the limitation of storing all files at the root of a Rclone remote, next to each other in the same "folder".
In a SeaweedFS deployment like mine with, hmm, tens of thousands of volume files, I'd like to have a way to split all those files into subfolders.
How are we solving the problem?
By introducing a new configuration property that lets the user provide a template generating the filename from the volume UUID.
How is the PR tested?
Manually, by configuring such a backend:
And checking that volume files were uploaded in OneDrvive in such a structure:
Which matches the output of
volume.list
:Checks
Other considerations
If this template functionality is deemed useful for the Rclone backend, I propose to implement it in a generic fashion, so that the S3 backend can benefit from it as well.