This pull request adds the feature of allowing users to create the legal hold download bundles directly in the configured filestore rather than downloading them directly in the browser.
Adds new logic to allow "locking" a legal hold with a custom name. Using bundle to prevent several uploads at the same time.
Adds new configuration option GenerateDownloadOnFilestore(bool) to setup this workflow.
Created logic to ensure that the file is uploladed in chunks directly to the filestore, by leveraging a bufio.BufferedWritter and a custom io.Writter implementation to use the model.Filestore underneath.
A job to cleanup the files. Bundles are created with a timestamp in the filename and a job running every hour will check if there's any file older than 24h and remove it automatically. A custom job on the plugin is preferred to ensure compatibility with all filestores.
Added a bot user to notify the requesting user of updates on the bundle creation.
Use a different download API to generate a bundle than to download the file
Notes
I have been experimenting with this feature for several days and before I had a setting to dis/allow this action. But when I had it ready it made no sense, since the page to download the legal holds is the same as the settings, and I had permissions to enable/disable it on the spot:
Summary
This pull request adds the feature of allowing users to create the legal hold download bundles directly in the configured filestore rather than downloading them directly in the browser.
bundle
to prevent several uploads at the same time.GenerateDownloadOnFilestore(bool)
to setup this workflow.bufio.BufferedWritter
and a customio.Writter
implementation to use themodel.Filestore
underneath.Notes
I have been experimenting with this feature for several days and before I had a setting to dis/allow this action. But when I had it ready it made no sense, since the page to download the legal holds is the same as the settings, and I had permissions to enable/disable it on the spot:
https://github.com/mattermost/mattermost-plugin-legal-hold/assets/812088/ea017809-dd1c-40a2-afc0-d9724124f943
(You can see the upload button appearing and disappearing)
44