Files
rclone/docs/plans/upstream-post-draft.md
T
Lucas WintherandClaude Opus 5.5 a1e80580e2
ci / protondrive (push) Failing after 27m24s
docs: hand over the Proton Drive work after the plan 002 review
Correct the polling interval wording, record the comparison with
clayliddell/proton-drive-go-sdk, log the review findings left open, and
add a draft post for the upstream discussion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 23:13:48 +01:00

3.4 KiB

Draft: post for rclone issue #9252 / forum thread 53609

Fork-only. Not posted. Before posting, the owner must: publish the branch somewhere public (the Gitea is private), fill in <LINK>, and decide whether to stand behind the AI-assistance statement as written (rclone's CONTRIBUTING.md requires the submitter to understand every line).


A pure-Go Proton Drive backend following the official SDK (no cgo, no sidecar), for anyone who wants to pick it up

I've written a replacement for the internals of rclone's Proton Drive backend. It's on a branch here: . I'm not offering to maintain it long-term. I'm posting it so whoever takes this on, whether rclone's maintainers or someone from this thread, can use it as a starting point or a reference.

What it is:

  • Pure Go, no cgo and no sidecar process. It talks to the Proton Drive API directly through lib/rest, lib/pacer and lib/dircache, with Proton's own Go crypto libraries (gopenpgp/v3, go-srp). It replaces Proton-API-Bridge and go-proton-api.
  • It follows the official TypeScript SDK's behaviour, aiming at the requirements Proton gave in forum thread 53609:
    • volume-based and v2 routes only, with no share-scoped routes;
    • the upload block verifier (each block is checked to decrypt before it is committed);
    • x-pm-appversion: external-drive-rclone@<version>, sent to drive-api.proton.me;
    • the v4 node key with v6 PKESK and SEIPDv2/AEAD content, as described in post 19;
    • signed manifests and extended attributes (modtime, size, SHA1).
  • Events: rclone follows the volume's events, at most once every 30 s against Proton's hosts. It uses them to invalidate its cache and to implement ChangeNotify, so rclone mount sees changes made by Proton's own apps.
  • Sign-in by browser session fork, so rclone never sees the password and 2FA and CAPTCHA are handled by Proton's page. Username and password sign-in still works for existing configs.
  • Hermetic tests: a fake Proton server (protontest) runs the full fstests suite without an account, plus fuzz and hostile-server tests.

Tested against the real service on a free account (the suites ran before the events work; events were then checked live on their own): TestIntegration passes (98 pass, 29 skipped by feature checks). test_all also passes for fs/operations, fs/sync and vfs, except for two things. Five cross-Fs cache tests fail. FsChangeNotify also fails, because fstests waits 27 s and Proton's polling floor is 30 s. A paid account was checked for sign-in, about and basic operations only. Files written by rclone open in the web app and in Proton's official CLI 0.9.0, and rclone reads files those clients wrote. Files also round-trip both ways with released rclone v1.76.0.

Not done yet:

  • a persistent metadata cache, the local replica Proton asked for in posts 33 and 41 (designed, not built);
  • rclone --metadata;
  • the single-request upload for small files;
  • Photos, shared-with-me and desktop-app backups;
  • live checks of 2FA by code and of Proton's desktop and mobile clients.

Prior art: I looked at clayliddell/proton-drive-go-sdk. It covers less (no events, no overwrite of existing files, share-scoped routes, gopenpgp v2), so this branch doesn't use it.

Disclosure: this was written with heavy AI assistance (Claude Code), following rclone's AGENTS.md. I've built it, run the tests and used it against real accounts, but please review it with that in mind.