"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
protondrive: implement two-password mode (#7279)
Chun-Hung Tsenged755bf04f24
diff --git a/backend/protondrive/protondrive.go b/backend/protondrive/protondrive.goindex e19edc75b..0aa24d306 100644--- a/backend/protondrive/protondrive.go+++ b/backend/protondrive/protondrive.go@@ -61,13 +61,23 @@ func init() {NewFs: NewFs,Options: []fs.Option{{Name: "username",- Help: `The username of your proton drive account`,+ Help: `The username of your proton account`,Required: true,}, {Name: "password",- Help: "The password of your proton drive account.",+ Help: "The password of your proton account.",Required: true,IsPassword: true,+ }, {+ Name: "mailboxPassword",+ Help: `The mailbox password of your two-password proton account.++For more information regarding the mailbox password, please check the+following official knowledge base article:+https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password+`,+ IsPassword: true,+ Advanced: true,}, {Name: "2fa",Help: `The 2FA code@@ -149,9 +159,10 @@ then we might have a problem with caching the stale data.`,// Options defines the configuration for this backendtype Options struct {- Username string `config:"username"`- Password string `config:"password"`- TwoFA string `config:"2fa"`+ Username string `config:"username"`+ Password string `config:"password"`+ MailboxPassword string `config:"mailboxPassword"`+ TwoFA string `config:"2fa"`// advancedEnc encoder.MultiEncoder `config:"encoding"`@@ -313,6 +324,7 @@ func newProtonDrive(ctx context.Context, f *Fs, opt *Options, m configmap.Mapperconfig.UseReusableLogin = falseconfig.FirstLoginCredential.Username = opt.Usernameconfig.FirstLoginCredential.Password = opt.Password+ config.FirstLoginCredential.MailboxPassword = opt.MailboxPasswordconfig.FirstLoginCredential.TwoFA = opt.TwoFAprotonDrive, auth, err := protonDriveAPI.NewProtonDrive(ctx, config, authHandler, deAuthHandler)if err != nil {@@ -344,6 +356,14 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e}}+ if opt.MailboxPassword != "" {+ var err error+ opt.MailboxPassword, err = obscure.Reveal(opt.MailboxPassword)+ if err != nil {+ return nil, fmt.Errorf("couldn't decrypt mailbox password: %w", err)+ }+ }+ci := fs.GetConfig(ctx)root = strings.Trim(root, "/")diff --git a/docs/content/protondrive.md b/docs/content/protondrive.mdindex 315b8a7fb..96554352a 100644--- a/docs/content/protondrive.md+++ b/docs/content/protondrive.md@@ -90,7 +90,7 @@ To copy a local directory to an Proton Drive directory called backup### Modified time-Proton Drive Bridge does not support modification times yet.+Proton Drive Bridge does not support updating modification times yet.### Restricted filename characters@@ -103,6 +103,10 @@ Proton Drive can not have two files with exactly the same name and path. If theconflict occurs, depending on the advanced config, the file might or might notbe overwritten.+### [Mailbox password](https://proton.me/support/the-difference-between-the-mailbox-password-and-login-password)++Please set your mailbox password in the advanced config section.+### CachingThe cache is currently built for the case when the rclone is the only instance