Commit Graph
3511 Commits
Author SHA1 Message Date
Lucas WintherandClaude Opus 5.5 b4fa0fc8cc docs: bring the Proton Drive handoffs and architecture up to date
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:16:52 +01:00
Lucas WintherandClaude Opus 5.5 fa43dad943 docs: hand off Proton Drive M5 at the end of the day
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:15:13 +01:00
Lucas WintherandClaude Opus 5.5 d912e6ba24 protondrive: record what Task 7 of the events work left open
Record the refresh race investigation and the remaining race detector
reports in the security tests, give the reasons the TestMain and two
crypto items are left, and tick Task 7 in the plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:09:55 +01:00
Lucas WintherandClaude Opus 5.5 021591a0ca protondrive: document that environment-set remotes can't share a refresh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:50:46 +01:00
Lucas WintherandClaude Opus 5.5 1517d8e3d8 protondrive: say how to reconnect when the saved key password is wrong
A saved session whose key password unlocks no key failed with "is the
password right?" alone; it now also says to run rclone config
reconnect, as other unusable saved sessions do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:50:07 +01:00
Lucas WintherandClaude Opus 5.5 01882f7910 protondrive: warn in the docs not to share rclone config output
rclone config create, show and dump print the saved session, whose
salted key password outlives a sign out. Also say that a cache unused
for 10 minutes is forgotten, and make the fake server's init.d stop
kill protonfake if it hasn't stopped within 10s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:48:40 +01:00
Lucas WintherandClaude Opus 5.5 c1aa97fe34 protondrive: refuse oversized encrypted names before decrypting them
An uncompressed encrypted name, passphrase, hash key or extended
attributes far larger than the limit for its kind was decrypted into
memory in full before being refused; one of 10 MiB took about 230 MiB
to list. It is now refused by its size first. Also wrap the error for
folders nested too deep once rather than at every level, where a
hostile server could make it about 88 KB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:47:39 +01:00
Lucas WintherandClaude Opus 5.5 abd6701b2b protondrive: finish a poll for changes in flight before Shutdown returns
Shutdown cancelled a poll in flight without waiting for it, so a poll
whose response had already arrived could still log after Shutdown
returned; the race detector caught one racing with a test's change to
the log level. Shutdown and Disconnect now wait for the poll, though
not for any notification it makes.

Also make TestPollerShutdownAndReuse wait for its polls rather than
count them after a fixed sleep, which failed under load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:42:00 +01:00
Lucas WintherandClaude Opus 5.5 ebdb2307c9 protondrive: make three tests end cleanly when they fail
TestListingRacingChange now releases its held request however it ends,
rather than hanging until the package timeout, protonfake's TestRun
stops and waits for its server on a failed assertion, and
TestClientBootstrapCreateVolumeRace starts both clients at once rather
than always waiting 2 s for one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:38:31 +01:00
Lucas WintherandClaude Opus 5.5 669d7c08d1 protondrive: don't send a block's storage token on to a redirected host
Go's HTTP client drops only standard credential headers on a redirect
to another host, so pm-storage-token and x-pm-uid went with it; they
are now dropped too. Also let a later pass of a sync retry an upload
whose source changed while it was read, rather than failing it for
the whole run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:35:43 +01:00
Lucas WintherandClaude Opus 5.5 272fbe5ccb protondrive: don't fail a key lookup because another caller gave up
A caller waiting for another's fetch of the same public keys got that
caller's context error if it was cancelled; it now fetches them
itself. Also:

- build each own address's public key ring once at sign-in rather
  than on every lookup, 2-3 times per decrypted node
- a listing caching a node under a new parent forgets the old
  parent's listing, as caching a single node already did

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:33:45 +01:00
Lucas WintherandClaude Opus 5.5 d934016ba2 protondrive: fail a listing whose pages repeat instead of hanging
A server answering More with an anchor already followed made a listing
page until its context ended; it now fails at once. Also read an
extended attribute Size of null as missing, so the block sizes give
the size, rather than as 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:31:38 +01:00
Lucas WintherandClaude Opus 5.5 a60b5fc04a protondrive: stop polling for changes once the cache goes unused
With nothing subscribed to changes, a node cache neither read nor
filled for 10 minutes is now cleared, which stops polling until the
Fs is used again; before, an Fs never shut down polled for ever.

Also keep to one events request per interval:

- a Retry-After on an events request no longer holds up the listing
  that filled the cache; it delays the next poll instead
- after Shutdown, polling resumes from the cursor it had, an interval
  after reuse, instead of fetching a new cursor at once
