Recycle bin on MacOS

Though I understand the application architecture and the use of WebDAV (or any similar replacement in the future) a major drawback for me is that I cannot use the systems recycle bin anymore (I am on a mac).

It is my understanding that will never be the case (natively by MacOS) because of Cryptomators core architecure to use network drives as access to the vaults.

The use of network drives is very appealing. It assures that never ever decrypted data will be uploaded to the cloud.

Can you think of any way to support the recycle bin (on MacOS)?

While we can not support the native recycle bin, we could theoretically add an option to move files to a /bin directory located inside the vault, when they’re deleted.

The actual purge could then take place as soon as files inside of /bin directory (or the directory itself) are deleted.

1 Like

That would actually be a good and reasonable (thus very appealing simple) approach IMHO – if it is possible.

Initially I though about something like watching the host OS file system for a delete event and moving the file to the recycle bin. After written the post above I again thought about it and this is just not possible, nor does it makes sense:

  1. AFAIK macOs does not have such events on file level (while windows has and I think Linux too).

  2. even if there would be such an event: copying a file manually into the .Trash breaks the concept of the systems recycle bin (there would no “move back” in the context menu – and if the vault is closed there is even no original location to move back even if the command was there).

While with WebDAV you can easily check the request and if a recycle bin is activated then a DELETE request just becomes a move operation.

But: when I press alt-backspace in finder I get a warning dialog that the file cannot be moved but will be permanently deleted. It could be irritating if this dialog will also be shown in case of a move. Not sure if you can handle this use case completely via WebDAV commands. Also not sure if the request of a recycle bin still makes sense after thinking about this stuff in detail.

This dialog is shown before Finder even talks to the WebDAV server, so there is no way of changing this behavior. I.e. the dialog will be shown but still the file will be moved instead of deleted.

Sure, that is the same as for activating a recycle bin on a NAS, e.g. Synology.

So, I would like to request for a recycle bin :wink: I think it is a good feature because it assures the same concept as for normal file systems. The usage of Cryptomator would then not have any drawbacks compared to “normal” file usage.

Some thoughts on the concept of the recycle just as an input:

  • it would be good to give it a special name that very unlikely clashes with folder names that a user normally would give. E.g. better “#recycle” than “bin”.

  • The path to the file that was deleted must be considered. It must be considered technically to keep the files uniquely in the bin. And it should be considered so the user can uniquely identify deleted files with same names from different folders. A straight forward approach could be to preserve the file structure also in the recycle bin (of course only for files that were deleted).

  • It should be possible to set a plan on when Cryptomator deletes files in the recycle bin, e.g. by defining the numbers of days after wich a file was put into the recycle bin – or never. Cryptomator could check this when opening a vault.

  • It may make sense to provide a recycle bin optional so the user can switch it on or off for a vault.

Just shooting from hip.

1 Like

Hi all,

It’s a shame macOS doesn’t support the trash on certain types of network drives (which Cryptomator is an example of).

I see Linux handles it just fine. That’s yet another reason to go over to Linux if you want privacy!

On macOS, this idea inspired me to set up my own alternative trash situation for my Cryptomator. I call it ‘CRYPTOTRASH’. :slight_smile:

It’s an AppleScript script I bind to the usual delete cmd-backspace hotkey in Finder (using Keyboard Maestro to bind it and only applying to while in the Finder app).

This code checks your selection to determine whether it’s inside your Cryptomator volume. If it is, it does a cool ‘move to CRYPTOTRASH’ action. If not, it just performs the normal Finder ‘move to trash’ action.

CAREFUL - cautiously test on dummy files before you use it on real files in your Cryptomator. This actually hard deletes whatever you select, YOU WILL LOSE DATA IF YOU DON’T SET UP THE FOLDERS PROPERLY.

(I couldn’t get it to MOVE files into the virtual trash, but only COPY them, so I had to add an extra hard DELETE action to simulate normal trash binning.)

Instructions:

  • You cannot have your Cryptomator mount to a custom path. Have it to automatic like /Volumes/35GrE6R1HwRY_0 (and change script code accordingly.)
  • Customise your chosen /Users/Nate/CRYPTOTRASH path in code.
  • Not sure if needed, but I updated my osxfuse to the latest, it was out of date by many months.
  • If you have non-cryptomator normal NAS shares like a samba share from a LAN, customise below for any paths that apply.
tell application "Finder"
	set thePath to the POSIX path of (parent of first item of (get selection) as alias)
	tell application "Finder"
		if thePath contains "/Volumes/35GrE6R1HwRY_0" then
			set destFolder to "/Users/Nate/CRYPTOTRASH" as POSIX file
			move selection to folder destFolder
			delete selection
		else
			if "/Volumes/LANsamba1" is in thePath or "/Volumes/anotherNAS" is in thePath then
				display alert "Are you sure you want to delete this?" message "macOS can only hard-delete NAS files. This item will be deleted immediately. You can’t undo this action." buttons {"Cancel", "Delete"}
				if button returned of result = "Delete" then
					delete selection
				else
					if button returned of result = "Cancel" then
						""
					end if
				end if
			else
				move selection to trash
			end if
		end if
	end tell
end tell

I only just started testing it but seems to work reliably. Of course, it will have no ‘put back’ functionality, but at least this way I can worry less about accidentally immediately irreversibly deleting files. That’s the whole point.

You can also script up other things to automate CRYPTOTRASH emptying as mentioned here. Go to town, even bind some ‘empty trash’ dock item to empty both normal trash and your CRYPTOTRASH.

Since I only use Cryptomator to have privacy from cloud services, I consider it safe to copy files outside of my Cryptomator solely for preventing data disasters. I wasn’t able to get it to work if my CRYPTOTRASH is inside my actual Cryptomator. I’d prefer that, so if someone has an improvement, please share.

4 Likes
© 2020 Skymatic GmbH • Privacy PolicyImpressum