Rclone directory name encryption

[neunghaha28]
type = drive
client_id = xxx
client_secret = xxx
scope = drive
token = xxx
team_drive = xxx
use_trash = false

[gdrive]
type = crypt
remote = neunghaha28:/
filename_encryption = standard
directory_name_encryption = false
password = xxx
use_trash = false

[crypt]
type = crypt
remote = neunghaha28:/
filename_encryption = standard
directory_name_encryption = true
password = xxx
use_trash = false

I want to change from directory_name_encryption = false to directory_name_encryption = true without re-uploading. What am I missing please help me.

I will always encrypt files. But now I want to encrypt the folder too.

All files are encrypted except folders.

root@DIYNEZ:~# rclone lsf 'gdrive:/movies/movies/#Alive (2020)' --config /mnt/cache/appdata/rclone/rclone.conf
#Alive (2020) [imdb-tt10620868][DIYNEZ].mkv
root@DIYNEZ:~# rclone lsf 'neunghaha28:/movies/movies/#Alive (2020)' --config /mnt/cache/appdata/rclone/rclone.conf
sucudgv27eal58er8o67qghtg0dlg727c5nsfsc85l5vgamrrd243gesmghg9u4n9583gas80a0n4

Which I want to modify to encrypt the folder name without having to re-upload files again.

what i have tried but it doesn't work.

