Skip to content

protondrive: align backend with newer Proton SDK stack - #9260

Merged
ncw merged 4 commits into
rclone:masterfrom
tdawe1:fix/protondrive-sdk-2026
Apr 24, 2026
Merged

ncw merged 4 commits into
rclone:masterfrom
tdawe1:fix/protondrive-sdk-2026

Conversation

@tdawe1

@tdawe1 tdawe1 commented Mar 14, 2026 •

Copy link
Copy Markdown
Contributor

What is the purpose of this change?

This PR is part of the work needed to keep Proton Drive compatible with Proton's newer SDK-based stack.

Recent Proton Drive changes introduced a newer SDK for the API and corresponding request expectations. The companion PRs update the lower-level Proton dependencies, while this PR updates the protondrive backend in rclone/rclone to match that newer behavior.

As part of that, this PR also updates the app-version value sent by the backend so it uses a third-party external-drive-rclone@... identifier derived from the rclone version, rather than an official-client value.

The lower-level dependency changes are handled in companion PRs, so each layer can be reviewed independently.

Was the change discussed in an issue or in the forum before?

Related context:

Required supporting dependency PRs:

How was this change tested?

Locally:

go test ./backend/protondrive

This PR also adds targeted internal tests covering version-to-header mapping for:

  • stable releases
  • dev builds
  • beta builds
  • invalid-version fallback

Documentation

The backend option help text was updated in code so regenerated docs will pick up the corrected wording.

Notes

This PR is intentionally limited to the rclone/rclone layer.

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@tdawe1

tdawe1 commented Mar 15, 2026

Copy link
Copy Markdown
Contributor Author

I noticed that rclone doesn't currently have a maintainer for Proton Drive, so I thought I'd share what I had done for compatibility with the new API for my personal use. I've tried to match the contributing standards, but please feel free to request modifications - or of course, to close the PR entirely if it isn't helpful.

@Overcrimp

Copy link
Copy Markdown

Thank you for this fix! I have tested it and it works perfectly fixing the current syncing issues present in the latest release.

@ncw

ncw commented Apr 22, 2026

Copy link
Copy Markdown
Member

@tdawe1 sorry for the delay looking at this.

Can you rebase this on master and drop the non proton drive related commits.

I notice a replace statement in your go.mod which we can't merge. Do you need that?

Thanks

Nick

tdawe1 added 2 commits April 22, 2026 17:50
Use SDK-era Proton defaults by adding drive_sdk_version configuration and updating app_version defaults so requests match current Proton Drive API expectations.

Wire both values through to Proton API Bridge configuration to keep move and upload operations working against the 2026 SDK-backed backend.
@tdawe1
tdawe1 force-pushed the fix/protondrive-sdk-2026 branch from e44d76a to afcaf7f Compare April 22, 2026 17:04
@tdawe1

tdawe1 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

@ncw I've rebased onto current master and removed the unrelated commits as requested. After the cleanup, the change to go.mod was unnecessary and has also been dropped.

I've updated the PR description to match, and removed the make quicktest / racequicktest verification claims, since these no longer apply after narrowing the PR. go test ./backend/protondrive still passes locally.

@Overcrimp

Copy link
Copy Markdown

Thank you for this fix! I have tested it and it works perfectly fixing the current syncing issues present in the latest release.

With the updates the fixes continue to work well with my existing protondrive config. Thank you all again!

@dlaumen

dlaumen commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Hi @tdawe1 , I'm an engineer at Proton. Thanks for working on the rclone integration with Proton Drive.

We kindly request that you refrain from manually sending the x-pm-drive-sdk-version header. This header is automatically injected by the Proton Drive SDK when used correctly. Requests not originating from the SDK should not identify themselves as such, as this prevents us from accurately tracking SDK versions for debugging and support.

Additionally, the x-pm-appversion header should not match the official web-client value. As outlined in #9189 and our SDK's README (https://github.com/ProtonDriveApps/sdk#technical-requirements), third-party integrations must use a version string conforming to the external-drive pattern:

