wunderio / csi-rclone

CSI driver for rclone
Apache License 2.0
213 stars 62 forks source link

How do I use it for backend that requires token? #12

Open stevefan1999-personal opened 4 years ago

stevefan1999-personal commented 4 years ago

It seems like I cannot go past the token generation, and I realized it is not just for GDrive but for all other backend types that requires token too like OneDrive, Mega and Box.

Snake4life commented 3 years ago

did you find a solution?

Jancis commented 3 years ago

so the drive-token would not work? does it work with rclone? https://rclone.org/drive/#drive-token

PatrickHuetter commented 2 years ago

@Jancis No, it's mostly an access and renew token (within a jwt token). Without this, you can't use dropbox or similar services that use OAuth2 since the token changes from time to time (gets renewed by rclone) and needs to be persisted somewhere.

Jancis commented 2 years ago

Oh, sounds like chicken and egg problem where You need to mount a rwx storage on all rclone plugin pods and share the token, but You don't have any :)

I had some success with nfs-subdir-external-provisioner and a custom nfs server. If You mount a storage with rclone in it, You might have more or less the same system (but the storage is mounted in a single pod then). If You customize the nfs server, You could store and persist the token.

dvcrn commented 2 years ago
  1. Do rclone config on your local machine
  2. Connect to the remote backend
  3. rclone config view
  4. Copy config into PersistenVolume
PatrickHuetter commented 2 weeks ago

This won't work stable since refresh tokens change and it might work the first time but won't after a while or after restarting the backend pod after a token isn't active anymore. The best case would be to you optionally a RWX volume OR a secret that can be written via k8s API by the pod. I think the best option would be to use an RWX volume since most storage providers already provide that.

stevefan1999-personal commented 2 weeks ago

This won't work stable since refresh tokens change and it might work the first time but won't after a while or after restarting the backend pod after a token isn't active anymore. The best case would be to you optionally a RWX volume OR a secret that can be written via k8s API by the pod. I think the best option would be to use an RWX volume since most storage providers already provide that.

Agreed. We need a feedback mechanism.