- once the start cursor fetch has failed, the next is fetched after
  the backoff rather than inline

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:28:33 +01:00
Lucas WintherandClaude Opus 5.5 1f1db51f6c test_all: skip FsChangeNotify against the real Proton Drive
fstests waits 27 s for changes and Proton allows one events request per
30 s. The live events check otherwise passed; record its findings and
tick plan 002 Task 6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:06:56 +01:00
Lucas WintherandClaude Opus 5.5 cb94ae034c protondrive: say in the enable_caching help that the cache follows other clients
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:53:57 +01:00
Lucas WintherandClaude Opus 5.5 8fecab6450 protondrive: keep the root folder when the directory cache is flushed
DirCacheFlush reset the directory cache to the volume root until the
root was found again, so a change notified in between would be named
relative to the volume root. It now keeps the root folder's ID, as
flushes made for change events do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:53:57 +01:00
Lucas WintherandClaude Opus 5.5 16acb17940 protondrive: notify the old path of a folder moved while not cached
A folder the node cache no longer held but the directory cache did, as
after the cache is cleared, was notified only by its new parent when
another client moved it, so a mount kept showing it at its old path.
Its old path is now notified as well, and flushed as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:53:25 +01:00
Lucas WintherandClaude Opus 5.5 0ea3605988 protondrive: name new items exactly in change notifications
An item's event can be applied before rclone caches the item, as for
its own uploads and new folders. Its folder is still notified at once,
and the item itself is now notified at its path if it is cached within
the next two polls, with no extra requests. This makes mounts and the
FsChangeNotify integration test see exact paths for such items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:53:04 +01:00
Lucas WintherandClaude Opus 5.5 2fa149c373 protondrive: document change notification
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:41:15 +01:00
Lucas WintherandClaude Opus 5.5 2ccddb5585 protondrive: notify mounts of changes made by other clients
Add ChangeNotify, fed by the volume events: an item is reported at its
old path, and its new folder if it moved, when it was cached; otherwise
its folder is reported. An expired cursor reports the root. Every event
batch also flushes the folders it names from the dircache, so a folder
renamed or moved by another client is found under its new path and
nothing is left at its old one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:37:11 +01:00
Lucas WintherandClaude Opus 5.5 355fb0699d protondrive: poll volume events while the cache is in use
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:29:55 +01:00
Lucas WintherandClaude Opus 5.5 877bb5d10c protondrive: read volume events and invalidate the cache from them
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:05:46 +01:00
Lucas WintherandClaude Opus 5.5 6b02131ba3 docs: plan Proton Drive events and change notification (M5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 15:42:33 +01:00
Lucas WintherandClaude Opus 5.5 fbf2d565e8 docs: bring the Proton Drive handoff up to date after the final review
ci / protondrive (push) Successful in 23m29s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 15:12:51 +01:00
Lucas WintherandClaude Opus 5.5 ad3552e2e5 docs: note the Proton Drive block size cache in the architecture
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:48:33 +01:00
Lucas WintherandClaude Opus 5.5 bfa9b7122b protondrive: tighten tests and docs from the final review, log the rest
Timing bounds in parallel tests leave room for a slow race runner, the
block 502 test checks its fault fired, refusedCommit's 408 exclusion is
pinned, the user docs explain the "server doesn't show it yet" error and
the conformance checklist matches the current draft and trust rules.
Every other minor from the review is listed in docs/TODO.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:48:17 +01:00
Lucas WintherandClaude Opus 5.5 5dbf5b04c6 protondrive: stop telling users to upgrade rclone on unrelated Proton errors
Proton's generic "requirements not met" code 2000, which it returns for
a node changed since it was read (as when a lost rename response is
resent), aborted the whole run with "upgrade rclone". It is now an
ordinary error that isn't retried. Code 2028 (a feature disabled,
rate-limited or blocked) is retried, and the codes Proton actually uses
for a rejected or missing app version, 5003 and 5001, now give the
upgrade message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:40:13 +01:00
Lucas WintherandClaude Opus 5.5 788a711dc9 protondrive: make multi-thread downloads of files without block sizes linear
A file whose extended attributes don't record its block sizes, as some
other clients write, was read from the first block for every ranged
read, so a multi-thread copy, which opens each chunk as a range,
downloaded data quadratically: about 8.5 GiB for a 1 GiB file. The sizes
of blocks already read are now remembered per Fs (bounded to 16
revisions and 65536 blocks), so later chunks start at the right block.
A block list that disagrees with what was learnt is an integrity error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:37:40 +01:00
Lucas WintherandClaude Opus 5.5 674b538ca5 protondrive: keep the draft client ID stable for remotes configured from the environment
A remote set up with environment variables or a connection string can't
save its draft client ID, so it got a new random one on every run, and a
draft left by an earlier run then blocked uploading that name as if
another client were uploading it. When the ID can't be saved it is now
derived from the remote name and the account's volume, so it is the same
on every run. A remote in the config file still gets a random ID, saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:32:14 +01:00
Lucas WintherandClaude Opus 5.5 94eedc942f protondrive: ignore modification times and hashes the owner didn't sign
Extended attributes whose signature failed or was missing were used, so
a server could set a file's modification time, size and SHA-1 at will:
for example make `rclone sync --update` skip every changed file. Without
ignore_signature_errors they are now not used and an ERROR is logged:
the modification time is the server's, there is no SHA-1, and the size
comes from the recorded block sizes, which reads check. The file stays
readable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:29:40 +01:00
Lucas WintherandClaude Opus 5.5 b3f5685e62 protondrive: refuse writing into a folder whose name hash key is unsigned
A folder's hash key whose signature failed or was missing was only
logged, and the names of everything written into the folder were then
hashed with it, so a server which made the key could test guesses at
those names. Creating, uploading, renaming, moving or copying into such
a folder is now refused unless ignore_signature_errors is set, when an
ERROR is logged once per folder. Reading is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:24:56 +01:00
Lucas WintherandClaude Opus 5.5 db7afafc08 protondrive: refuse node keys whose Argon2 parameters would exhaust memory
A node or share key from the server was unlocked with whatever Argon2
parameters it carried, so a crafted key could make every listing
including it allocate up to 2 TiB and crash rclone. Node and share keys
locked with Argon2 beyond 4 passes, parallelism 8 or 128 MiB are now
refused before the key derivation runs, as an integrity error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:23:50 +01:00
Lucas WintherandClaude Opus 5.5 e95317b52a protondrive: refuse files whose content key signature is missing
A server could replace a file's content key with one it made, without a
signature: updates were then encrypted with a key the server knows, and
ranged reads returned whatever it encrypted under that key. A missing or
invalid content key signature now makes the file unverified, like an
unverified node key: reads and updates are refused unless
ignore_signature_errors is set, when an ERROR is logged once per file and
operation. The fake gains corruptions for this and for the hash key,
name and extended attribute checks that follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:21:14 +01:00
Lucas WintherandClaude Opus 5.5 ea8d09ce43 docs: say which Proton Drive test files can't go upstream without the fake
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:10:53 +01:00
Lucas WintherandClaude Opus 5.5 29ad269444 docs: record the Proton Drive live verification results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 13:53:13 +01:00
Lucas WintherandClaude Opus 5.5 b440df2e1f docs: note the conflict-cleanup delete after an unknown upload outcome
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 12:33:37 +01:00
Lucas WintherandClaude Opus 5.5 61733fce6e protondrive: add re-keyed fixtures of files written by Proton's web app and CLI
Captured from a throwaway test account on 2026-11-12 and re-keyed onto
test-only keys; no key, passphrase, ID or email of the account is in them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 12:32:19 +01:00
Lucas WintherandClaude Opus 5.5 be00536078 protondrive: never delete an upload's draft unless Proton refused the commit
After a failed commit the client read the file back and deleted the
draft if the read showed it uncommitted. Proton's server can take a
moment to show a commit, so a stale read could send a delete against a
file or revision which had in fact been committed.

