-
-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds transfers between stores to external attachments (#1358)
This PR follows on from #1320, and adds support for: - Moving attachments between stores - Basic configuration of external attachments using environment variables This allows a user to change the document's store, then transfer all of the attachments from their current store(s) to the new default. This includes transfers from internal (SQLite) storage to external storage, external to internal, and external to external (e.g MinIO to filesystem). This PR also introduces the concept of "labels", which are an admin-friendly way to refer to a store, and map 1-to-1 with store IDs. Labels don't need to be unique between instances, only within an instance. ### User-facing changes: - Adds API endpoints to: - Migrate all attachments from their current store to the store set for that document - Check on the status of transfers - Get and set the store for a document - Adds an environment variable for setting external attachments behaviour `GRIST_EXTERNAL_ATTACHMENTS_MODE` - `test` mode sets Grist to use a temporary folder in the filesystem. - `snapshots` mode sets Grist to use the external storage currently used for snapshots, to also be used for attachments. ### Internal changes: - Adds methods to AttachmentFileManager to facilitate transfers from one storage to another. - Exposes new methods on ActiveDoc for triggering transfers, retrieving transfer status and setting the store. - Refactors how DocStorage provides access to attachment details - Adds a way to retrieve attachment config from env vars, and use them to decide which stores will be available. - Adds a `snapshot` external storage provider, that uses an attachment-compatible external storage for attachments. All of the logic behind these changes should be documented in the source code with comments.
- Loading branch information
Showing
26 changed files
with
1,378 additions
and
208 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.