Directory_name_encryption is set to always false when choosing filename_encryption = off

What is the problem you are having with rclone?

I created a crypt mount (named test) upon my Google drive (named gdrive), chose filename_encryption = off and directory_name_encryption = true, everything else default with random passwords. Newly created folders don't get encrypted (like the flag was set to false instead of true)

What is your rclone version (output from rclone version )

rclone v1.51.0

  • os/arch: linux/amd64
  • go version: go1.12.15

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Gentoo Linux 64-bit

Which cloud storage system are you using? (eg Google Drive)

Google drive

The command you were trying to run (eg rclone copy /tmp remote:tmp )

rclone mkdir test:1/2/3
rclone copy file test:1/2/3/

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp )

rclone copy file test:1/2/3/ -vv

2020/02/27 16:13:17 DEBUG : rclone: Version "v1.51.0" starting with parameters ["rclone" "copy" "file" "test:1/2/3/" "-vv"]
2020/02/27 16:13:17 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2020/02/27 16:13:27 DEBUG : file: Need to transfer - File not found at Destination
2020/02/27 16:13:29 INFO : file: Copied (new)
2020/02/27 16:13:29 INFO :
Transferred: 58 / 58 Bytes, 100%, 36 Bytes/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 1.5s

2020/02/27 16:13:29 DEBUG : 7 go routines active
2020/02/27 16:13:29 DEBUG : rclone: Version "v1.51.0" finishing with parameters ["rclone" "copy" "file" "test:1/2/3/" "-vv"]


Now, in order to check what has been done to both folder names and filename, the file gets successfully the '.bin' extension, however the folder names remain unencrypted.

rclone ls gdrive:1/2/3 returns the following:
58 1/2/3/file.bin instead of randomchars/morerandomchars/evenmorerandomchars/file.bin

Can you share your rclone.conf without passwords and such?

Sure thing, here it is:

[gdrive]
type = drive
client_id = myid
client_secret = mysecret
scope = drive
token = {"access_token":"my_access_token","token_type":"Bearer","refresh_token":"my_refresh_token","expiry":"2020-02-27T17:09:07.374648959+02:00"}
root_folder_id = myrootfolderid

[test]
type = crypt
remote = gdrive:
filename_encryption = off
directory_name_encryption = true
password = mypass1
password2 = mypass2

P.S. I just read more thoroughly the rclone documentation (link here) it states that if you are not using file name encryption, then it "doesn’t hide file names or directory structure" , which contradicts the "Directory name encryption" (section right below the link) when set to true.
It's like the filename_encryption = off disregards the directory_name_encryption = true and it sets it to 'false' no matter what.
If it is indeed working as intended, then it shouldn't ask you for folder name encryption in the first place, as it is really difference there (false = true = you can't encrypt folder names whatsoever).

I see what you mean.

Yes you are right filename_encryption is the master setting meaning "should I encrypt any filenames or directory names?"

And directory_name_encryption only comes into effect if filename_encryption is not off

Unfortunately the configurator isn't that clever, but I could make crypt stop with an error if

what would you think of that?

Thank you very much for the clarification!

As for stopping the crypt with an error, perhaps it would be better if the 'directory_name_encryption' was bypassed (during rclone wizard) when the user would choose the "off" encryption regarding 'filename_encryption', along with a message that "Folder names won't be encrypted with this option" or something like that.
Of course, at the rclone configuration file it should automatically create the directory_name_encryption = false , which is ultimately redundant as it seems, but a good thing so the user should be given a hint when browsing the conf file.
I don't know if this would be a large change or not, you can stick with the error I guess.

Nevertheless, I believe a minor update in the rclone documentation should be done, just to clarify things there too.

Thanks again!

I've had to go for the doc fix here.

The configurator isn't clever enough to skip the directory_name_encryption if filename_encryption is off.

I can't put a runtime warning in because the default for directory_name_encryption is true which means that this will make a warning for everyone using filename_encryption = off.

So docfix it is!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.