The draft is now deleted only when the server refused the commit with a
4xx API error on a single attempt which was not resent; any other
failure leaves it and reports that the upload may have succeeded. A
cancelled upload whose commit succeeded stops waiting for the server to
show it at once. The fake server's read lag can also serve a file
without an active revision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 12:30:07 +01:00
Lucas WintherandClaude Opus 5.5 1b2fcbd212 protondrive: make the golden capture fail closed on foreign keys
The capture names its folder with -capture-remote and refuses -remote,
so a mistyped -run can't start the integration tests against the
account. Every key written has a placeholder user ID; a node key holding
another user's email, or a signature by or intended for a key not being
replaced, fails the capture without naming it. Salt notations are
written only where the original had one.

TestGoldenFixtures now also walks every key, key packet and signature of
a fixture, inside encrypted messages too, and checks folder modification
times; tampered fixtures are shown to fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 12:19:05 +01:00
Lucas WintherandClaude Opus 5.5 af6fdd7899 protondrive: fix uploads failing while Proton catches up after a commit
Proton's server can take a moment to show a change: a file read back
just after its commit may be missing or still a draft with no active
revision. Uploads then failed with "upload committed, but the file now
has another revision (revision  is active ...)" or "object not found".

The read back after a commit, the read of a server-side copy and, with
enable_caching off, the read of a folder to write into now retry with
backoff for about 7 s while the change doesn't show. A committed upload
the server still doesn't show after that fails with a new "committed,
but the server doesn't show it yet" error, deletes nothing and is not
retried at once. The fake server gains SetReadLag to model the lag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:57:02 +01:00
Lucas WintherandClaude Opus 5.5 a2dc6f71f1 protondrive: test against re-keyed files written by Proton's own clients
TestGoldenCapture (-capture DIR -capture-label NAME -remote NAME:PATH)
captures a folder another client wrote, re-keyed onto keys made for the
tests: blocks and signature-free SEIPD packets kept byte for byte, key
packets re-wrapped, signatures re-made with the same parameters (names,
hash keys and extended attributes encrypted again with their own session
keys, as their signatures are embedded), IDs and emails replaced.
TestGoldenFixtures reads every fixture in testdata/golden through the
backend from the fake server with every signature checked.

