Replace Proton-API-Bridge and go-proton-api with a client in
backend/protondrive written against Proton's current Drive API, following
the behaviour of Proton's official Drive SDK:
- volume-based and v2 routes only
- upload block verification, signed manifests and extended attributes
- current content encryption (v4 node keys, v6 PKESK, SEIPDv2)
- browser (session fork) sign-in, with username and password still
supported
- the volume's change events, used to keep the metadata cache current and
for ChangeNotify, polled at most every 30 s
- an in-memory fake Proton server (protontest) so the tests run without
an account
Uses ProtonMail/gopenpgp/v3 and ProtonMail/go-srp directly; no cgo.
Written with heavy AI assistance (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the jlaffaye/ftp v0.2.3 bump in v1.76.0, the IP in the PASV reply
is ignored unless trust is opted into, which breaks servers whose PASV
reply legitimately points at a different data host. Add an opt-in
trust_pasv_ip option (default off) that passes DialWithTrustPasvIP to
the library.
If --user (or --rc-user etc.) is set without --pass then the basic
auth middleware is installed with an empty password, so anyone who
knows the user name can log in with an empty password. For the rc
this also counts as "authenticated" and unlocks the methods which
need authentication.
This now logs a NOTICE level warning at startup so the operator can
see what they have configured. Behaviour is otherwise unchanged as an
empty password may be intentional.
Reported by @ctxloop
Multi-thread copies from a local source hand the chunk writer an
unbuffered ReOpen. Backends such as s3, azureblob and
oracleobjectstorage checksum the chunk with io.Copy before uploading
it, and as ReOpen didn't implement io.WriterTo, io.Copy read the file
in 32 KiB pieces.
ReOpen now implements io.WriterTo:
- If the destination implements io.ReaderFrom, that is used so the
destination's own buffering is kept. This means multi-thread
downloads (bufio.Writer over an OffsetWriter, sized by
--multi-thread-write-buffer-size) and HTTP request bodies behave as
before and don't gain an extra buffer.
- If less than 1 MiB remains it uses io.Copy as before, so small files
don't take a 1 MiB buffer.
- Otherwise it copies through a 1 MiB buffer from the global pool, so
the memory is reused and is counted by --max-buffer-memory.
This replaces the s3 specific io.CopyBuffer from a68480093 (reverted
in the previous commit) which allocated a fresh 1 MiB buffer for every
chunk outside of --max-buffer-memory, and gives the same speedup to
every backend which io.Copies from the chunk reader.
Benchmarks on Linux, 16 cores, source file on tmpfs, warm cache.
"orig" is master with a68480093 reverted (32 KiB reads), "master" has
a68480093 (make 1 MiB per chunk), "branch" is this commit.
Checksum pass only - ReOpen of a local 128 MiB range into md5, 5 runs:
1 stream MB/s B/op
orig 752-759 34 KiB
master 751-784 1025 KiB
branch 764-784 1.2 KiB
16 streams MB/s B/op
orig 4772-5495 547 KiB
master 4008-4607 16405 KiB
branch 4525-5052 22 KiB
On Linux the reads are cheap so the larger reads are worth ~2-3% for
a single stream and are lost in the noise with 16 streams. The point
here is that branch matches master's reads without allocating.
The same benchmark on Windows 10 (VirtualBox VM, 8 vCPUs on a Ryzen 7
PRO 5850U, 64 MiB chunk per stream, 1 GiB file in the file cache),
where reads are more expensive, shows the speedup. Median of 5 runs:
streams orig master branch
1 560 MB/s 594 MB/s (+6.1%) 610 MB/s (+9.0%)
4 1438 MB/s 1594 MB/s (+10.9%) 1610 MB/s (+12.0%)
8 1878 MB/s 2123 MB/s (+13.0%) 2143 MB/s (+14.1%)
allocated per op (all streams)
1 33 KiB 1026 KiB 1 KiB
4 134 KiB 4102 KiB 5 KiB
8 267 KiB 8204 KiB 10 KiB
With 4 and 8 streams the ranges of orig and branch don't overlap.
End to end - rclone copy of a 2 GiB local file to MinIO on localhost
(server bound, so wall time doesn't change), mean of 4 runs, max RSS
and number of GCs from GODEBUG=gctrace=1:
default (5 MiB chunks, 4 streams)
wall max RSS GCs
orig 6.13s 84 MiB 14
master 6.29s 93 MiB 54
branch 6.30s 90 MiB 8
--s3-upload-concurrency 16 --s3-chunk-size 64M
wall max RSS GCs
orig 4.76s 83 MiB 6
master 4.80s 112 MiB 7
branch 4.80s 97 MiB 6
Multi-thread download of the same file from MinIO to local disk
(checks the io.ReaderFrom path), mean of 4 runs:
wall max RSS GCs
orig 4.31s 80 MiB 5
master 4.31s 80 MiB 5
branch 4.32s 80 MiB 5
Uploads with --max-buffer-memory 2M and 4M (with
--s3-upload-concurrency 16 --s3-chunk-size 64M) complete normally in
5-7s, throttled rather than stalled.
This reverts commit a68480093c.
The next commit gives the same speedup to all backends by implementing
io.WriterTo on operations.ReOpen, using a buffer from the pool.
Before this change TestMount for cmount on Linux failed from time to
time with
lstat /tmp/rclonefs-mount.../.fuse_hidden0000002200000001: no such file or directory
libfuse renames a file which is removed while still open to
.fuse_hidden* and removes it once the last handle is released. If the
test suite lists the directory in between, os.ReadDir returns the entry
but entry.Info() fails with ENOENT. readLocalEx then aborts the test
with require.NoError instead of letting the retry loop in checkDir run,
and the file the aborted test created is left behind, so the following
tests fail as well.
ioutil.ReadDir skipped such entries, but this was lost when it was
replaced by os.ReadDir and entry.Info() in 5d6b8141e. realOs.ReadDir now
skips entries which no longer exist again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The example `rclone config` session in the Google Drive docs was
written for an older version and no longer matched what rclone prints.
In particular it left out the "Edit advanced config?" question, which
comes straight after service_account_file, so users following along
could answer "y" to it by accident thinking it was the web browser
question.
The session now shows the current prompts: the "Option <name>."
headers, the "Enter a value" hints, `\ (drive)` choice values, the
"Edit advanced config?" question, and the "Yes (default)" markers.
It also lists the options actually saved, including team_drive.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This type checks all the backends looking for config which is saved
with a key which isn't one of the backend's config options. Unlike the
runtime check, this catches config saved in config flows which the
tests don't exercise.
Config saved by a backend with no matching config option isn't
redacted by rclone config redacted, and can't be set with flags or
environment variables.
This logs an internal error when that happens and panics when running
tests so these are caught by the integration tests.
Keys supplied by the user with rclone config create and update are
still saved without checking.
The 2FA code and bucket ID stored in the config file had no config
options, so weren't marked sensitive and were shown in clear by rclone
config redacted.
The username, legacy setup password and verification code stored in
the config file had no config options so weren't marked sensitive and
were shown in clear by rclone config redacted.
This adds config options for all the values jottacloud stores in the
config file. The device and mountpoint can now be set with
--jottacloud-device and --jottacloud-mountpoint.
The 2FA auth session stored in the config file during setup had no
config option, so it wasn't marked sensitive and was left in clear
in the output of rclone config redacted if setup was abandoned.
redact these values in the debug log:
- password and sensitive flags set from environment variables, also
in the error for an invalid value
- the client secret from jottacloud config
- the token after a bad token response from shade
- the login_token used to open the rc web gui
mark these options as sensitive so they are redacted:
- pass for serve ftp and serve sftp
- auth_key for serve s3
- pass for serve http, serve webdav, serve restic, serve s3 and the rc
mark these backend options as sensitive so they are redacted:
- internxt: token
- linkbox: web_token
- oracleobjectstorage: sse_customer_key, sse_customer_key_sha256 and sse_kms_key_id
- pikpak: captcha_token and token
- s3: ibm_api_key
- shade: token
pikpak needs a captcha token for every API call. The backend fetches one,
caches it, and refreshes it when it expires; the token source did those
refreshes with the context it was constructed with, stored in a field.
That context does not live as long as the token source does.
Re-authorization rebuilds the token source with the context of one API
call, so when that call finished every later refresh failed with "context
canceled", and nothing would ever replace the stored context again. The
cached token hid this until it expired, so a mount worked for a while and
then failed every request until it was restarted.
The failed fetch was also wrapped in fserrors.FatalError, which turns a
transient error into an unrecoverable one: sync cancelled the whole run
with "Cancelling sync due to fatal error" and exited with the fatal code.
Pass the context of the request that needs the token instead, and return a
failed fetch as an ordinary error so that only the operation that needed
the token fails. The next request fetches a token with a live context.
The backend turned every error from statting a bucket or key into
NoSuchBucket or NoSuchKey, so a failure to list the remote, for
example a network error or a timeout, was reported to the client as a
missing bucket or object. Clients treat that as final and don't retry
it, and BucketExists reported such a bucket as not existing.
Only return NoSuchBucket and NoSuchKey when the VFS says the path
doesn't exist, and return other errors, which gofakes3 sends as 500
InternalError.
Co-authored-by: Nick Craig-Wood <nick@craig-wood.com>
Filen treats names which differ only in case as the same name, but the
backend didn't set the CaseInsensitive feature. Syncing "Photos/a.txt"
onto an existing "photos/a.txt" uploaded it as a new file, which
replaced the existing one on Filen, and then failed to delete the old
name with "file_is_versioned" on every run.
Set CaseInsensitive and treat parent paths which differ only in case
as the same directory when moving. Allow DirMove when the destination
found is the source directory itself, which is a case-only rename.
When a name transform failed for a file at the top level of the transfer,
Path returned an empty name: the only fallback checked the number of path
segments, which is unchanged for a top-level file. The file then failed to
copy on local, or landed on the destination root path itself on bucket
remotes. Path now keeps the original name as soon as a transform fails,
and the baseOnly branch returns the real segment error instead of the
misleading empty-segment one.
When copy, sync or move found an existing destination file, Copy and
move replaced the transformed source name with a transform of the
destination's name. That name is already transformed (it is how the
file was matched), so updates went to a doubly transformed name, e.g.
prefix-prefix-file.txt instead of prefix-file.txt.
Keep the transformed source name when --name-transform is in use and
only fall back to the destination's name when it isn't, which keeps
the existing case of a file on case-insensitive remotes as before.
TransformFile and convmv are unaffected as their dst is the source
file itself.
The hasher example used hashsums, and the docker plugin example used
drive_id. Neither is an option, so both lines were silently ignored.
They are hashes and team_drive.
RemoteStats read s.errors and s.lastError after releasing s.mu,
while Error writes both fields under the write lock, so polling
stats concurrently with a failing transfer raced. Move the
lastError read inside the existing read-lock section and guard
against a nil lastError, which Errors() can leave behind when it
bumps the error count on its own. Adds a regression test that
runs concurrent Error and RemoteStats calls under the race
detector.
An empty lock file decodes with io.EOF and no recorded error,
leaving TimeExpires zero, so lockFileIsExpired skipped the
expiry check and --max-lock was never consulted. Treat a zero
expiry like a decode failure so the existing --max-lock branch
handles it.
Features.Mask combined SlowModTime with AND, but it is a restriction.
Wrapping backends such as crypt start with it false, so crypt over s3,
swift, qingstor, oracleobjectstorage or ftp lost it and read the
modtime when a fast fingerprint was wanted. This cost an extra
transaction per file when downloading through crypt to local, and with
--vfs-fast-fingerprint. Combine it with OR so the restriction
propagates through Mask.
Note that this changes the fast fingerprint for these wrapped remotes,
so a VFS cache using --vfs-fast-fingerprint will treat its cached
files as changed once after upgrading.
Reading a range from a zip entry decompresses it from the start and
discards the data before the offset, so each chunk of a multi-thread
download re-read the entry. Disable multi-thread downloads for zip
files.
Seafile ignores Range requests on encrypted libraries, so each chunk
of a multi-thread download fetched the file from the start and threw
away the data before its offset. Disable multi-thread downloads for
encrypted libraries.
Features.Mask combined NoMultiThreading with AND like the positive
feature flags, but it is a restriction. Wrapping backends such as
crypt, chunker, compress, hasher, union and combine start with it
false, so they dropped it and crypt over pikpak or protondrive used
multi-thread downloads. Combine it with OR so the restriction
propagates through Mask.
With --rc-serve a GET of a URL such as /[:sftp,ssh=cmd:]/ instantiated
the inline remote, which runs a command, provided the rc had
authentication configured or --rc-no-auth was in use.
A web page can make a browser send such a GET with an <img> tag, and
the browser will add any credentials it has cached for the rc.
Browsers only mark these requests as cross-origin when they are sent to
localhost or over HTTPS, so for an rc server on another address rclone
could not tell the request came from a web page.
Inline remotes and connection string parameters in --rc-serve URLs are
now always refused. Remotes in the config file can still be served,
as can bare local paths if authentication is configured or
--rc-no-auth is in use.
The exception is [:local:/path] without parameters, which is the same
as the bare local path [/path] and is treated as one. rclone-ui uses
this form to preview local files.
This changes the rule introduced for CVE-2026-49980 where
authentication or --rc-no-auth allowed everything on the serve path.
Open turned the range and seek options into an offset and count, but it
never sent a Range header. It downloaded the file from the start and
threw away everything before the offset. Multi-thread copies open each
chunk separately, so a 5 GiB file in 80 chunks pulled about 200 GB from
the server and took over 30 minutes instead of under one. rclone mount
and resumed transfers were affected the same way.
Download through lib/rest, which turns the range and seek options into
a Range header. The FileLu file servers answer Range requests with 206
Partial Content.
Fixes#10305
Before this change, `rclone gui` had no way to turn off the web GUI's
automatic remote usage checks. The Dashboard has always called
`operations/about` on every remote that supports it as soon as it loads
(for `sftp`, an SSH login to each). Since rclone-web `1.2.0`, a "Check
usage automatically" setting can turn that off, but only from inside
the GUI, after the first checks have already run.
After this change, `--no-check-usage` adds `checkUsage=false` to the
login URL, which turns the setting off before the Dashboard loads. It
needs rclone-web `1.2.1` or later; older versions ignore it. The flag
never turns the setting on, so without it, the user's own choice is
kept. It can also be set with `RCLONE_NO_CHECK_USAGE`. It has no effect
with `--no-auth`, which opens the GUI without the login URL, and a log
line says so.
The idle time after which a cache downloader stops and the number of
errors it tolerates were fixed at 5s and 10. A slow reader, such as
audio streamed with --buffer-size 0, could see its downloader time out
between reads, and a failing backend kept a mount busy until the error
count was reached.
Swift clusters without the bulk middleware in the proxy pipeline answer
bulk delete requests with 403 Forbidden. Rclone then failed to delete
large objects with "Operation forbidden", and when a segmented upload
failed its segments were left behind, silently using up space.
When BulkDelete returns swift.Forbidden, rclone falls back to deleting
each segment with ObjectDelete. A segment that is already gone counts
as deleted, as it does in a bulk delete. Any other error is returned
as before. Both removing a large object and cleaning up after a failed
upload go through the same helper.
Co-authored-by: Walter Doekes <1225014+wdoekes@users.noreply.github.com>
Seven flag references in the docs named flags rclone does not have:
--max--connections, --tps-burst, --buffer, --s3-concurrency,
--sufix, --cache-mode and Storj's --chunk-size. Each now names the
real flag.
The password command was missing the powershell executable and used
double quotes inside the command, which rclone's space separated list
parser rejects. Store the credential under the user profile so it is
found from any working directory, and load System.Web so the password
generation step works in a fresh Windows PowerShell session.