What is the problem you are having with rclone?
I do not want to store my passwords and salts on disk,
so I am using environment variables to supply these on the fly
like this:
export RCLONE_CRYPT_PASSWORD1=$(command-producing-password | rclone obscure -)
export RCLONE_CRYPT_PASSWORD2=$(command-producing-salt | rclone obscure -)
The actual passwords come from my password manager.
Using environment variables triggers a message:
detected overridden config - adding "{xxxxx}" suffix to name
Problem is: this suffix is different every time I mount, which causes two problems:
- A lot of
vfs/storagebox-crypt{xxxxx}
dirs build up in the cache directory
that take up space and never get cleaned up. - Not-yet-uploaded files waiting in those dirs that never get 'resumed'
so won't get written to the remote.
I'm guessing the suffix is based on the hash of the obscured salt,
which is different every time I run rclone obscure
.
I order to prevent this I would have to store the obscured password in my password manager, next to the actual password.
I guess I could do that, but I'm wondering if this is the correct solution.
I can think of the following solutions on the rclone side:
- Don't hash obscured passwords and salts, but 'decrypt' them first.
- Don't hash passwords at all and ignore them when producing the suffix.
- Don't require obfuscation of passwords and salts in environment variables. This would be difficult to do while being backwards compatible.
- Make
rclone obscure
deterministic.
Option 3 would be more of a workaround.
A combination of 1 and 2 might be needed: I'm guessing a changed salt
doesn't have an influence on accessing existing encrypted content
but a changed password does.
Run the command 'rclone version' and share the full output of the command.
rclone 1.62.2
- os/version: nixos 23.05 (Stoat) (64 bit)
- os/kernel: 6.1.38 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.6
- go/linking: dynamic
- go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
Webdav (Hetzner storagebox) + crypt
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
Obtaining the actual salt is left out here.
Here I'm directly passing the salt to make things simpler:
export RCLONE_CRYPT_PASSWORD2=$(rclone obscure xxxxxxxxxxxxx)
rclone mount -vv --config=rclone.conf --vfs-cache-mode writes storagebox-crypt: crypt-mount/
The rclone config contents with secrets removed.
[storagebox]
type = webdav
url = https://xxxxx.your-storagebox.de
vendor = other
user = xxxxx
pass = xxxxx
[storagebox-crypt]
type = crypt
remote = storagebox:probeer
password = xxxxx
password2 = xxxxx
A log from the command with the -vv
flag
Run 1:
2023/08/19 20:36:49 DEBUG : Setting default for crypt-password2="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" from environment variable RCLONE_CRYPT_PASSWORD2
2023/08/19 20:36:49 DEBUG : rclone: Version "1.62.2" starting with parameters ["/run/current-system/sw/bin/rclone" "mount" "-vv" "--config=rclone.conf" "--vfs-cache-mode" "writes" "storagebox-crypt:" "crypt-mount/"]
2023/08/19 20:36:49 DEBUG : Creating backend with remote "storagebox-crypt:"
2023/08/19 20:36:49 DEBUG : Using config file from "/home/jeroen/meuk/rclone-gocryptfs/rclone.conf"
2023/08/19 20:36:49 DEBUG : Setting crypt_password2="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" from environment variable RCLONE_CRYPT_PASSWORD2
2023/08/19 20:36:49 DEBUG : storagebox-crypt: detected overridden config - adding "{84U5l}" suffix to name
2023/08/19 20:36:49 DEBUG : Setting crypt_password2="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" from environment variable RCLONE_CRYPT_PASSWORD2
2023/08/19 20:36:50 DEBUG : Creating backend with remote "storagebox:probeer"
2023/08/19 20:36:50 DEBUG : found headers:
2023/08/19 20:36:50 DEBUG : fs cache: renaming cache item "storagebox-crypt:" to be canonical "storagebox-crypt{84U5l}:"
2023/08/19 20:36:50 INFO : Encrypted drive 'storagebox-crypt{84U5l}:': poll-interval is not supported by this remote
2023/08/19 20:36:50 DEBUG : vfs cache: root is "/home/jeroen/.cache/rclone"
2023/08/19 20:36:50 DEBUG : vfs cache: data root is "/home/jeroen/.cache/rclone/vfs/storagebox-crypt{84U5l}"
2023/08/19 20:36:50 DEBUG : vfs cache: metadata root is "/home/jeroen/.cache/rclone/vfsMeta/storagebox-crypt{84U5l}"
2023/08/19 20:36:50 DEBUG : Creating backend with remote "/home/jeroen/.cache/rclone/vfs/storagebox-crypt{84U5l}/"
2023/08/19 20:36:50 DEBUG : fs cache: renaming cache item "/home/jeroen/.cache/rclone/vfs/storagebox-crypt{84U5l}/" to be canonical "/home/jeroen/.cache/rclone/vfs/storagebox-crypt{84U5l}"
2023/08/19 20:36:50 DEBUG : Creating backend with remote "/home/jeroen/.cache/rclone/vfsMeta/storagebox-crypt{84U5l}/"
2023/08/19 20:36:50 DEBUG : fs cache: renaming cache item "/home/jeroen/.cache/rclone/vfsMeta/storagebox-crypt{84U5l}/" to be canonical "/home/jeroen/.cache/rclone/vfsMeta/storagebox-crypt{84U5l}"
2023/08/19 20:36:50 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2023/08/19 20:36:50 DEBUG : Encrypted drive 'storagebox-crypt{84U5l}:': Mounting on "crypt-mount/"
Run 2, different suffix:
2023/08/19 20:40:02 DEBUG : Setting default for crypt-password2="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" from environment variable RCLONE_CRYPT_PASSWORD2
2023/08/19 20:40:02 DEBUG : rclone: Version "1.62.2" starting with parameters ["/run/current-system/sw/bin/rclone" "mount" "-vv" "--config=rclone.conf" "--vfs-cache-mode" "writes" "storagebox-crypt:" "crypt-mount/"]
2023/08/19 20:40:02 DEBUG : Creating backend with remote "storagebox-crypt:"
2023/08/19 20:40:02 DEBUG : Using config file from "/home/jeroen/meuk/rclone-gocryptfs/rclone.conf"
2023/08/19 20:40:02 DEBUG : Setting crypt_password2="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" from environment variable RCLONE_CRYPT_PASSWORD2
2023/08/19 20:40:02 DEBUG : storagebox-crypt: detected overridden config - adding "{gy3BQ}" suffix to name
2023/08/19 20:40:02 DEBUG : Setting crypt_password2="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" from environment variable RCLONE_CRYPT_PASSWORD2
2023/08/19 20:40:02 DEBUG : Creating backend with remote "storagebox:probeer"
2023/08/19 20:40:02 DEBUG : found headers:
2023/08/19 20:40:02 DEBUG : fs cache: renaming cache item "storagebox-crypt:" to be canonical "storagebox-crypt{gy3BQ}:"
2023/08/19 20:40:02 INFO : Encrypted drive 'storagebox-crypt{gy3BQ}:': poll-interval is not supported by this remote
2023/08/19 20:40:02 DEBUG : vfs cache: root is "/home/jeroen/.cache/rclone"
2023/08/19 20:40:02 DEBUG : vfs cache: data root is "/home/jeroen/.cache/rclone/vfs/storagebox-crypt{gy3BQ}"
2023/08/19 20:40:02 DEBUG : vfs cache: metadata root is "/home/jeroen/.cache/rclone/vfsMeta/storagebox-crypt{gy3BQ}"
2023/08/19 20:40:02 DEBUG : Creating backend with remote "/home/jeroen/.cache/rclone/vfs/storagebox-crypt{gy3BQ}/"
2023/08/19 20:40:02 DEBUG : fs cache: renaming cache item "/home/jeroen/.cache/rclone/vfs/storagebox-crypt{gy3BQ}/" to be canonical "/home/jeroen/.cache/rclone/vfs/storagebox-crypt{gy3BQ}"
2023/08/19 20:40:02 DEBUG : Creating backend with remote "/home/jeroen/.cache/rclone/vfsMeta/storagebox-crypt{gy3BQ}/"
2023/08/19 20:40:02 DEBUG : fs cache: renaming cache item "/home/jeroen/.cache/rclone/vfsMeta/storagebox-crypt{gy3BQ}/" to be canonical "/home/jeroen/.cache/rclone/vfsMeta/storagebox-crypt{gy3BQ}"
2023/08/19 20:40:02 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2023/08/19 20:40:02 DEBUG : Encrypted drive 'storagebox-crypt{gy3BQ}:': Mounting on "crypt-mount/"