westberliner / checksum

Plugin for Nextcloud and ownCloud to create hashes of files.
GNU General Public License v3.0
29 stars 15 forks source link

Generate checksums for multiple files or directories to check local copies #51

Open teneighty-yvr opened 3 years ago

teneighty-yvr commented 3 years ago

Closely related to #23 except generate the checksums on demand without downloading to check local copies.

If the output could be downloaded in a file or copied and pasted into a file in a format that can then be fed into "sha256sum -c " or "md5sum -c ", a set of files can be checked.

Alternatively an implementation of #28, compare feature, capable of comparing multiple checksums at once, for example the output of "sha256sum *" run locally, copied and pasted into the browser.

Use case scenario:

I work with multiple files from multiple machines, at least some of which do not have a Nextcloud sync client installed. Before making changes and uploading to Nextcloud, which serves as my master repository, it's tremendously helpful for me to be able to check the checksums provided by this project to make sure that my local copy is current. Thank you! One by one comparison however is tedious for more than a few files, so a feature to generate multiple checksums would be valuable.

Another more common use case:

A third party has shared a directory with me by public link, so I cannot use the Nextcloud client to sync them. I download all the files to my local machine. After some time, I want to quickly check if any of the files have changed since I downloaded them without downloading everything over again.

Thanks westberliner!

westberliner commented 3 years ago

Hi, thanks for your input. I guess I could do this like the multiple file select action and show the list in the popup. Is this what you are looking for?

teneighty-yvr commented 3 years ago

Yes, that would be beautiful! Popup opens, choose algorithm, populate the popup with list of checksums for selected files.

I propose the results be formatted the same as gnu coreutils, " " per line, so it can be passed directly to coreutils md5sum/sha256sum for checking local copies.

Not to get carried away, but a "copy" button to copy the results to the clipboard would also be very convenient. :)

If you are considering implementing checking of remote files as per #28, for multiple files this could be a selectable option in the popup that changes to input mode, providing an input text box where the output from coreutils checksum tools can be pasted. The output of the coreutils tools contains the filenames, so it wouldn't be necessary to select the specific files to be checked, but the muliselect "...action" menu still seems to me like a good place to open the popup from, which requires at least one selection. I suppose for checking remote files the file selection could be ignored.

On the other hand, it may be useful, using the list of checksums provided, to see which files match, differ, exist only on the server, or exist only locally. That may be a reason to respect the file selection, not sure. It is very easy to select all in Nextcloud files if the user wants a report on the entire directory, and respecting the selection gives the ability to check a subset of files. That seems like a tough call.