Feature request: Add multi threading support & environment / config file - slight change to readme.
Meffesino opened this issue · 2 comments
Hi, first of all: you saved my life!
I struggled really to get this running, as I am not used to php files at all and looked for hours where I am configuring the required values for: "DATADIRECTORY", "SECRET" and co. I was looking for a config file or .env to enter it, but nothing was given.
Till I finally found out after hours of serach, that I have to enter in the recover.php in the middle of php file. See, here is the thing: this file has a huge readme at first explaining everything, but never said once, where you have to enter the data. As I am not familiar with php, I just "ignored" the rest of the file, once the code started (root cause...). Would be helpful to add in the Readme (and in the file itself) to show where the information has to be entered. It seems like I am the only one who has that problem, as I have not found anything in the issues section nor at google ;)
Second feature request would be to speed up things by adding multi threading support for decrypting. Decrypting thousands of files and Gigabyte takes ages single threaded.
But again: THANK YOU, you saved my life!
@Meffesino First of all: Thanks for your feedback. I implemented #41 so that it's easier for people to find where to configure the recovery scripts.
Regarding multi-threading: This has been requested in the past (when this was not yet a Nextcloud project). I'd prefer not to implement it in the script as this would drastically increase the overall complexity. People already have the option to execute the script in parallel to decrypt different sub-directories (e.g. one process per user directory):
SCRIPTPATH="<PUT-REAL-PATH-HERE>/recover.php" SOURCEDIR="<PUT-REAL-PATH-HERE>" TARGETDIR="<PUT-REAL-PATH-HERE>" ; cd "$SOURCEDIR" ; for subdir in * ; do ; if [ -d "$SOURCEDIR/$subdir/" ] ; then ; mkdir -p "$TARGETDIR/$subdir/" && "$SCRIPTPATH" "$TARGETDIR/$subdir/" "$SOURCEDIR/$subdir/" & ; fi ; done
Many thanks for the quick update of the code @yahesh ! I understand the increased complexity for multi threading! It is not dramatic, as this is a hopefuly "just once in a lifetime" problem and then you can wait a bit longer or use the parallel run like you mentioned it via the sub-directories.
Thank you for your great work!