The fake server can now seed stored folders and keeps the times of
seeded nodes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:35:36 +01:00
Lucas WintherandClaude Opus 5.5 502a32b5f3 protondrive: name the SDK commit the client was last checked against
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:30:31 +01:00
Lucas WintherandClaude Opus 5.5 22b9c4fdc3 protondrive: fix ranged reads of files which don't record block sizes
A file written by an old client without recorded block sizes was read
in ranges by assuming 4 MiB blocks, so a range past the first block could
return the wrong bytes, or too few, without an error. Such a range is now
read from the first block, discarding the bytes before it, with every
block still checked against its hash.

Also identify the SDK the conformance checklist was checked against by
commit, and align the enable_caching help with the docs page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:19:53 +01:00
Lucas WintherandClaude Opus 5.5 7be50f9e22 protondrive: update docs for the rewritten backend
Rewrite the hand-written parts of the Proton Drive docs page for the
native client: browser and password sign-in with a transcript taken from
the current code, the third-party notice, what is verified on upload and
download, the ranged-read caveat, the trust rules and the
ignore_signature_errors option, the two protocol limits, the --dump
warning, filename rules, drafts, trash and limits. The generated options
section is left for make backenddocs.

Describe everything ignore_signature_errors allows in its help text,
update the feature list and score in protondrive.yaml, and add the SDK
conformance checklist and fork notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:06:19 +01:00
Lucas WintherandClaude Opus 5.5 c1464a39ab docs: mark Task 19 done in the Proton Drive handoff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:54:41 +01:00
Lucas WintherandClaude Opus 5.5 fd7a0dc98d chore: allow golangci-lint run in the Claude Code settings
The owner added the rule; docs/PERMISSIONS.md already listed it in the
Allow tier. Also record that the force-with-lease deny rule misses the
`--force-with-lease=` form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:53:08 +01:00
Lucas WintherandClaude Opus 5.5 cf7577dc1d protondrive: drop Proton-API-Bridge and go-proton-api
The old libraries were only used by the differential crypto tests. Those
go, and TestFrozenFixtures moves into crypto_internal_test.go without its
-update branch, so files the old library wrote stay checked through the
frozen fixtures in testdata/oldlib. go mod tidy removes the two libraries
and the modules only they pulled in; relvacode/iso8601 leaves go.mod.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:51:43 +01:00
Lucas WintherandClaude Opus 5.5 b667a1ab0f docs: record the owner's answers, the history rewrite and Task 18 in the Proton Drive handoff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:29:46 +01:00
Lucas WintherandClaude Opus 5.5 5afbe9e4fa protondrive: run the wider suites against the fake server in fork CI
Add the TestProtonDriveFake init.d script, which builds and starts
protonfake on port 28642 and passes on the session it prints, and a
test_all entry for it, so fs/operations, fs/sync, vfs and cmd/bisync
run against the fake server. Five tests that need a second Fs of the
same account to see what the first wrote are ignored, as each Fs
caches separately, and cmd/gitannex is skipped as for every init.d
remote; both are in docs/TODO.md.

Add a Gitea Actions workflow that builds, vets, lints, race-tests,
fuzzes and vulnerability-checks the backend, and re-verify the agent
permission table on the host toolchain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:23:26 +01:00
Lucas WintherandClaude Fable 5.2 65840bdc57 docs: record open questions and credential locations in the Proton Drive handoff
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 21:24:07 +01:00