rclone move gdrive: crypt: --fast-list -vP --config /mnt/cache/appdata/rclone/rclone.conf --delete-empty-src-dirs`

It re-upload files T-T

hi,
could try a --dry-run test on one file using --server-side-across-configs

edit: i am a confused about using --server-side-across-configs to crypt folder names.

i did a quick test and looks like rclone

  1. creates a new set of crypted folder names
  2. copy/delete the files from the non-crypted folders to the crypted folders.

but also, the debug log claims to have renamed files.


[gdrive]
type = drive
client_id = 417390510813-8v2pb7jfp8968r5h861bbd8m9bje09lo.apps.googleusercontent.com
client_secret = jaSuArinIOhnHOsM6TvO1o60
scope = drive
token = {"access_token":"ya29.a0ARrdaM-145k_kvaHilDsCYpHdwFJVW78gwx_OoYNgM-eA_X5AU-SCeIFYxDuQRIwxsLYwD1s9f8810lDOKybMxsiX2QKo20QLf5gGPFPJFWc9FDvNvYXnxM0_NL1X60C_9hF57HkjltxkLn9k5zDc2_HLM4G2rQ","token_type":"Bearer","refresh_token":"1//0h9C5MPJwUJo4CgYIARAAGBESNwF-L9Ir4NoazoXYt8B1fHhAegRcmjISmndFatlUt_SYstasLG_zDjILrRxoeql4UKhWSsaR02k","expiry":"2021-12-11T10:33:19.9097907-05:00"}
team_drive = 

[gcrypt_direnc_false]
type = crypt
remote = gdrive:crypt
filename_encryption = standard
directory_name_encryption = false
password = IsqaiTkJzL479iJWNLYwWmJS2usOtRFA
password2 = UnA9Se1T3eAdtSwJM7pfV8gOmB4KcCwv

[gcrypt_direnc_true]
type = crypt
remote = gdrive:crypt
filename_encryption = standard
directory_name_encryption = true
password = IsqaiTkJzL479iJWNLYwWmJS2usOtRFA
password2 = UnA9Se1T3eAdtSwJM7pfV8gOmB4KcCwv
rclone.exe move gcrypt_direnc_false:source gcrypt_direnc_true:dest -vv --crypt-server-side-across-configs 
DEBUG : Setting --config "C:\\data\\rclone\\scripts\\rclone.conf" from environment variable RCLONE_CONFIG="C:\\data\\rclone\\scripts\\rclone.conf"
DEBUG : rclone: Version "v1.57.0" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "move" "gcrypt_direnc_false:source" "gcrypt_direnc_true:dest" "-vv" "--crypt-server-side-across-configs"]
DEBUG : Creating backend with remote "gcrypt_direnc_false:source"
DEBUG : Using config file from "C:\\data\\rclone\\scripts\\rclone.conf"
DEBUG : gcrypt_direnc_false: detected overridden config - adding "{Db_Y9}" suffix to name
DEBUG : Creating backend with remote "gdrive:crypt/l8v6tiq52jaekot7q45c9rbq4o"
DEBUG : Google drive root 'crypt/l8v6tiq52jaekot7q45c9rbq4o': 'root_folder_id = 0AIYnsu88uXytUk9PVA' - save this in the config to speed up startup
DEBUG : Creating backend with remote "gdrive:crypt/source"
DEBUG : Google drive root 'crypt/source': 'root_folder_id = 0AIYnsu88uXytUk9PVA' - save this in the config to speed up startup
DEBUG : fs cache: renaming cache item "gcrypt_direnc_false:source" to be canonical "gcrypt_direnc_false{Db_Y9}:source"
DEBUG : Creating backend with remote "gcrypt_direnc_true:dest"
DEBUG : gcrypt_direnc_true: detected overridden config - adding "{Db_Y9}" suffix to name
DEBUG : Creating backend with remote "gdrive:crypt/p0tru1aognkok78nfntsibbo9o"
DEBUG : Google drive root 'crypt/p0tru1aognkok78nfntsibbo9o': 'root_folder_id = 0AIYnsu88uXytUk9PVA' - save this in the config to speed up startup
DEBUG : fs cache: renaming cache item "gcrypt_direnc_true:dest" to be canonical "gcrypt_direnc_true{Db_Y9}:dest"
DEBUG : Encrypted drive 'gcrypt_direnc_true{Db_Y9}:dest': Waiting for checks to finish
DEBUG : Encrypted drive 'gcrypt_direnc_true{Db_Y9}:dest': Waiting for transfers to finish
DEBUG : 01.txt: md5 = 39ff174f155ee49ffe14c2d8a88f3100 OK
INFO  : 01.txt: Copied (new)
DEBUG : test/02.txt: md5 = 08a32a25c63a6798f13d73979a5075fc OK
INFO  : test/02.txt: Copied (new)
INFO  : 01.txt: Deleted
INFO  : test/02.txt: Deleted
INFO  : 
Transferred:   	         64 B / 64 B, 100%, 21 B/s, ETA 0s
Checks:                 4 / 4, 100%
Deleted:                2 (files), 0 (dirs)
Renamed:                2
Transferred:            2 / 2, 100%
Elapsed time:         6.6s

That feels like you need a script / manually make these changes.

If I have a regular folder, I just need to figure out what the crypt name would be by making the same directory name with the same keys somewhere else or in place.

felix@gemini:~/test$ rclone ls testnondir:
      130 test2/hosts
felix@gemini:~/test$ rclone mkdir testdir:test2
felix@gemini:~/test$ ls
fn0jbidpl7cqq9so46diq346so  test2
felix@gemini:~/test$ rmdir fn0jbidpl7cqq9so46diq346so
felix@gemini:~/test$ mv test2 fn0jbidpl7cqq9so46diq346so
felix@gemini:~/test$ rclone ls testdir:
      130 test2/hosts

Once I make the name, I can just rename the normal folder to the crypt name and it'll show up in the encrypted remote.

I have one crypt remote with it off and one with it on and worked with my test case.

1 Like

did more testing, this command seems to have worked.
rclone move gcrypt_direnc_false:source gcrypt_direnc_true:dest -vv --crypt-server-side-across-configs --drive-server-side-across-configs

rclone move gcrypt_direnc_false:source gcrypt_direnc_true:dest -vv --crypt-server-side-across-configs --drive-server-side-across-configs 
DEBUG : Setting --config "C:\\data\\rclone\\scripts\\rclone.conf" from environment variable RCLONE_CONFIG="C:\\data\\rclone\\scripts\\rclone.conf"
DEBUG : rclone: Version "v1.57.0" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "move" "gcrypt_direnc_false:source" "gcrypt_direnc_true:dest" "-vv" "--crypt-server-side-across-configs" "--drive-server-side-across-configs"]
DEBUG : Creating backend with remote "gcrypt_direnc_false:source"
DEBUG : Using config file from "C:\\data\\rclone\\scripts\\rclone.conf"
DEBUG : gcrypt_direnc_false: detected overridden config - adding "{Db_Y9}" suffix to name
DEBUG : Creating backend with remote "gdrive:crypt/l8v6tiq52jaekot7q45c9rbq4o"
DEBUG : gdrive: detected overridden config - adding "{Db_Y9}" suffix to name
DEBUG : Google drive root 'crypt/l8v6tiq52jaekot7q45c9rbq4o': 'root_folder_id = 0AIYnsu88uXytUk9PVA' - save this in the config to speed up startup
DEBUG : fs cache: renaming cache item "gdrive:crypt/l8v6tiq52jaekot7q45c9rbq4o" to be canonical "gdrive{Db_Y9}:crypt/l8v6tiq52jaekot7q45c9rbq4o"
DEBUG : Creating backend with remote "gdrive:crypt/source"
DEBUG : gdrive: detected overridden config - adding "{Db_Y9}" suffix to name
DEBUG : Google drive root 'crypt/source': 'root_folder_id = 0AIYnsu88uXytUk9PVA' - save this in the config to speed up startup
DEBUG : fs cache: renaming cache item "gdrive:crypt/source" to be canonical "gdrive{Db_Y9}:crypt/source"
DEBUG : fs cache: renaming cache item "gcrypt_direnc_false:source" to be canonical "gcrypt_direnc_false{Db_Y9}:source"
DEBUG : Creating backend with remote "gcrypt_direnc_true:dest"
DEBUG : gcrypt_direnc_true: detected overridden config - adding "{Db_Y9}" suffix to name
DEBUG : Creating backend with remote "gdrive:crypt/p0tru1aognkok78nfntsibbo9o"
DEBUG : gdrive: detected overridden config - adding "{Db_Y9}" suffix to name
DEBUG : Google drive root 'crypt/p0tru1aognkok78nfntsibbo9o': 'root_folder_id = 0AIYnsu88uXytUk9PVA' - save this in the config to speed up startup
DEBUG : fs cache: renaming cache item "gdrive:crypt/p0tru1aognkok78nfntsibbo9o" to be canonical "gdrive{Db_Y9}:crypt/p0tru1aognkok78nfntsibbo9o"
DEBUG : fs cache: switching user supplied name "gdrive:crypt/p0tru1aognkok78nfntsibbo9o" for canonical name "gdrive{Db_Y9}:crypt/p0tru1aognkok78nfntsibbo9o"
DEBUG : fs cache: renaming cache item "gcrypt_direnc_true:dest" to be canonical "gcrypt_direnc_true{Db_Y9}:dest"
DEBUG : Encrypted drive 'gcrypt_direnc_true{Db_Y9}:dest': Waiting for checks to finish
DEBUG : Encrypted drive 'gcrypt_direnc_true{Db_Y9}:dest': Waiting for transfers to finish
INFO  : 01.txt: Moved (server-side)
INFO  : test/02.txt: Moved (server-side)
INFO  : There was nothing to transfer
INFO  : 
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Checks:                 2 / 2, 100%
Renamed:                2
Elapsed time:         3.8s
1 Like

Thank you very much it works.

But It doesn't work without flags. --drive-server-side-across-configs Which in the manual says to use only --crypt-server-side-across-configs It should work as well.

@ncw

server-side working.

rclone move test2:tv test3:tv -vvP --fast-list --crypt-server-side-across-configs --drive-server-side-across-configs --config /mnt/cache/appdata/rclone/rclone.conf --drive-use-trash=false --delete-empty-src-dirs

server-side not working.

rclone move test2:tv test3:tv -vvP --fast-list --crypt-server-side-across-configs --config /mnt/cache/appdata/rclone/rclone.conf --drive-use-trash=false --delete-empty-src-dirs

Thank you very much for trying to help me. I found the answer.

  • this looks to be where rclone deals with server-side
    https://github.com/rclone/rclone/blob/408d9f3e7aa8a88dc36f7c69046f80cc946fc74d/backend/crypt/crypt.go#L243

  • looks like the documentation needs to be updated; at least when a crypt remote is wrapped inside a gdrive remote.
    when using --crypt-server-side-across-configs, --drive-server-side-across-configs has to be set explicitly
    in effect, unless both flags are set to true, the result is false and nothing happens
    --crypt-server-side-across-configs=true && --drive-server-side-across-configs=false == false

  • --crypt-server-side-across-configs when moving files between two remotes where
    source remote -> directory_name_encryption = false
    dest remote -> directory_name_encryption = true
    --- does not seem to work with s3, which i think makes sense, as s3 does not support server-side-move
    --- does not seem to work with sftp?

1 Like

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