/^(external-drive)+(-[a-z_]+)+@[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-((stable|beta|RC|alpha)(([.-]?\d+)*)?)?([.-]?dev)?(\+.*)?$/i

Aligning with these standards will help ensure the integration works smoothly with our systems. Appreciate your efforts on this!

@tdawe1 tdawe1 changed the title protondrive: send SDK-era app headers for move and upload compatibility protondrive: align backend with newer Proton SDK stack Apr 23, 2026
@tdawe1

tdawe1 commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor Author

@dlaumen Thanks for clarifying! I’ve updated this in
1e95ef7:

The backend now sends a third-party external-drive- rclone@... app version derived from the rclone
version.

Current mapping is:

  • stable release: external-drive- rclone@<version>-stable
  • dev build: external-drive-rclone@<version>-dev
  • beta build: external-drive- rclone@<version>-beta...

I removed the manual x-pm-drive-sdk-version
handling, added tests for the version mapping, and
updated the backend docs/help text.

Verified with go test ./backend/protondrive.

I wasn't entirely sure if Proton requires a suffix in the app version, so when one is not present, it assumes that it is -stable and appends that the header.

I’ve also updated the PR title and description to make them clearer and easier to understand.

@kohane27

kohane27 commented Apr 23, 2026 •

Copy link
Copy Markdown

Thank you for this PR! I'm so excited about the possibility of finally getting rclone protondrive to work again after months of being broken (lack of maintainer and broken Proton-API-Bridge upstream) and I unsubscribed Proton because of it.

I have tested this PR fork (commit 1e95ef7) and built rclone with the patches:

go build -o rclone .

Update: Turned out I just needed to log in again in the browser to avoid the CAPTCHA issue below:

But when running ./rclone ls protondrive-crypt:/ I was hit with the following:

2026/04/23 11:19:51.721066 WARN RESTY 422 POST https://mail.proton.me/api/auth/v4: For security reasons, please complete CAPTCHA. If you can't pass it, please try updating your app or contact us here: https://proton.me/support/appeal-abuse (Code=9001, Status=422), Attempt 1

This PR works flawlessly and I can confirm protondrive in rclone is working! Thank you again!

@dlaumen

dlaumen commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

@tdawe1 great! the suffix is optional, it doesn't matter so much for us, as long as it conforms to the regex it's fine (as the rules are slightly stricter than standard semver). Most important part for us is the first part, external-drive-rclone@, so thank you! 🙏

@tdawe1

tdawe1 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for this PR! I'm so excited about the possibility of finally getting rclone protondrive to work again after months of being broken (lack of maintainer and broken Proton-API-Bridge upstream) and I unsubscribed Proton because of it.

I have tested this PR fork (commit 1e95ef7) and built rclone with the patches:

go build -o rclone .

Update: Turned out I just needed to log in again in the browser to avoid the CAPTCHA issue below:

But when running ./rclone ls protondrive-crypt:/ I was hit with the following:

2026/04/23 11:19:51.721066 WARN RESTY 422 POST https://mail.proton.me/api/auth/v4: For security reasons, please complete CAPTCHA. If you can't pass it, please try updating your app or contact us here: https://proton.me/support/appeal-abuse (Code=9001, Status=422), Attempt 1

This PR works flawlessly and I can confirm protondrive in rclone is working! Thank you again!

Thanks for testing - I'll look at the error in the next couple of days, this should probably be handled better

@ncw

ncw commented Apr 23, 2026

Copy link
Copy Markdown
Member

@tdawe1 this looks ready to merge now - are you happy?

Can you drop the changes in the .md files - these are all in auto generated sections (the linter will probably moan about them)

Thanks

@kohane27

Copy link
Copy Markdown

@tdawe1

"I'll look at the error in the next couple of days, this should probably be handled better"

The CAPTCHA error doesn't seem to be related to this PR changes. It happened to other people and hence I got the workaround from googling. Thank you again!

@ncw ncw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great - thank you for doing this @tdawe1

I will merge this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants