Compare commits

..
Author SHA1 Message Date
Nick Craig-Wood 37e4117f48 Version v1.74.3 2026-06-05 16:20:23 +01:00
Nick Craig-Wood 9222ed2c5a rc: stop global.* connection string options changing config CVE-2026-49980
A connection string can carry global.* options which change rclone's
process-wide configuration (e.g. global.http_proxy). This is
undesirable for the rc interface which was designed to have multiple
users or connections at once. The rc interface has the `_config`
mechanism for setting request scoped global config.

This blocks global.* options on all rc paths by marking the context as
a remote control request at the rc boundaries. fs.NewFs then skips
applying global.* to the process-wide config for a marked context.

The marker is reapplied in fs.CopyConfig, which is the call rclone
uses to detach context but keep config.

global.* options still apply to the individual backend they are set
on, exactly like override.* options; they just no longer leak into the
rest of the process. Remotes created directly on the command line are
unaffected as are remotes defined in the config file.

See: GHSA-qw24-gh76-8rvv
(cherry picked from commit 53f972830c)
2026-06-05 15:22:06 +01:00
Nick Craig-Wood 48da1774f4 rc: fix unauthenticated command execution via --rc-serve inline remotes CVE-2026-49980
The --rc-serve GET/HEAD file serving path accepted bracketed inline
remotes from the URL and instantiated them, so a single
unauthenticated request could run a command as the rclone user via
backend options such as webdav bearer_token_command or sftp ssh, read
arbitrary local files, or change process-wide config via global.*
options.

This was the GET/HEAD equivalent of the POST hole fixed for
CVE-2026-41179, which only guarded the rc call dispatch path.

Now, unless the rc server has authentication configured or
--rc-no-auth is set, the serve path only allows remotes already
present in the config file: inline remotes, connection string
parameters and bare local paths are rejected. Connection string
global.* options are never honoured on the serve path, even when
authenticated.

See: GHSA-qw24-gh76-8rvv
(cherry picked from commit 2326ea79f7)
2026-06-05 15:22:03 +01:00
Nick Craig-Wood 2a7b0d0d3b build: fix multiple CVEs by upgrading to go1.26.4
- CVE-2026-42504: mime: quadratic complexity in WordDecoder.DecodeHeader
- CVE-2026-42507: net/textproto: arbitrary input are included in errors without any escaping
- CVE-2026-27145: crypto/x509: split candidate hostname only once
2026-06-03 17:51:47 +01:00
Nick Craig-Wood fc4349dc16 iclouddrive: fix "Index has invalid data" error listing iCloud Photos
Accounts with shared-album zones (named CMM-*) returned these zones in
the photos changes/database listing alongside the real photo
libraries. rclone treated them as libraries and queried their albums,
but these zones have no CPLAlbumByPositionLive index so the query
failed with BAD_REQUEST / "Index has invalid data", aborting the whole
listing.

Only PrimarySync and SharedSync-* zones are photo libraries, so skip
any other zone during discovery.

See: https://forum.rclone.org/t/sync-to-icloud-gives-index-has-invalid-data-errors/53852
2026-06-03 17:51:47 +01:00
Nick Craig-Wood dff3a0731e build: cache Go build and module dirs to speed up CI
The build matrix relied on setup-go's built-in cache, which keys only on
go.sum with no job differentiation. All matrix jobs computed the same
cache key and raced to save it; since cache keys are immutable, only the
first job to finish saved its cache. That winner was usually a fast job
whose build cache contained none of the cross-compiled architectures, so
the compile_all and ci_beta steps started from a cold cache on every run.

Disable setup-go's cache and add two explicit actions/cache steps to the
build matrix, the android job and the lint job:

  - the module cache (~/go/pkg/mod) depends only on go.sum, so it is
    shared across all jobs under a single key; it used to be duplicated in
    every job's cache. The downloaded module .zip archives are pruned
    before saving as they are not needed to build from the extracted
    module cache, roughly halving it to ~260 MiB per OS;
  - the build cache (compiled artifacts) is specific to OS, arch and Go
    version, so it is kept per job, keyed on the job name.

This lets the cross-compile steps reuse per-architecture build artifacts
and keeps the total cache within the repository limit.

Measured on CI, comparing a cold-cache run against the following
warm-cache run:

    other_os    23m12s -> 3m35s    (compile_all 14m -> 21s)
    linux       23m13s -> 12m14s   (deploy 11m -> 1m37s,
                                     race test 8m -> 4m45s)

Both jobs now finish well under 15 minutes once the cache is warm.
2026-06-03 17:51:47 +01:00
Nick Craig-Wood 5f5e2ef9cf log: fix wrong source file:line in JSON logs from release builds
JSON logs reported "source":"slog/logger.go:256" instead of the real
caller. getCaller skips logging-machinery frames by file path, but
release builds use -trimpath which rewrites the standard library slog
frame's path to "log/slog/logger.go" - matching neither the "/log/" nor
the "log.go" check, so it was reported as the source. Also skip frames
whose function belongs to the log/slog package, which is immune to
-trimpath.
2026-06-03 17:51:47 +01:00
Janne Beate BakengandNick Craig-Wood d4397faa94 mount2: fix empty directory listings on re-read
With cmd/mount2, reading a directory more than once returned the correct
entries on the first read but nothing on subsequent reads. Plain `ls`
triggers this: it does lseek(fd, 0, SEEK_SET) to rewind the directory
before a second getdents.

go-fuse v2.9.0 rewinds a directory stream by calling Seekdir on the
FileSeekdirer interface. dirStream did not implement it, so go-fuse
returned ENOTSUP and produced an empty listing on every read after the
first.

This implements Seekdir on dirStream: a rewind to offset 0 resets the
stream to the start, restoring correct listings on re-read. Non-zero
offsets are uncommon for in-memory listings and still return ENOTSUP,
matching go-fuse's own default. A compile-time interface assertion is
added so signature drift on future go-fuse updates is caught at build
time.

Before: second and subsequent reads of a directory returned no entries.
After: directories list correctly on every read.

See: https://github.com/hanwen/go-fuse/issues/549
Co-authored-by: Nick Craig-Wood <nick@craig-wood.com>
2026-06-03 17:51:47 +01:00
Yakov Till 7324ee850a iclouddrive: fix ADP/PCS cookie acquisition for iCloud Drive 2026-06-03 17:51:47 +01:00
Nick Craig-Wood 3c54a37488 drive: fix server-side move failing on shared drives with duplicate dirs - fixes #9472
When moving a file rclone removed the file from its old parent by
looking the parent ID up from the path using the directory cache. When
the source contained two directories with the same name and path, the
cache could resolve to the wrong duplicate, so the removeParents
request didn't match the file's real parent.

This left the file with both its old and new parent, which fails on
shared drives with:

    A shared drive item must have exactly one parent., teamDrivesParentLimit

This uses the source object's actual parent ID instead when it is
known, falling back to the path lookup only when the object has zero
or multiple parents.
2026-06-03 17:51:47 +01:00
Leon Brocard a2f8b493ed local: fix getXattr returning empty map instead of nil
At least on my macOS Sequoia 15.7.4, the system automatically adds a
com.apple.provenance xattr to files created by processes. This xattr
lacks the "user." prefix so getXattr filters it out, but the metadata
map was already allocated, resulting in an empty non-nil map being
returned instead of nil.

This caused TestMetadata/Symlink/Xattr and TestMetadata/File/Xattr
to fail because they assert the return value is nil when no user
xattrs are present.

The fix checks if the metadata map is empty after filtering and
returns nil if so.
2026-06-03 17:51:47 +01:00
Nick Craig-Wood 641702fc7f serve s3: fix multipart ListParts pagination returning wrong part numbers - fixes #9460
Listing the parts of a multipart upload with a MaxParts smaller than
the number of parts returned wrong PartNumber values and duplicate
parts on pages after the first, and the part number marker regressed
instead of advancing, causing clients to loop forever.

This bumps github.com/rclone/gofakes3 to v0.0.6 pick up the fix.
2026-06-03 17:51:47 +01:00
Nick Craig-Wood f25d9e2bf3 drime: fix directory rename leaving the renamed folder empty in VFS
Drime's folder rename returns success immediately but the children
listing of the renamed folder briefly returns empty before settling,
which made VFS see an empty directory right after a successful rename
and broke subsequent operations on its contents.

After a successful DirMove, poll the renamed folder's listing until it
shows the pre-rename child count, with a 30s timeout and exponential
backoff. The backend integration test already tolerated this via its
own list-consistency retries; this brings VFS into line.

Fixes #9450
2026-06-03 17:51:47 +01:00
Nick Craig-Wood ec28206d8a drime: remove duplicate upload_cutoff config option
The upload_cutoff option was registered twice with identical content.
Remove the second copy.
2026-06-03 17:51:47 +01:00
Nick Craig-Wood ddbc886395 drime: fix files being uploaded to the wrong directory
Large files (sent as multipart uploads) were placed in the wrong folder
for two reasons:

- the parent folder was sent as "parent_id", but the API ignores that
  and expects "parentId", so the parent was never honoured
- relativePath was sent as the full path from the drive root, which made
  the server build folders from it and silently drop any "0" path
  segment (e.g. ".../data/0/file" lost the "0")

Send the parent as "parentId" and use just the leaf as relativePath,
matching the working single-part upload. This also lets us remove the
now-unneeded absolute-path resolution code.

Fixes #9392
Co-authored-by: Brian King <BrianDKing@gmail.com>
2026-06-03 17:51:47 +01:00
Nick Craig-Wood c8ceb209fc drime: fix server-side copy and move failing with Cloudflare 520 error
The drime origin returns a malformed response (reported by Cloudflare as
a 520 error) for a literal PUT request to the file-entries update
endpoint, which broke renaming, and so server-side copy and move.

Use a POST with the X-HTTP-Method-Override: PUT header instead - the API
routes this to the same handler and it works reliably.

Also retry Cloudflare 520-524 errors which may occur transiently.
2026-06-03 17:51:47 +01:00
Nick Craig-Wood 5b4eb0eefb serve sftp: fix truncate request being silently ignored
The SFTP serve handler ignored the size attribute of SETSTAT/FSETSTAT
requests, only acting on the modification time. This meant a client
asking to truncate a file (eg setting the final size of an upload, or
an explicit truncate) had no effect at all.

This respects the size attribute (if present) by truncating the file
to the requested size.
2026-06-03 17:51:47 +01:00
Nick Craig-Wood 223e473e6e serve sftp: fix file corruption when a client resumes an upload
The SFTP serve write handler always opened files with O_TRUNC,
ignoring the flags requested in the SFTP OPEN packet. Some clients
(notably WinSCP's "Process in Background", which resumes an upload on
a second connection) re-open the partially written file without the
truncate flag and continue writing from the offset they had reached,
relying on the existing data being preserved. Forcing O_TRUNC zeroed
that prefix, so the start of the uploaded file ended up as a block of
zero bytes.

This fix respects the requested open flags instead so a resume open
without truncate keeps the already written data intact.

See: https://forum.rclone.org/t/rclone-serve-sftp-winscp-background-mode-uploading-causes-file-corruption/53841
2026-06-03 17:51:47 +01:00
Nick Craig-Wood bac27547d5 Start v1.74.3-DEV development 2026-05-23 11:32:11 +01:00
Nick Craig-Wood b22fe9811c Version v1.74.2 2026-05-22 17:11:48 +01:00
Nick Craig-Wood ce64f4edb8 gui: update embedded release to 1.1.8 2026-05-22 16:30:02 +01:00
Nick Craig-Wood f3986e2bb7 lib/http: replace deprecated h2c.NewHandler with http.Server.Protocols
The golang.org/x/net/http2/h2c package was deprecated in v0.54.0 in
favour of setting the http.Server Protocols field to enable unencrypted
HTTP/2.

This replaces the h2c.NewHandler wrapping added in e863f751f with
http.Server.Protocols, which is supported by the standard library
since Go 1.24.

Note that the stdlib only supports HTTP/2 prior-knowledge on cleartext
connections, not HTTP/1.1 Upgrade: h2c negotiation. In practice clients
use prior-knowledge or require TLS, so this should not affect users.
2026-05-22 12:48:37 +01:00
Nick Craig-Wood f0961f4a8d build: update golang.org/x dependencies to address multiple CVEs
Upgrade to v0.55.0 of golang.org/x/net in order to address:

- CVE-2026-42506: html: incorrect handling of namespaced elements in foreign content
- CVE-2026-39821: idna: failure to reject ASCII-only Punycode-encoded labels
- CVE-2026-42502: html: incorrect handling of HTML elements in foreign content
- CVE-2026-25680: html: denial of service when parsing arbitrary HTML
- CVE-2026-25681: html: incorrect handling of character references in DOCTYPE nodes
- CVE-2026-27136: html: duplicate attributes can cause XSS

Upgrade to version v0.52.0 of golang.org/x/crypto to address:

- CVE-2026-46598: ssh/agent: pathological inputs can lead to client panic
- CVE-2026-46597: ssh: byte arithmetic causes underflow and panic
- CVE-2026-39828: ssh: bypass of certificate restrictions
- CVE-2026-39835: ssh: server panic during CheckHostKey/Authenticate
- CVE-2026-39833: ssh/agent: key constraints not enforced
- CVE-2026-39832: ssh/agent: agent constraints dropped when forwarding keys
- CVE-2026-39827: ssh: memory leak when rejecting channels can lead to DoS
- CVE-2026-39830: ssh: client can cause server deadlock on unexpected responses
- CVE-2026-39829: ssh: pathological RSA/DSA parameters may cause DoS
- CVE-2026-39831: ssh: bypass of FIDO/U2F security keys physical interaction
- CVE-2026-39834: ssh: infinite loop on large channel writes
- CVE-2026-42508: ssh/knownhosts: auth bypass via unenforced @revoked status
- CVE-2026-46595: ssh: VerifiedPublicKeyCallback permissions skip enforcement

Upgrade to version v0.41.0 of golang.org/x/image to address:

- CVE-2026-42500: bmp: panic when reading out of bound palette index
- CVE-2026-33809: tiff: excessive resource consumption in PackBits decompression

Upgrade to version v0.45.0 of golang.org/x/sys to address:

- CVE-2026-39824: windows: integer overflow in NewNTUnicodeString
2026-05-22 12:48:37 +01:00
Iizuki 139ccc7ffd docs: s3: update doc link for force_path_style 2026-05-22 12:48:37 +01:00
Nick Craig-Wood b3ddec50c6 s3: add new MEGA S4 endpoints on megas4.com including Asia-Pacific region
MEGA S4 has launched a new dedicated domain megas4.com with three new
endpoints, including their first Asia-Pacific location in Tokyo, plus
new endpoints in Paris and Barcelona. The existing Amsterdam,
Luxembourg, Montreal and Vancouver locations have been renamed onto
the new domain.

All current s4.mega.io endpoints continue to be supported and are
retained as legacy options. New accounts use the megas4.com endpoints.
2026-05-22 12:48:37 +01:00
Nick Craig-Wood 3cd224e03f docs: fix heading levels so sections appear in the table of contents
The "Import/Export of google documents" section in drive.md and the
"--b2-versions" examples section in b2.md were both at H4 instead of H3,
which excluded them from the ToC even though they are top-level topics
in their respective sections.
2026-05-22 12:48:37 +01:00
William Tange 52af9caa14 protondrive: fix corrupted on transfer: sha1 hashes differ
Some SHA1 hashes of protondrive files are uppercase, so always
converting to lowercase before comparing seems to be the solution.

Fixes #7345
2026-05-22 12:48:37 +01:00
Lucky945H b2cb7f89c1 vfs/vfscache: fix silent write failure when mounting with remote:.
When mounting with 'remote:.' (dot notation for current directory),
the '.' is passed through toOSPath() which encodes it to full-width
'.' (U+FF0E) via EncodeDot. This caused the VFS cache data/meta root
to be written to a full-width-dot directory while the local cache
backend pointed to the canonicalized path, resulting in writes being
cached but never uploaded.

Fix by calling clean() on the relativeDirPath before toOSPath(),
so path.Clean() strips the trailing '/.' removing the dot before
encoding.
2026-05-22 12:48:37 +01:00
Leon Brocard 2292ba0cd4 docs: fix misspellings
Fix several misspellings in documentation and config comments detected by `misspell`.
2026-05-22 12:48:37 +01:00
Sai Asish Y 07c87327ae webdav: honour auth_redirect on listAll PROPFIND - fixes #9159 2026-05-22 12:48:37 +01:00
Tore Anderson 6cc0d1a0b0 jottacloud: support whitelabel service Phonero Sky
Phonero is a Norwegian mobile provider focusing on the enterprise
market. They provide rebranded Jottacloud service through their «Phonero
Sky» (Norwegian for «Phonero Cloud»).

The Client ID `desktop` used by most of the other whitelabel services
does not work for Phonero Sky. Both `desktop-win` and `desktop-mac`
work, though. Authentication does not work when the `jotta-default`
scope is present, so drop it. This results in a Client ID and scope
setup that is identical with that of Let's Go Cloud (Germany).
2026-05-22 12:48:37 +01:00
FTCHD 7a5e01b015 docs: add note about using config/update to reconnect an oauth remote 2026-05-22 12:48:37 +01:00
dependabot[bot] bf111df84a build: bump github.com/go-git/go-billy/v5 to 5.9.0 to fix CVE-2026-44740 (again)
The previous commit had no content due to copilot deleting it as I was
merging it!

Bumps [github.com/go-git/go-billy/v5](https://github.com/go-git/go-billy) from 5.8.0 to 5.9.0.
- [Release notes](https://github.com/go-git/go-billy/releases)
- [Commits](https://github.com/go-git/go-billy/compare/v5.8.0...v5.9.0)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-billy/v5
  dependency-version: 5.9.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-22 12:48:37 +01:00
Nick Craig-Wood 0b73e2b858 docs: upgrade protondrive to tier 4 tests pass and community maintains 2026-05-22 12:48:37 +01:00
Alvinwylim e0f210cdc4 drime: fix 500 errors when listing shared folders
When using the drime backend to access a folder shared from another
Drime account (via root_folder_id config option), listing the folder's
children fails with HTTP 500. This makes cross-account read-only
mounts non-functional.

This fixes the problem by changing listAll to use `folderId` instead
of `parentIds[]`

Fixes #9420
2026-05-22 12:48:37 +01:00
nielash 1c06bb9272 bisync: fix --conflict-loser pathname with --conflict-resolve newer
Before this change, --conflict-loser pathname assumed --conflict-resolve none,
following the legacy behavior prior to v1.66. This produced unexpected behavior
when used with a different --conflict-resolve option.

This change fixes the issue by ensuring that --conflict-loser pathname looks for
the correct name on the side not being renamed, when only one side should be
renamed.

https://forum.rclone.org/t/bisync-does-not-copy-the-winner-file-to-the-loser-site/53768
2026-05-22 12:48:37 +01:00
Nick Craig-Wood b2e1aa65dc rc: remove duplicate metrics_addr option registration
The metrics_addr option was registered twice: once explicitly and once
implicitly via AddPrefix(libhttp.ConfigInfo, "metrics", ...). Both
pointed at the same MetricsHTTP.ListenAddr field, so options/info
returned a duplicate entry.

Drop the explicit entry and use SetDefault to keep the empty default
(so the metrics server stays off unless configured), matching the
pattern already used for rc_addr.

Fixes #9419
2026-05-22 12:48:37 +01:00
John Volk 3a414d8262 drime: fix file doesn't exists error when trying to delete
When using rcat to upload a new version of a file that already existed,
the file upload would succeed. The subsequent deletion of the old file
is attempted after the upload. Drime appears to handle the deletion of
the old file automatically and returns HTTP status code 422, stating
the "The selected entry ids is invalid."

The deletion and the rcat would fail before this change. This is with
file history enabled on my Drime account.

This change detects the error and ignores it since the file has
already been deleted.
2026-05-22 12:48:37 +01:00
Nick Craig-Wood 24054305ce Start v1.74.2-DEV development 2026-05-08 17:14:19 +01:00
Nick Craig-Wood 076fb2bc53 Version v1.74.1 2026-05-08 15:15:36 +01:00
Nick Craig-Wood e1fd3725bc build: update golang.org/x/net to v0.53.0 to fix CVE-2026-33814 2026-05-08 15:07:27 +01:00
Nick Craig-Wood 5780a30c30 build: fix multiple CVEs by upgrading to go1.26.3
- CVE-2026-42501: cmd/go: malicious module proxy can bypass checksum database
- CVE-2026-39825: net/http/httputil: ReverseProxy forwards queries with more than urlmaxqueryparams parameters
- CVE-2026-39836: net: panic in Dial and LookupPort when handling NUL byte on Windows
- CVE-2026-42499: net/mail: quadratic string concatenation in consumePhrase
- CVE-2026-39820: net/mail: quadratic string concatentation in consumeComment
- CVE-2026-39819: cmd/go: "go bug" follows symlinks in predictable temporary filenames
- CVE-2026-39817: cmd/go: "go tool pack" does not sanitize output paths
- CVE-2026-33814: net/http: infinite loop in HTTP/2 transport when given bad SETTINGS_MAX_FRAME_SIZE
- CVE-2026-39826: html/template: escaper bypass leads to XSS
- CVE-2026-33811: net: crash when handling long CNAME response
- CVE-2026-39823: html/template: bypass of meta content URL escaping causes XSS
2026-05-08 15:07:27 +01:00
Nick Craig-Wood 17c2db7289 drime: fix uploads of 100..200M files
At some point Drime recommended 200M for the upload cutoff for
switching to multipart upload. However uploads have stopped working
using single part upload for 100..200Mish files.

Their docs now recommend 5M as the cutoff for multipart upload so this
changes the default.
2026-05-08 15:07:27 +01:00
Nick Craig-Wood 44c56ed481 drime: fix large file uploads landing in drive root instead of configured folder
The /s3/multipart/create and /s3/entries endpoints interpret relativePath
as an absolute path from the drive root, not relative to parent_id. When
root_folder_id was set to a non-root folder, files larger than
upload_cutoff ended up at the user's drive root instead of the configured
folder.

Resolve the absolute path of the Fs root once via GET /folders/{hash}/path
(cached on first OpenChunkWriter call) and use that to build the correct
relativePath.

Fixes #9392
2026-05-08 15:07:27 +01:00
Nick Craig-Wood ebca82f7db docs: sponsor updates
- Add Data Raven as a silver sponsor
- Add Impossible Cloud as a bronze sponsor
- Shuffle silver sponsors once per page load
- Remove TOC from sponsors page
2026-05-08 15:07:27 +01:00
Leon Brocard e9d280b793 s3: add new Fastly Object Storage regions
Add three new regions and their endpoints for Fastly Object Storage:

- eu-west-1 (Paris)
- us-east-1 (Virginia)
- us-west-1 (Oregon)

These are distinct from the existing us-east, us-west and eu-central
endpoints, which are kept in place.
2026-05-08 15:07:27 +01:00
Nick Craig-Wood 4f93bd482f cloudinary: fix retrying every error and fix pacer sleep units
shouldRetry treated every non-nil error as retryable, so permanent
failures (auth, 4xx, not-found) burned through the LowLevelRetries
budget instead of returning fast.

This also fixes the pacer sleeps: pacer.MinSleep(1000) and
MaxSleep(10000) are time.Duration values, so they were 1µs and 10µs -
almost certainly intended as 10ms and 2s.
2026-05-08 15:07:27 +01:00
Nick Craig-Wood b6c68882e5 s3: fix STS call per request by caching AssumeRole credentials
The stscreds.AssumeRoleProvider from AWS SDK Go v2 does not cache
credentials by itself. The SDK only auto-wraps providers with
aws.CredentialsCache when they are loaded via
config.LoadDefaultConfig; when assigned directly to
aws.Config.Credentials it must be wrapped manually, as documented on
stscreds.NewAssumeRoleProvider.

Without the cache, configurations using role_arn would call AssumeRole
once per S3 request, flooding STS and CloudTrail.

See: https://forum.rclone.org/t/aws-iam-roles-credentials-arent-cached/53732
2026-05-08 15:07:27 +01:00
Nick Craig-Wood 23dc9d0515 protondrive: fix segfault when copying files missing revision metadata
When a Proton Drive file has no active revision attributes,
readMetaDataForLink returns a nil FileSystemAttrs and Object.originalSize
is left as nil. Object.Open then dereferenced this nil pointer when
calling fs.FixRangeOption, causing a SIGSEGV during copy.

Use Object.Size() instead, which already implements the correct fallback
to the link size when originalSize is unavailable.

This updates the github.com/rclone/Proton-API-Bridge package to fix a
segfault when reading files with no metadata.

Fixes #9377
Fixes #9117
2026-05-08 15:07:27 +01:00
Nick Craig-Wood be7c0f31a4 protondrive: route library logging through rclone's logger
Previously all log output produced by Proton-API-Bridge (stdlib log)
and go-proton-api (logrus + resty's logger) bypassed rclone's
logging: it ignored -v / -vv levels and didn't reach --log-file.

Add a small adapter implementing the resty.Logger / bridge Logger
shape that calls fs.Errorf / fs.Logf / fs.Debugf, and pass it via
the new Config.Logger hook. The bridge in turn forwards the same
value to go-proton-api's WithLogger option, so HTTP-layer warnings
and the formerly-hardcoded logrus warnings inside go-proton-api
also surface through rclone's log levels.
2026-05-08 15:07:27 +01:00
Nick Craig-Wood 3ac9b75a83 protondrive: route HTTP through rclone's transport
The Proton Drive backend constructed the upstream Proton-API-Bridge
without ever passing rclone's HTTP transport. As a result none of
rclone's HTTP flags reached Proton: --dump headers, --dump bodies,
--no-check-certificate, --user-agent, --bind, --ca-cert, --header,
--tpslimit etc. all silently did nothing for this remote, and HTTP
traffic was invisible to -vv.

Pass fshttp.NewTransport(ctx) through the new Config.Transport hook on
the bridge, which forwards it to the updated go-proton-api's
WithTransport option and so to the underlying resty client.
2026-05-08 15:07:27 +01:00
Gustavo V. F. 5e9cb39084 bisync: fix retryable without --resync error message when --resync has a critical failure 2026-05-08 15:07:27 +01:00
Leon Brocard 87d0b59a51 cmd/serve/s3: return object listings in key order
The S3 ListObjects response from `rclone serve s3` was sorting object
contents by modification time instead of object key. This made the
listing order incompatible with S3 clients which expect lexicographic
key ordering.

In particular, `aws s3 sync` assumes both source and destination
iterators are ordered by key. With the old modtime ordering it could
misidentify files as missing or outdated and re-download objects that
were already up to date.

Change the pager to sort returned objects by key and add a regression
test which uses keys and modtimes arranged so the old behaviour would
fail.

Fixes #9002
2026-05-08 15:07:27 +01:00
Nick Craig-Wood 76596b6727 Start v1.74.1-DEV development 2026-05-08 15:07:27 +01:00
98 changed files with 2755 additions and 2434 deletions

No files matched your search

+120 -9
View File
@@ -37,7 +37,7 @@ jobs:
include:
- job_name: linux
os: ubuntu-latest
go: '~1.26.3'
go: '~1.26.4'
gotags: cmount
build_flags: '-include "^linux/"'
check: true
@@ -48,14 +48,14 @@ jobs:
- job_name: linux_386
os: ubuntu-latest
go: '~1.26.3'
go: '~1.26.4'
goarch: 386
gotags: cmount
quicktest: true
- job_name: mac_amd64
os: macos-latest
go: '~1.26.3'
go: '~1.26.4'
gotags: 'cmount'
build_flags: '-include "^darwin/amd64" -cgo'
quicktest: true
@@ -64,14 +64,14 @@ jobs:
- job_name: mac_arm64
os: macos-latest
go: '~1.26.3'
go: '~1.26.4'
gotags: 'cmount'
build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib'
deploy: true
- job_name: windows
os: windows-latest
go: '~1.26.3'
go: '~1.26.4'
gotags: cmount
cgo: '0'
build_flags: '-include "^windows/"'
@@ -81,7 +81,7 @@ jobs:
- job_name: other_os
os: ubuntu-latest
go: '~1.26.3'
go: '~1.26.4'
build_flags: '-exclude "^(windows/|darwin/|linux/)"'
compile_all: true
deploy: true
@@ -97,16 +97,58 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Get runner parameters
id: get-runner-parameters
run: |
echo "year-week=$(date -u "+%Y%V")" >> $GITHUB_OUTPUT
echo "runner-os-version=$ImageOS" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Go
id: setup-go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
check-latest: true
# Caching is handled explicitly below. setup-go's built-in cache
# keys only on go.sum, so all matrix jobs collide on one key and
# only the first to finish saves - which loses the cross-compile
# build cache.
cache: false
- name: Get Go paths
id: go-paths
run: |
echo "build-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
# The module cache holds downloaded source and is identical across
# jobs (it depends only on go.sum, not on OS, arch or Go version), so
# it is shared via a single key to avoid storing the same ~600 MiB in
# every job's cache and overflowing the repo cache limit.
- name: Module cache
uses: actions/cache@v5
with:
path: ${{ steps.go-paths.outputs.mod-cache }}
key: go-mod-${{ steps.get-runner-parameters.outputs.year-week }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-mod-${{ steps.get-runner-parameters.outputs.year-week }}-
go-mod-
# The build cache holds compiled artifacts which are specific to the
# OS, arch and Go version, so it is kept per job.
- name: Build cache
uses: actions/cache@v5
with:
path: ${{ steps.go-paths.outputs.build-cache }}
key: go-build-${{ matrix.job_name }}-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-${{ steps.get-runner-parameters.outputs.year-week }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-build-${{ matrix.job_name }}-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-${{ steps.get-runner-parameters.outputs.year-week }}-
go-build-${{ matrix.job_name }}-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-
- name: Set environment variables
run: |
@@ -205,6 +247,15 @@ jobs:
# Deploy binaries if enabled in config && not a PR && not a fork
if: env.RCLONE_CONFIG_PASS != '' && matrix.deploy && github.head_ref == '' && github.repository == 'rclone/rclone'
- name: Trim module cache before saving
if: always()
run: |
# The downloaded module .zip archives are not needed to build from
# the already-extracted module cache, so drop them before the cache
# is saved - this roughly halves the module cache size.
modcache=$(go env GOMODCACHE | tr '\\' '/')
find "$modcache/cache/download" -name '*.zip' -type f -delete 2>/dev/null || true
lint:
if: inputs.manual || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name))
timeout-minutes: 30
@@ -227,15 +278,23 @@ jobs:
id: setup-go
uses: actions/setup-go@v6
with:
go-version: '~1.26.3'
go-version: '~1.26.4'
check-latest: true
cache: false
- name: Module cache
uses: actions/cache@v5
with:
path: ~/go/pkg/mod
key: go-mod-${{ steps.get-runner-parameters.outputs.year-week }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-mod-${{ steps.get-runner-parameters.outputs.year-week }}-
go-mod-
- name: Cache
uses: actions/cache@v5
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint
key: golangci-lint-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-${{ steps.get-runner-parameters.outputs.year-week }}-${{ hashFiles('go.sum') }}
@@ -302,6 +361,15 @@ jobs:
run: bin/check_autogenerated_edits.py 'origin/${{ github.base_ref }}'
if: github.event_name == 'pull_request'
- name: Trim module cache before saving
if: always()
run: |
# The downloaded module .zip archives are not needed to build from
# the already-extracted module cache, so drop them before the cache
# is saved - this roughly halves the module cache size.
modcache=$(go env GOMODCACHE | tr '\\' '/')
find "$modcache/cache/download" -name '*.zip' -type f -delete 2>/dev/null || true
android:
if: inputs.manual || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name))
timeout-minutes: 30
@@ -309,6 +377,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Get runner parameters
id: get-runner-parameters
run: |
echo "year-week=$(date -u "+%Y%V")" >> $GITHUB_OUTPUT
echo "runner-os-version=$ImageOS" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v6
with:
@@ -316,9 +390,37 @@ jobs:
# Upgrade together with NDK version
- name: Set up Go
id: setup-go
uses: actions/setup-go@v6
with:
go-version: '~1.26.3'
go-version: '~1.26.4'
# Caching is handled explicitly below to share the module cache
# with the other jobs - see the build job for the rationale.
cache: false
- name: Get Go paths
id: go-paths
run: |
echo "build-cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "mod-cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Module cache
uses: actions/cache@v5
with:
path: ${{ steps.go-paths.outputs.mod-cache }}
key: go-mod-${{ steps.get-runner-parameters.outputs.year-week }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-mod-${{ steps.get-runner-parameters.outputs.year-week }}-
go-mod-
- name: Build cache
uses: actions/cache@v5
with:
path: ${{ steps.go-paths.outputs.build-cache }}
key: go-build-android-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-${{ steps.get-runner-parameters.outputs.year-week }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-build-android-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-${{ steps.get-runner-parameters.outputs.year-week }}-
go-build-android-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-
- name: Set global environment variables
run: |
@@ -394,3 +496,12 @@ jobs:
RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }}
# Upload artifacts if not a PR && not a fork
if: env.RCLONE_CONFIG_PASS != '' && github.head_ref == '' && github.repository == 'rclone/rclone'
- name: Trim module cache before saving
if: always()
run: |
# The downloaded module .zip archives are not needed to build from
# the already-extracted module cache, so drop them before the cache
# is saved - this roughly halves the module cache size.
modcache=$(go env GOMODCACHE | tr '\\' '/')
find "$modcache/cache/download" -name '*.zip' -type f -delete 2>/dev/null || true
-1
View File
@@ -20,4 +20,3 @@ __pycache__
.DS_Store
resource_windows_*.syso
.devcontainer
.vscode/launch.json
+3 -3
View File
@@ -1,6 +1,6 @@
default: true
# Use specific styles, to be consistent accross all documents.
# Use specific styles, to be consistent across all documents.
# Default is to accept any as long as it is consistent within the same document.
heading-style: # MD003
style: atx
@@ -48,12 +48,12 @@ link-fragments: false # MD051
# https://gohugo.io/content-management/syntax-highlighting/#languages
# https://docs.github.com//get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting
# In addition, we only want to allow identifiers (aliases) that correspond to
# the same language in Hugo and GitHub, and preferrably also VSCode and other
# the same language in Hugo and GitHub, and preferably also VSCode and other
# commonly used tools, to avoid confusion. An example of this is that "shell"
# by some are considered an identifier for shell scripts, i.e. an alias for
# "sh", while others consider it an identifier for shell sessions, i.e. an
# alias for "console". Although Hugo and GitHub in this case are consistent and
# have choosen the former, using "sh" instead, and not allowing use of "shell",
# have chosen the former, using "sh" instead, and not allowing use of "shell",
# avoids the confusion entirely.
fenced-code-language: # MD040
allowed_languages:
Generated
+364 -25
View File
@@ -5,7 +5,6 @@
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Nick Craig-Wood" />
<meta name="dcterms.date" content="2026-05-01" />
<title>rclone(1) User Manual</title>
<style>
html {
@@ -234,7 +233,7 @@
<header id="title-block-header">
<h1 class="title">rclone(1) User Manual</h1>
<p class="author">Nick Craig-Wood</p>
<p class="date">May 01, 2026</p>
<p class="date">Jun 05, 2026</p>
</header>
<h1 id="name">NAME</h1>
<p>rclone - manage files on cloud storage</p>
@@ -4576,9 +4575,9 @@ SquareBracket</code></pre>
<pre class="console"><code>rclone convmv &quot;stories/The Quick Brown Fox!.txt&quot; --name-transform &quot;all,command=echo&quot;
// Output: stories/The Quick Brown Fox!.txt</code></pre>
<pre class="console"><code>rclone convmv &quot;stories/The Quick Brown Fox!&quot; --name-transform &quot;date=-{YYYYMMDD}&quot;
// Output: stories/The Quick Brown Fox!-20260501</code></pre>
// Output: stories/The Quick Brown Fox!-20260605</code></pre>
<pre class="console"><code>rclone convmv &quot;stories/The Quick Brown Fox!&quot; --name-transform &quot;date=-{macfriendlytime}&quot;
// Output: stories/The Quick Brown Fox!-2026-05-01 0208PM</code></pre>
// Output: stories/The Quick Brown Fox!-2026-06-05 0414PM</code></pre>
<pre class="console"><code>rclone convmv &quot;stories/The Quick Brown Fox!.txt&quot; --name-transform &quot;all,regex=[\\.\\w]/ab&quot;
// Output: ababababababab/ababab ababababab ababababab ababab!abababab</code></pre>
<p>The regex command generally accepts Perl-style regular expressions,
@@ -15125,7 +15124,7 @@ by value <code>NUL</code> on Windows and <code>/dev/null</code> on Unix
systems, then rclone will keep the configuration file in memory
only.</p>
<p>You may see a log message "Config file not found - using defaults" if
there is no configuration file. This can be supressed, e.g. if you are
there is no configuration file. This can be suppressed, e.g. if you are
using rclone entirely with <a
href="https://rclone.org/docs/#backend-path-to-dir">on the fly
remotes</a>, by using memory-only configuration file or by creating an
@@ -18288,7 +18287,26 @@ by default, so you can browse to <code>http://127.0.0.1:5572/</code> or
<code>http://127.0.0.1:5572/*</code> to see a listing of the remotes.
Objects may be requested from remotes using this syntax
<code>http://127.0.0.1:5572/[remote:path]/path/to/object</code></p>
<p>Unless the rc server has authentication configured
(<code>--rc-user</code>/<code>--rc-pass</code> or
<code>--rc-htpasswd</code>) or the <code>--rc-no-auth</code> flag is
set, only remotes already present in the config file may be served this
way. Inline remotes (e.g. <code>[:webdav,url=...:]</code>), connection
string parameters and bare local paths are rejected, since instantiating
them from an unauthenticated request could run commands or read
arbitrary local files.</p>
<p>Default Off.</p>
<h3 id="global.-connection-string-options-and-the-rc">global.*
connection string options and the rc</h3>
<p>Remotes instantiated by the rc do not let <a
href="https://rclone.org/docs/#connection-strings">connection string</a>
<code>global.*</code> options change rclone's process-wide
configuration. Remotes created directly on the command line or defined
in the config file are unaffected.</p>
<p>A <code>global.*</code> option still takes effect for the individual
backend it is set on (exactly like an <code>override.*</code> option),
it just does not leak into the global config for the rest of the
process.</p>
<h3 id="rc-serve-no-modtime">--rc-serve-no-modtime</h3>
<p>Set this flag to skip reading the modification time (can speed things
up).</p>
@@ -21695,7 +21713,7 @@ split into groups.</p>
--tpslimit float Limit HTTP transactions per second to this
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
--use-cookies Enable session cookiejar
--user-agent string Set the user-agent to a specified string (default &quot;rclone/v1.74.0&quot;)</code></pre>
--user-agent string Set the user-agent to a specified string (default &quot;rclone/v1.74.3&quot;)</code></pre>
<h2 id="performance">Performance</h2>
<p>Flags helpful for increasing performance.</p>
<pre><code> --buffer-size SizeSuffix In memory buffer size when reading files for each --transfer (default 16Mi)
@@ -21833,7 +21851,7 @@ split into groups.</p>
--rc-web-gui-update Check and update to latest version of web gui</code></pre>
<h2 id="metrics-1">Metrics</h2>
<p>Flags to control the Metrics HTTP endpoint..</p>
<pre><code> --metrics-addr stringArray IPaddress:Port or :Port to bind metrics server to
<pre><code> --metrics-addr stringArray IPaddress:Port or :Port to bind server to
--metrics-allow-origin string Origin which cross-domain request (CORS) can be executed from
--metrics-baseurl string Prefix for URLs - leave blank for root
--metrics-cert string TLS PEM key (concatenation of certificate and CA certificate)
@@ -22033,7 +22051,7 @@ split into groups.</p>
--drime-list-chunk int Number of items to list in each call (default 1000)
--drime-root-folder-id string ID of the root folder
--drime-upload-concurrency int Concurrency for multipart uploads and copies (default 4)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 5Mi)
--drime-workspace-id string Account ID
--drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded
--drive-allow-import-name-change Allow the filetype to change when uploading Google docs
@@ -24434,12 +24452,34 @@ disallowed special characters and filename encodings.)</p>
investigation:</p>
<!--- start list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
<ul>
<li><code>TestDropbox</code> (<code>dropbox</code>)
<li><code>TestFilen</code> (<code>filen</code>)
<ul>
<li><a
href="https://pub.rclone.org/integration-tests/current/dropbox-cmd.bisync-TestDropbox-1.txt"><code>TestBisyncRemoteRemote/normalization</code></a></li>
href="https://pub.rclone.org/integration-tests/current/filen-cmd.bisync-TestFilen-1.txt"><code>TestBisyncRemoteRemote/resync_modes</code></a></li>
<li><a
href="https://pub.rclone.org/integration-tests/current/filen-cmd.bisync-TestFilen-1.txt"><code>TestBisyncRemoteRemote/rmdirs</code></a></li>
</ul></li>
<li>Updated: 2026-05-01-010013
<li><code>TestHuaweiDrive</code> (<code>huaweidrive</code>)
<ul>
<li><a
href="https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt"><code>TestBisyncRemoteLocal/ext_paths</code></a></li>
<li><a
href="https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt"><code>TestBisyncRemoteLocal/extended_filenames</code></a></li>
<li><a
href="https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt"><code>TestBisyncRemoteLocal/normalization</code></a></li>
<li><a
href="https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt"><code>TestBisyncLocalRemote/ext_paths</code></a></li>
<li><a
href="https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt"><code>TestBisyncLocalRemote/extended_filenames</code></a></li>
<li><a href="https://pub.rclone.org/integration-tests/current/">4
more</a></li>
</ul></li>
<li><code>TestSeafile</code> (<code>seafile</code>)
<ul>
<li><a
href="https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafile-1.txt"><code>TestBisyncLocalRemote/rmdirs</code></a></li>
</ul></li>
<li>Updated: 2026-06-05-010010
<!--- end list_failures - DO NOT EDIT THIS SECTION - use make commanddocs ---></li>
</ul>
<p>The following backends either have not been tested recently or have
@@ -25343,6 +25383,12 @@ article</a>.</p>
href="http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization">Benjamin
Pierce</a> about <em>Unison</em> and synchronization in general.</p>
<h2 id="changelog">Changelog</h2>
<h3 id="v1.74.2"><code>v1.74.2</code></h3>
<ul>
<li>Fixed an issue causing <code>--conflict-loser pathname</code> to
produce unexpected behavior if using a non-default
<code>--conflict-resolve</code> value.</li>
</ul>
<h3 id="v1.74"><code>v1.74</code></h3>
<ul>
<li>Added several missing <code>rc</code> parameters.</li>
@@ -27336,6 +27382,11 @@ centers for low latency.</li>
<li>EU South 1</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"eu-west-1"
<ul>
<li>EU West 1</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"jp-central-1"
<ul>
<li>JP Central 1</li>
@@ -27356,11 +27407,21 @@ centers for low latency.</li>
<li>US East</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"us-east-1"
<ul>
<li>US East 1</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"us-west"
<ul>
<li>US West</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"us-west-1"
<ul>
<li>US West 1</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"global"
<ul>
<li>Global</li>
@@ -28298,6 +28359,11 @@ tenant name. Do not select this directly</li>
<li>EU South 1</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"eu-west-1.object.fastlystorage.app"
<ul>
<li>EU West 1</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"jp-central-1.object.fastlystorage.app"
<ul>
<li>JP Central 1</li>
@@ -28318,11 +28384,21 @@ tenant name. Do not select this directly</li>
<li>US East</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"us-east-1.object.fastlystorage.app"
<ul>
<li>US East 1</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"us-west.object.fastlystorage.app"
<ul>
<li>US West</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"us-west-1.object.fastlystorage.app"
<ul>
<li>US West 1</li>
<li>Provider: Fastly</li>
</ul></li>
<li>"s5lu.com"
<ul>
<li>Global FileLu S5 endpoint</li>
@@ -28960,24 +29036,59 @@ tenant name. Do not select this directly</li>
<li>Fortaleza, CE (BR), br-ne1</li>
<li>Provider: Magalu</li>
</ul></li>
<li>"s3.eu-amsterdam.megas4.com"
<ul>
<li>Mega S4 Amsterdam</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.eu-luxembourg.megas4.com"
<ul>
<li>Mega S4 Luxembourg</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.eu-paris.megas4.com"
<ul>
<li>Mega S4 Paris</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.eu-barcelona.megas4.com"
<ul>
<li>Mega S4 Barcelona</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.ca-montreal.megas4.com"
<ul>
<li>Mega S4 Montreal</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.ca-vancouver.megas4.com"
<ul>
<li>Mega S4 Vancouver</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.ap-tokyo.megas4.com"
<ul>
<li>Mega S4 Tokyo</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.eu-central-1.s4.mega.io"
<ul>
<li>Mega S4 eu-central-1 (Amsterdam)</li>
<li>Mega S4 eu-central-1 (Amsterdam, legacy)</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.eu-central-2.s4.mega.io"
<ul>
<li>Mega S4 eu-central-2 (Bettembourg)</li>
<li>Mega S4 eu-central-2 (Bettembourg, legacy)</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.ca-central-1.s4.mega.io"
<ul>
<li>Mega S4 ca-central-1 (Montreal)</li>
<li>Mega S4 ca-central-1 (Montreal, legacy)</li>
<li>Provider: Mega</li>
</ul></li>
<li>"s3.ca-west-1.s4.mega.io"
<ul>
<li>Mega S4 ca-west-1 (Vancouver)</li>
<li>Mega S4 ca-west-1 (Vancouver, legacy)</li>
<li>Provider: Mega</li>
</ul></li>
<li>"oos.eu-west-2.outscale.com"
@@ -30891,7 +31002,7 @@ increasing this may help to speed up the transfers.</p>
<p>If true use path style access if false use virtual hosted style.</p>
<p>If this is true (the default) then rclone will use path style access,
if false then rclone will use virtual path style. See <a
href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro">the
href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html">the
AWS S3 docs</a> for more info.</p>
<p>Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS)
require this set to false - rclone will do this automatically based on
@@ -37414,7 +37525,8 @@ start and finish the upload) and another 2 requests for each chunk:</p>
/b2api/v1/b2_get_upload_part_url
/b2api/v1/b2_upload_part/
/b2api/v1/b2_finish_large_file</code></pre>
<h4 id="versions-2">Versions</h4>
<h3 id="viewing-versions-with---b2-versions">Viewing versions with
--b2-versions</h3>
<p>Versions can be viewed with the <code>--b2-versions</code> flag. When
it is set rclone will show and act on older versions of files. For
example</p>
@@ -41443,7 +41555,7 @@ The minimum is 0 and the maximum is 5 GiB.</p>
<li>Config: upload_cutoff</li>
<li>Env Var: RCLONE_DRIME_UPLOAD_CUTOFF</li>
<li>Type: SizeSuffix</li>
<li>Default: 200Mi</li>
<li>Default: 5Mi</li>
</ul>
<h4 id="drime-chunk-size">--drime-chunk-size</h4>
<p>Chunk size to use for uploading.</p>
@@ -44994,8 +45106,8 @@ echoed, so there will be no confirmation even using -v or -vv.</p>
limit (quota), the usage in Google Drive, the size of all files in the
Trash and the space used by other Google services such as Gmail. This
command does not take any path arguments.</p>
<h4 id="importexport-of-google-documents">Import/Export of google
documents</h4>
<h3 id="importexport-of-google-documents">Import/Export of google
documents</h3>
<p>Google documents can be exported from and uploaded to Google
Drive.</p>
<p>When rclone downloads a Google doc it chooses a format to download
@@ -50151,6 +50263,10 @@ setup as described <a href="#traditional">below</a>:</p>
<li>MediaMarkt Cloud (mediamarkt.jottacloud.com)</li>
<li>Let's Go Cloud (letsgo.jotta.cloud)</li>
</ul></li>
<li>Phonero
<ul>
<li>Phonero Sky (sky.phonero.no)</li>
</ul></li>
</ul>
<p>Paths are specified as <code>remote:path</code></p>
<p>Paths may be as deep as required, e.g.
@@ -50510,7 +50626,7 @@ or set the equivalent environment variable. Emptying the trash is
supported by the <a
href="https://rclone.org/commands/rclone_cleanup/">cleanup</a>
command.</p>
<h3 id="versions-3">Versions</h3>
<h3 id="versions-2">Versions</h3>
<p>Jottacloud supports file versioning. When rclone uploads a new
version of a file it creates a new version of it. Currently rclone only
supports retrieving the current version but older versions can be
@@ -55400,7 +55516,7 @@ info.</p>
<p>An official document about the limitations for different types of
OneDrive can be found <a
href="https://support.office.com/en-us/article/invalid-file-names-and-file-types-in-onedrive-onedrive-for-business-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07630fa">here</a>.</p>
<h2 id="versions-4">Versions</h2>
<h2 id="versions-3">Versions</h2>
<p>Every change in a file OneDrive causes the service to create a new
version of the file. This counts against a users quota. For example
changing the modification time of a file creates a second version, so
@@ -65008,6 +65124,229 @@ the output.</p>
<!-- autogenerated options stop -->
<!-- markdownlint-disable line-length -->
<h1 id="changelog-1">Changelog</h1>
<h2 id="v1.74.3---2026-06-05">v1.74.3 - 2026-06-05</h2>
<p><a
href="https://github.com/rclone/rclone/compare/v1.74.2...v1.74.3">See
commits</a></p>
<ul>
<li>Bug Fixes
<ul>
<li>rc
<ul>
<li>Fix unauthenticated command execution via <code>--rc-serve</code>
inline remotes CVE-2026-49980 (Nick Craig-Wood)</li>
<li>Stop <code>global.*</code> connection string options changing config
CVE-2026-49980 (Nick Craig-Wood)</li>
</ul></li>
<li>build: Fix multiple CVEs by upgrading to go1.26.4 (Nick Craig-Wood)
<ul>
<li>CVE-2026-42504: mime: quadratic complexity in
WordDecoder.DecodeHeader</li>
<li>CVE-2026-42507: net/textproto: arbitrary input are included in
errors without any escaping</li>
<li>CVE-2026-27145: crypto/x509: split candidate hostname only once</li>
</ul></li>
<li>log: Fix wrong source <code>file:line</code> in JSON logs from
release builds (Nick Craig-Wood)</li>
<li>mount2: Fix empty directory listings on re-read (Janne Beate
Bakeng)</li>
<li>serve s3: Fix multipart <code>ListParts</code> pagination returning
wrong part numbers (Nick Craig-Wood)</li>
<li>serve sftp
<ul>
<li>Fix file corruption when a client resumes an upload (Nick
Craig-Wood)</li>
<li>Fix truncate request being silently ignored (Nick Craig-Wood)</li>
</ul></li>
</ul></li>
<li>Local
<ul>
<li>Fix <code>getXattr</code> returning empty map instead of nil (Leon
Brocard)</li>
</ul></li>
<li>Drime
<ul>
<li>Fix server-side copy and move failing with Cloudflare 520 error
(Nick Craig-Wood)</li>
<li>Fix files being uploaded to the wrong directory (Nick
Craig-Wood)</li>
<li>Remove duplicate upload_cutoff config option (Nick Craig-Wood)</li>
<li>Fix directory rename leaving the renamed folder empty in VFS (Nick
Craig-Wood)</li>
</ul></li>
<li>Drive
<ul>
<li>Fix server-side move failing on shared drives with duplicate dirs
(Nick Craig-Wood)</li>
</ul></li>
<li>Iclouddrive
<ul>
<li>Fix ADP/PCS cookie acquisition for iCloud Drive (Yakov Till)</li>
<li>Fix "Index has invalid data" error listing iCloud Photos (Nick
Craig-Wood)</li>
</ul></li>
</ul>
<h2 id="v1.74.2---2026-05-22">v1.74.2 - 2026-05-22</h2>
<p><a
href="https://github.com/rclone/rclone/compare/v1.74.1...v1.74.2">See
commits</a></p>
<ul>
<li>Bug Fixes
<ul>
<li>build
<ul>
<li>Update golang.org/x/net to v0.55.0 to address:
<ul>
<li>CVE-2026-42506: html: incorrect handling of namespaced elements in
foreign content</li>
<li>CVE-2026-39821: idna: failure to reject ASCII-only Punycode-encoded
labels</li>
<li>CVE-2026-42502: html: incorrect handling of HTML elements in foreign
content</li>
<li>CVE-2026-25680: html: denial of service when parsing arbitrary
HTML</li>
<li>CVE-2026-25681: html: incorrect handling of character references in
DOCTYPE nodes</li>
<li>CVE-2026-27136: html: duplicate attributes can cause XSS</li>
</ul></li>
<li>Update golang.org/x/crypto to v0.52.0 to address:
<ul>
<li>CVE-2026-46598: ssh/agent: pathological inputs can lead to client
panic</li>
<li>CVE-2026-46597: ssh: byte arithmetic causes underflow and panic</li>
<li>CVE-2026-39828: ssh: bypass of certificate restrictions</li>
<li>CVE-2026-39835: ssh: server panic during
CheckHostKey/Authenticate</li>
<li>CVE-2026-39833: ssh/agent: key constraints not enforced</li>
<li>CVE-2026-39832: ssh/agent: agent constraints dropped when forwarding
keys</li>
<li>CVE-2026-39827: ssh: memory leak when rejecting channels can lead to
DoS</li>
<li>CVE-2026-39830: ssh: client can cause server deadlock on unexpected
responses</li>
<li>CVE-2026-39829: ssh: pathological RSA/DSA parameters may cause
DoS</li>
<li>CVE-2026-39831: ssh: bypass of FIDO/U2F security keys physical
interaction</li>
<li>CVE-2026-39834: ssh: infinite loop on large channel writes</li>
<li>CVE-2026-42508: ssh/knownhosts: auth bypass via unenforced <span
class="citation" data-cites="revoked">@revoked</span> status</li>
<li>CVE-2026-46595: ssh: VerifiedPublicKeyCallback permissions skip
enforcement</li>
</ul></li>
<li>Update golang.org/x/image to v0.41.0 to address:
<ul>
<li>CVE-2026-42500: bmp: panic when reading out of bound palette
index</li>
<li>CVE-2026-33809: tiff: excessive resource consumption in PackBits
decompression</li>
</ul></li>
<li>Update golang.org/x/sys to version v0.45.0 to address:
<ul>
<li>CVE-2026-39824: windows: integer overflow in NewNTUnicodeString</li>
</ul></li>
<li>Update github.com/go-git/go-billy/v5 to 5.9.0 to fix
CVE-2026-44740</li>
<li>bisync: Fix --conflict-loser pathname with --conflict-resolve newer
(nielash)</li>
<li>gui: Update embedded release to 1.1.8 (Nick Craig-Wood)</li>
<li>lib/http: Replace deprecated h2c.NewHandler with
http.Server.Protocols (Nick Craig-Wood)</li>
<li>rc: Remove duplicate metrics_addr option registration (Nick
Craig-Wood)</li>
<li>vfs/vfscache: Fix silent write failure when mounting with remote:.
(Lucky945H)</li>
</ul></li>
<li>doc fixes (FTCHD, Iizuki, Leon Brocard, Nick Craig-Wood)</li>
</ul></li>
<li>Drime
<ul>
<li>Fix file doesn't exists error when trying to delete (John Volk)</li>
<li>Fix 500 errors when listing shared folders (Alvinwylim)</li>
</ul></li>
<li>Jottacloud
<ul>
<li>Support whitelabel service Phonero Sky (Tore Anderson)</li>
</ul></li>
<li>Protondrive
<ul>
<li>Fix corrupted on transfer: sha1 hashes differ (William Tange)</li>
</ul></li>
<li>S3
<ul>
<li>Add new MEGA S4 endpoints on megas4.com including Asia-Pacific
region (Nick Craig-Wood)</li>
</ul></li>
<li>WebDAV
<ul>
<li>Honour auth_redirect on listAll PROPFIND (Sai Asish Y)</li>
</ul></li>
</ul>
<h2 id="v1.74.1---2026-05-08">v1.74.1 - 2026-05-08</h2>
<p><a
href="https://github.com/rclone/rclone/compare/v1.74.0...v1.74.1">See
commits</a></p>
<ul>
<li>Bug Fixes
<ul>
<li>bisync: Fix retryable without <code>--resync</code> error message
when <code>--resync</code> has a critical failure (Gustavo V. F.)</li>
<li>build
<ul>
<li>Fix multiple CVEs by upgrading to go1.26.3 (Nick Craig-Wood)
<ul>
<li>CVE-2026-42501: cmd/go: malicious module proxy can bypass checksum
database</li>
<li>CVE-2026-39825: net/http/httputil: ReverseProxy forwards queries
with more than urlmaxqueryparams parameters</li>
<li>CVE-2026-39836: net: panic in Dial and LookupPort when handling NUL
byte on Windows</li>
<li>CVE-2026-42499: net/mail: quadratic string concatenation in
consumePhrase</li>
<li>CVE-2026-39820: net/mail: quadratic string concatentation in
consumeComment</li>
<li>CVE-2026-39819: cmd/go: "go bug" follows symlinks in predictable
temporary filenames</li>
<li>CVE-2026-39817: cmd/go: "go tool pack" does not sanitize output
paths</li>
<li>CVE-2026-33814: net/http: infinite loop in HTTP/2 transport when
given bad SETTINGS_MAX_FRAME_SIZE</li>
<li>CVE-2026-39826: html/template: escaper bypass leads to XSS</li>
<li>CVE-2026-33811: net: crash when handling long CNAME response</li>
<li>CVE-2026-39823: html/template: bypass of meta content URL escaping
causes XSS</li>
</ul></li>
<li>Update golang.org/x/net to v0.53.0 to fix CVE-2026-33814 (Nick
Craig-Wood)</li>
</ul></li>
<li>cmd/serve/s3: Return object listings in key order (Leon
Brocard)</li>
</ul></li>
<li>Cloudinary
<ul>
<li>Fix retrying every error and fix pacer sleep units (Nick
Craig-Wood)</li>
</ul></li>
<li>Drime
<ul>
<li>Fix large file uploads landing in drive root instead of configured
folder (Nick Craig-Wood)</li>
<li>Fix uploads of 100..200M files (Nick Craig-Wood)</li>
</ul></li>
<li>Protondrive
<ul>
<li>Route HTTP through rclone's transport (Nick Craig-Wood)</li>
<li>Route library logging through rclone's logger (Nick Craig-Wood)</li>
<li>Fix segfault when copying files missing revision metadata (Nick
Craig-Wood)</li>
</ul></li>
<li>S3
<ul>
<li>Fix STS call per request by caching AssumeRole credentials (Nick
Craig-Wood)</li>
<li>Add new Fastly Object Storage regions (Leon Brocard)</li>
</ul></li>
</ul>
<h2 id="v1.74.0---2026-05-01">v1.74.0 - 2026-05-01</h2>
<p><a
href="https://github.com/rclone/rclone/compare/v1.73.0...v1.74.0">See
@@ -65966,7 +66305,7 @@ data-cites="RTH_">@RTH_</span>)</li>
<li>New Features
<ul>
<li>Allow <a href="https://rclone.org/docs/#globalconfig">global config
to be overriden or set on backend creation</a> (Nick Craig-Wood)</li>
to be overridden or set on backend creation</a> (Nick Craig-Wood)</li>
<li>bisync: Promoted from beta to stable (nielash)</li>
<li>build
<ul>
@@ -66101,7 +66440,7 @@ the config file.</li>
</ul></li>
<li>Googlephotos
<ul>
<li>Added warning for Google Photos compatability-fixes
<li>Added warning for Google Photos compatibility-fixes
(raider13209)</li>
</ul></li>
<li>Imagekit
@@ -68860,7 +69199,7 @@ runtime (Peter Brunner)</li>
<li>Update drive service account guide (Juang, Yi-Lin)</li>
<li>Fix change notify picking up files outside the root (Nick
Craig-Wood)</li>
<li>Fix trailing slash mis-identificaton of folder as file (Nick
<li>Fix trailing slash mis-identification of folder as file (Nick
Craig-Wood)</li>
<li>Fix incorrect remote after Update on object (Nick Craig-Wood)</li>
</ul></li>
Generated
+211 -21
View File
@@ -1,6 +1,6 @@
% rclone(1) User Manual
% Nick Craig-Wood
% May 01, 2026
% Jun 05, 2026
# NAME
@@ -5416,12 +5416,12 @@ rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,command=e
```console
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}"
// Output: stories/The Quick Brown Fox!-20260501
// Output: stories/The Quick Brown Fox!-20260605
```
```console
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}"
// Output: stories/The Quick Brown Fox!-2026-05-01 0208PM
// Output: stories/The Quick Brown Fox!-2026-06-05 0414PM
```
```console
@@ -18052,7 +18052,7 @@ Windows and `/dev/null` on Unix systems, then rclone will keep the
configuration file in memory only.
You may see a log message "Config file not found - using defaults" if there is
no configuration file. This can be supressed, e.g. if you are using rclone
no configuration file. This can be suppressed, e.g. if you are using rclone
entirely with [on the fly remotes](https://rclone.org/docs/#backend-path-to-dir), by using
memory-only configuration file or by creating an empty configuration file, as
described above.
@@ -21703,8 +21703,26 @@ so you can browse to `http://127.0.0.1:5572/` or `http://127.0.0.1:5572/*`
to see a listing of the remotes. Objects may be requested from
remotes using this syntax `http://127.0.0.1:5572/[remote:path]/path/to/object`
Unless the rc server has authentication configured (`--rc-user`/`--rc-pass`
or `--rc-htpasswd`) or the `--rc-no-auth` flag is set, only remotes already
present in the config file may be served this way. Inline remotes (e.g.
`[:webdav,url=...:]`), connection string parameters and bare local paths are
rejected, since instantiating them from an unauthenticated request could run
commands or read arbitrary local files.
Default Off.
### global.* connection string options and the rc
Remotes instantiated by the rc do not let [connection
string](https://rclone.org/docs/#connection-strings) `global.*` options change rclone's
process-wide configuration. Remotes created directly on the command
line or defined in the config file are unaffected.
A `global.*` option still takes effect for the individual backend it
is set on (exactly like an `override.*` option), it just does not leak
into the global config for the rest of the process.
### --rc-serve-no-modtime
Set this flag to skip reading the modification time (can speed things up).
@@ -24985,7 +25003,7 @@ Flags for general networking and HTTP stuff.
--tpslimit float Limit HTTP transactions per second to this
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
--use-cookies Enable session cookiejar
--user-agent string Set the user-agent to a specified string (default "rclone/v1.74.0")
--user-agent string Set the user-agent to a specified string (default "rclone/v1.74.3")
```
@@ -25177,7 +25195,7 @@ Flags to control the Remote Control API.
Flags to control the Metrics HTTP endpoint..
```
--metrics-addr stringArray IPaddress:Port or :Port to bind metrics server to
--metrics-addr stringArray IPaddress:Port or :Port to bind server to
--metrics-allow-origin string Origin which cross-domain request (CORS) can be executed from
--metrics-baseurl string Prefix for URLs - leave blank for root
--metrics-cert string TLS PEM key (concatenation of certificate and CA certificate)
@@ -25383,7 +25401,7 @@ Backend-only flags (these can be set in the config file also).
--drime-list-chunk int Number of items to list in each call (default 1000)
--drime-root-folder-id string ID of the root folder
--drime-upload-concurrency int Concurrency for multipart uploads and copies (default 4)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 5Mi)
--drime-workspace-id string Account ID
--drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded
--drive-allow-import-name-change Allow the filetype to change when uploading Google docs
@@ -27772,9 +27790,19 @@ encodings.)
The following backends have known issues that need more investigation:
<!--- start list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
- `TestDropbox` (`dropbox`)
- [`TestBisyncRemoteRemote/normalization`](https://pub.rclone.org/integration-tests/current/dropbox-cmd.bisync-TestDropbox-1.txt)
- Updated: 2026-05-01-010013
- `TestFilen` (`filen`)
- [`TestBisyncRemoteRemote/resync_modes`](https://pub.rclone.org/integration-tests/current/filen-cmd.bisync-TestFilen-1.txt)
- [`TestBisyncRemoteRemote/rmdirs`](https://pub.rclone.org/integration-tests/current/filen-cmd.bisync-TestFilen-1.txt)
- `TestHuaweiDrive` (`huaweidrive`)
- [`TestBisyncRemoteLocal/ext_paths`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [`TestBisyncRemoteLocal/extended_filenames`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [`TestBisyncRemoteLocal/normalization`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [`TestBisyncLocalRemote/ext_paths`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [`TestBisyncLocalRemote/extended_filenames`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [4 more](https://pub.rclone.org/integration-tests/current/)
- `TestSeafile` (`seafile`)
- [`TestBisyncLocalRemote/rmdirs`](https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafile-1.txt)
- Updated: 2026-06-05-010010
<!--- end list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
The following backends either have not been tested recently or have known issues
@@ -28618,6 +28646,11 @@ about *Unison* and synchronization in general.
## Changelog
### `v1.74.2`
- Fixed an issue causing `--conflict-loser pathname` to produce unexpected
behavior if using a non-default `--conflict-resolve` value.
### `v1.74`
- Added several missing `rc` parameters.
@@ -30500,6 +30533,9 @@ Properties:
- "eu-south-1"
- EU South 1
- Provider: Fastly
- "eu-west-1"
- EU West 1
- Provider: Fastly
- "jp-central-1"
- JP Central 1
- Provider: Fastly
@@ -30512,9 +30548,15 @@ Properties:
- "us-east"
- US East
- Provider: Fastly
- "us-east-1"
- US East 1
- Provider: Fastly
- "us-west"
- US West
- Provider: Fastly
- "us-west-1"
- US West 1
- Provider: Fastly
- "global"
- Global
- Provider: FileLu
@@ -31087,6 +31129,9 @@ Properties:
- "eu-south-1.object.fastlystorage.app"
- EU South 1
- Provider: Fastly
- "eu-west-1.object.fastlystorage.app"
- EU West 1
- Provider: Fastly
- "jp-central-1.object.fastlystorage.app"
- JP Central 1
- Provider: Fastly
@@ -31099,9 +31144,15 @@ Properties:
- "us-east.object.fastlystorage.app"
- US East
- Provider: Fastly
- "us-east-1.object.fastlystorage.app"
- US East 1
- Provider: Fastly
- "us-west.object.fastlystorage.app"
- US West
- Provider: Fastly
- "us-west-1.object.fastlystorage.app"
- US West 1
- Provider: Fastly
- "s5lu.com"
- Global FileLu S5 endpoint
- Provider: FileLu
@@ -31485,17 +31536,38 @@ Properties:
- "br-ne1.magaluobjects.com"
- Fortaleza, CE (BR), br-ne1
- Provider: Magalu
- "s3.eu-amsterdam.megas4.com"
- Mega S4 Amsterdam
- Provider: Mega
- "s3.eu-luxembourg.megas4.com"
- Mega S4 Luxembourg
- Provider: Mega
- "s3.eu-paris.megas4.com"
- Mega S4 Paris
- Provider: Mega
- "s3.eu-barcelona.megas4.com"
- Mega S4 Barcelona
- Provider: Mega
- "s3.ca-montreal.megas4.com"
- Mega S4 Montreal
- Provider: Mega
- "s3.ca-vancouver.megas4.com"
- Mega S4 Vancouver
- Provider: Mega
- "s3.ap-tokyo.megas4.com"
- Mega S4 Tokyo
- Provider: Mega
- "s3.eu-central-1.s4.mega.io"
- Mega S4 eu-central-1 (Amsterdam)
- Mega S4 eu-central-1 (Amsterdam, legacy)
- Provider: Mega
- "s3.eu-central-2.s4.mega.io"
- Mega S4 eu-central-2 (Bettembourg)
- Mega S4 eu-central-2 (Bettembourg, legacy)
- Provider: Mega
- "s3.ca-central-1.s4.mega.io"
- Mega S4 ca-central-1 (Montreal)
- Mega S4 ca-central-1 (Montreal, legacy)
- Provider: Mega
- "s3.ca-west-1.s4.mega.io"
- Mega S4 ca-west-1 (Vancouver)
- Mega S4 ca-west-1 (Vancouver, legacy)
- Provider: Mega
- "oos.eu-west-2.outscale.com"
- Outscale EU West 2 (Paris)
@@ -32851,7 +32923,7 @@ If true use path style access if false use virtual hosted style.
If this is true (the default) then rclone will use path style access,
if false then rclone will use virtual path style. See [the AWS S3
docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro)
docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html)
for more info.
Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to
@@ -40204,7 +40276,7 @@ start and finish the upload) and another 2 requests for each chunk:
/b2api/v1/b2_finish_large_file
```
#### Versions
### Viewing versions with --b2-versions
Versions can be viewed with the `--b2-versions` flag. When it is set
rclone will show and act on older versions of files. For example
@@ -44796,7 +44868,7 @@ Properties:
- Config: upload_cutoff
- Env Var: RCLONE_DRIME_UPLOAD_CUTOFF
- Type: SizeSuffix
- Default: 200Mi
- Default: 5Mi
#### --drime-chunk-size
@@ -48753,7 +48825,7 @@ Drive, the size of all files in the Trash and the space used by other
Google services such as Gmail. This command does not take any path
arguments.
#### Import/Export of google documents
### Import/Export of google documents
Google documents can be exported from and uploaded to Google Drive.
@@ -54082,6 +54154,8 @@ as described [below](#traditional):
- MediaMarkt
- MediaMarkt Cloud (mediamarkt.jottacloud.com)
- Let's Go Cloud (letsgo.jotta.cloud)
- Phonero
- Phonero Sky (sky.phonero.no)
Paths are specified as `remote:path`
@@ -70245,6 +70319,122 @@ Options:
# Changelog
## v1.74.3 - 2026-06-05
[See commits](https://github.com/rclone/rclone/compare/v1.74.2...v1.74.3)
- Bug Fixes
- rc
- Fix unauthenticated command execution via `--rc-serve` inline remotes CVE-2026-49980 (Nick Craig-Wood)
- Stop `global.*` connection string options changing config CVE-2026-49980 (Nick Craig-Wood)
- build: Fix multiple CVEs by upgrading to go1.26.4 (Nick Craig-Wood)
- CVE-2026-42504: mime: quadratic complexity in WordDecoder.DecodeHeader
- CVE-2026-42507: net/textproto: arbitrary input are included in errors without any escaping
- CVE-2026-27145: crypto/x509: split candidate hostname only once
- log: Fix wrong source `file:line` in JSON logs from release builds (Nick Craig-Wood)
- mount2: Fix empty directory listings on re-read (Janne Beate Bakeng)
- serve s3: Fix multipart `ListParts` pagination returning wrong part numbers (Nick Craig-Wood)
- serve sftp
- Fix file corruption when a client resumes an upload (Nick Craig-Wood)
- Fix truncate request being silently ignored (Nick Craig-Wood)
- Local
- Fix `getXattr` returning empty map instead of nil (Leon Brocard)
- Drime
- Fix server-side copy and move failing with Cloudflare 520 error (Nick Craig-Wood)
- Fix files being uploaded to the wrong directory (Nick Craig-Wood)
- Remove duplicate upload_cutoff config option (Nick Craig-Wood)
- Fix directory rename leaving the renamed folder empty in VFS (Nick Craig-Wood)
- Drive
- Fix server-side move failing on shared drives with duplicate dirs (Nick Craig-Wood)
- Iclouddrive
- Fix ADP/PCS cookie acquisition for iCloud Drive (Yakov Till)
- Fix "Index has invalid data" error listing iCloud Photos (Nick Craig-Wood)
## v1.74.2 - 2026-05-22
[See commits](https://github.com/rclone/rclone/compare/v1.74.1...v1.74.2)
- Bug Fixes
- build
- Update golang.org/x/net to v0.55.0 to address:
- CVE-2026-42506: html: incorrect handling of namespaced elements in foreign content
- CVE-2026-39821: idna: failure to reject ASCII-only Punycode-encoded labels
- CVE-2026-42502: html: incorrect handling of HTML elements in foreign content
- CVE-2026-25680: html: denial of service when parsing arbitrary HTML
- CVE-2026-25681: html: incorrect handling of character references in DOCTYPE nodes
- CVE-2026-27136: html: duplicate attributes can cause XSS
- Update golang.org/x/crypto to v0.52.0 to address:
- CVE-2026-46598: ssh/agent: pathological inputs can lead to client panic
- CVE-2026-46597: ssh: byte arithmetic causes underflow and panic
- CVE-2026-39828: ssh: bypass of certificate restrictions
- CVE-2026-39835: ssh: server panic during CheckHostKey/Authenticate
- CVE-2026-39833: ssh/agent: key constraints not enforced
- CVE-2026-39832: ssh/agent: agent constraints dropped when forwarding keys
- CVE-2026-39827: ssh: memory leak when rejecting channels can lead to DoS
- CVE-2026-39830: ssh: client can cause server deadlock on unexpected responses
- CVE-2026-39829: ssh: pathological RSA/DSA parameters may cause DoS
- CVE-2026-39831: ssh: bypass of FIDO/U2F security keys physical interaction
- CVE-2026-39834: ssh: infinite loop on large channel writes
- CVE-2026-42508: ssh/knownhosts: auth bypass via unenforced @revoked status
- CVE-2026-46595: ssh: VerifiedPublicKeyCallback permissions skip enforcement
- Update golang.org/x/image to v0.41.0 to address:
- CVE-2026-42500: bmp: panic when reading out of bound palette index
- CVE-2026-33809: tiff: excessive resource consumption in PackBits decompression
- Update golang.org/x/sys to version v0.45.0 to address:
- CVE-2026-39824: windows: integer overflow in NewNTUnicodeString
- Update github.com/go-git/go-billy/v5 to 5.9.0 to fix CVE-2026-44740
- bisync: Fix --conflict-loser pathname with --conflict-resolve newer (nielash)
- gui: Update embedded release to 1.1.8 (Nick Craig-Wood)
- lib/http: Replace deprecated h2c.NewHandler with http.Server.Protocols (Nick Craig-Wood)
- rc: Remove duplicate metrics_addr option registration (Nick Craig-Wood)
- vfs/vfscache: Fix silent write failure when mounting with remote:. (Lucky945H)
- doc fixes (FTCHD, Iizuki, Leon Brocard, Nick Craig-Wood)
- Drime
- Fix file doesn't exists error when trying to delete (John Volk)
- Fix 500 errors when listing shared folders (Alvinwylim)
- Jottacloud
- Support whitelabel service Phonero Sky (Tore Anderson)
- Protondrive
- Fix corrupted on transfer: sha1 hashes differ (William Tange)
- S3
- Add new MEGA S4 endpoints on megas4.com including Asia-Pacific region (Nick Craig-Wood)
- WebDAV
- Honour auth_redirect on listAll PROPFIND (Sai Asish Y)
## v1.74.1 - 2026-05-08
[See commits](https://github.com/rclone/rclone/compare/v1.74.0...v1.74.1)
- Bug Fixes
- bisync: Fix retryable without `--resync` error message when `--resync` has a critical failure (Gustavo V. F.)
- build
- Fix multiple CVEs by upgrading to go1.26.3 (Nick Craig-Wood)
- CVE-2026-42501: cmd/go: malicious module proxy can bypass checksum database
- CVE-2026-39825: net/http/httputil: ReverseProxy forwards queries with more than urlmaxqueryparams parameters
- CVE-2026-39836: net: panic in Dial and LookupPort when handling NUL byte on Windows
- CVE-2026-42499: net/mail: quadratic string concatenation in consumePhrase
- CVE-2026-39820: net/mail: quadratic string concatentation in consumeComment
- CVE-2026-39819: cmd/go: "go bug" follows symlinks in predictable temporary filenames
- CVE-2026-39817: cmd/go: "go tool pack" does not sanitize output paths
- CVE-2026-33814: net/http: infinite loop in HTTP/2 transport when given bad SETTINGS_MAX_FRAME_SIZE
- CVE-2026-39826: html/template: escaper bypass leads to XSS
- CVE-2026-33811: net: crash when handling long CNAME response
- CVE-2026-39823: html/template: bypass of meta content URL escaping causes XSS
- Update golang.org/x/net to v0.53.0 to fix CVE-2026-33814 (Nick Craig-Wood)
- cmd/serve/s3: Return object listings in key order (Leon Brocard)
- Cloudinary
- Fix retrying every error and fix pacer sleep units (Nick Craig-Wood)
- Drime
- Fix large file uploads landing in drive root instead of configured folder (Nick Craig-Wood)
- Fix uploads of 100..200M files (Nick Craig-Wood)
- Protondrive
- Route HTTP through rclone's transport (Nick Craig-Wood)
- Route library logging through rclone's logger (Nick Craig-Wood)
- Fix segfault when copying files missing revision metadata (Nick Craig-Wood)
- S3
- Fix STS call per request by caching AssumeRole credentials (Nick Craig-Wood)
- Add new Fastly Object Storage regions (Leon Brocard)
## v1.74.0 - 2026-05-01
[See commits](https://github.com/rclone/rclone/compare/v1.73.0...v1.74.0)
@@ -70745,7 +70935,7 @@ Options:
- [OVHcloud Object Storage](https://rclone.org/s3/#ovhcloud) (Florent Vennetier)
- [Zata](https://rclone.org/s3/#Zata) ($@M@RTH_)
- New Features
- Allow [global config to be overriden or set on backend creation](https://rclone.org/docs/#globalconfig) (Nick Craig-Wood)
- Allow [global config to be overridden or set on backend creation](https://rclone.org/docs/#globalconfig) (Nick Craig-Wood)
- bisync: Promoted from beta to stable (nielash)
- build
- Update to go1.25 and make go1.24 the minimum required version (Nick Craig-Wood)
@@ -70812,7 +71002,7 @@ Options:
- This allows `--ca-cert`, `--client-cert` etc to be used.
- This also allows `override.ca_cert = XXX` to be used in the config file.
- Googlephotos
- Added warning for Google Photos compatability-fixes (raider13209)
- Added warning for Google Photos compatibility-fixes (raider13209)
- Imagekit
- Return correct error when attempting to upload zero length files (Nick Craig-Wood)
- Don't low level retry uploads (Nick Craig-Wood)
@@ -72169,7 +72359,7 @@ instead of of `--size-only`, when `check` is not available.
- Add `--drive-env-auth` to get IAM credentials from runtime (Peter Brunner)
- Update drive service account guide (Juang, Yi-Lin)
- Fix change notify picking up files outside the root (Nick Craig-Wood)
- Fix trailing slash mis-identificaton of folder as file (Nick Craig-Wood)
- Fix trailing slash mis-identification of folder as file (Nick Craig-Wood)
- Fix incorrect remote after Update on object (Nick Craig-Wood)
- Dropbox
- Implement `--dropbox-pacer-min-sleep` flag (Nick Craig-Wood)
Generated
+267 -19
View File
@@ -1,6 +1,6 @@
rclone(1) User Manual
Nick Craig-Wood
May 01, 2026
Jun 05, 2026
NAME
@@ -4632,10 +4632,10 @@ Examples:
// Output: stories/The Quick Brown Fox!.txt
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}"
// Output: stories/The Quick Brown Fox!-20260501
// Output: stories/The Quick Brown Fox!-20260605
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}"
// Output: stories/The Quick Brown Fox!-2026-05-01 0208PM
// Output: stories/The Quick Brown Fox!-2026-06-05 0414PM
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,regex=[\\.\\w]/ab"
// Output: ababababababab/ababab ababababab ababababab ababab!abababab
@@ -16361,7 +16361,7 @@ notfound, or the os null device represented by value NUL on Windows and
in memory only.
You may see a log message "Config file not found - using defaults" if
there is no configuration file. This can be supressed, e.g. if you are
there is no configuration file. This can be suppressed, e.g. if you are
using rclone entirely with on the fly remotes, by using memory-only
configuration file or by creating an empty configuration file, as
described above.
@@ -19838,8 +19838,26 @@ can browse to http://127.0.0.1:5572/ or http://127.0.0.1:5572/* to see a
listing of the remotes. Objects may be requested from remotes using this
syntax http://127.0.0.1:5572/[remote:path]/path/to/object
Unless the rc server has authentication configured (--rc-user/--rc-pass
or --rc-htpasswd) or the --rc-no-auth flag is set, only remotes already
present in the config file may be served this way. Inline remotes (e.g.
[:webdav,url=...:]), connection string parameters and bare local paths
are rejected, since instantiating them from an unauthenticated request
could run commands or read arbitrary local files.
Default Off.
global.* connection string options and the rc
Remotes instantiated by the rc do not let connection string global.*
options change rclone's process-wide configuration. Remotes created
directly on the command line or defined in the config file are
unaffected.
A global.* option still takes effect for the individual backend it is
set on (exactly like an override.* option), it just does not leak into
the global config for the rest of the process.
--rc-serve-no-modtime
Set this flag to skip reading the modification time (can speed things
@@ -23140,7 +23158,7 @@ Flags for general networking and HTTP stuff.
--tpslimit float Limit HTTP transactions per second to this
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
--use-cookies Enable session cookiejar
--user-agent string Set the user-agent to a specified string (default "rclone/v1.74.0")
--user-agent string Set the user-agent to a specified string (default "rclone/v1.74.3")
Performance
@@ -23305,7 +23323,7 @@ Metrics
Flags to control the Metrics HTTP endpoint..
--metrics-addr stringArray IPaddress:Port or :Port to bind metrics server to
--metrics-addr stringArray IPaddress:Port or :Port to bind server to
--metrics-allow-origin string Origin which cross-domain request (CORS) can be executed from
--metrics-baseurl string Prefix for URLs - leave blank for root
--metrics-cert string TLS PEM key (concatenation of certificate and CA certificate)
@@ -23508,7 +23526,7 @@ Backend-only flags (these can be set in the config file also).
--drime-list-chunk int Number of items to list in each call (default 1000)
--drime-root-folder-id string ID of the root folder
--drime-upload-concurrency int Concurrency for multipart uploads and copies (default 4)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 5Mi)
--drime-workspace-id string Account ID
--drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded
--drive-allow-import-name-change Allow the filetype to change when uploading Google docs
@@ -25839,9 +25857,19 @@ disallowed special characters and filename encodings.)
The following backends have known issues that need more investigation:
- TestDropbox (dropbox)
- TestBisyncRemoteRemote/normalization
- Updated: 2026-05-01-010013
- TestFilen (filen)
- TestBisyncRemoteRemote/resync_modes
- TestBisyncRemoteRemote/rmdirs
- TestHuaweiDrive (huaweidrive)
- TestBisyncRemoteLocal/ext_paths
- TestBisyncRemoteLocal/extended_filenames
- TestBisyncRemoteLocal/normalization
- TestBisyncLocalRemote/ext_paths
- TestBisyncLocalRemote/extended_filenames
- 4 more
- TestSeafile (seafile)
- TestBisyncLocalRemote/rmdirs
- Updated: 2026-06-05-010010
The following backends either have not been tested recently or have
known issues that are deemed unfixable for the time being:
@@ -26682,6 +26710,11 @@ Unison and synchronization in general.
Changelog
v1.74.2
- Fixed an issue causing --conflict-loser pathname to produce
unexpected behavior if using a non-default --conflict-resolve value.
v1.74
- Added several missing rc parameters.
@@ -28535,6 +28568,9 @@ Properties:
- "eu-south-1"
- EU South 1
- Provider: Fastly
- "eu-west-1"
- EU West 1
- Provider: Fastly
- "jp-central-1"
- JP Central 1
- Provider: Fastly
@@ -28547,9 +28583,15 @@ Properties:
- "us-east"
- US East
- Provider: Fastly
- "us-east-1"
- US East 1
- Provider: Fastly
- "us-west"
- US West
- Provider: Fastly
- "us-west-1"
- US West 1
- Provider: Fastly
- "global"
- Global
- Provider: FileLu
@@ -29124,6 +29166,9 @@ Properties:
- "eu-south-1.object.fastlystorage.app"
- EU South 1
- Provider: Fastly
- "eu-west-1.object.fastlystorage.app"
- EU West 1
- Provider: Fastly
- "jp-central-1.object.fastlystorage.app"
- JP Central 1
- Provider: Fastly
@@ -29136,9 +29181,15 @@ Properties:
- "us-east.object.fastlystorage.app"
- US East
- Provider: Fastly
- "us-east-1.object.fastlystorage.app"
- US East 1
- Provider: Fastly
- "us-west.object.fastlystorage.app"
- US West
- Provider: Fastly
- "us-west-1.object.fastlystorage.app"
- US West 1
- Provider: Fastly
- "s5lu.com"
- Global FileLu S5 endpoint
- Provider: FileLu
@@ -29522,17 +29573,38 @@ Properties:
- "br-ne1.magaluobjects.com"
- Fortaleza, CE (BR), br-ne1
- Provider: Magalu
- "s3.eu-amsterdam.megas4.com"
- Mega S4 Amsterdam
- Provider: Mega
- "s3.eu-luxembourg.megas4.com"
- Mega S4 Luxembourg
- Provider: Mega
- "s3.eu-paris.megas4.com"
- Mega S4 Paris
- Provider: Mega
- "s3.eu-barcelona.megas4.com"
- Mega S4 Barcelona
- Provider: Mega
- "s3.ca-montreal.megas4.com"
- Mega S4 Montreal
- Provider: Mega
- "s3.ca-vancouver.megas4.com"
- Mega S4 Vancouver
- Provider: Mega
- "s3.ap-tokyo.megas4.com"
- Mega S4 Tokyo
- Provider: Mega
- "s3.eu-central-1.s4.mega.io"
- Mega S4 eu-central-1 (Amsterdam)
- Mega S4 eu-central-1 (Amsterdam, legacy)
- Provider: Mega
- "s3.eu-central-2.s4.mega.io"
- Mega S4 eu-central-2 (Bettembourg)
- Mega S4 eu-central-2 (Bettembourg, legacy)
- Provider: Mega
- "s3.ca-central-1.s4.mega.io"
- Mega S4 ca-central-1 (Montreal)
- Mega S4 ca-central-1 (Montreal, legacy)
- Provider: Mega
- "s3.ca-west-1.s4.mega.io"
- Mega S4 ca-west-1 (Vancouver)
- Mega S4 ca-west-1 (Vancouver, legacy)
- Provider: Mega
- "oos.eu-west-2.outscale.com"
- Outscale EU West 2 (Paris)
@@ -37963,7 +38035,7 @@ start and finish the upload) and another 2 requests for each chunk:
/b2api/v1/b2_upload_part/
/b2api/v1/b2_finish_large_file
Versions
Viewing versions with --b2-versions
Versions can be viewed with the --b2-versions flag. When it is set
rclone will show and act on older versions of files. For example
@@ -42405,7 +42477,7 @@ Properties:
- Config: upload_cutoff
- Env Var: RCLONE_DRIME_UPLOAD_CUTOFF
- Type: SizeSuffix
- Default: 200Mi
- Default: 5Mi
--drime-chunk-size
@@ -51596,6 +51668,8 @@ setup as described below:
- MediaMarkt
- MediaMarkt Cloud (mediamarkt.jottacloud.com)
- Let's Go Cloud (letsgo.jotta.cloud)
- Phonero
- Phonero Sky (sky.phonero.no)
Paths are specified as remote:path
@@ -67336,6 +67410,180 @@ Options:
Changelog
v1.74.3 - 2026-06-05
See commits
- Bug Fixes
- rc
- Fix unauthenticated command execution via --rc-serve inline
remotes CVE-2026-49980 (Nick Craig-Wood)
- Stop global.* connection string options changing config
CVE-2026-49980 (Nick Craig-Wood)
- build: Fix multiple CVEs by upgrading to go1.26.4 (Nick
Craig-Wood)
- CVE-2026-42504: mime: quadratic complexity in
WordDecoder.DecodeHeader
- CVE-2026-42507: net/textproto: arbitrary input are included
in errors without any escaping
- CVE-2026-27145: crypto/x509: split candidate hostname only
once
- log: Fix wrong source file:line in JSON logs from release builds
(Nick Craig-Wood)
- mount2: Fix empty directory listings on re-read (Janne Beate
Bakeng)
- serve s3: Fix multipart ListParts pagination returning wrong
part numbers (Nick Craig-Wood)
- serve sftp
- Fix file corruption when a client resumes an upload (Nick
Craig-Wood)
- Fix truncate request being silently ignored (Nick
Craig-Wood)
- Local
- Fix getXattr returning empty map instead of nil (Leon Brocard)
- Drime
- Fix server-side copy and move failing with Cloudflare 520 error
(Nick Craig-Wood)
- Fix files being uploaded to the wrong directory (Nick
Craig-Wood)
- Remove duplicate upload_cutoff config option (Nick Craig-Wood)
- Fix directory rename leaving the renamed folder empty in VFS
(Nick Craig-Wood)
- Drive
- Fix server-side move failing on shared drives with duplicate
dirs (Nick Craig-Wood)
- Iclouddrive
- Fix ADP/PCS cookie acquisition for iCloud Drive (Yakov Till)
- Fix "Index has invalid data" error listing iCloud Photos (Nick
Craig-Wood)
v1.74.2 - 2026-05-22
See commits
- Bug Fixes
- build
- Update golang.org/x/net to v0.55.0 to address:
- CVE-2026-42506: html: incorrect handling of namespaced
elements in foreign content
- CVE-2026-39821: idna: failure to reject ASCII-only
Punycode-encoded labels
- CVE-2026-42502: html: incorrect handling of HTML
elements in foreign content
- CVE-2026-25680: html: denial of service when parsing
arbitrary HTML
- CVE-2026-25681: html: incorrect handling of character
references in DOCTYPE nodes
- CVE-2026-27136: html: duplicate attributes can cause XSS
- Update golang.org/x/crypto to v0.52.0 to address:
- CVE-2026-46598: ssh/agent: pathological inputs can lead
to client panic
- CVE-2026-46597: ssh: byte arithmetic causes underflow
and panic
- CVE-2026-39828: ssh: bypass of certificate restrictions
- CVE-2026-39835: ssh: server panic during
CheckHostKey/Authenticate
- CVE-2026-39833: ssh/agent: key constraints not enforced
- CVE-2026-39832: ssh/agent: agent constraints dropped
when forwarding keys
- CVE-2026-39827: ssh: memory leak when rejecting channels
can lead to DoS
- CVE-2026-39830: ssh: client can cause server deadlock on
unexpected responses
- CVE-2026-39829: ssh: pathological RSA/DSA parameters may
cause DoS
- CVE-2026-39831: ssh: bypass of FIDO/U2F security keys
physical interaction
- CVE-2026-39834: ssh: infinite loop on large channel
writes
- CVE-2026-42508: ssh/knownhosts: auth bypass via
unenforced @revoked status
- CVE-2026-46595: ssh: VerifiedPublicKeyCallback
permissions skip enforcement
- Update golang.org/x/image to v0.41.0 to address:
- CVE-2026-42500: bmp: panic when reading out of bound
palette index
- CVE-2026-33809: tiff: excessive resource consumption in
PackBits decompression
- Update golang.org/x/sys to version v0.45.0 to address:
- CVE-2026-39824: windows: integer overflow in
NewNTUnicodeString
- Update github.com/go-git/go-billy/v5 to 5.9.0 to fix
CVE-2026-44740
- bisync: Fix --conflict-loser pathname with
--conflict-resolve newer (nielash)
- gui: Update embedded release to 1.1.8 (Nick Craig-Wood)
- lib/http: Replace deprecated h2c.NewHandler with
http.Server.Protocols (Nick Craig-Wood)
- rc: Remove duplicate metrics_addr option registration (Nick
Craig-Wood)
- vfs/vfscache: Fix silent write failure when mounting with
remote:. (Lucky945H)
- doc fixes (FTCHD, Iizuki, Leon Brocard, Nick Craig-Wood)
- Drime
- Fix file doesn't exists error when trying to delete (John Volk)
- Fix 500 errors when listing shared folders (Alvinwylim)
- Jottacloud
- Support whitelabel service Phonero Sky (Tore Anderson)
- Protondrive
- Fix corrupted on transfer: sha1 hashes differ (William Tange)
- S3
- Add new MEGA S4 endpoints on megas4.com including Asia-Pacific
region (Nick Craig-Wood)
- WebDAV
- Honour auth_redirect on listAll PROPFIND (Sai Asish Y)
v1.74.1 - 2026-05-08
See commits
- Bug Fixes
- bisync: Fix retryable without --resync error message when
--resync has a critical failure (Gustavo V. F.)
- build
- Fix multiple CVEs by upgrading to go1.26.3 (Nick Craig-Wood)
- CVE-2026-42501: cmd/go: malicious module proxy can
bypass checksum database
- CVE-2026-39825: net/http/httputil: ReverseProxy forwards
queries with more than urlmaxqueryparams parameters
- CVE-2026-39836: net: panic in Dial and LookupPort when
handling NUL byte on Windows
- CVE-2026-42499: net/mail: quadratic string concatenation
in consumePhrase
- CVE-2026-39820: net/mail: quadratic string
concatentation in consumeComment
- CVE-2026-39819: cmd/go: "go bug" follows symlinks in
predictable temporary filenames
- CVE-2026-39817: cmd/go: "go tool pack" does not sanitize
output paths
- CVE-2026-33814: net/http: infinite loop in HTTP/2
transport when given bad SETTINGS_MAX_FRAME_SIZE
- CVE-2026-39826: html/template: escaper bypass leads to
XSS
- CVE-2026-33811: net: crash when handling long CNAME
response
- CVE-2026-39823: html/template: bypass of meta content
URL escaping causes XSS
- Update golang.org/x/net to v0.53.0 to fix CVE-2026-33814
(Nick Craig-Wood)
- cmd/serve/s3: Return object listings in key order (Leon Brocard)
- Cloudinary
- Fix retrying every error and fix pacer sleep units (Nick
Craig-Wood)
- Drime
- Fix large file uploads landing in drive root instead of
configured folder (Nick Craig-Wood)
- Fix uploads of 100..200M files (Nick Craig-Wood)
- Protondrive
- Route HTTP through rclone's transport (Nick Craig-Wood)
- Route library logging through rclone's logger (Nick Craig-Wood)
- Fix segfault when copying files missing revision metadata (Nick
Craig-Wood)
- S3
- Fix STS call per request by caching AssumeRole credentials (Nick
Craig-Wood)
- Add new Fastly Object Storage regions (Leon Brocard)
v1.74.0 - 2026-05-01
See commits
@@ -67972,7 +68220,7 @@ See commits
- OVHcloud Object Storage (Florent Vennetier)
- Zata ($@M@RTH_)
- New Features
- Allow global config to be overriden or set on backend creation
- Allow global config to be overridden or set on backend creation
(Nick Craig-Wood)
- bisync: Promoted from beta to stable (nielash)
- build
@@ -68072,7 +68320,7 @@ See commits
- This also allows override.ca_cert = XXX to be used in the
config file.
- Googlephotos
- Added warning for Google Photos compatability-fixes
- Added warning for Google Photos compatibility-fixes
(raider13209)
- Imagekit
- Return correct error when attempting to upload zero length files
@@ -69958,7 +70206,7 @@ See commits
- Update drive service account guide (Juang, Yi-Lin)
- Fix change notify picking up files outside the root (Nick
Craig-Wood)
- Fix trailing slash mis-identificaton of folder as file (Nick
- Fix trailing slash mis-identification of folder as file (Nick
Craig-Wood)
- Fix incorrect remote after Update on object (Nick Craig-Wood)
- Dropbox
+1 -1
View File
@@ -1 +1 @@
v1.75.0
v1.74.3
+2 -10
View File
@@ -171,7 +171,7 @@ type MultiPartCreateRequest struct {
Mime string `json:"mime"`
Size int64 `json:"size"`
Extension string `json:"extension"`
ParentID json.Number `json:"parent_id"`
ParentID json.Number `json:"parentId"`
RelativePath string `json:"relativePath"`
WorkspaceID string `json:"workspaceId,omitempty"`
}
@@ -222,7 +222,7 @@ type MultiPartEntriesRequest struct {
Filename string `json:"filename"`
Size int64 `json:"size"`
ClientExtension string `json:"clientExtension"`
ParentID json.Number `json:"parent_id"`
ParentID json.Number `json:"parentId"`
RelativePath string `json:"relativePath"`
WorkspaceID string `json:"workspaceId,omitempty"`
}
@@ -238,14 +238,6 @@ type MultiPartAbort struct {
Key string `json:"key"`
}
// FolderPathResponse is returned by GET /folders/{hash}/path
//
// Path is the breadcrumb from the drive root down to the requested folder.
type FolderPathResponse struct {
Status string `json:"status"`
Path []Item `json:"path"`
}
// SpaceUsageResponse is returned by GET /user/space-usage
type SpaceUsageResponse struct {
Used int64 `json:"used"`
+86 -92
View File
@@ -15,7 +15,6 @@ should stay under that.
import (
"context"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
@@ -147,14 +146,6 @@ and these uploads do not fully utilize your bandwidth, then increasing
this may help to speed up the transfers.`,
Default: 4,
Advanced: true,
}, {
Name: "upload_cutoff",
Help: `Cutoff for switching to chunked upload.
Any files larger than this will be uploaded in chunks of chunk_size.
The minimum is 0 and the maximum is 5 GiB.`,
Default: defaultUploadCutoff,
Advanced: true,
}, {
Name: config.ConfigEncoding,
Help: config.ConfigEncodingHelp,
@@ -200,16 +191,13 @@ type Options struct {
// Fs represents a remote drime
type Fs struct {
name string // name of this remote
root string // the path we are working on
opt Options // parsed options
features *fs.Features // optional features
srv *rest.Client // the connection to the server
dirCache *dircache.DirCache // Map of directory path to directory id
pacer *fs.Pacer // pacer for API calls
absRootOnce *sync.Once // protects absRoot computation
absRoot string // absolute path of f.root from drive root
absRootErr error // error from computing absRoot, if any
name string // name of this remote
root string // the path we are working on
opt Options // parsed options
features *fs.Features // optional features
srv *rest.Client // the connection to the server
dirCache *dircache.DirCache // Map of directory path to directory id
pacer *fs.Pacer // pacer for API calls
}
// Object describes a drime object
@@ -282,6 +270,11 @@ var retryErrorCodes = []int{
503, // Service Unavailable
504, // Gateway Timeout
509, // Bandwidth Limit Exceeded
520, // Cloudflare: Web server returns an unknown error
521, // Cloudflare: Web server is down
522, // Cloudflare: Connection timed out
523, // Cloudflare: Origin is unreachable
524, // Cloudflare: A timeout occurred
}
// shouldRetry returns a boolean as to whether this resp and err
@@ -334,62 +327,6 @@ func (f *Fs) getItem(ctx context.Context, id string, dirID string, leaf string)
return info, err
}
// idToAbsolutePath returns the absolute path (from the user's drive root) of
// the folder with the given ID.
//
// Drime exposes GET /folders/{hash}/path which returns the breadcrumb from
// drive root down to the folder. The hash format is undocumented but
// observed to be base64("<id>|") - every item drime returns has a `hash`
// field of that shape (e.g. id 704791396 => "NzA0NzkxMzk2fA"). The docs
// example "MTExMzQ0fHBhZA" decodes to "111344|pad", so a non-empty suffix
// after the pipe is also accepted; if drime ever starts requiring a
// specific suffix this will break.
//
// Returns "" for an empty/zero ID (drive root).
func (f *Fs) idToAbsolutePath(ctx context.Context, id string) (string, error) {
if id == "" || id == "0" {
return "", nil
}
hash := base64.StdEncoding.EncodeToString([]byte(id + "|"))
opts := rest.Opts{
Method: "GET",
Path: "/folders/" + hash + "/path",
Parameters: url.Values{},
}
if f.opt.WorkspaceID != "" {
opts.Parameters.Set("workspaceId", f.opt.WorkspaceID)
}
var result api.FolderPathResponse
var resp *http.Response
err := f.pacer.Call(func() (bool, error) {
var err error
resp, err = f.srv.CallJSON(ctx, &opts, nil, &result)
return shouldRetry(ctx, resp, err)
})
if err != nil {
return "", fmt.Errorf("failed to get folder path for %q: %w", id, err)
}
parts := make([]string, 0, len(result.Path))
for _, item := range result.Path {
parts = append(parts, f.opt.Enc.ToStandardName(item.Name))
}
return path.Join(parts...), nil
}
// absoluteRoot returns the absolute path from the drive root to the Fs root.
// Computed once and cached.
func (f *Fs) absoluteRoot(ctx context.Context) (string, error) {
f.absRootOnce.Do(func() {
rootID, err := f.dirCache.RootID(ctx, false)
if err != nil {
f.absRootErr = err
return
}
f.absRoot, f.absRootErr = f.idToAbsolutePath(ctx, rootID)
})
return f.absRoot, f.absRootErr
}
// errorHandler parses a non 2xx error response into an error
func errorHandler(resp *http.Response) error {
body, err := rest.ReadBody(resp)
@@ -430,12 +367,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
client := fshttp.NewClient(ctx)
f := &Fs{
name: name,
root: root,
opt: *opt,
srv: rest.NewClient(client).SetRoot(rootURL),
pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))),
absRootOnce: new(sync.Once),
name: name,
root: root,
opt: *opt,
srv: rest.NewClient(client).SetRoot(rootURL),
pacer: fs.NewPacer(ctx, pacer.NewDefault(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))),
}
f.features = (&fs.Features{
CanHaveEmptyDirectories: true,
@@ -588,7 +524,7 @@ func (f *Fs) listAll(ctx context.Context, dirID string, directoriesOnly bool, fi
Parameters: url.Values{},
}
if dirID != "" {
opts.Parameters.Add("parentIds", dirID)
opts.Parameters.Add("folderId", dirID)
}
if directoriesOnly {
opts.Parameters.Add("type", api.ItemTypeFolder)
@@ -848,10 +784,16 @@ func (f *Fs) patch(ctx context.Context, id, attribute string, value string) (ite
Name: value,
}
var result api.UpdateItemResponse
// The drime origin returns a malformed response (seen by Cloudflare as
// a 520) for a literal PUT to this endpoint, so use a POST with Laravel
// method spoofing instead - the API routes it to the same handler.
opts := rest.Opts{
Method: "PUT",
Method: "POST",
Path: "/file-entries/" + id,
Parameters: url.Values{},
ExtraHeaders: map[string]string{
"X-HTTP-Method-Override": "PUT",
},
}
if f.opt.WorkspaceID != "" {
opts.Parameters.Set("workspaceId", f.opt.WorkspaceID)
@@ -985,6 +927,48 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object,
return dstObj, nil
}
// countDirChildren returns the number of direct children of dirID.
func (f *Fs) countDirChildren(ctx context.Context, dirID string) (int, error) {
n := 0
_, err := f.listAll(ctx, dirID, false, false, "", func(*api.Item) bool {
n++
return false
})
return n, err
}
// waitForDirChildren polls dirID until it lists at least want direct
// children, or the timeout elapses. Drime's folder rename has visible
// eventual-consistency on the children listing - the rename returns
// success immediately but the renamed folder lists as empty for a
// short window - so callers that rename a folder use this to wait for
// the listing to settle before returning (see issue #9450).
func (f *Fs) waitForDirChildren(ctx context.Context, dirID string, want int) error {
const timeout = 30 * time.Second
deadline := time.Now().Add(timeout)
backoff := 100 * time.Millisecond
for {
got, err := f.countDirChildren(ctx, dirID)
if err != nil {
return err
}
if got >= want {
return nil
}
if time.Now().After(deadline) {
return fmt.Errorf("timed out waiting for directory listing to settle: got %d, want %d", got, want)
}
select {
case <-ctx.Done():
return ctx.Err()
case <-time.After(backoff):
}
if backoff < 2*time.Second {
backoff *= 2
}
}
}
// DirMove moves src, srcRemote to this remote at dstRemote
// using server-side move operations.
//
@@ -1005,11 +989,25 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
return err
}
// Count children before the move so we can wait for the server's
// children listing to reflect the rename - see waitForDirChildren.
preCount, err := f.countDirChildren(ctx, srcID)
if err != nil {
return fmt.Errorf("DirMove: count source children: %w", err)
}
// Do the move
_, err = f.moveTo(ctx, srcID, srcLeaf, dstLeaf, srcDirectoryID, dstDirectoryID)
info, err := f.moveTo(ctx, srcID, srcLeaf, dstLeaf, srcDirectoryID, dstDirectoryID)
if err != nil {
return err
}
if preCount > 0 {
if err := f.waitForDirChildren(ctx, info.ID.String(), preCount); err != nil {
fs.Logf(f, "DirMove: %v (continuing)", err)
}
}
srcFs.dirCache.FlushDir(srcRemote)
return nil
}
@@ -1162,14 +1160,10 @@ func (f *Fs) OpenChunkWriter(ctx context.Context, remote string, src fs.ObjectIn
return info, nil, err
}
// The /s3/multipart/create and /s3/entries endpoints interpret
// relativePath as an absolute path from the drive root, not relative to
// parent_id. Resolve our root's absolute path so we can build it.
absRoot, err := f.absoluteRoot(ctx)
if err != nil {
return info, nil, fmt.Errorf("failed to resolve absolute path of root: %w", err)
}
relPath := f.opt.Enc.FromStandardPath(path.Join(absRoot, remote))
// Send just the leaf as relativePath, matching the single-part /uploads
// convention. The file is placed by parentId; sending an absolute path
// here makes the server build folders from it and drop "0" path segments.
relPath := f.opt.Enc.FromStandardName(leaf)
// Temporary Object under construction
o := &Object{
+11 -4
View File
@@ -3034,11 +3034,18 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object,
remote = remote[:len(remote)-len(ext)]
}
_, srcParentID, err := srcObj.fs.dirCache.FindPath(ctx, src.Remote(), false)
if err != nil {
return nil, err
// Find the ID of the parent to remove the file from.
var srcParentID string
if len(srcObj.parents) == 1 {
srcParentID = srcObj.parents[0]
} else {
var err error
_, srcParentID, err = srcObj.fs.dirCache.FindPath(ctx, src.Remote(), false)
if err != nil {
return nil, err
}
srcParentID = actualID(srcParentID)
}
srcParentID = actualID(srcParentID)
// Temporary Object under construction
dstInfo, err := f.createFileInfo(ctx, remote, src.ModTime(ctx))
+78
View File
@@ -681,6 +681,83 @@ func (f *Fs) InternalTestSingleQuoteFolder(t *testing.T) {
assert.NoError(t, err)
}
// TestIntegration/FsMkdir/FsPutFiles/Internal/MoveDuplicateParent
//
// Check that moving a file removes it from its real parent even when there
// are two directories with the same name and the directory cache resolves the
// path to the wrong duplicate. Otherwise the file ends up with two parents
// which fails on shared drives with a teamDrivesParentLimit error (#9472).
func (f *Fs) InternalTestMoveDuplicateParent(t *testing.T) {
ctx := context.Background()
if f.Features().Move == nil {
t.Skip("Move not supported")
}
rootID, err := f.dirCache.RootID(ctx, false)
require.NoError(t, err)
const dupName = "dup9472"
const dstName = "dst9472"
const fileName = "michael.txt"
// Create the first "dup9472" directory - this is the one the directory
// cache will resolve the path to.
dirA, err := f.createDir(ctx, rootID, dupName, nil)
require.NoError(t, err)
f.dirCache.Put(dupName, dirA.Id)
// Create a second directory with the SAME name and parent: a duplicate
// the directory cache does not know about.
dirB, err := f.createDir(ctx, rootID, dupName, nil)
require.NoError(t, err)
// Destination directory
dirDst, err := f.createDir(ctx, rootID, dstName, nil)
require.NoError(t, err)
defer func() {
_ = f.delete(ctx, dirA.Id, false)
_ = f.delete(ctx, dirB.Id, false)
_ = f.delete(ctx, dirDst.Id, false)
f.dirCache.Flush()
}()
// Upload a file directly into dirB (the duplicate the cache doesn't know).
createInfo := &drive.File{
Name: fileName,
Parents: []string{dirB.Id},
}
var fileInfo *drive.File
err = f.pacer.Call(func() (bool, error) {
fileInfo, err = f.svc.Files.Create(createInfo).
Media(strings.NewReader("9472 duplicate parent test")).
Fields(f.getFileFields(ctx)).
SupportsAllDrives(true).
Context(ctx).Do()
return f.shouldRetry(ctx, err)
})
require.NoError(t, err)
require.Equal(t, []string{dirB.Id}, fileInfo.Parents)
// Sanity check: the directory cache resolves the path to dirA, not the
// dirB the file actually lives in.
gotDirID, err := f.dirCache.FindDir(ctx, dupName, false)
require.NoError(t, err)
require.Equal(t, dirA.Id, gotDirID, "directory cache should resolve to the wrong duplicate")
// Build the source object pointing at the file in dirB and move it.
srcObj, err := f.newObjectWithInfo(ctx, dupName+"/"+fileName, fileInfo)
require.NoError(t, err)
dstObj, err := f.Move(ctx, srcObj, dstName+"/"+fileName)
require.NoError(t, err)
// The moved file must have exactly one parent: the destination.
movedInfo, err := f.getFile(ctx, dstObj.(fs.IDer).ID(), "id,parents")
require.NoError(t, err)
assert.Equal(t, []string{dirDst.Id}, movedInfo.Parents)
}
func (f *Fs) InternalTest(t *testing.T) {
// These tests all depend on each other so run them as nested tests
t.Run("DocumentImport", func(t *testing.T) {
@@ -701,6 +778,7 @@ func (f *Fs) InternalTest(t *testing.T) {
t.Run("Query", f.InternalTestQuery)
t.Run("AgeQuery", f.InternalTestAgeQuery)
t.Run("SingleQuoteFolder", f.InternalTestSingleQuoteFolder)
t.Run("MoveDuplicateParent", f.InternalTestMoveDuplicateParent)
t.Run("ShouldRetry", f.InternalTestShouldRetry)
}
+1 -9
View File
@@ -52,21 +52,13 @@ func (f *Fs) testUploadTimeout(t *testing.T) {
ci.Timeout = saveTimeout
}()
ci.LowLevelRetries = 1
ci.Timeout = fs.Duration(idleTimeout)
upload := func(concurrency int, shutTimeout time.Duration) (obj fs.Object, err error) {
// Use the saved (long) timeout while NewFs dials the FTP control
// connection and reads the welcome banner. On slow CI servers this
// can take longer than idleTimeout, which would cause a spurious
// i/o timeout before the test can run. The connection's idle
// deadline is captured at dial time, so the data connection
// dialled later inside Put will still get idleTimeout - which is
// what the test is actually trying to exercise.
ci.Timeout = saveTimeout
fixFs := deriveFs(ctx, t, f, settings{
"concurrency": concurrency,
"shut_timeout": shutTimeout,
})
ci.Timeout = fs.Duration(idleTimeout)
// Make test object
fileTime := fstest.Time("2020-03-08T09:30:00.000000000Z")
-13
View File
@@ -156,7 +156,6 @@ type Fs struct {
endpoint *url.URL
endpointURL string // endpoint as a string
httpClient *http.Client
fileName string // set if we are pointing to a file
}
// Object is a remote object that has been stat'd (so it exists, but is not necessarily open for reading)
@@ -298,7 +297,6 @@ func (f *Fs) httpConnection(ctx context.Context, opt *Options) (isFile bool, err
if isFile {
// Correct root if definitely pointing to a file
f.fileName = path.Base(f.root)
f.root = path.Dir(f.root)
if f.root == "." || f.root == "/" {
f.root = ""
@@ -566,17 +564,6 @@ func (f *Fs) readDir(ctx context.Context, dir string) (names []string, err error
// This should return ErrDirNotFound if the directory isn't
// found.
func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) {
// pointed at a single file: only that file is visible
if f.fileName != "" {
if dir != "" {
return nil, fs.ErrorDirNotFound
}
obj, err := f.NewObject(ctx, f.fileName)
if err != nil {
return nil, err
}
return fs.DirEntries{obj}, nil
}
if !strings.HasSuffix(dir, "/") && dir != "" {
dir += "/"
}
+1 -13
View File
@@ -331,19 +331,7 @@ func TestIsAFileRoot(t *testing.T) {
f, err := NewFs(context.Background(), remoteName, "one%.txt", m)
assert.Equal(t, err, fs.ErrorIsFile)
entries, err := f.List(context.Background(), "")
require.NoError(t, err)
require.Equal(t, 1, len(entries))
e := entries[0]
assert.Equal(t, "one%.txt", e.Remote())
assert.Equal(t, int64(5+lineEndSize), e.Size())
_, ok := e.(*Object)
assert.True(t, ok)
_, err = f.List(context.Background(), "anysub")
assert.Equal(t, fs.ErrorDirNotFound, err)
testListRoot(t, f, false)
}
func TestIsAFileSubDir(t *testing.T) {
+32 -3
View File
@@ -25,6 +25,13 @@ const (
authEndpoint = "https://idmsa.apple.com/appleauth/auth"
)
// Webservice keys in AccountInfo.Webservices map
const (
WsDrive = "drivews"
WsDocs = "docws"
WsPhotos = "ckdatabasews"
)
type sessionSave func(*Session)
// Client defines the client configuration
@@ -32,6 +39,7 @@ type Client struct {
appleID string
password string
remoteName string // rclone remote name, used for cache namespacing
pcsWSKey string // webservice key for PCS cookie scoping (e.g. WsDrive, WsPhotos)
srv *rest.Client
Session *Session
sessionSaveCallback sessionSave
@@ -41,11 +49,14 @@ type Client struct {
}
// New creates a new iCloud API client and initializes its HTTP session
func New(appleID, password, trustToken string, clientID string, cookies []*http.Cookie, sessionSaveCallback sessionSave, remoteName string) (*Client, error) {
// pcsWSKey scopes PCS cookie acquisition to the caller's webservice (WsDrive, WsPhotos);
// empty string skips PCS entirely
func New(appleID, password, trustToken string, clientID string, cookies []*http.Cookie, sessionSaveCallback sessionSave, remoteName string, pcsWSKey string) (*Client, error) {
icloud := &Client{
appleID: strings.ToLower(appleID), // Apple SRP requires lowercase in client-side proof
password: password,
remoteName: filepath.Base(remoteName),
pcsWSKey: pcsWSKey,
srv: rest.NewClient(fshttp.NewClient(context.Background())),
Session: NewSession(),
sessionSaveCallback: sessionSaveCallback,
@@ -75,8 +86,8 @@ func (c *Client) DriveService() (*DriveService, error) {
func (c *Client) Request(ctx context.Context, opts rest.Opts, request any, response any) (resp *http.Response, err error) {
resp, err = c.Session.Request(ctx, opts, request, response)
if err != nil && resp != nil {
// try to reauth
if resp.StatusCode == 401 || resp.StatusCode == 421 {
// 401/421 = session expired, 423 = missing PCS cookies (ADP)
if resp.StatusCode == 401 || resp.StatusCode == 421 || resp.StatusCode == 423 {
err = c.Authenticate(ctx)
if err != nil {
return nil, err
@@ -95,6 +106,24 @@ func (c *Client) Request(ctx context.Context, opts rest.Opts, request any, respo
func (c *Client) Authenticate(ctx context.Context) error {
c.mu.Lock()
defer c.mu.Unlock()
if err := c.authenticateSession(ctx); err != nil {
return err
}
// Ensure PCS cookies after any successful auth path (ADP accounts)
acquired, err := c.Session.ensurePCSCookies(ctx, c.pcsWSKey)
if err != nil {
return err
}
if acquired && c.sessionSaveCallback != nil {
c.sessionSaveCallback(c.Session)
}
return nil
}
// authenticateSession establishes a valid session via the cheapest available path
func (c *Client) authenticateSession(ctx context.Context) error {
// Skip /validate round-trip when saved session has cookies + service endpoints
// Native client behavior: use cached session, reauth lazily on 401/421
if c.Session.Cookies != nil && len(c.Session.AccountInfo.Webservices) > 0 {
+1 -1
View File
@@ -33,7 +33,7 @@ type DriveService struct {
// NewDriveService creates a new DriveService instance.
func NewDriveService(icloud *Client) (*DriveService, error) {
return &DriveService{icloud: icloud, RootID: "FOLDER::com.apple.CloudDocs::root", endpoint: icloud.Session.AccountInfo.Webservices["drivews"].URL, docsEndpoint: icloud.Session.AccountInfo.Webservices["docws"].URL}, nil
return &DriveService{icloud: icloud, RootID: "FOLDER::com.apple.CloudDocs::root", endpoint: icloud.Session.AccountInfo.Webservices[WsDrive].URL, docsEndpoint: icloud.Session.AccountInfo.Webservices[WsDocs].URL}, nil
}
// GetItemByDriveID retrieves a DriveItem by its Drive ID.
+9 -2
View File
@@ -510,7 +510,7 @@ func (album *Album) SetTestPhotoCache(cache map[string]*Photo) {
// NewPhotosService creates a new PhotosService instance
func NewPhotosService(ctx context.Context, client *Client, pacer *fs.Pacer, shouldRetry ShouldRetryFunc) (*PhotosService, error) {
service, exists := client.Session.AccountInfo.Webservices["ckdatabasews"]
service, exists := client.Session.AccountInfo.Webservices[WsPhotos]
if !exists || service.Status != "active" {
return nil, fmt.Errorf("ckdatabasews service not available")
}
@@ -605,6 +605,13 @@ func (ps *PhotosService) discoverLibraries(ctx context.Context) (*libraryDiscove
continue
}
name := zone.ZoneID.ZoneName
// Only PrimarySync and SharedSync-* are photo libraries. Other
// zones (e.g. CMM-* shared-album zones) appear in changes/database
// but have no CPLAlbumByPositionLive index, so querying their
// albums returns BAD_REQUEST / "Index has invalid data".
if name != "PrimarySync" && !strings.HasPrefix(name, "SharedSync") {
continue
}
// SharedSync-* found in private takes precedence over shared
if _, exists := result.libraries[name]; exists {
continue
@@ -2313,7 +2320,7 @@ func (ps *PhotosService) requestWithReauth(ctx context.Context, makeOpts func()
reauthDone := false
return ps.pacer.Call(func() (bool, error) {
resp, err := ps.client.Session.Request(ctx, makeOpts(), data, response)
if !reauthDone && err != nil && resp != nil && (resp.StatusCode == 401 || resp.StatusCode == 421) {
if !reauthDone && err != nil && resp != nil && (resp.StatusCode == 401 || resp.StatusCode == 421 || resp.StatusCode == 423) {
reauthDone = true
if authErr := ps.client.Authenticate(ctx); authErr != nil {
return false, authErr
+70 -46
View File
@@ -495,7 +495,7 @@ func (s *Session) getSRPAuthHeaders() map[string]string {
return headers
}
// AuthWithToken authenticates the session
// AuthWithToken authenticates the session with the account login endpoint
func (s *Session) AuthWithToken(ctx context.Context) error {
values := map[string]any{
"accountCountryCode": s.AccountCountry,
@@ -522,86 +522,110 @@ func (s *Session) AuthWithToken(ctx context.Context) error {
fs.Debugf(nil, "iclouddrive: accountLogin response cookies: %v", cookieDebugSummaries(resp.Cookies()))
fs.Debugf(nil, "iclouddrive: session cookie jar after accountLogin: %v", cookieJarDebugSummaries(s.Cookies))
// Acquire PCS cookies if Advanced Data Protection is enabled
if ws := s.AccountInfo.Webservices["ckdatabasews"]; ws != nil && ws.PcsRequired {
fs.Debugf(nil, "iclouddrive: ADP detected (pcsRequired=true)")
if s.hasPCSCookies() {
fs.Debugf(nil, "iclouddrive: PCS cookies already present, skipping acquisition")
} else {
if err := s.acquirePCSCookies(ctx); err != nil {
return err
}
}
} else {
fs.Debugf(nil, "iclouddrive: no ADP (pcsRequired=false)")
}
return nil
}
// hasPCSCookies checks if the required PCS cookies for Photos are already present
func (s *Session) hasPCSCookies() bool {
var hasPhotos, hasSharing bool
for _, c := range s.Cookies {
switch c.Name {
case "X-APPLE-WEBAUTH-PCS-Photos":
hasPhotos = true
case "X-APPLE-WEBAUTH-PCS-Sharing":
hasSharing = true
}
}
return hasPhotos && hasSharing
type pcsService struct {
wsKey string
appName string
cookies []string
}
// acquirePCSCookies requests PCS cookies for ADP-enabled accounts
// pcsServices lists all services that need PCS cookies
// appName values from icloud.com JS (Build 2616/19)
var pcsServices = []pcsService{
{WsPhotos, "photos", []string{"X-APPLE-WEBAUTH-PCS-Photos", "X-APPLE-WEBAUTH-PCS-Sharing"}},
{WsDrive, "iclouddrive", []string{"X-APPLE-WEBAUTH-PCS-Documents"}},
}
func (s *Session) hasPCSCookiesFor(names []string) bool {
for _, name := range names {
if !slices.ContainsFunc(s.Cookies, func(c *http.Cookie) bool { return c.Name == name }) {
return false
}
}
return true
}
// ensurePCSCookies checks whether the session needs PCS cookies for the given
// webservice and acquires them if missing, returning true if new cookies were acquired
func (s *Session) ensurePCSCookies(ctx context.Context, pcsWSKey string) (bool, error) {
if pcsWSKey == "" {
return false, nil
}
for _, pcs := range pcsServices {
if pcs.wsKey != pcsWSKey {
continue
}
ws := s.AccountInfo.Webservices[pcs.wsKey]
if ws == nil || !ws.PcsRequired {
return false, nil
}
if s.hasPCSCookiesFor(pcs.cookies) {
return false, nil
}
fs.Debugf(nil, "iclouddrive: ADP detected, acquiring PCS cookies for %s", pcs.appName)
if err := s.acquirePCSCookiesFor(ctx, pcs.appName, pcs.cookies); err != nil {
return false, err
}
return true, nil
}
return false, nil
}
// acquirePCSCookiesFor requests PCS cookies for a specific service on ADP-enabled accounts
// May require user approval on a trusted device (polls every 10s, max 5 min)
func (s *Session) acquirePCSCookies(ctx context.Context) error {
fs.Logf(nil, "iclouddrive: Advanced Data Protection enabled, requesting PCS cookies")
const maxAttempts = 30 // 30 * 10s = 5 minutes max
for attempt := 0; attempt < maxAttempts; attempt++ {
fs.Debugf(nil, "iclouddrive: requestPCS outgoing cookies: %v", cookieJarDebugSummaries(s.Cookies))
func (s *Session) acquirePCSCookiesFor(ctx context.Context, appName string, cookies []string) error {
fs.Logf(nil, "iclouddrive: Advanced Data Protection enabled, requesting PCS cookies for %s", appName)
const maxAttempts = 30
for range maxAttempts {
fs.Debugf(nil, "iclouddrive: requestPCS(%s) outgoing cookies: %v", appName, cookieJarDebugSummaries(s.Cookies))
values := map[string]any{
"appName": "photos",
"appName": appName,
"derivedFromUserAction": true,
}
body, err := IntoReader(values)
if err != nil {
return fmt.Errorf("requestPCS: %w", err)
return fmt.Errorf("requestPCS(%s): %w", appName, err)
}
opts := rest.Opts{
Method: "POST",
Path: "/requestPCS",
ExtraHeaders: s.GetHeaders(map[string]string{}),
RootURL: setupEndpoint,
Body: body,
}
opts.Body = body
var pcsResp struct {
Status string `json:"status"`
Message string `json:"message"`
}
resp, err := s.Request(ctx, opts, nil, &pcsResp)
if err != nil {
return fmt.Errorf("requestPCS: %w", err)
return fmt.Errorf("requestPCS(%s): %w", appName, err)
}
fs.Debugf(nil, "iclouddrive: requestPCS response cookies: %v", cookieDebugSummaries(resp.Cookies()))
fs.Debugf(nil, "iclouddrive: requestPCS response: status=%q message=%q cookies=%d",
pcsResp.Status, pcsResp.Message, len(resp.Cookies()))
fs.Debugf(nil, "iclouddrive: requestPCS(%s) response: status=%q message=%q cookies=%d %v",
appName, pcsResp.Status, pcsResp.Message, len(resp.Cookies()), cookieDebugSummaries(resp.Cookies()))
if pcsResp.Status == "success" {
if !s.hasPCSCookies() {
return fmt.Errorf("requestPCS: server returned success but PCS cookies missing")
if !s.hasPCSCookiesFor(cookies) {
var missing []string
for _, name := range cookies {
if !slices.ContainsFunc(s.Cookies, func(c *http.Cookie) bool { return c.Name == name }) {
missing = append(missing, name)
}
}
return fmt.Errorf("requestPCS(%s): server returned success but cookies still missing: %v", appName, missing)
}
fs.Logf(nil, "iclouddrive: PCS cookies acquired")
fs.Logf(nil, "iclouddrive: PCS cookies acquired for %s", appName)
return nil
}
// Device consent required - poll until approved
fs.Logf(nil, "iclouddrive: waiting for device approval for PCS (%s)", pcsResp.Message)
fs.Logf(nil, "iclouddrive: waiting for device approval for PCS/%s (%s)", appName, pcsResp.Message)
select {
case <-ctx.Done():
return ctx.Err()
case <-time.After(10 * time.Second):
}
}
return fmt.Errorf("requestPCS: timed out waiting for device approval after 5 minutes")
return fmt.Errorf("requestPCS(%s): timed out waiting for device approval after 5 minutes", appName)
}
// RequestPushNotification explicitly requests a push notification to trusted devices
+5 -3
View File
@@ -96,7 +96,7 @@ func resumeConfigClient(m configmap.Mapper, appleid, password, trustToken, clien
if err != nil {
return nil, nil, err
}
icloud, err := api.New(appleid, password, trustToken, clientID, cookies, nil, "_config")
icloud, err := api.New(appleid, password, trustToken, clientID, cookies, nil, "_config", "")
if err != nil {
return nil, nil, err
}
@@ -280,7 +280,7 @@ func Config(ctx context.Context, name string, m configmap.Mapper, config fs.Conf
// Force fresh SRP authentication - ignore stale trust token and cookies
// so that reconnect always prompts for 2FA
m.Set(configAuthSession, "")
icloud, err := api.New(appleid, password, "", clientID, nil, nil, "_config")
icloud, err := api.New(appleid, password, "", clientID, nil, nil, "_config", "")
if err != nil {
return nil, err
}
@@ -410,7 +410,8 @@ func Config(ctx context.Context, name string, m configmap.Mapper, config fs.Conf
// newICloudClient parses options, authenticates, and returns a ready client
// Shared between NewFs (Drive) and NewFsPhotos (Photos) to avoid duplication
func newICloudClient(ctx context.Context, name string, m configmap.Mapper) (*api.Client, *Options, error) {
// pcsWSKey scopes PCS cookie acquisition to the caller's service
func newICloudClient(ctx context.Context, name string, m configmap.Mapper, pcsWSKey string) (*api.Client, *Options, error) {
opt := new(Options)
err := configstruct.Set(m, opt)
if err != nil {
@@ -442,6 +443,7 @@ func newICloudClient(ctx context.Context, name string, m configmap.Mapper) (*api
cookies,
callback,
name,
pcsWSKey,
)
if err != nil {
return nil, nil, err
+1 -1
View File
@@ -677,7 +677,7 @@ func retryResultUnknown(ctx context.Context, resp *http.Response, err error) (bo
// NewFs constructs an Fs from the path, container:path
func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) {
icloud, opt, err := newICloudClient(ctx, name, m)
icloud, opt, err := newICloudClient(ctx, name, m, api.WsDrive)
if err != nil {
return nil, err
}
+1 -1
View File
@@ -59,7 +59,7 @@ type PhotosObject struct {
// NewFsPhotos constructs an Fs for Photos from the path, container:path
func NewFsPhotos(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, error) {
icloud, opt, err := newICloudClient(ctx, name, m)
icloud, opt, err := newICloudClient(ctx, name, m, api.WsPhotos)
if err != nil {
return nil, err
}
+1
View File
@@ -91,6 +91,7 @@ func getServices() []service {
{"letsgo", "Let's Go Cloud (Germany)", "letsgo.jotta.cloud", "letsgo", "desktop-win", []string{"openid", "offline_access"}},
{"mediamarkt", "MediaMarkt Cloud (Multiregional)", "mediamarkt.jottacloud.com", "mediamarkt", "desktop", []string{"openid", "jotta-default", "offline_access"}},
{"onlime", "Onlime (Denmark)", "cloud-auth.onlime.dk", "onlime_wl", "desktop", []string{"openid", "jotta-default", "offline_access"}},
{"phonero", "Phonero Sky", "sky.phonero.no", "phonero", "desktop-win", []string{"openid", "offline_access"}},
{"tele2", "Tele2 Cloud (Sweden)", "mittcloud-auth.tele2.se", "comhem", "desktop", []string{"openid", "jotta-default", "offline_access"}},
{"telia_no", "Telia Sky (Norway)", "sky-auth.telia.no", "get", "desktop", []string{"openid", "jotta-default", "offline_access"}},
{"telia_se", "Telia Cloud (Sweden)", "cloud-auth.telia.se", "telia_se", "desktop", []string{"openid", "jotta-default", "offline_access"}},
-23
View File
@@ -280,17 +280,6 @@ enabled, rclone will no longer update the modtime after copying a file.`,
Default: false,
Advanced: true,
},
{
Name: "fatal_if_no_space",
Help: `Make out-of-space errors fatal during transfers.
When enabled, an ENOSPC error during a write returns a fatal error so
that rclone aborts rather than retrying the operation. Useful for
backup scripts that should halt loudly on a full disk rather than spin
retrying.`,
Default: false,
Advanced: true,
},
{
Name: "time_type",
Help: `Set what kind of time is returned.
@@ -360,7 +349,6 @@ type Options struct {
NoPreAllocate bool `config:"no_preallocate"`
NoSparse bool `config:"no_sparse"`
NoSetModTime bool `config:"no_set_modtime"`
FatalIfNoSpace bool `config:"fatal_if_no_space"`
TimeType timeType `config:"time_type"`
Hashes fs.CommaSepList `config:"hashes"`
Enc encoder.MultiEncoder `config:"encoding"`
@@ -1422,19 +1410,8 @@ func (nwc nopWriterCloser) Close() error {
return nil
}
// isDiskFullError returns true if err indicates the underlying filesystem
// has run out of space.
func isDiskFullError(err error) bool {
return errors.Is(err, file.ErrDiskFull) || fserrors.IsErrNoSpace(err)
}
// Update the object from in with modTime and size
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) {
defer func() {
if err != nil && o.fs.opt.FatalIfNoSpace && isDiskFullError(err) {
err = fserrors.FatalError(err)
}
}()
var out io.WriteCloser
var hasher *hash.MultiHasher
@@ -1,98 +0,0 @@
//go:build !plan9
// Tests for the FatalIfNoSpace option and isDiskFullError helper.
//
// Kept in a separate file with a !plan9 build tag because syscall.ENOSPC
// is not portable to plan9, mirroring the split in
// fs/fserrors/enospc_error.go vs fs/fserrors/enospc_error_notsupported.go.
package local
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"syscall"
"testing"
"time"
"github.com/rclone/rclone/fs/fserrors"
"github.com/rclone/rclone/fs/object"
"github.com/rclone/rclone/fstest"
"github.com/rclone/rclone/lib/file"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// errReader is an io.Reader that always returns the configured error,
// used to inject a synthetic disk-full failure into Update's io.Copy.
type errReader struct{ err error }
func (r errReader) Read(p []byte) (int, error) { return 0, r.err }
// TestIsDiskFullError covers the helper used by the Update defer.
func TestIsDiskFullError(t *testing.T) {
cases := []struct {
name string
err error
want bool
}{
{"nil", nil, false},
{"unrelated error", errors.New("unrelated error"), false},
{"syscall.ENOSPC direct", syscall.ENOSPC, true},
{"syscall.ENOSPC wrapped", fmt.Errorf("io.Copy: %w", syscall.ENOSPC), true},
{"file.ErrDiskFull direct", file.ErrDiskFull, true},
{"file.ErrDiskFull wrapped", fmt.Errorf("preallocate: %w", file.ErrDiskFull), true},
{"os.PathError wrapping ENOSPC", &os.PathError{Op: "write", Path: "/foo", Err: syscall.ENOSPC}, true},
{"os.SyscallError wrapping ENOSPC", os.NewSyscallError("write", syscall.ENOSPC), true},
{"os.PathError wrapping unrelated", &os.PathError{Op: "write", Path: "/foo", Err: syscall.EPERM}, false},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
assert.Equal(t, c.want, isDiskFullError(c.err))
})
}
}
// updateWithReader runs Update with an injected reader error and the given
// FatalIfNoSpace setting, returning the error from Update.
func updateWithReader(t *testing.T, fatalIfNoSpace bool, readerErr error) error {
t.Helper()
r := fstest.NewRun(t)
f := r.Flocal.(*Fs)
f.opt.FatalIfNoSpace = fatalIfNoSpace
src := object.NewStaticObjectInfo("test.txt", time.Now(), 100, true, nil, f)
o := &Object{
fs: f,
remote: "test.txt",
path: filepath.Join(r.LocalName, "test.txt"),
}
return o.Update(context.Background(), errReader{err: readerErr}, src)
}
// TestUpdateFatalIfNoSpaceOff verifies an ENOSPC during a write is NOT
// wrapped as fatal when the option is off.
func TestUpdateFatalIfNoSpaceOff(t *testing.T) {
err := updateWithReader(t, false, syscall.ENOSPC)
require.Error(t, err)
assert.False(t, fserrors.IsFatalError(err), "ENOSPC must not be fatal when FatalIfNoSpace=false")
}
// TestUpdateFatalIfNoSpaceOn verifies an ENOSPC during a write IS wrapped as
// fatal when the option is on.
func TestUpdateFatalIfNoSpaceOn(t *testing.T) {
err := updateWithReader(t, true, syscall.ENOSPC)
require.Error(t, err)
assert.True(t, fserrors.IsFatalError(err), "ENOSPC must be fatal when FatalIfNoSpace=true")
}
// TestUpdateFatalIfNoSpaceOnButNotDiskFull verifies non-disk-full errors are
// NOT wrapped as fatal even when the option is on.
func TestUpdateFatalIfNoSpaceOnButNotDiskFull(t *testing.T) {
err := updateWithReader(t, true, errors.New("unrelated network error"))
require.Error(t, err)
assert.False(t, fserrors.IsFatalError(err), "non-disk-full errors must not be fatal regardless of option")
}
+4
View File
@@ -81,6 +81,10 @@ func (o *Object) getXattr() (metadata fs.Metadata, err error) {
}
metadata[k] = string(v)
}
// Return nil if all xattrs were filtered out (e.g. com.apple.provenance on macOS)
if len(metadata) == 0 {
return nil, nil
}
return metadata, nil
}
+1 -1
View File
@@ -969,7 +969,7 @@ func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) {
}
if o.digests != nil {
return *o.digests, nil
return strings.ToLower(*o.digests), nil
}
// sha1 not cached: we fetch and try to obtain the sha1 of the link
+11 -4
View File
@@ -1,10 +1,17 @@
name: Mega
description: MEGA S4 Object Storage
endpoint:
s3.eu-central-1.s4.mega.io: Mega S4 eu-central-1 (Amsterdam)
s3.eu-central-2.s4.mega.io: Mega S4 eu-central-2 (Bettembourg)
s3.ca-central-1.s4.mega.io: Mega S4 ca-central-1 (Montreal)
s3.ca-west-1.s4.mega.io: Mega S4 ca-west-1 (Vancouver)
s3.eu-amsterdam.megas4.com: Mega S4 Amsterdam
s3.eu-luxembourg.megas4.com: Mega S4 Luxembourg
s3.eu-paris.megas4.com: Mega S4 Paris
s3.eu-barcelona.megas4.com: Mega S4 Barcelona
s3.ca-montreal.megas4.com: Mega S4 Montreal
s3.ca-vancouver.megas4.com: Mega S4 Vancouver
s3.ap-tokyo.megas4.com: Mega S4 Tokyo
s3.eu-central-1.s4.mega.io: Mega S4 eu-central-1 (Amsterdam, legacy)
s3.eu-central-2.s4.mega.io: Mega S4 eu-central-2 (Bettembourg, legacy)
s3.ca-central-1.s4.mega.io: Mega S4 ca-central-1 (Montreal, legacy)
s3.ca-west-1.s4.mega.io: Mega S4 ca-west-1 (Vancouver, legacy)
bucket_acl: true
quirks:
list_version: 2
+1 -1
View File
@@ -371,7 +371,7 @@ this may help to speed up the transfers.`,
If this is true (the default) then rclone will use path style access,
if false then rclone will use virtual path style. See [the AWS S3
docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro)
docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html)
for more info.
Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to
+1 -1
View File
@@ -88,7 +88,7 @@ func init() {
if opt.RefreshToken == "" {
return fs.ConfigGoto("username")
}
return fs.ConfigConfirm("refresh", true, "config_refresh", "Token already configured - replace it?")
return fs.ConfigConfirm("refresh", true, "config_refresh", "Already have a token - refresh?")
case "refresh":
if config.Result == "false" {
return nil, nil
+1
View File
@@ -796,6 +796,7 @@ func (f *Fs) listAll(ctx context.Context, dir string, directoriesOnly bool, file
ExtraHeaders: map[string]string{
"Depth": depth,
},
AuthRedirect: f.opt.AuthRedirect, // allow redirects to preserve Auth
}
if f.hasOCMD5 || f.hasOCSHA1 {
opts.Body = bytes.NewBuffer(owncloudProps)
+39
View File
@@ -12,6 +12,7 @@ import (
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config/configfile"
"github.com/rclone/rclone/fs/config/configmap"
"github.com/rclone/rclone/fs/config/obscure"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -81,6 +82,44 @@ func TestHeaders(t *testing.T) {
require.NoError(t, err)
}
// TestListAllAuthRedirect checks auth_redirect is honoured on listAll PROPFIND.
func TestListAllAuthRedirect(t *testing.T) {
var targetAuth string
var targetHits int
target := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
targetHits++
targetAuth = r.Header.Get("Authorization")
_, err := fmt.Fprint(w, `<d:multistatus xmlns:d="DAV:"></d:multistatus>`)
require.NoError(t, err)
}))
defer target.Close()
// Redirect via a different hostname so net/http strips Authorization on cross-host redirect.
targetURL := strings.Replace(target.URL, "127.0.0.1", "localhost", 1)
source := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, targetURL+r.URL.Path, http.StatusTemporaryRedirect)
}))
defer source.Close()
configfile.Install()
m := configmap.Simple{
"type": "webdav",
"url": source.URL,
"user": "alice",
"pass": obscure.MustObscure("secret"),
"auth_redirect": "true",
}
f, err := webdav.NewFs(context.Background(), remoteName, "", m)
require.NoError(t, err)
_, _ = f.List(context.Background(), "")
assert.GreaterOrEqual(t, targetHits, 1, "redirect target should receive the request")
assert.NotEmpty(t, targetAuth, "Authorization header should be preserved across redirect")
}
// TestReservedCharactersInPathAreEscaped verifies that reserved characters
// like semicolons and equals signs in file paths are percent-encoded in
// HTTP requests to the WebDAV server (RFC 3986 compliance).
-2
View File
@@ -25,7 +25,6 @@ import (
"github.com/rclone/rclone/fs/cache"
"github.com/rclone/rclone/fs/config/configfile"
"github.com/rclone/rclone/fs/config/configflags"
profiles "github.com/rclone/rclone/fs/config/configprofiles"
"github.com/rclone/rclone/fs/config/flags"
"github.com/rclone/rclone/fs/filter"
"github.com/rclone/rclone/fs/fserrors"
@@ -537,7 +536,6 @@ func AddBackendFlags() {
func Main() {
setupRootCommand(Root)
AddBackendFlags()
profiles.AddProfiles(context.Background(), Root)
if err := Root.Execute(); err != nil {
if strings.HasPrefix(err.Error(), "unknown command") && selfupdateEnabled {
Root.PrintErrf("You could use '%s selfupdate' to get latest features.\n\n", Root.CommandPath())
-16
View File
@@ -26,7 +26,6 @@ func init() {
configCommand.AddCommand(configTouchCommand)
configCommand.AddCommand(configPathsCommand)
configCommand.AddCommand(configShowCommand)
configCommand.AddCommand(configProfileCommand)
configCommand.AddCommand(configRedactedCommand)
configCommand.AddCommand(configDumpCommand)
configCommand.AddCommand(configProvidersCommand)
@@ -124,21 +123,6 @@ var configShowCommand = &cobra.Command{
},
}
var configProfileCommand = &cobra.Command{
Use: "profile",
Short: `Manage saved profiles of flags.`,
Long: `Manage saved profiles of flags, stored in the config file under
"[profile:NAME]" sections.
Use the save, list, show and delete subcommands. See ` + "`rclone config profile --help`" + `
for the full list, and the [Profiles](/docs/#profiles) section of the
docs for an overview of the feature.`,
Annotations: map[string]string{
"versionIntroduced": "v1.66",
},
Aliases: []string{"profiles"},
}
var configRedactedCommand = &cobra.Command{
Use: "redacted [<remote>]",
Short: `Print redacted (decrypted) config file, or the redacted config for a single remote.`,
-161
View File
@@ -1,161 +0,0 @@
// Profile subcommands for `rclone config profile`.
package config
import (
"context"
"errors"
"fmt"
"os"
"github.com/rclone/rclone/cmd"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config"
profiles "github.com/rclone/rclone/fs/config/configprofiles"
"github.com/rclone/rclone/fs/config/flags"
"github.com/spf13/cobra"
)
func init() {
configProfileCommand.AddCommand(configProfileListCommand)
configProfileCommand.AddCommand(configProfileShowCommand)
configProfileCommand.AddCommand(configProfileDeleteCommand)
configProfileCommand.AddCommand(configProfileSaveCommand)
flags.FVarP(configProfileSaveCommand.Flags(), &profileSaveFlagsFrom,
"flags-from", "",
"Import command-specific flags from these subcommands (comma separated)", "")
configProfileSaveCommand.PersistentPreRunE = profileSaveAddFlagsFrom
configProfileSaveCommand.FParseErrWhitelist.UnknownFlags = true
}
// profileSaveFlagsFrom backs --flags-from on `rclone config profile save`.
var profileSaveFlagsFrom fs.CommaSepList
var configProfileListCommand = &cobra.Command{
Use: "list",
Short: "List the profiles in the config file.",
Annotations: map[string]string{
"versionIntroduced": "v1.72",
},
RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(0, 0, command, args)
profiles.ShowProfiles()
return nil
},
}
var configProfileShowCommand = &cobra.Command{
Use: "show NAME",
Short: "Show the flags saved in a profile.",
Annotations: map[string]string{
"versionIntroduced": "v1.72",
},
RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 1, command, args)
name := args[0]
section := config.ProfileSectionPrefix + name
if !config.LoadedData().HasSection(section) {
return fmt.Errorf("no profile named %q", name)
}
fmt.Print(profiles.SprintSection(section))
return nil
},
}
var configProfileDeleteCommand = &cobra.Command{
Use: "delete NAME",
Short: "Delete a profile.",
Annotations: map[string]string{
"versionIntroduced": "v1.72",
},
RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 1, command, args)
name := args[0]
section := config.ProfileSectionPrefix + name
if !config.LoadedData().HasSection(section) {
return fmt.Errorf("no profile named %q", name)
}
config.LoadedData().DeleteSection(section)
if err := config.LoadedData().Save(); err != nil {
return fmt.Errorf("failed to save config: %w", err)
}
return nil
},
}
var configProfileSaveCommand = &cobra.Command{
Use: "save NAME [args...]",
Short: "Save the given flags (and optional args) as a reusable profile.",
Long: `Save a profile under NAME built from the flags (and, if
` + "`--profile-save-args`" + ` is set, the positional arguments) passed
on this command line.
Without ` + "`--flags-from`" + ` only global rclone flags can be saved. To
save flags that belong to a specific command (e.g. VFS flags from
` + "`rclone mount`" + ` or bisync-specific flags), import that command's
flag set with ` + "`--flags-from CMD[,CMD...]`" + `.
`,
Annotations: map[string]string{
"versionIntroduced": "v1.72",
},
RunE: func(command *cobra.Command, args []string) error {
cmd.CheckArgs(1, 100, command, args)
name := args[0]
ctx := context.Background()
opt := profiles.ProfileOptFromCtx(ctx)
p := profiles.NewProfile(name)
p.NewFromCommand(command, args[1:])
return p.Save(ctx, &opt)
},
}
// profileSaveAddFlagsFrom is the PersistentPreRunE for
// `rclone config profile save`. It interprets --flags-from, merges in
// the requested commands' flag sets, then re-parses the command line so
// the newly-added flags pick up their values.
func profileSaveAddFlagsFrom(saveCmd *cobra.Command, args []string) error {
// The first parse was done with UnknownFlags=true so --verbose may
// have been counted; preserve its current value across the reparse.
var verboseSaved string
if vf := saveCmd.Flags().Lookup("verbose"); vf != nil {
verboseSaved = vf.Value.String()
defer func() {
if err := vf.Value.Set(verboseSaved); err != nil {
fs.Errorf(nil, "error restoring --verbose: %v", err)
}
}()
}
for _, sub := range profileSaveFlagsFrom {
sc, _, err := cmd.Root.Find([]string{sub})
if err != nil {
return fmt.Errorf("--flags-from %s: %w", sub, err)
}
if sc == cmd.Root {
return fmt.Errorf("--flags-from %s: not a known subcommand", sub)
}
saveCmd.Flags().AddFlagSet(sc.Flags())
}
// Re-parse strictly now that the flag set is complete.
saveCmd.FParseErrWhitelist.UnknownFlags = false
flagArgs, err := argsAfterCommand(saveCmd)
if err != nil {
return err
}
return saveCmd.ParseFlags(flagArgs)
}
// argsAfterCommand returns the portion of os.Args that came after the
// chain of cobra command names leading to cmd.
func argsAfterCommand(cmd *cobra.Command) ([]string, error) {
depth := 0
for c := cmd; c != nil; c = c.Parent() {
depth++
}
if depth > len(os.Args) {
return nil, errors.New("internal error: command depth exceeds os.Args length")
}
return os.Args[depth:], nil
}
+1 -1
View File
@@ -1 +1 @@
1.1.7
1.1.8
BIN
View File
Binary file not shown.
-2
View File
@@ -14,7 +14,6 @@ import (
"strings"
"sync"
"github.com/go-chi/chi/v5/middleware"
"github.com/rclone/rclone/cmd"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/rc"
@@ -192,7 +191,6 @@ For more help see [the GUI docs](/gui/).
if err != nil || spaHandler == nil {
return fmt.Errorf("failed to start GUI handler: %w", err)
}
guiServer.Router().Use(middleware.Compress(5))
guiServer.Router().Get("/*", spaHandler.ServeHTTP)
guiServer.Router().Head("/*", spaHandler.ServeHTTP)
guiServer.Serve()
-37
View File
@@ -2,7 +2,6 @@ package gui
import (
"archive/zip"
"compress/gzip"
"io"
iofs "io/fs"
"net/http"
@@ -12,8 +11,6 @@ import (
"strings"
"testing"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -305,37 +302,3 @@ func TestHandlerSPAFallbackDeepPath(t *testing.T) {
assert.Equal(t, http.StatusOK, resp.StatusCode)
assert.Contains(t, string(body), "<div id=\"root\"></div>")
}
func TestHandlerServesGzip(t *testing.T) {
dir := writeTestDir(t)
srcFS, cleanup, err := guiSourceFS(dir)
require.NoError(t, err)
t.Cleanup(func() { _ = cleanup() })
h, err := guiHandler(srcFS)
require.NoError(t, err)
// Build a chi router with Compress middleware, mirroring the
// production setup in the gui command.
r := chi.NewRouter()
r.Use(middleware.Compress(5))
r.Get("/*", h.ServeHTTP)
req := httptest.NewRequest("GET", "/", nil)
req.Header.Set("Accept-Encoding", "gzip")
w := httptest.NewRecorder()
r.ServeHTTP(w, req)
resp := w.Result()
assert.Equal(t, http.StatusOK, resp.StatusCode)
assert.Equal(t, "gzip", resp.Header.Get("Content-Encoding"),
"response should be gzip-encoded when client accepts it")
// Decompress and verify the content is correct.
gr, err := gzip.NewReader(resp.Body)
require.NoError(t, err)
body, err := io.ReadAll(gr)
require.NoError(t, err)
require.NoError(t, gr.Close())
assert.Contains(t, string(body), `<div id="root"></div>`)
}
+13
View File
@@ -271,7 +271,20 @@ func (ds *dirStream) Next() (de fuse.DirEntry, errno syscall.Errno) {
func (ds *dirStream) Close() {
}
// Seekdir implements fusefs.FileSeekdirer so go-fuse can rewind the directory
// stream when the kernel calls lseek(fd, 0, SEEK_SET) before a second getdents.
// Without this, go-fuse returns ENOTSUP and ls returns empty on every call after
// the first. See: https://github.com/hanwen/go-fuse/issues/549
func (ds *dirStream) Seekdir(_ context.Context, off uint64) syscall.Errno {
if off == 0 {
ds.i = 0
return 0
}
return syscall.ENOTSUP
}
var _ fusefs.DirStream = (*dirStream)(nil)
var _ fusefs.FileSeekdirer = (*dirStream)(nil)
// Readdir opens a stream of directory entries.
//
+28 -2
View File
@@ -38,7 +38,22 @@ func (v vfsHandler) Fileread(r *sftp.Request) (io.ReaderAt, error) {
}
func (v vfsHandler) Filewrite(r *sftp.Request) (io.WriterAt, error) {
file, err := v.OpenFile(r.Filepath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0777)
// Respect the flags requested in the SFTP OPEN packet
p := r.Pflags()
flags := os.O_WRONLY
if p.Append {
flags |= os.O_APPEND
}
if p.Creat {
flags |= os.O_CREATE
}
if p.Trunc {
flags |= os.O_TRUNC
}
if p.Excl {
flags |= os.O_EXCL
}
file, err := v.OpenFile(r.Filepath, flags, 0777)
if err != nil {
return nil, err
}
@@ -49,7 +64,18 @@ func (v vfsHandler) Filecmd(r *sftp.Request) error {
switch r.Method {
case "Setstat":
attr := r.Attributes()
if attr.Mtime != 0 {
flags := r.AttrFlags()
// A size attribute is a request to truncate the file
if flags.Size {
node, err := v.Stat(r.Filepath)
if err != nil {
return err
}
if err := node.Truncate(int64(attr.Size)); err != nil {
return err
}
}
if flags.Acmodtime {
modTime := time.Unix(int64(attr.Mtime), 0)
err := v.Chtimes(r.Filepath, modTime, modTime)
if err != nil {
+183
View File
@@ -0,0 +1,183 @@
// Test the SFTP serve handler against a real server and client.
//
// We skip tests on platforms with troublesome character mappings
//go:build !windows && !darwin && !plan9
package sftp
import (
"context"
"io"
"os"
"strings"
"testing"
"github.com/pkg/sftp"
_ "github.com/rclone/rclone/backend/local"
"github.com/rclone/rclone/cmd/serve/proxy"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/vfs/vfscommon"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/ssh"
)
// startTestServer starts an sftp server serving a temporary local directory
// with the given VFS options and returns a connected sftp client.
func startTestServer(t *testing.T, vfsOpt *vfscommon.Options) *sftp.Client {
ctx := context.Background()
f, err := fs.NewFs(ctx, t.TempDir())
require.NoError(t, err)
opt := Opt
opt.ListenAddr = testBindAddress
opt.User = testUser
opt.Pass = testPass
w, err := newServer(ctx, f, &opt, vfsOpt, &proxy.Opt)
require.NoError(t, err)
go func() {
_ = w.Serve()
}()
t.Cleanup(func() {
assert.NoError(t, w.Shutdown())
})
clientConfig := &ssh.ClientConfig{
User: testUser,
Auth: []ssh.AuthMethod{ssh.Password(testPass)},
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
conn, err := ssh.Dial("tcp", w.Addr().String(), clientConfig)
require.NoError(t, err)
t.Cleanup(func() {
_ = conn.Close()
})
client, err := sftp.NewClient(conn)
require.NoError(t, err)
t.Cleanup(func() {
_ = client.Close()
})
return client
}
// Test that re-opening a file for write without the truncate flag preserves
// the data already written, rather than zeroing the start of the file.
//
// This reproduces a corruption seen with WinSCP "Process in Background", which
// resumes an upload on a second connection by re-opening the partial file
// without SSH_FXF_TRUNC and writing from the offset it had reached.
func TestFilewriteResumeNoTruncate(t *testing.T) {
vfsOpt := vfscommon.Opt
vfsOpt.CacheMode = vfscommon.CacheModeWrites
client := startTestServer(t, &vfsOpt)
const (
fileName = "file.bin"
total = 1024 * 1024 // 1 MiB
split = 700 * 1024 // where the upload is "backgrounded"
)
// Deterministic non-zero contents so a zeroed hole is easy to spot
contents := make([]byte, total)
for i := range contents {
contents[i] = byte(i%251 + 1)
}
// First connection: write the first part with truncate, as a fresh upload
f, err := client.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC)
require.NoError(t, err)
_, err = f.Write(contents[:split])
require.NoError(t, err)
require.NoError(t, f.Close())
// Resume: re-open WITHOUT truncate and write the remainder at its offset
f, err = client.OpenFile(fileName, os.O_WRONLY|os.O_CREATE)
require.NoError(t, err)
_, err = f.WriteAt(contents[split:], int64(split))
require.NoError(t, err)
require.NoError(t, f.Close())
// Read the file back and check it is intact - no zeroed prefix
rd, err := client.Open(fileName)
require.NoError(t, err)
got, err := io.ReadAll(rd)
require.NoError(t, err)
require.NoError(t, rd.Close())
require.Equal(t, total, len(got), "wrong file size")
assert.Equal(t, contents, got, "file contents corrupted on resumed upload")
}
// Test that opening a file for write with the truncate flag does truncate any
// existing data, which is the normal overwrite case for most clients.
func TestFilewriteTruncate(t *testing.T) {
vfsOpt := vfscommon.Opt
vfsOpt.CacheMode = vfscommon.CacheModeWrites
client := startTestServer(t, &vfsOpt)
const fileName = "file.bin"
// Write some initial long contents
require.NoError(t, writeFile(client, fileName, strings.Repeat("A", 1024)))
// Overwrite with shorter contents using truncate
const newContents = "hello"
require.NoError(t, writeFile(client, fileName, newContents))
rd, err := client.Open(fileName)
require.NoError(t, err)
got, err := io.ReadAll(rd)
require.NoError(t, err)
require.NoError(t, rd.Close())
assert.Equal(t, newContents, string(got))
}
// Test that a SETSTAT request with a size attribute truncates the file, rather
// than being silently ignored.
func TestSetstatTruncate(t *testing.T) {
vfsOpt := vfscommon.Opt
vfsOpt.CacheMode = vfscommon.CacheModeWrites
client := startTestServer(t, &vfsOpt)
const fileName = "file.bin"
// Write a file and then truncate it via FSETSTAT (a size attribute) on the
// open handle, the way a client setting the final size of an upload does.
f, err := client.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC)
require.NoError(t, err)
_, err = f.Write([]byte(strings.Repeat("A", 1024)))
require.NoError(t, err)
require.NoError(t, f.Truncate(10))
require.NoError(t, f.Close())
fi, err := client.Stat(fileName)
require.NoError(t, err)
assert.Equal(t, int64(10), fi.Size(), "file not truncated to requested size")
rd, err := client.Open(fileName)
require.NoError(t, err)
got, err := io.ReadAll(rd)
require.NoError(t, err)
require.NoError(t, rd.Close())
assert.Equal(t, strings.Repeat("A", 10), string(got))
}
// writeFile writes contents to fileName via the client truncating any existing
// data, the way a normal upload does.
func writeFile(client *sftp.Client, fileName, contents string) error {
f, err := client.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC)
if err != nil {
return err
}
if _, err := f.Write([]byte(contents)); err != nil {
_ = f.Close()
return err
}
return f.Close()
}
-22
View File
@@ -122,13 +122,6 @@ supported hash on the backend or you can use a named hash such as
"MD5" or "SHA-1". Use the [hashsum](/commands/rclone_hashsum/) command
to see the full list.
### Gzip compression
The server will compress certain response bodies (text and XML, including
WebDAV PROPFIND responses) using gzip when the client advertises gzip
support via the ` + "`Accept-Encoding: gzip`" + ` request header. This reduces
bandwidth usage.
### Access WebDAV on Windows
WebDAV shared folder can be mapped as a drive on Windows, however the default
@@ -243,20 +236,6 @@ type WebDAV struct {
etagHashType hash.Type
}
func webDAVCompressMiddleware() func(http.Handler) http.Handler {
compress := middleware.Compress(5, "text/*", "application/xml")
return func(next http.Handler) http.Handler {
compressedNext := compress(next)
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
if r.Header.Get("Range") != "" {
next.ServeHTTP(rw, r)
return
}
compressedNext.ServeHTTP(rw, r)
})
}
}
// check interface
var _ webdav.FileSystem = (*WebDAV)(nil)
@@ -309,7 +288,6 @@ func newWebDAV(ctx context.Context, f fs.Fs, opt *Options, vfsOpt *vfscommon.Opt
router := w.server.Router()
router.Use(
webDAVCompressMiddleware(),
middleware.SetHeader("Accept-Ranges", "bytes"),
middleware.SetHeader("Server", "rclone/"+fs.Version),
)
+17 -98
View File
@@ -8,7 +8,6 @@
package webdav
import (
"compress/gzip"
"context"
"flag"
"io"
@@ -16,6 +15,7 @@ import (
"os"
"strings"
"testing"
"time"
_ "github.com/rclone/rclone/backend/local"
"github.com/rclone/rclone/cmd/serve/proxy"
@@ -115,6 +115,22 @@ func TestHTTPFunction(t *testing.T) {
assert.NoError(t, w.Shutdown())
}()
testURL := w.server.URLs()[0]
pause := time.Millisecond
i := 0
for ; i < 10; i++ {
resp, err := http.Head(testURL)
if err == nil {
_ = resp.Body.Close()
break
}
// t.Logf("couldn't connect, sleeping for %v: %v", pause, err)
time.Sleep(pause)
pause *= 2
}
if i >= 10 {
t.Fatal("couldn't connect to server")
}
HelpTestGET(t, testURL)
}
@@ -249,103 +265,6 @@ func HelpTestGET(t *testing.T, testURL string) {
}
}
// startAuthenticatedServer creates a webdav server with basic auth against
// the test files directory, starts it, waits for it to be ready, and returns
// the base URL. It registers cleanup to shut the server down.
func startAuthenticatedServer(t *testing.T) string {
t.Helper()
f, err := fs.NewFs(context.Background(), "../http/testdata/files")
require.NoError(t, err)
opt := Opt
opt.HTTP.ListenAddr = []string{testBindAddress}
opt.Template.Path = testTemplate
opt.Auth.BasicUser = testUser
opt.Auth.BasicPass = testPass
w, err := newWebDAV(context.Background(), f, &opt, &vfscommon.Opt, &proxy.Opt)
require.NoError(t, err)
go func() {
require.NoError(t, w.Serve())
}()
t.Cleanup(func() {
assert.NoError(t, w.Shutdown())
})
testURL := w.server.URLs()[0]
return testURL
}
func TestCompressedTextFile(t *testing.T) {
testURL := startAuthenticatedServer(t)
req, err := http.NewRequest("GET", testURL+"two.txt", nil)
require.NoError(t, err)
req.SetBasicAuth(testUser, testPass)
req.Header.Set("Accept-Encoding", "gzip")
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err)
defer func() { _ = resp.Body.Close() }()
assert.Equal(t, http.StatusOK, resp.StatusCode)
assert.Equal(t, "gzip", resp.Header.Get("Content-Encoding"))
gr, err := gzip.NewReader(resp.Body)
require.NoError(t, err)
defer func() { _ = gr.Close() }()
body, err := io.ReadAll(gr)
require.NoError(t, err)
assert.Equal(t, "0123456789\n", string(body))
}
func TestCompressedPROPFIND(t *testing.T) {
testURL := startAuthenticatedServer(t)
req, err := http.NewRequest("PROPFIND", testURL, nil)
require.NoError(t, err)
req.SetBasicAuth(testUser, testPass)
req.Header.Set("Depth", "1")
req.Header.Set("Accept-Encoding", "gzip")
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err)
defer func() { _ = resp.Body.Close() }()
assert.Equal(t, http.StatusMultiStatus, resp.StatusCode)
assert.Equal(t, "gzip", resp.Header.Get("Content-Encoding"))
gr, err := gzip.NewReader(resp.Body)
require.NoError(t, err)
defer func() { _ = gr.Close() }()
body, err := io.ReadAll(gr)
require.NoError(t, err)
assert.Contains(t, string(body), "multistatus")
}
func TestRangeRequestNotCompressed(t *testing.T) {
testURL := startAuthenticatedServer(t)
req, err := http.NewRequest("GET", testURL+"two.txt", nil)
require.NoError(t, err)
req.SetBasicAuth(testUser, testPass)
req.Header.Set("Accept-Encoding", "gzip")
req.Header.Set("Range", "bytes=2-5")
resp, err := http.DefaultClient.Do(req)
require.NoError(t, err)
defer func() { _ = resp.Body.Close() }()
assert.Equal(t, http.StatusPartialContent, resp.StatusCode)
assert.Empty(t, resp.Header.Get("Content-Encoding"))
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
assert.Equal(t, "2345", string(body))
}
func TestRc(t *testing.T) {
servetest.TestRc(t, rc.Params{
"type": "webdav",
-8
View File
@@ -1123,11 +1123,3 @@ put them back in again. -->
- Yakov Till <37628546+Lyapsus@users.noreply.github.com>
- Chris Coughlan <chris@coughlan.io>
- John Volk <volkjohn@users.noreply.github.com>
- 王一赫 <wyihe5220@gmail.com>
- Gustavo V. F. <31892323+Gustavo-V-F@users.noreply.github.com>
- Sven Rebhan <36194019+srebhan@users.noreply.github.com>
- Copilot <223556219+Copilot@users.noreply.github.com>
- KTibow <KTibow@users.noreply.github.com>
- kkocdko <31189892+kkocdko@users.noreply.github.com>
- Tim Schumacher <tim@tschumacher.net>
- ferrumclaudepilgrim <ferrumclaudepilgrim@users.noreply.github.com>
+1 -1
View File
@@ -314,7 +314,7 @@ start and finish the upload) and another 2 requests for each chunk:
/b2api/v1/b2_finish_large_file
```
#### Versions
### Viewing versions with --b2-versions
Versions can be viewed with the `--b2-versions` flag. When it is set
rclone will show and act on older versions of files. For example
+13 -3
View File
@@ -1053,9 +1053,19 @@ encodings.)
The following backends have known issues that need more investigation:
<!--- start list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
- `TestDropbox` (`dropbox`)
- [`TestBisyncRemoteRemote/normalization`](https://pub.rclone.org/integration-tests/current/dropbox-cmd.bisync-TestDropbox-1.txt)
- Updated: 2026-05-01-010013
- `TestFilen` (`filen`)
- [`TestBisyncRemoteRemote/resync_modes`](https://pub.rclone.org/integration-tests/current/filen-cmd.bisync-TestFilen-1.txt)
- [`TestBisyncRemoteRemote/rmdirs`](https://pub.rclone.org/integration-tests/current/filen-cmd.bisync-TestFilen-1.txt)
- `TestHuaweiDrive` (`huaweidrive`)
- [`TestBisyncRemoteLocal/ext_paths`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [`TestBisyncRemoteLocal/extended_filenames`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [`TestBisyncRemoteLocal/normalization`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [`TestBisyncLocalRemote/ext_paths`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [`TestBisyncLocalRemote/extended_filenames`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [4 more](https://pub.rclone.org/integration-tests/current/)
- `TestSeafile` (`seafile`)
- [`TestBisyncLocalRemote/rmdirs`](https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafile-1.txt)
- Updated: 2026-06-05-010010
<!--- end list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
The following backends either have not been tested recently or have known issues
+1 -1
View File
@@ -183,7 +183,7 @@ y) Yes
n) No
y/n> n
Remote config
Token already configured - replace it?
Already have a token - refresh?
y) Yes
n) No
y/n> y
+85 -3
View File
@@ -6,6 +6,88 @@ description: "Rclone Changelog"
# Changelog
## v1.74.3 - 2026-06-05
[See commits](https://github.com/rclone/rclone/compare/v1.74.2...v1.74.3)
- Bug Fixes
- rc
- Fix unauthenticated command execution via `--rc-serve` inline remotes CVE-2026-49980 (Nick Craig-Wood)
- Stop `global.*` connection string options changing config CVE-2026-49980 (Nick Craig-Wood)
- build: Fix multiple CVEs by upgrading to go1.26.4 (Nick Craig-Wood)
- CVE-2026-42504: mime: quadratic complexity in WordDecoder.DecodeHeader
- CVE-2026-42507: net/textproto: arbitrary input are included in errors without any escaping
- CVE-2026-27145: crypto/x509: split candidate hostname only once
- log: Fix wrong source `file:line` in JSON logs from release builds (Nick Craig-Wood)
- mount2: Fix empty directory listings on re-read (Janne Beate Bakeng)
- serve s3: Fix multipart `ListParts` pagination returning wrong part numbers (Nick Craig-Wood)
- serve sftp
- Fix file corruption when a client resumes an upload (Nick Craig-Wood)
- Fix truncate request being silently ignored (Nick Craig-Wood)
- Local
- Fix `getXattr` returning empty map instead of nil (Leon Brocard)
- Drime
- Fix server-side copy and move failing with Cloudflare 520 error (Nick Craig-Wood)
- Fix files being uploaded to the wrong directory (Nick Craig-Wood)
- Remove duplicate upload_cutoff config option (Nick Craig-Wood)
- Fix directory rename leaving the renamed folder empty in VFS (Nick Craig-Wood)
- Drive
- Fix server-side move failing on shared drives with duplicate dirs (Nick Craig-Wood)
- Iclouddrive
- Fix ADP/PCS cookie acquisition for iCloud Drive (Yakov Till)
- Fix "Index has invalid data" error listing iCloud Photos (Nick Craig-Wood)
## v1.74.2 - 2026-05-22
[See commits](https://github.com/rclone/rclone/compare/v1.74.1...v1.74.2)
- Bug Fixes
- build
- Update golang.org/x/net to v0.55.0 to address:
- CVE-2026-42506: html: incorrect handling of namespaced elements in foreign content
- CVE-2026-39821: idna: failure to reject ASCII-only Punycode-encoded labels
- CVE-2026-42502: html: incorrect handling of HTML elements in foreign content
- CVE-2026-25680: html: denial of service when parsing arbitrary HTML
- CVE-2026-25681: html: incorrect handling of character references in DOCTYPE nodes
- CVE-2026-27136: html: duplicate attributes can cause XSS
- Update golang.org/x/crypto to v0.52.0 to address:
- CVE-2026-46598: ssh/agent: pathological inputs can lead to client panic
- CVE-2026-46597: ssh: byte arithmetic causes underflow and panic
- CVE-2026-39828: ssh: bypass of certificate restrictions
- CVE-2026-39835: ssh: server panic during CheckHostKey/Authenticate
- CVE-2026-39833: ssh/agent: key constraints not enforced
- CVE-2026-39832: ssh/agent: agent constraints dropped when forwarding keys
- CVE-2026-39827: ssh: memory leak when rejecting channels can lead to DoS
- CVE-2026-39830: ssh: client can cause server deadlock on unexpected responses
- CVE-2026-39829: ssh: pathological RSA/DSA parameters may cause DoS
- CVE-2026-39831: ssh: bypass of FIDO/U2F security keys physical interaction
- CVE-2026-39834: ssh: infinite loop on large channel writes
- CVE-2026-42508: ssh/knownhosts: auth bypass via unenforced @revoked status
- CVE-2026-46595: ssh: VerifiedPublicKeyCallback permissions skip enforcement
- Update golang.org/x/image to v0.41.0 to address:
- CVE-2026-42500: bmp: panic when reading out of bound palette index
- CVE-2026-33809: tiff: excessive resource consumption in PackBits decompression
- Update golang.org/x/sys to version v0.45.0 to address:
- CVE-2026-39824: windows: integer overflow in NewNTUnicodeString
- Update github.com/go-git/go-billy/v5 to 5.9.0 to fix CVE-2026-44740
- bisync: Fix --conflict-loser pathname with --conflict-resolve newer (nielash)
- gui: Update embedded release to 1.1.8 (Nick Craig-Wood)
- lib/http: Replace deprecated h2c.NewHandler with http.Server.Protocols (Nick Craig-Wood)
- rc: Remove duplicate metrics_addr option registration (Nick Craig-Wood)
- vfs/vfscache: Fix silent write failure when mounting with remote:. (Lucky945H)
- doc fixes (FTCHD, Iizuki, Leon Brocard, Nick Craig-Wood)
- Drime
- Fix file doesn't exists error when trying to delete (John Volk)
- Fix 500 errors when listing shared folders (Alvinwylim)
- Jottacloud
- Support whitelabel service Phonero Sky (Tore Anderson)
- Protondrive
- Fix corrupted on transfer: sha1 hashes differ (William Tange)
- S3
- Add new MEGA S4 endpoints on megas4.com including Asia-Pacific region (Nick Craig-Wood)
- WebDAV
- Honour auth_redirect on listAll PROPFIND (Sai Asish Y)
## v1.74.1 - 2026-05-08
[See commits](https://github.com/rclone/rclone/compare/v1.74.0...v1.74.1)
@@ -540,7 +622,7 @@ description: "Rclone Changelog"
- [OVHcloud Object Storage](/s3/#ovhcloud) (Florent Vennetier)
- [Zata](/s3/#Zata) ($@M@RTH_)
- New Features
- Allow [global config to be overriden or set on backend creation](/docs/#globalconfig) (Nick Craig-Wood)
- Allow [global config to be overridden or set on backend creation](/docs/#globalconfig) (Nick Craig-Wood)
- bisync: Promoted from beta to stable (nielash)
- build
- Update to go1.25 and make go1.24 the minimum required version (Nick Craig-Wood)
@@ -607,7 +689,7 @@ description: "Rclone Changelog"
- This allows `--ca-cert`, `--client-cert` etc to be used.
- This also allows `override.ca_cert = XXX` to be used in the config file.
- Googlephotos
- Added warning for Google Photos compatability-fixes (raider13209)
- Added warning for Google Photos compatibility-fixes (raider13209)
- Imagekit
- Return correct error when attempting to upload zero length files (Nick Craig-Wood)
- Don't low level retry uploads (Nick Craig-Wood)
@@ -1964,7 +2046,7 @@ instead of of `--size-only`, when `check` is not available.
- Add `--drive-env-auth` to get IAM credentials from runtime (Peter Brunner)
- Update drive service account guide (Juang, Yi-Lin)
- Fix change notify picking up files outside the root (Nick Craig-Wood)
- Fix trailing slash mis-identificaton of folder as file (Nick Craig-Wood)
- Fix trailing slash mis-identification of folder as file (Nick Craig-Wood)
- Fix incorrect remote after Update on object (Nick Craig-Wood)
- Dropbox
- Implement `--dropbox-pacer-min-sleep` flag (Nick Craig-Wood)
+3 -3
View File
@@ -232,7 +232,7 @@ rclone [flags]
--drime-list-chunk int Number of items to list in each call (default 1000)
--drime-root-folder-id string ID of the root folder
--drime-upload-concurrency int Concurrency for multipart uploads and copies (default 4)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 5Mi)
--drime-workspace-id string Account ID
--drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded
--drive-allow-import-name-change Allow the filetype to change when uploading Google docs
@@ -624,7 +624,7 @@ rclone [flags]
--metadata-include-from stringArray Read metadata include patterns from file (use - to read from stdin)
--metadata-mapper SpaceSepList Program to run to transforming metadata before upload
--metadata-set stringArray Add metadata key=value when uploading
--metrics-addr stringArray IPaddress:Port or :Port to bind metrics server to
--metrics-addr stringArray IPaddress:Port or :Port to bind server to
--metrics-allow-origin string Origin which cross-domain request (CORS) can be executed from
--metrics-baseurl string Prefix for URLs - leave blank for root
--metrics-cert string TLS PEM key (concatenation of certificate and CA certificate)
@@ -1094,7 +1094,7 @@ rclone [flags]
--use-json-log Use json log format
--use-mmap Use mmap allocator (see docs)
--use-server-modtime Use server modified time instead of object metadata
--user-agent string Set the user-agent to a specified string (default "rclone/v1.74.0")
--user-agent string Set the user-agent to a specified string (default "rclone/v1.74.3")
-v, --verbose count Print lots more stuff (repeat for more)
-V, --version Print the version number
--webdav-auth-redirect Preserve authentication on redirect
+2 -2
View File
@@ -231,12 +231,12 @@ rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,command=e
```console
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}"
// Output: stories/The Quick Brown Fox!-20260501
// Output: stories/The Quick Brown Fox!-20260605
```
```console
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}"
// Output: stories/The Quick Brown Fox!-2026-05-01 0208PM
// Output: stories/The Quick Brown Fox!-2026-06-05 0414PM
```
```console
+1 -237
View File
@@ -542,212 +542,6 @@ If two remotes set the same global variable then the first one instantiated will
be overridden by the second one. A `global.var` will override all other config
methods when the remote is created.
## Profiles {#profiles}
Profiles let you save a named set of flags (and optionally arguments)
in the config file and reuse them on later command lines, so you
don't have to retype long flag combinations every time.
For example, if you regularly sync a directory to Google Drive with a
specific set of flags, you can save that combination once as a
profile and from then on use `--profile mybackup` instead.
### Saving a profile
Add `--profile-save NAME` to any rclone command. The command will run
as normal, and rclone will additionally write all the explicitly-set
flags from that command line into the config file under a new section
named `[profile:NAME]`. The `profile:` prefix is the namespace
profiles live in - because `:` is illegal in remote names, a profile
called `backup` and a remote called `backup` can coexist without
colliding.
For example:
```sh
rclone sync src: dst: --checkers 16 --transfers 8 --metadata --profile-save fast-sync
```
writes:
```ini
[profile:fast-sync]
checkers = 16
transfers = 8
metadata = true
```
Only flags whose values you explicitly changed are saved - flags left
at their default are not.
The profile-control flags themselves (`--profile-save`, `--profile`,
`--profile-save-args`, `--profile-strict-flags`) are never saved
into the profile. `--config` is also excluded - it's
environment-specific and would re-point the config storage mid-load
when applied from a profile.
### Using a profile
Add `--profile NAME` to apply a saved profile:
```sh
rclone sync src: dst: --profile fast-sync
```
This is equivalent to repeating all the flags from the saved profile
on the command line.
You can apply several profiles in one go by passing a comma-separated
list. They are applied in lowest-to-highest priority order, so later
profiles override earlier ones:
```sh
rclone sync src: dst: --profile common,fast-sync
```
Any flag you pass explicitly on the command line overrides the
profile's value for that flag, so you can use a profile as a baseline
and tweak individual values for one run.
For safety, a profile can never turn off `--dry-run` if it was set
explicitly on the command line.
### Including command arguments
By default `--profile-save` only saves flags. If you also want to
save the positional arguments (e.g. the source and destination paths)
add `--profile-save-args`:
```sh
rclone sync /local/path remote:backup --profile-save nightly --profile-save-args
```
When the profile is later used, saved arguments are applied
automatically - you don't need to pass anything extra at use time.
If you pass your own positional arguments on the command line, they
take precedence over the profile's saved ones (the profile only
fills slots you didn't provide).
### Strict flag checking
When you save a profile from one command (say `sync`) and then apply
it to another (say `copy`), the profile may contain flags that don't
exist on the new command. By default these flags are silently
ignored. Pass `--profile-strict-flags` to make rclone error out
instead of skipping them.
### Command-specific flags
Profiles work with the flag set of the command they're saved from
and applied to, so command-specific flags (e.g. the [VFS
flags](/commands/rclone_mount/#vfs-options) on `rclone mount`, or
bisync's `--resilient`) are saved and loaded just like global flags:
```sh
rclone mount remote: /mnt --vfs-cache-mode full --dir-cache-time 24h \
--profile-save media-mount
rclone mount remote: /mnt --profile media-mount
```
The resulting section looks like any other profile:
```ini
[profile:media-mount]
vfs_cache_mode = full
dir_cache_time = 24h0m0s
```
If you later apply this profile to a different command that doesn't
have those flags (e.g. `rclone copy --profile media-mount`), the
VFS flags are silently skipped - or rejected if you also pass
`--profile-strict-flags`.
To build a profile for command-specific flags without actually
running the command, use `rclone config profile save NAME --flags-from CMD`:
```sh
rclone config profile save media-mount --flags-from mount \
--vfs-cache-mode full --dir-cache-time 24h
```
### Inheriting from parent profiles
A profile can inherit settings from one or more parent profiles by
listing them in `parent_profiles` in the config:
```ini
[profile:shared]
checkers = 16
metadata = true
[profile:nightly]
parent_profiles = shared
transfers = 4
```
Parent names are also given in their user-facing form (without the
`profile:` prefix).
Using `--profile nightly` first applies `shared`, then applies
`nightly` on top, so `nightly` overrides any flag the two have in
common. Parents themselves can have parents - profiles are resolved
recursively.
### Always applying a profile
There is no "default profile" mechanism - if you want a profile to
apply every time, set it in the environment instead:
```sh
export RCLONE_PROFILE=mybackup
```
`--profile` is exposed as a standard rclone option, so the
`RCLONE_PROFILE` environment variable Just Works. Use a shell
alias or wrapper script if you want different defaults in different
contexts. This keeps "what flags am I actually running with" answerable
from the command line and environment alone, with no spooky action
from the config file.
### Managing profiles
Use the `rclone config profile` subcommands to manage profiles
without editing the config file by hand:
```sh
rclone config profile save NAME [args...] [flags...]
rclone config profile list
rclone config profile show NAME
rclone config profile delete NAME
```
- `save` writes a new profile from the flags (and optional positional
args, with `--profile-save-args`) given on the command line.
Pass `--flags-from CMD[,CMD...]` to make flags from other commands
(e.g. `mount`, `bisync`) available for saving without having to
actually run those commands.
- `list` prints the names of all profiles in the config file.
- `show` prints the keys and values stored in one profile.
- `delete` removes a profile.
To edit an existing profile, either re-save it (overwriting the old
one) or edit the corresponding `[profile:NAME]` section in the
config file by hand.
### Config file layout
Profiles live under the `[profile:NAME]` namespace in the config
file. The `profile:` prefix is the canonical signal that a section
is a profile - `:` is illegal in remote names, so profiles and
remotes can share a name without colliding. Profile sections are
hidden from `rclone listremotes`, `rclone config show <remote>` and
the rc API's `config/dump` (they don't appear as remotes).
Saved flags are written with their option name in snake_case (e.g.
`drive-skip-gdocs` becomes `drive_skip_gdocs = true`). Saved
arguments are written as `arg_1 = ...`, `arg_2 = ...` and so on.
## Quoting and the shell
When you are typing commands to your computer you are using something
@@ -1418,7 +1212,7 @@ Windows and `/dev/null` on Unix systems, then rclone will keep the
configuration file in memory only.
You may see a log message "Config file not found - using defaults" if there is
no configuration file. This can be supressed, e.g. if you are using rclone
no configuration file. This can be suppressed, e.g. if you are using rclone
entirely with [on the fly remotes](/docs/#backend-path-to-dir), by using
memory-only configuration file or by creating an empty configuration file, as
described above.
@@ -2670,36 +2464,6 @@ See the [Configuration Encryption](#configuration-encryption) for more info.
See a [Windows PowerShell example on the Wiki](https://github.com/rclone/rclone/wiki/Windows-Powershell-use-rclone-password-command-for-Config-file-password).
### --profile CommaSepList
Apply one or more saved profiles to this command, as if their flags
had been typed on the command line. Multiple profiles are
comma-separated and applied lowest-to-highest priority (later
profiles override earlier ones). Explicit command-line flags still
take precedence over the profile. See the [Profiles](#profiles)
section.
### --profile-save string
Save the explicitly-set flags from this command (and optionally its
arguments, with `--profile-save-args`) into the config file as a
reusable profile under the given name. The command still runs as
normal. See the [Profiles](#profiles) section.
### --profile-save-args
When used with `--profile-save`, also save the command's positional
arguments (e.g. the source and destination paths) into the profile.
At use time the saved arguments are applied automatically (the user's
own positional arguments, if any, take precedence). See the
[Profiles](#profiles) section.
### --profile-strict-flags
When used with `--profile`, error out if the profile contains a
flag that isn't valid for the current command. The default is to
silently skip such flags. See the [Profiles](#profiles) section.
### -P, --progress
This flag makes rclone update the stats in a static block in the
+1 -1
View File
@@ -234,7 +234,7 @@ Properties:
- Config: upload_cutoff
- Env Var: RCLONE_DRIME_UPLOAD_CUTOFF
- Type: SizeSuffix
- Default: 200Mi
- Default: 5Mi
#### --drime-chunk-size
+2 -2
View File
@@ -496,7 +496,7 @@ Drive, the size of all files in the Trash and the space used by other
Google services such as Gmail. This command does not take any path
arguments.
#### Import/Export of google documents
### Import/Export of google documents
Google documents can be exported from and uploaded to Google Drive.
@@ -2009,7 +2009,7 @@ Scroll down and click "+ Add users". Add yourself as a test user and press save.
10. Provide the noted client ID and client secret to rclone.
11. Run the web-based authorization flow from within `rclone config`, by answering
"Y" when it asks "Token already configured - replace it?".
"Y" when it asks "Already have a token - refresh?".
Be aware that, due to the "enhanced security" recently introduced by
Google, you are theoretically expected to "submit your app for verification"
+3 -3
View File
@@ -121,7 +121,7 @@ Flags for general networking and HTTP stuff.
--tpslimit float Limit HTTP transactions per second to this
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
--use-cookies Enable session cookiejar
--user-agent string Set the user-agent to a specified string (default "rclone/v1.74.0")
--user-agent string Set the user-agent to a specified string (default "rclone/v1.74.3")
```
@@ -313,7 +313,7 @@ Flags to control the Remote Control API.
Flags to control the Metrics HTTP endpoint..
```
--metrics-addr stringArray IPaddress:Port or :Port to bind metrics server to
--metrics-addr stringArray IPaddress:Port or :Port to bind server to
--metrics-allow-origin string Origin which cross-domain request (CORS) can be executed from
--metrics-baseurl string Prefix for URLs - leave blank for root
--metrics-cert string TLS PEM key (concatenation of certificate and CA certificate)
@@ -519,7 +519,7 @@ Backend-only flags (these can be set in the config file also).
--drime-list-chunk int Number of items to list in each call (default 1000)
--drime-root-folder-id string ID of the root folder
--drime-upload-concurrency int Concurrency for multipart uploads and copies (default 4)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 5Mi)
--drime-workspace-id string Account ID
--drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded
--drive-allow-import-name-change Allow the filetype to change when uploading Google docs
-27
View File
@@ -114,33 +114,6 @@ rclone sync --interactive remote:directory /home/local/directory
This remote is read only - you can't upload files to an HTTP server.
### Servers without directory listings
Rclone normally needs the HTTP server to return a parseable directory
listing in order to discover files. However if the path points
directly at a single file (i.e. it does not end with `/` and the
initial HEAD request reports it as a file), rclone will skip the
parent directory listing entirely and access the file directly.
This means rclone can be used to download individual files on HTTP
servers that have directory listings disabled, as long as you know the
exact URL of each file. For example, given a server that serves
`https://example.com/path/file.txt` but returns an error or an
unparseable response for `https://example.com/path/`:
```console
rclone copy --http-url https://example.com :http:path/file.txt /tmp/
```
You can use this as a remote in other rclone commands too:
```console
rclone hashsum crc32 --http-url "https://getsamplefiles.com" :archive::http:download/zip/sample-1.zip
```
If you just want to download a file or multiple files by URL then
using [copyurl](/commands/rclone_copyurl/) is more efficient.
### Modification times
Most HTTP servers store time accurate to 1 second.
+2
View File
@@ -30,6 +30,8 @@ as described [below](#traditional):
- MediaMarkt
- MediaMarkt Cloud (mediamarkt.jottacloud.com)
- Let's Go Cloud (letsgo.jotta.cloud)
- Phonero
- Phonero Sky (sky.phonero.no)
Paths are specified as `remote:path`
+1 -1
View File
@@ -1243,7 +1243,7 @@ If you see the error above after enabling multi-factor authentication for your
account, you can fix it by refreshing your OAuth refresh token. To do that, run
`rclone config`, and choose to edit your OneDrive backend. Then, you don't need
to actually make any changes until you reach this question:
`Token already configured - replace it?`. For this question, answer `y` and go through
`Already have a token - refresh?`. For this question, answer `y` and go through
the process to refresh your token, just like the first time the backend is
configured. After this, rclone should work again for this backend.
+18
View File
@@ -78,8 +78,26 @@ so you can browse to `http://127.0.0.1:5572/` or `http://127.0.0.1:5572/*`
to see a listing of the remotes. Objects may be requested from
remotes using this syntax `http://127.0.0.1:5572/[remote:path]/path/to/object`
Unless the rc server has authentication configured (`--rc-user`/`--rc-pass`
or `--rc-htpasswd`) or the `--rc-no-auth` flag is set, only remotes already
present in the config file may be served this way. Inline remotes (e.g.
`[:webdav,url=...:]`), connection string parameters and bare local paths are
rejected, since instantiating them from an unauthenticated request could run
commands or read arbitrary local files.
Default Off.
### global.* connection string options and the rc
Remotes instantiated by the rc do not let [connection
string](/docs/#connection-strings) `global.*` options change rclone's
process-wide configuration. Remotes created directly on the command
line or defined in the config file are unaffected.
A `global.*` option still takes effect for the individual backend it
is set on (exactly like an `override.*` option), it just does not leak
into the global config for the rest of the process.
### --rc-serve-no-modtime
Set this flag to skip reading the modification time (can speed things up).
+44 -5
View File
@@ -1273,6 +1273,9 @@ Properties:
- "eu-south-1"
- EU South 1
- Provider: Fastly
- "eu-west-1"
- EU West 1
- Provider: Fastly
- "jp-central-1"
- JP Central 1
- Provider: Fastly
@@ -1285,9 +1288,15 @@ Properties:
- "us-east"
- US East
- Provider: Fastly
- "us-east-1"
- US East 1
- Provider: Fastly
- "us-west"
- US West
- Provider: Fastly
- "us-west-1"
- US West 1
- Provider: Fastly
- "global"
- Global
- Provider: FileLu
@@ -1860,6 +1869,9 @@ Properties:
- "eu-south-1.object.fastlystorage.app"
- EU South 1
- Provider: Fastly
- "eu-west-1.object.fastlystorage.app"
- EU West 1
- Provider: Fastly
- "jp-central-1.object.fastlystorage.app"
- JP Central 1
- Provider: Fastly
@@ -1872,9 +1884,15 @@ Properties:
- "us-east.object.fastlystorage.app"
- US East
- Provider: Fastly
- "us-east-1.object.fastlystorage.app"
- US East 1
- Provider: Fastly
- "us-west.object.fastlystorage.app"
- US West
- Provider: Fastly
- "us-west-1.object.fastlystorage.app"
- US West 1
- Provider: Fastly
- "s5lu.com"
- Global FileLu S5 endpoint
- Provider: FileLu
@@ -2258,17 +2276,38 @@ Properties:
- "br-ne1.magaluobjects.com"
- Fortaleza, CE (BR), br-ne1
- Provider: Magalu
- "s3.eu-amsterdam.megas4.com"
- Mega S4 Amsterdam
- Provider: Mega
- "s3.eu-luxembourg.megas4.com"
- Mega S4 Luxembourg
- Provider: Mega
- "s3.eu-paris.megas4.com"
- Mega S4 Paris
- Provider: Mega
- "s3.eu-barcelona.megas4.com"
- Mega S4 Barcelona
- Provider: Mega
- "s3.ca-montreal.megas4.com"
- Mega S4 Montreal
- Provider: Mega
- "s3.ca-vancouver.megas4.com"
- Mega S4 Vancouver
- Provider: Mega
- "s3.ap-tokyo.megas4.com"
- Mega S4 Tokyo
- Provider: Mega
- "s3.eu-central-1.s4.mega.io"
- Mega S4 eu-central-1 (Amsterdam)
- Mega S4 eu-central-1 (Amsterdam, legacy)
- Provider: Mega
- "s3.eu-central-2.s4.mega.io"
- Mega S4 eu-central-2 (Bettembourg)
- Mega S4 eu-central-2 (Bettembourg, legacy)
- Provider: Mega
- "s3.ca-central-1.s4.mega.io"
- Mega S4 ca-central-1 (Montreal)
- Mega S4 ca-central-1 (Montreal, legacy)
- Provider: Mega
- "s3.ca-west-1.s4.mega.io"
- Mega S4 ca-west-1 (Vancouver)
- Mega S4 ca-west-1 (Vancouver, legacy)
- Provider: Mega
- "oos.eu-west-2.outscale.com"
- Outscale EU West 2 (Paris)
@@ -3624,7 +3663,7 @@ If true use path style access if false use virtual hosted style.
If this is true (the default) then rclone will use path style access,
if false then rclone will use virtual path style. See [the AWS S3
docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro)
docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html)
for more info.
Some providers (e.g. AWS, Aliyun OSS, Netease COS, or Tencent COS) require this set to
+1 -1
View File
@@ -1 +1 @@
v1.75.0
v1.74.3
+5 -25
View File
@@ -566,26 +566,6 @@ var ConfigOptionsInfo = Options{{
Default: "",
Help: "HTTP proxy URL.",
Groups: "Networking",
}, {
Name: "profile_save",
Default: "",
Help: "Save this flag configuration as a reusable preset",
Groups: "Config",
}, {
Name: "profile",
Default: []string{},
Help: "Apply the flag configuration saved with this name. If more than one is provided, priority will be lowest to highest.",
Groups: "Config",
}, {
Name: "profile_save_args",
Default: false,
Help: "When used with --profile-save, also save positional args (e.g. the paths being synced) into the profile",
Groups: "Config",
}, {
Name: "profile_strict_flags",
Default: false,
Help: "If set, --profile will error if any flags are invalid for this command, instead of ignoring.",
Groups: "Config",
}}
// ConfigInfo is filesystem config options
@@ -700,10 +680,6 @@ type ConfigInfo struct {
MaxConnections int `config:"max_connections"`
NameTransform []string `config:"name_transform"`
HTTPProxy string `config:"http_proxy"`
SaveProfile string `config:"profile_save"`
UseProfile CommaSepList `config:"profile"`
ProfileSaveArgs bool `config:"profile_save_args"`
ProfileStrictFlags bool `config:"profile_strict_flags"`
}
func init() {
@@ -826,11 +802,15 @@ func GetConfig(ctx context.Context) *ConfigInfo {
}
// CopyConfig copies the global config (if any) from srcCtx into
// dstCtx returning the new context.
// dstCtx returning the new context. It also copies the rc request
// marker if present.
func CopyConfig(dstCtx, srcCtx context.Context) context.Context {
if srcCtx == nil {
return dstCtx
}
if IsRCRequest(srcCtx) {
dstCtx = WithRCRequest(dstCtx)
}
c := srcCtx.Value(configContextKey)
if c == nil {
return dstCtx
-16
View File
@@ -396,19 +396,6 @@ func SaveConfig() {
fs.Errorf(nil, "Failed to save config after %d tries: %v", ci.LowLevelRetries, err)
}
// ProfileSectionPrefix is the namespace prefix used for profile
// sections in the config file (e.g. [profile:fast-sync]). It lets
// profiles and remotes share the config file without colliding on
// names: a section called "backup" is a remote, "profile:backup" is
// a profile.
const ProfileSectionPrefix = "profile:"
// IsProfileSection reports whether the given section name lives in
// the profiles namespace.
func IsProfileSection(name string) bool {
return strings.HasPrefix(name, ProfileSectionPrefix)
}
// FileSections returns the sections in the config file
func FileSections() []string {
return LoadedData().GetSectionList()
@@ -723,9 +710,6 @@ func DumpRcRemote(name string) (dump rc.Params) {
func DumpRcBlob() (dump rc.Params) {
dump = rc.Params{}
for _, name := range LoadedData().GetSectionList() {
if IsProfileSection(name) {
continue
}
dump[name] = DumpRcRemote(name)
}
return dump
+20 -3
View File
@@ -61,6 +61,23 @@ func AddFlags(ci *fs.ConfigInfo, flagSet *pflag.FlagSet) {
flags.StringVarP(flagSet, &dscp, "dscp", "", "", "Set DSCP value to connections, value or name, e.g. CS1, LE, DF, AF21", "Networking")
}
// ParseHeaders converts the strings passed in via the header flags into HTTPOptions
func ParseHeaders(headers []string) []*fs.HTTPOption {
opts := []*fs.HTTPOption{}
for _, header := range headers {
parts := strings.SplitN(header, ":", 2)
if len(parts) == 1 {
fs.Fatalf(nil, "Failed to parse '%s' as an HTTP header. Expecting a string like: 'Content-Encoding: gzip'", header)
}
option := &fs.HTTPOption{
Key: strings.TrimSpace(parts[0]),
Value: strings.TrimSpace(parts[1]),
}
opts = append(opts, option)
}
return opts
}
// SetFlags sets flags which aren't part of the config system
func SetFlags(ci *fs.ConfigInfo) {
// Process obsolete --dump-headers and --dump-bodies flags
@@ -136,13 +153,13 @@ func SetFlags(ci *fs.ConfigInfo) {
// Process --headers-upload, --headers-download, --headers
if len(uploadHeaders) != 0 {
ci.UploadHeaders = fs.MustParseHeaders(uploadHeaders)
ci.UploadHeaders = ParseHeaders(uploadHeaders)
}
if len(downloadHeaders) != 0 {
ci.DownloadHeaders = fs.MustParseHeaders(downloadHeaders)
ci.DownloadHeaders = ParseHeaders(downloadHeaders)
}
if len(headers) != 0 {
ci.Headers = fs.MustParseHeaders(headers)
ci.Headers = ParseHeaders(headers)
}
// Process --metadata-set
-371
View File
@@ -1,371 +0,0 @@
// Package profiles handles presets for config
package profiles
import (
"context"
"fmt"
"os"
"slices"
"strings"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config"
"github.com/rclone/rclone/fs/config/configflags"
"github.com/rclone/rclone/fs/operations"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
// ignoredFlags are flag names (in profile-key form, i.e. snake_case)
// that must never be persisted into a profile or copied out of one.
//
// "config" is excluded because applying it from a profile would
// re-point the config-file storage mid-Use(), while we're reading
// the profile out of that very file.
var ignoredFlags = []string{"profile", "profile_save", "profile_save_args", "profile_strict_flags", "flags_from", "config"}
const (
argPrefix = "arg_"
parentKey = "parent_profiles"
)
// ProfileOpt stores the settings for Profiles
type ProfileOpt struct {
SaveProfile string // name of profile to save
UseProfile fs.CommaSepList // name(s) of profiles to use
StrictFlags bool // If set, --profile will error if any flags are invalid for this command, instead of ignoring.
SaveArgs bool // When saving, also include positional args (e.g. the paths being synced)
}
// Profile represents a flag/arg configuration to save/use as a reusable preset
type Profile struct {
Name string // the name of the profile
Args []string // command args (ex. the paths being synced)
Flags map[string]string // any flags (command, config, backend...)
Parents []string // see p.GetParents() to get a slice of *Profiles instead
}
// NewProfile returns a new empty *Profile
func NewProfile(name string) *Profile {
return &Profile{
Name: name,
Args: []string{},
Flags: map[string]string{},
Parents: []string{},
}
}
// ProfileOptFromCtx gets a new ProfileOpt from config settings
func ProfileOptFromCtx(ctx context.Context) ProfileOpt {
ci := fs.GetConfig(ctx)
return ProfileOpt{
SaveProfile: ci.SaveProfile,
UseProfile: ci.UseProfile,
StrictFlags: ci.ProfileStrictFlags,
SaveArgs: ci.ProfileSaveArgs,
}
}
// NewFromCommand sets the profile's Args and Flags from the cmd and args passed in
func (p *Profile) NewFromCommand(cmd *cobra.Command, args []string) {
p.Args = args
setProfileVal := func(flag *pflag.Flag) {
key := optionToProfileKey(flag.Name)
if slices.Contains(ignoredFlags, key) {
return
}
if !flag.Changed {
return
}
p.Flags[key] = flag.Value.String()
}
// .Visit() does not visit the flags we add manually via
// --flags-from (in `rclone config profile save`), but .VisitAll()
// with a flag.Changed check does, so use that.
cmd.Flags().VisitAll(setProfileVal)
}
// sectionName returns the config-file section name for the profile
// "name" (e.g. "fast" -> "profile:fast"). Profile.Name itself stays
// in its user-facing form.
func sectionName(name string) string {
return config.ProfileSectionPrefix + name
}
// GetProfile gets a profile from the config
func GetProfile(name string) (*Profile, error) {
p := NewProfile(name)
section := sectionName(p.Name)
data := config.LoadedData()
if !data.HasSection(section) {
return nil, fmt.Errorf("no profile named %q found in config file", p.Name)
}
// Args may appear out of order or be sparse (e.g. arg_3 without
// arg_1) so collect them first then size the slice from the max
// index.
args := map[int]string{}
keys := data.GetKeyList(section)
for _, key := range keys {
if slices.Contains(ignoredFlags, key) {
continue
}
if key == parentKey {
parentList, _ := data.GetValue(section, key)
p.Parents = strings.Split(parentList, ",")
continue
}
if strings.HasPrefix(key, argPrefix) {
i, err := argNum(key)
if err != nil {
return nil, fmt.Errorf("error parsing arg %s: %v", key, err)
}
if i < 0 {
return nil, fmt.Errorf("arg index out of range: %s", key)
}
val, _ := data.GetValue(section, key)
args[i] = val
continue
}
val, _ := data.GetValue(section, key)
p.Flags[key] = val
}
if len(args) > 0 {
maxIdx := -1
for i := range args {
if i > maxIdx {
maxIdx = i
}
}
p.Args = make([]string, maxIdx+1)
for i, v := range args {
p.Args[i] = v
}
}
return p, nil
}
// GetProfiles gets a slice of profiles
func GetProfiles(names []string) ([]*Profile, error) {
profiles := []*Profile{}
for _, name := range names {
p, err := GetProfile(name)
if err != nil {
return nil, err
}
profiles = append(profiles, p)
}
return profiles, nil
}
// UseProfiles gets one or more Profiles from opt.UseProfile and applies them to context (priority: lowest to highest)
func UseProfiles(ctx context.Context, cmd *cobra.Command, args []string, opt *ProfileOpt) error {
for _, profileName := range opt.UseProfile {
err := GetAndUseProfile(ctx, cmd, args, opt, profileName)
if err != nil {
return err
}
}
return nil
}
// GetAndUseProfile gets one Profile and uses it
func GetAndUseProfile(ctx context.Context, cmd *cobra.Command, args []string, opt *ProfileOpt, profileName string) error {
profile, err := GetProfile(profileName)
if err != nil {
return err
}
err = profile.Use(ctx, cmd, args, opt)
if err != nil {
return err
}
return nil
}
// Save saves a profile to the config file
func (p *Profile) Save(ctx context.Context, opt *ProfileOpt) error {
var err error
p.Name, err = validateProfileName(p.Name)
if err != nil {
return err
}
if operations.SkipDestructive(ctx, p.Name, "save profile") {
return nil
}
section := sectionName(p.Name)
data := config.LoadedData()
data.DeleteSection(section) // clear it if already exists
for k, v := range p.Flags {
// Defensive normalisation: callers building a *Profile
// directly may pass keys in either form.
data.SetValue(section, optionToProfileKey(k), v)
}
if opt.SaveArgs {
p.saveArgs()
}
if len(p.Parents) > 0 {
data.SetValue(section, parentKey, strings.Join(p.Parents, ","))
}
if err := data.Save(); err != nil {
return fmt.Errorf("error saving config: %v", err)
}
fs.Debugf(p.Name, "saved profile: %v", SprintSection(sectionName(p.Name)))
return nil
}
func (p *Profile) saveArgs() {
section := sectionName(p.Name)
for i, arg := range p.Args {
config.LoadedData().SetValue(section, argPrefix+fmt.Sprint(i+1), arg)
}
}
// Use sets the current command args and flags from the profile struct
func (p *Profile) Use(ctx context.Context, cmd *cobra.Command, cobraArgs []string, opt *ProfileOpt) error {
// set logging first
ci := fs.GetConfig(ctx)
section := sectionName(p.Name)
if ci.LogLevel == fs.LogLevelNotice {
if verbose, ok := config.FileGetValue(section, "verbose"); ok {
_ = cmd.Flags().Lookup("verbose").Value.Set(verbose)
configflags.SetFlags(ci)
}
}
fs.Debugf(p.Name, "loading profile: %v", SprintSection(section))
err := p.useParents(ctx, cmd, cobraArgs, opt)
if err != nil {
return err
}
err = p.useFlags(ctx, cmd, cobraArgs, opt)
if err != nil {
return err
}
// Apply saved args whenever the profile carries them. Whether or
// not args were saved is a per-profile decision made at save time
// (--profile-save-args); the user shouldn't have to know or
// re-pass that knob at use time.
if len(p.Args) > 0 {
p.useArgs(ctx, cmd, cobraArgs, opt)
}
// Copy any option-backed flag values we just changed (e.g.
// --checkers, --transfers, --metadata, backend flags) out of the
// pflag/options registry and into ConfigInfo.
if err := fs.GlobalOptionsInit(); err != nil {
return fmt.Errorf("failed to reload global options from profile: %w", err)
}
// Re-run configflags.SetFlags() for the hand-rolled flags it owns
// (-v, -q, --bind, --headers, --config, --cache-dir...).
configflags.SetFlags(ci)
return nil
}
func (p *Profile) useFlags(ctx context.Context, cmd *cobra.Command, cobraArgs []string, opt *ProfileOpt) error {
ci := fs.GetConfig(ctx)
for rawKey, val := range p.Flags {
key := optionToProfileKey(rawKey) // tolerate hyphenated keys from external callers
if slices.Contains(ignoredFlags, key) {
continue
}
flag := cmd.Flags().Lookup(profileKeyToFlag(key))
if flag == nil {
if opt.StrictFlags {
return fmt.Errorf("invalid flag: %s", profileKeyToFlag(key))
}
fs.Debugf(p.Name, "ignoring unknown flag %s for this command", profileKeyToFlag(key))
continue
}
if ci.DryRun && key == "dry_run" && val == "false" {
// disallow overriding --dry-run if it was specifically set
fs.Logf(nil, "for safety, profiles cannot change --dry-run from true to false. Ignoring.")
continue
}
logChange(p.Name, key, flag.Value.String(), val)
err := flag.Value.Set(val)
if err != nil {
return fmt.Errorf("%s: error setting val %s from profile: %v", flag.Name, val, err)
}
}
return nil
}
// useArgs fills positional args from the profile's saved Args list,
// but only into slots the user did not provide on the command line.
// We don't CheckArgs() here as the command will do it later; users
// should take care to not exceed MaxArgs.
//
// Args on parent profiles are generally a bad idea (children would
// overwrite parent), but the same precedence rule applies if you
// use them.
func (p *Profile) useArgs(ctx context.Context, cmd *cobra.Command, cobraArgs []string, opt *ProfileOpt) {
userProvided := len(cobraArgs)
for i, pArg := range p.Args { // we DO assume that the p.Args are in the right order here.
if pArg == "" {
continue
}
if i < userProvided {
// User gave an explicit positional arg for this slot - keep it.
continue
}
if i > len(cobraArgs)-1 {
cobraArgs = append(cobraArgs, "")
}
logChange(p.Name, fmt.Sprintf("Arg %d", i+1), cobraArgs[i], pArg)
cobraArgs[i] = pArg
}
// rclone command [args...]
os.Args = append([]string{os.Args[0], os.Args[1]}, cobraArgs...)
os.Args = cleanArgs(os.Args)
}
// allows nested profiles (priority lowest to highest, parents all lower than child)
func (p *Profile) useParents(ctx context.Context, cmd *cobra.Command, args []string, opt *ProfileOpt) error {
if len(p.Parents) == 0 {
return nil
}
newopt := *opt
newopt.UseProfile = p.Parents
return UseProfiles(ctx, cmd, args, &newopt)
}
// GetParents returns the parent profiles of this profile
func (p *Profile) GetParents() ([]*Profile, error) {
return GetProfiles(p.Parents)
}
/*
TODO:
- should we be storing more in memory to cut down on config.LoadedData() calls?
- when profile/key names have illegal characters should we error or auto-convert them? currently we do some of both.
- more tests
- docs
- document handling of blank or default values
- UI could use some cleanup (and see the note there about the use of the word "remote")
- rc methods
- API for other commands (bisync) to save/use profiles
- better handle scenario where logging level passed in is higher than that of the profile we're getting/using...
...probably needs a defer to make sure debugs are seen (if requested) during profile setting, then set the real level (from profile) after
- maybe edit more of the helper functions to use the types and methods instead of modifying config directly
- the ProfileOpt logic maybe needs another look -- slightly confusing that we store the profile name both there and in the profile struct.
- search other TODOs
*/
@@ -1,47 +0,0 @@
package profiles
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestProfileRequested(t *testing.T) {
// Clear any RCLONE_PROFILE* env vars set in the caller's
// environment so they don't leak into the test cases. t.Setenv
// restores them automatically.
t.Setenv("RCLONE_PROFILE", "")
t.Setenv("RCLONE_PROFILE_SAVE", "")
savedArgs := os.Args
defer func() { os.Args = savedArgs }()
cases := []struct {
name string
args []string
env map[string]string
expect bool
}{
{"no flag, no env", []string{"rclone", "ls", "remote:"}, nil, false},
{"--profile NAME", []string{"rclone", "ls", "remote:", "--profile", "x"}, nil, true},
{"--profile=NAME", []string{"rclone", "ls", "remote:", "--profile=x"}, nil, true},
{"--profile-save NAME", []string{"rclone", "ls", "remote:", "--profile-save", "x"}, nil, true},
{"--profile-save=NAME", []string{"rclone", "ls", "remote:", "--profile-save=x"}, nil, true},
{"--profile-save-args alone does not trigger", []string{"rclone", "ls", "remote:", "--profile-save-args"}, nil, false},
{"--profile-strict-flags alone does not trigger", []string{"rclone", "ls", "remote:", "--profile-strict-flags"}, nil, false},
{"RCLONE_PROFILE env var", []string{"rclone", "ls", "remote:"}, map[string]string{"RCLONE_PROFILE": "x"}, true},
{"RCLONE_PROFILE_SAVE env var", []string{"rclone", "ls", "remote:"}, map[string]string{"RCLONE_PROFILE_SAVE": "x"}, true},
{"empty RCLONE_PROFILE does not trigger", []string{"rclone", "ls", "remote:"}, map[string]string{"RCLONE_PROFILE": ""}, false},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
os.Args = c.args
for k, v := range c.env {
t.Setenv(k, v)
}
assert.Equal(t, c.expect, profileRequested())
})
}
}
@@ -1,187 +0,0 @@
// Package profiles handles presets for config
package profiles
import (
"context"
"errors"
"fmt"
"os"
"slices"
"strconv"
"strings"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config"
"github.com/rclone/rclone/fs/config/configfile"
"github.com/rclone/rclone/fs/config/configflags"
"github.com/rclone/rclone/fs/fspath"
fslog "github.com/rclone/rclone/fs/log"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
// AddProfiles handles saving/loading of config profiles
// We do this before Root.Execute() because there's otherwise
// no good way to add args to an already-executing command
func AddProfiles(ctx context.Context, Root *cobra.Command) {
if !profileRequested() {
return
}
cmd, remaining, err := Root.Find(os.Args[1:])
if err != nil {
fs.Fatalf(nil, "Fatal error: %v", err)
}
// Anything under `rclone config` (notably `config profile save`)
// manages profiles directly and must not be intercepted here.
for c := cmd; c != nil; c = c.Parent() {
if c.Name() == "config" {
return
}
}
// Start the logger so debug/info messages from the profile code
// reach the user; the normal cobra.OnInitialize path hasn't run
// yet because Root.Execute() hasn't been called.
fslog.InitLogging()
if err := cmd.Flags().Parse(remaining); err != nil {
fs.Fatalf(nil, "Fatal error: %v", err)
}
ci := fs.GetConfig(ctx)
// The hand-rolled flags (--config, --cache-dir, -v, -q, ...) live
// on pflag.CommandLine rather than on `cmd`, so parse it as well
// to populate the package vars configflags.SetFlags reads from.
if err := pflag.CommandLine.Parse(os.Args[1:]); err != nil {
fs.Fatalf(nil, "Fatal error: %v", err)
}
// Populate ConfigInfo from the option-registry values (covers
// every option-backed flag including --profile, --profile-save,
// and env vars like RCLONE_PROFILE).
if err := fs.GlobalOptionsInit(); err != nil {
fs.Fatalf(nil, "Failed to initialise global options: %v", err)
}
// Apply the hand-rolled flags last - SetFlags writes directly to
// ConfigInfo (e.g. ci.LogLevel from -vv) and would otherwise be
// overwritten by GlobalOptionsInit reloading from the option
// defaults.
configflags.SetFlags(ci)
// Install the config file handler *after* SetFlags has applied
// --config (or RCLONE_CONFIG), otherwise the install is a no-op
// against an empty path and any save goes to an in-memory
// storage that's discarded at exit.
configfile.Install()
if err := HandleProfiles(ctx, cmd, cmd.Flags().Args()); err != nil {
fs.Fatalf(nil, "Fatal error: %v", err)
}
}
// HandleProfiles handles --profile-save and --profile
func HandleProfiles(ctx context.Context, cmd *cobra.Command, args []string) error {
opt := ProfileOptFromCtx(ctx)
if len(opt.UseProfile) > 0 {
err := UseProfiles(ctx, cmd, args, &opt)
if err != nil {
return err
}
}
if opt.SaveProfile != "" {
saveProfile := NewProfile(opt.SaveProfile)
saveProfile.NewFromCommand(cmd, args)
return saveProfile.Save(ctx, &opt)
}
return nil
}
func argNum(key string) (int, error) {
s := strings.TrimPrefix(key, argPrefix)
i, err := strconv.Atoi(s)
if err != nil {
return i, err
}
return i - 1, nil
}
func optionToProfileKey(name string) string {
name = strings.TrimSpace(name)
name = strings.ReplaceAll(name, " ", "_")
return strings.ToLower(strings.ReplaceAll(name, "-", "_"))
}
// note that this is case-insensitive
func profileKeyToFlag(name string) string {
return strings.ToLower(strings.ReplaceAll(name, "_", "-"))
}
func validateKeyName(name string) (convertedName string, err error) {
convertedName = fspath.MakeConfigName(optionToProfileKey(name))
if convertedName != name {
return convertedName, errors.New("invalid characters detected")
}
return convertedName, nil
}
func validateProfileName(name string) (convertedName string, err error) {
// Profiles live in the "profile:" namespace so there is no
// conflict possible with remote names - we only need to validate
// the name's character set.
return validateKeyName(name)
}
func logChange(useProfileName, key, oldval, newval string) {
if oldval == newval {
return
}
if oldval == "" {
oldval = "[blank]"
}
fs.Infof(useProfileName, "changing %s from %s to %s", key, oldval, newval)
}
// SprintSection returns a string of this section from the config file
func SprintSection(name string) string {
keys := config.LoadedData().GetKeyList(name)
s := fmt.Sprintf("\n[%s]\n", name)
for _, key := range keys {
if value, ok := config.FileGetValue(name, key); ok {
s += fmt.Sprintf("%s%s%s\n", key, " = ", value)
}
}
return s
}
func cleanArgs(s []string) []string {
var r []string
// s = s[:cap(s)]
for _, str := range s {
if str != "" {
r = append(r, str)
}
}
return r
}
// profileRequested returns true when the user has asked for profile
// machinery to fire on this invocation, via either a CLI flag or an
// env var.
//
// We need this *before* cobra/options have done any of their work,
// so we look at the raw os.Args / os.Environ directly rather than
// reading from ConfigInfo (which is still populated from defaults
// at this point).
func profileRequested() bool {
if os.Getenv("RCLONE_PROFILE") != "" || os.Getenv("RCLONE_PROFILE_SAVE") != "" {
return true
}
return slices.ContainsFunc(os.Args, func(a string) bool {
// Exact "--profile" / "--profile-save" and their "=value" forms.
// Anything else (e.g. --profile-save-args, --profile-strict-flags)
// is a modifier and does not on its own trigger the profile
// machinery.
return a == "--profile" || strings.HasPrefix(a, "--profile=") ||
a == "--profile-save" || strings.HasPrefix(a, "--profile-save=")
})
}
-389
View File
@@ -1,389 +0,0 @@
package profiles_test
import (
"context"
"os"
"path/filepath"
"sort"
"strings"
"testing"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config"
"github.com/rclone/rclone/fs/config/configfile"
profiles "github.com/rclone/rclone/fs/config/configprofiles"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// newTestCmd returns a cobra.Command with a small synthetic flag set
// covering the flag types the profile code actually has to handle.
//
// It is deliberately decoupled from cmd.Root and the real
// configflags/filterflags registrations: tests should exercise the
// profile machinery against a known, minimal surface rather than
// against the whole of rclone.
func newTestCmd() *cobra.Command {
cmd := &cobra.Command{Use: "test"}
fs := cmd.Flags()
fs.Int("checkers", 8, "Number of checkers")
fs.Bool("checksum", false, "Use checksum")
fs.Bool("metadata", false, "Preserve metadata")
fs.Bool("dry-run", false, "Do a trial run")
fs.String("backup-dir", "", "Backup directory")
fs.String("drive-skip-gdocs", "", "Drive: skip gdocs")
return cmd
}
// useTempConfig points the config subsystem at a fresh empty file
// inside t.TempDir() and registers cleanup to restore the previous
// path.
func useTempConfig(t *testing.T) string {
t.Helper()
configfile.Install()
old := config.GetConfigPath()
path := filepath.Join(t.TempDir(), "rclone.conf")
require.NoError(t, os.WriteFile(path, nil, 0600))
require.NoError(t, config.SetConfigPath(path))
t.Cleanup(func() {
_ = config.SetConfigPath(old)
})
// Make sure we start from an empty in-memory view too.
for _, section := range config.LoadedData().GetSectionList() {
config.LoadedData().DeleteSection(section)
}
return path
}
// parse parses argv into the given command's flag set and returns the
// remaining positional arguments.
func parse(t *testing.T, cmd *cobra.Command, argv ...string) []string {
t.Helper()
require.NoError(t, cmd.Flags().Parse(argv))
return cmd.Flags().Args()
}
func TestNewFromCommand_CollectsOnlyChangedFlags(t *testing.T) {
useTempConfig(t)
cmd := newTestCmd()
args := parse(t, cmd,
"--checkers", "16",
"--checksum",
"--drive-skip-gdocs", "true",
"src", "dst",
)
p := profiles.NewProfile("name")
p.NewFromCommand(cmd, args)
assert.Equal(t, []string{"src", "dst"}, p.Args)
assert.Equal(t, map[string]string{
"checkers": "16",
"checksum": "true",
"drive_skip_gdocs": "true",
}, p.Flags)
}
func TestNewFromCommand_SkipsIgnoredFlags(t *testing.T) {
useTempConfig(t)
cmd := newTestCmd()
// Profile-control flags must not be persisted into the profile,
// even if the test command happens to define them.
cmd.Flags().String("profile-save", "", "")
cmd.Flags().String("profile", "", "")
cmd.Flags().Bool("profile-save-args", false, "")
parse(t, cmd,
"--checkers", "4",
"--profile-save", "ignored",
"--profile", "ignored",
"--profile-save-args",
)
p := profiles.NewProfile("name")
p.NewFromCommand(cmd, nil)
assert.Equal(t, map[string]string{"checkers": "4"}, p.Flags)
}
func TestSaveAndGet_RoundTripsFlagsAndArgs(t *testing.T) {
useTempConfig(t)
ctx := context.Background()
p := profiles.NewProfile("preset")
p.Flags = map[string]string{
"checkers": "16",
"metadata": "true",
"drive_skip_gdocs": "true",
}
p.Args = []string{"src", "remote:dst"}
p.Parents = []string{"parent_a", "parent_b"}
opt := &profiles.ProfileOpt{SaveArgs: true}
require.NoError(t, p.Save(ctx, opt))
got, err := profiles.GetProfile("preset")
require.NoError(t, err)
assert.Equal(t, p, got)
}
func TestUse_UserPositionalArgsBeatProfileArgs(t *testing.T) {
useTempConfig(t)
ctx := context.Background()
// Save a profile with positional args.
p := profiles.NewProfile("paths")
p.Args = []string{"saved-src", "saved-dst"}
require.NoError(t, p.Save(ctx, &profiles.ProfileOpt{SaveArgs: true}))
// useArgs mutates os.Args; save/restore.
savedOSArgs := os.Args
defer func() { os.Args = savedOSArgs }()
os.Args = []string{"rclone", "copy", "user-src", "user-dst", "--profile", "paths"}
cmd := newTestCmd()
loaded, err := profiles.GetProfile("paths")
require.NoError(t, err)
require.NoError(t, loaded.Use(ctx, cmd, []string{"user-src", "user-dst"}, &profiles.ProfileOpt{}))
// The user's positional args must win over the profile's.
assert.Equal(t, []string{"rclone", "copy", "user-src", "user-dst"}, os.Args)
}
func TestUse_ProfileArgsFillUnprovidedSlots(t *testing.T) {
useTempConfig(t)
ctx := context.Background()
p := profiles.NewProfile("paths")
p.Args = []string{"saved-src", "saved-dst"}
require.NoError(t, p.Save(ctx, &profiles.ProfileOpt{SaveArgs: true}))
savedOSArgs := os.Args
defer func() { os.Args = savedOSArgs }()
// User provided no positional args.
os.Args = []string{"rclone", "copy", "--profile", "paths"}
cmd := newTestCmd()
loaded, err := profiles.GetProfile("paths")
require.NoError(t, err)
require.NoError(t, loaded.Use(ctx, cmd, nil, &profiles.ProfileOpt{}))
// With no user args, the profile's saved args fill in.
assert.Equal(t, []string{"rclone", "copy", "saved-src", "saved-dst"}, os.Args)
}
func TestSave_DefensiveKeyNormalisation(t *testing.T) {
// Callers building a *Profile directly may pass keys in either
// snake_case or hyphenated form. Both should land in the same
// section.
useTempConfig(t)
p := profiles.NewProfile("preset")
p.Flags = map[string]string{"drive-skip-gdocs": "true"}
require.NoError(t, p.Save(context.Background(), &profiles.ProfileOpt{}))
got, err := profiles.GetProfile("preset")
require.NoError(t, err)
assert.Equal(t, map[string]string{"drive_skip_gdocs": "true"}, got.Flags)
}
func TestSave_RemoteAndProfileWithSameNameCoexist(t *testing.T) {
// Profiles live in the "profile:" namespace so they can share a
// name with a remote without colliding.
useTempConfig(t)
config.LoadedData().SetValue("clash", "type", "drive")
require.NoError(t, config.LoadedData().Save())
p := profiles.NewProfile("clash")
p.Flags = map[string]string{"checkers": "4"}
require.NoError(t, p.Save(context.Background(), &profiles.ProfileOpt{}))
// Remote section still intact.
rt, ok := config.LoadedData().GetValue("clash", "type")
require.True(t, ok)
assert.Equal(t, "drive", rt)
// Profile under its namespaced section name.
assert.True(t, config.LoadedData().HasSection("profile:clash"))
}
func TestGetProfile_HandlesSparseArgIndices(t *testing.T) {
useTempConfig(t)
// Write arg_3 with no arg_1 / arg_2 - GetProfile used to crash
// here.
config.LoadedData().SetValue("profile:preset", "arg_3", "third")
require.NoError(t, config.LoadedData().Save())
got, err := profiles.GetProfile("preset")
require.NoError(t, err)
assert.Equal(t, []string{"", "", "third"}, got.Args)
}
func TestUse_AppliesFlagValues(t *testing.T) {
useTempConfig(t)
ctx := context.Background()
saved := profiles.NewProfile("preset")
saved.Flags = map[string]string{
"checkers": "16",
"metadata": "true",
}
require.NoError(t, saved.Save(ctx, &profiles.ProfileOpt{}))
cmd := newTestCmd()
loaded, err := profiles.GetProfile("preset")
require.NoError(t, err)
require.NoError(t, loaded.Use(ctx, cmd, nil, &profiles.ProfileOpt{}))
assert.Equal(t, "16", cmd.Flags().Lookup("checkers").Value.String())
assert.Equal(t, "true", cmd.Flags().Lookup("metadata").Value.String())
}
func TestUse_UnknownFlagSkippedByDefault(t *testing.T) {
// A profile may carry flags for commands other than the one it
// is currently being applied to; non-strict mode should just
// ignore them rather than erroring or nil-dereferencing.
useTempConfig(t)
ctx := context.Background()
saved := profiles.NewProfile("preset")
saved.Flags = map[string]string{
"checkers": "12",
"not_a_real_flag": "value",
}
require.NoError(t, saved.Save(ctx, &profiles.ProfileOpt{}))
cmd := newTestCmd()
loaded, err := profiles.GetProfile("preset")
require.NoError(t, err)
require.NoError(t, loaded.Use(ctx, cmd, nil, &profiles.ProfileOpt{}))
assert.Equal(t, "12", cmd.Flags().Lookup("checkers").Value.String())
}
func TestUse_UnknownFlagErrorsInStrictMode(t *testing.T) {
useTempConfig(t)
ctx := context.Background()
saved := profiles.NewProfile("preset")
saved.Flags = map[string]string{"not_a_real_flag": "value"}
require.NoError(t, saved.Save(ctx, &profiles.ProfileOpt{}))
cmd := newTestCmd()
loaded, err := profiles.GetProfile("preset")
require.NoError(t, err)
err = loaded.Use(ctx, cmd, nil, &profiles.ProfileOpt{StrictFlags: true})
require.Error(t, err)
assert.Contains(t, err.Error(), "not-a-real-flag")
}
func TestUse_Parents_LowestToHighestPriority(t *testing.T) {
useTempConfig(t)
ctx := context.Background()
opt := &profiles.ProfileOpt{}
parentA := profiles.NewProfile("parent_a")
parentA.Flags = map[string]string{
"checkers": "4",
"metadata": "true",
}
require.NoError(t, parentA.Save(ctx, opt))
parentB := profiles.NewProfile("parent_b")
parentB.Flags = map[string]string{
"checkers": "8",
"checksum": "true",
}
require.NoError(t, parentB.Save(ctx, opt))
child := profiles.NewProfile("child")
child.Flags = map[string]string{"checkers": "16"}
child.Parents = []string{"parent_a", "parent_b"}
require.NoError(t, child.Save(ctx, opt))
cmd := newTestCmd()
loaded, err := profiles.GetProfile("child")
require.NoError(t, err)
require.NoError(t, loaded.Use(ctx, cmd, nil, opt))
// child overrides both parents
assert.Equal(t, "16", cmd.Flags().Lookup("checkers").Value.String())
// parent_b overrides parent_a where both set the same flag
// (n/a here for checkers; for checksum only parent_b sets)
assert.Equal(t, "true", cmd.Flags().Lookup("checksum").Value.String())
// flag set only by parent_a still applies
assert.Equal(t, "true", cmd.Flags().Lookup("metadata").Value.String())
}
func TestUse_DryRunCannotBeTurnedOff(t *testing.T) {
useTempConfig(t)
saved := profiles.NewProfile("preset")
saved.Flags = map[string]string{"dry_run": "false"}
require.NoError(t, saved.Save(context.Background(), &profiles.ProfileOpt{}))
// Turn dry-run on *after* saving, otherwise Save itself is
// skipped as a destructive op under --dry-run.
ctx, ci := fs.AddConfig(context.Background())
ci.DryRun = true
cmd := newTestCmd()
loaded, err := profiles.GetProfile("preset")
require.NoError(t, err)
require.NoError(t, loaded.Use(ctx, cmd, nil, &profiles.ProfileOpt{}))
// The profile's "dry_run = false" must be ignored.
assert.Equal(t, "false", cmd.Flags().Lookup("dry-run").Value.String())
// We don't assert on ci.DryRun because Profile.Use re-runs
// GlobalOptionsInit, which would copy ci.DryRun back from the
// flag default - the relevant guarantee is that the flag was
// not overwritten.
}
func TestHandleProfiles_SaveRoundTrip(t *testing.T) {
useTempConfig(t)
ctx, ci := fs.AddConfig(context.Background())
cmd := newTestCmd()
parse(t, cmd, "--checkers", "32", "--checksum")
ci.SaveProfile = "fromcmd"
require.NoError(t, profiles.HandleProfiles(ctx, cmd, cmd.Flags().Args()))
loaded, err := profiles.GetProfile("fromcmd")
require.NoError(t, err)
assert.Equal(t, map[string]string{
"checkers": "32",
"checksum": "true",
}, loaded.Flags)
}
func TestSprintSection_ShowsAllKeys(t *testing.T) {
useTempConfig(t)
p := profiles.NewProfile("preset")
p.Flags = map[string]string{"checkers": "9"}
require.NoError(t, p.Save(context.Background(), &profiles.ProfileOpt{}))
s := profiles.SprintSection("profile:preset")
lines := sortedNonBlank(s)
want := sortedNonBlank("[profile:preset]\ncheckers = 9\n")
assert.Equal(t, want, lines)
}
func sortedNonBlank(s string) []string {
out := []string{}
for _, line := range strings.Split(s, "\n") {
if line == "" {
continue
}
out = append(out, line)
}
sort.Strings(out)
return out
}
// TestGlobalOptionsLoadable pins the contract that callers like
// HandleProfiles / Profile.Use rely on: fs.GlobalOptionsInit must be
// callable on an initialised process without erroring. If the global
// options registry ever ends up in a state that can't be loaded the
// rest of this suite will start blowing up too, but this gives a
// pointed failure.
func TestGlobalOptionsLoadable(t *testing.T) {
require.NoError(t, fs.GlobalOptionsInit())
}
-35
View File
@@ -1,35 +0,0 @@
// Package profiles handles presets for config
package profiles
import (
"fmt"
"sort"
"strings"
"github.com/rclone/rclone/fs/config"
)
// ShowProfiles prints an overview of every profile in the config file.
func ShowProfiles() {
profiles := GetProfileList()
fmt.Printf("%-20s %s\n", "Name", "Type")
fmt.Printf("%-20s %s\n", "====", "====")
for _, profile := range profiles {
fmt.Printf("%-20s %s\n", profile, "profile")
}
}
// GetProfileList returns the user-facing names of all profile
// sections (i.e. without the "profile:" prefix), sorted.
func GetProfileList() []string {
sections := config.LoadedData().GetSectionList()
profiles := []string{}
for _, s := range sections {
if !config.IsProfileSection(s) {
continue
}
profiles = append(profiles, strings.TrimPrefix(s, config.ProfileSectionPrefix))
}
sort.Strings(profiles)
return profiles
}
+3 -17
View File
@@ -294,7 +294,7 @@ func ChooseNumber(what string, min, max int) int {
// ShowRemotes shows an overview of the config file
func ShowRemotes() {
remotes := remoteSections()
remotes := LoadedData().GetSectionList()
if len(remotes) == 0 {
return
}
@@ -308,26 +308,12 @@ func ShowRemotes() {
// ChooseRemote chooses a remote name
func ChooseRemote() string {
remotes := remoteSections()
remotes := LoadedData().GetSectionList()
sort.Strings(remotes)
fmt.Println("Select remote.")
return Choose("remote", "value", remotes, nil, "", true, false)
}
// remoteSections returns the section names that are remotes (i.e.
// everything except profile sections).
func remoteSections() []string {
all := LoadedData().GetSectionList()
out := make([]string, 0, len(all))
for _, s := range all {
if IsProfileSection(s) {
continue
}
out = append(out, s)
}
return out
}
// mustFindByName finds the RegInfo for the remote name passed in or
// exits with a fatal error.
func mustFindByName(name string) *fs.RegInfo {
@@ -716,7 +702,7 @@ func ShowRedactedConfig() {
// EditConfig edits the config file interactively
func EditConfig(ctx context.Context) (err error) {
for {
haveRemotes := len(remoteSections()) != 0
haveRemotes := len(LoadedData().GetSectionList()) != 0
what := []string{"eEdit existing remote", "nNew remote", "dDelete remote", "rRename remote", "cCopy remote", "sSet configuration password", "qQuit config"}
if haveRemotes {
fmt.Printf("Current remotes:\n\n")
+18
View File
@@ -29,3 +29,21 @@ func TestGetConfig(t *testing.T) {
config2ctx := GetConfig(ctx2)
assert.Equal(t, config2, config2ctx)
}
// The rc request marker must survive CopyConfig, which is how rclone
// does detach context but keep config.
func TestRCRequestContext(t *testing.T) {
ctx := context.Background()
assert.False(t, IsRCRequest(ctx))
rcCtx := WithRCRequest(ctx)
assert.True(t, IsRCRequest(rcCtx))
// CopyConfig carries the marker even when there is no config to copy
assert.True(t, IsRCRequest(CopyConfig(context.Background(), rcCtx)))
// and when there is
rcCtx, _ = AddConfig(rcCtx)
assert.True(t, IsRCRequest(CopyConfig(context.Background(), rcCtx)))
// An unmarked context stays unmarked
assert.False(t, IsRCRequest(CopyConfig(context.Background(), ctx)))
}
+1 -10
View File
@@ -12,10 +12,6 @@ import (
"github.com/rclone/rclone/lib/caller"
)
// logger represents the slog logging facility and should be overridden by
// the fs/log handling code.
var logger *slog.Logger = slog.Default()
// LogLevel describes rclone's logs. These are a subset of the syslog log levels.
type LogLevel = Enum[logLevelChoices]
@@ -141,7 +137,7 @@ func LogLevelToSlog(level LogLevel) slog.Level {
}
func logSlog(level LogLevel, text string, attrs []any) {
logger.Log(context.Background(), LogLevelToSlog(level), text, attrs...)
slog.Log(context.Background(), LogLevelToSlog(level), text, attrs...)
}
func logSlogWithObject(level LogLevel, o any, text string, attrs []any) {
@@ -341,8 +337,3 @@ func PrettyPrint(in any, label string, level LogLevel) {
}
LogPrintf(level, label, "\n%s\n", string(inBytes))
}
// SetLogger overrides the slog logger using the specified handler
func SetLogger(h slog.Handler) {
logger = slog.New(h)
}
-15
View File
@@ -5,7 +5,6 @@ import (
"context"
"fmt"
"io"
"log/slog"
"os"
"reflect"
"runtime"
@@ -202,21 +201,7 @@ func init() {
}
// InitLogging start the logging as per the command line flags
//
// This is called explicitly from the CLI, the librclone wrapper and
// the test framework, but not from package init, so that importing
// rclone as a library has no side effects on the process-wide default
// slog logger.
func InitLogging() {
// Redirect the process-wide default logger through rclone's
// handler so that log.Print/log.Fatal and slog.Default() (used by
// some standard library and third party code) end up in rclone's
// log output.
slog.SetDefault(slog.New(Handler))
// Make log.Printf logs at level Notice
slog.SetLogLoggerLevel(fs.SlogLevelNotice)
// Note that ci only has the defaults in at this point
// We set real values in logReload
ci := fs.GetConfig(context.Background())
+20 -10
View File
@@ -27,12 +27,6 @@ var Handler = defaultHandler()
// This will be adjusted by InitLogging to be the configured levels
// but it is important we have a logger running regardless of whether
// InitLogging has been called yet or not.
//
// Note that this only sets rclone's private logger via fs.SetLogger
// so that importing this package has no side effects on the
// process-wide default slog logger. The CLI and other rclone-as-a-
// program entry points pick up the default logger redirection in
// InitLogging instead.
func defaultHandler() *OutputHandler {
// Default options for default handler
opts := &slog.HandlerOptions{
@@ -42,8 +36,11 @@ func defaultHandler() *OutputHandler {
// Create our handler
h := NewOutputHandler(os.Stderr, opts, logFormatDate|logFormatTime)
// Set rclone's internal logger so rclone logging works
fs.SetLogger(h)
// Set the slog default handler
slog.SetDefault(slog.New(h))
// Make log.Printf logs at level Notice
slog.SetLogLoggerLevel(fs.SlogLevelNotice)
return h
}
@@ -82,6 +79,19 @@ func mapLogLevelNames(groups []string, a slog.Attr) slog.Attr {
return a
}
// isLogFrame reports whether frame belongs to the logging machinery
// and so should be skipped when finding the real caller.
//
// rclone's own log packages are matched by file path, but the standard
// library log/slog package is matched by function name: under -trimpath
// its path is rewritten to "log/slog/logger.go", which neither file
// check catches.
func isLogFrame(frame runtime.Frame) bool {
file := frame.File
return strings.HasPrefix(frame.Function, "log/slog.") ||
strings.Contains(file, "/log/") || strings.HasSuffix(file, "log.go")
}
// get the file and line number of the caller skipping skip levels
func getCaller(skip int) string {
var pc [64]uintptr
@@ -95,10 +105,10 @@ func getCaller(skip int) string {
for more {
frame, more = frames.Next()
file := frame.File
if strings.Contains(file, "/log/") || strings.HasSuffix(file, "log.go") {
if isLogFrame(frame) {
continue
}
file := frame.File
line := frame.Line
// shorten file name
+28
View File
@@ -7,6 +7,7 @@ import (
"io"
"os"
"regexp"
"runtime"
"strings"
"sync"
"testing"
@@ -71,6 +72,33 @@ func TestGetCaller(t *testing.T) {
// assert.Equal(t, "slog_test.go", match[1])
}
// Test isLogFrame skips logging-machinery frames, including the
// standard library log/slog frames whose path is trimmed by -trimpath.
func TestIsLogFrame(t *testing.T) {
tests := []struct {
name string
file string
fn string
want bool
}{
// rclone's own log packages
{"fsLog", "github.com/rclone/rclone/fs/log.go", "github.com/rclone/rclone/fs.Debugf", true},
{"fsLogSlog", "github.com/rclone/rclone/fs/log/slog.go", "github.com/rclone/rclone/fs/log.(*OutputHandler).Handle", true},
// standard library slog with -trimpath: path is "log/slog/logger.go"
{"slogTrimpath", "log/slog/logger.go", "log/slog.(*Logger).log", true},
// standard library slog without -trimpath: full path contains "/log/"
{"slogFullPath", "/usr/local/go/src/log/slog/logger.go", "log/slog.(*Logger).Log", true},
// a real caller must not be skipped
{"realCaller", "github.com/rclone/rclone/backend/drive/drive.go", "github.com/rclone/rclone/backend/drive.(*Fs).newObjectWithInfo", false},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
got := isLogFrame(runtime.Frame{File: tc.file, Function: tc.fn})
assert.Equal(t, tc.want, got)
})
}
}
// Test formatStdLogHeader for various flag combinations.
func TestFormatStdLogHeader(t *testing.T) {
cases := []struct {
+18 -2
View File
@@ -25,6 +25,22 @@ var (
overriddenConfig = make(map[string]string)
)
// rcRequestKey marks a context as created by a remote control (rc) request.
type rcRequestKeyType struct{}
var rcRequestKey = rcRequestKeyType{}
// WithRCRequest marks ctx as created by a remote control (rc) request.
func WithRCRequest(ctx context.Context) context.Context {
return context.WithValue(ctx, rcRequestKey, true)
}
// IsRCRequest returns true if ctx was created by a remote control (rc) request.
func IsRCRequest(ctx context.Context) bool {
v, _ := ctx.Value(rcRequestKey).(bool)
return v
}
// NewFs makes a new Fs object from the path
//
// The path is of the form remote:path
@@ -115,8 +131,8 @@ func addConfigToContext(ctx context.Context, configName string, config configmap
return ctx, fmt.Errorf("failed to set override config variables %q: %w", overrideKeys, err)
}
Debugf(configName, "Set overridden config %q for backend startup", overrideKeys)
// Set the global context only
if len(globalConfig) != 0 {
// Set the global context unless this Fs is being created for an rc request
if len(globalConfig) != 0 && !IsRCRequest(ctx) {
globalCI := GetConfig(context.Background())
err = configstruct.Set(globalConfig, globalCI)
if err != nil {
+22
View File
@@ -53,3 +53,25 @@ func TestAddConfigToContext_GlobalOnly(t *testing.T) {
ci := GetConfig(newCtx)
assert.Equal(t, "potato2", ci.UserAgent)
}
// When the ctx is marked as a remote control (rc) request, a global.key must
// apply to the backend's own ctx but must NOT change the process-wide config.
func TestAddConfigToContext_GlobalFromRC(t *testing.T) {
global := configmap.Simple{
"global.user_agent": "potato3",
}
ctx := WithRCRequest(context.Background())
globalCI := GetConfig(ctx)
original := globalCI.UserAgent
defer func() {
globalCI.UserAgent = original
}()
newCtx, err := addConfigToContext(ctx, "unit-test", global)
require.NoError(t, err)
assert.NotEqual(t, newCtx, ctx)
// The process-wide config must be untouched
assert.Equal(t, original, globalCI.UserAgent)
// but the backend's own ctx still gets the value
ci := GetConfig(newCtx)
assert.Equal(t, "potato3", ci.UserAgent)
}
-26
View File
@@ -198,32 +198,6 @@ func (o *SeekOption) Mandatory() bool {
return true
}
// ParseHeaders converts the strings passed in via the header flags into HTTPOptions
func ParseHeaders(headers []string) ([]*HTTPOption, error) {
opts := []*HTTPOption{}
for _, header := range headers {
parts := strings.SplitN(header, ":", 2)
if len(parts) != 2 {
return nil, fmt.Errorf("failed to parse %q as an HTTP header. Expecting a string like: 'Cache-Control: no-store'", header)
}
option := &HTTPOption{
Key: strings.TrimSpace(parts[0]),
Value: strings.TrimSpace(parts[1]),
}
opts = append(opts, option)
}
return opts, nil
}
// MustParseHeaders converts the strings passed in via the header flags into HTTPOptions or exits.
func MustParseHeaders(headers []string) []*HTTPOption {
opts, err := ParseHeaders(headers)
if err != nil {
Fatalf(nil, "%v", err)
}
return opts
}
// HTTPOption defines a general purpose HTTP option
type HTTPOption struct {
Key string
+3
View File
@@ -328,6 +328,9 @@ func (jobs *Jobs) NewJob(ctx context.Context, fn rc.Func, in rc.Params) (job *Jo
// Add the job to the context
ctx = context.WithValue(ctx, jobKey, job)
// Mark the context as created from an rc request
ctx = fs.WithRCRequest(ctx)
if isAsync {
go job.run(ctx, fn, in)
out = make(rc.Params)
+31
View File
@@ -300,6 +300,37 @@ func TestExecuteJobWithConfig(t *testing.T) {
assert.NotEqual(t, 42*fs.Mebi, ci.BufferSize)
}
// NewJob must mark the context as a remote control (rc) request, including for
// asynchronous jobs whose context is detached
func TestNewJobMarksRCRequest(t *testing.T) {
jobID.Store(0)
jobs := newJobs() // local instance so we don't pollute the global registry
// synchronous job
var syncMarked bool
_, _, err := jobs.NewJob(context.Background(), func(ctx context.Context, in rc.Params) (rc.Params, error) {
syncMarked = fs.IsRCRequest(ctx)
return nil, nil
}, rc.Params{})
require.NoError(t, err)
assert.True(t, syncMarked, "sync rc job context must be marked as an rc request")
// asynchronous job - the context is detached, so the marker must be set
// after that detachment to survive
done := make(chan bool, 1)
_, _, err = jobs.NewJob(context.Background(), func(ctx context.Context, in rc.Params) (rc.Params, error) {
done <- fs.IsRCRequest(ctx)
return nil, nil
}, rc.Params{"_async": true})
require.NoError(t, err)
select {
case asyncMarked := <-done:
assert.True(t, asyncMarked, "async rc job context must be marked as an rc request")
case <-time.After(5 * time.Second):
t.Fatal("async job did not run")
}
}
func TestExecuteJobWithFilter(t *testing.T) {
ctx := context.Background()
called := false
+52 -1
View File
@@ -5,6 +5,7 @@ import (
"context"
"encoding/base64"
"encoding/json"
"errors"
"flag"
"fmt"
"mime"
@@ -20,6 +21,7 @@ import (
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/cache"
"github.com/rclone/rclone/fs/config"
"github.com/rclone/rclone/fs/fspath"
"github.com/rclone/rclone/fs/list"
"github.com/rclone/rclone/fs/rc"
"github.com/rclone/rclone/fs/rc/jobs"
@@ -325,8 +327,57 @@ func (s *Server) serveRoot(w http.ResponseWriter, r *http.Request) {
directory.Serve(w, r)
}
// checkServeRemote returns an error if fsName must not be instantiated on the
// file-serving (--rc-serve) path given the current authentication state.
//
// Instantiating a backend from request-supplied configuration can execute
// commands during initialisation (e.g. webdav bearer_token_command, sftp ssh),
// read arbitrary local files, or mutate process-wide config via global.*
// options so shouldn't be done without authentication.
//
// authenticated must be true if the request has been authenticated (HTTP auth
// is configured on the server) or --rc-no-auth was passed to explicitly opt in
// to running without authentication.
func checkServeRemote(fsName string, authenticated bool) error {
parsed, err := fspath.Parse(fsName)
if err != nil {
return fmt.Errorf("invalid remote %q: %w", fsName, err)
}
// global.* connection string options mutate process-wide rclone config. Never honour these
// from a request-derived remote, even when the request is authenticated
for k := range parsed.Config {
if strings.HasPrefix(k, "global.") {
return fmt.Errorf("setting %q on a served remote is not allowed", k)
}
}
if authenticated {
return nil
}
// On an unauthenticated server only allow access to pre-configured named remotes. Reject
// inline backend definitions, connection string option overrides and bare local paths
switch {
case parsed.Name == "":
return errors.New("serving local paths requires authentication to be set up on the rc server or the --rc-no-auth flag")
case strings.HasPrefix(parsed.Name, ":"):
return errors.New("serving inline remotes requires authentication to be set up on the rc server or the --rc-no-auth flag")
case len(parsed.Config) > 0:
return errors.New("serving remotes with connection string parameters requires authentication to be set up on the rc server or the --rc-no-auth flag")
}
return nil
}
func (s *Server) serveRemote(w http.ResponseWriter, r *http.Request, path string, fsName string) {
f, err := cache.Get(s.ctx, fsName)
// Check we are allowed to instantiate this remote
authenticated := s.noAuth || s.server.UsingAuth()
if err := checkServeRemote(fsName, authenticated); err != nil {
writeError(path, nil, w, err, http.StatusForbidden)
return
}
// Mark as an rc request e.g. so NewFs can reject global.* config
f, err := cache.Get(fs.WithRCRequest(s.ctx), fsName)
if err != nil {
writeError(path, nil, w, fmt.Errorf("failed to make Fs: %w", err), http.StatusInternalServerError)
return
+130
View File
@@ -368,9 +368,138 @@ func TestRemoteServing(t *testing.T) {
opt := newTestOpt()
opt.Serve = true
opt.Files = testFs
opt.NoAuth = true
testServer(t, tests, &opt)
}
// checkServeRemote must reject request-derived backend instantiation on the
// unauthenticated file-serving path, and global.* config mutation.
func TestCheckServeRemote(t *testing.T) {
for _, test := range []struct {
name string
fsName string
authenticated bool
wantErr string // substring of expected error, "" means no error
}{
// Plain named remotes are always allowed
{name: "named remote unauth", fsName: "remote:path", wantErr: ""},
{name: "named remote auth", fsName: "remote:path", authenticated: true, wantErr: ""},
// Inline backend definitions can run commands (webdav bearer_token_command, sftp ssh)
{name: "inline webdav unauth", fsName: ":webdav,url=http://localhost,bearer_token_command=id:", wantErr: "inline remotes"},
{name: "inline sftp unauth", fsName: ":sftp,ssh=id:", wantErr: "inline remotes"},
{name: "inline local unauth", fsName: ":local:/etc", wantErr: "inline remotes"},
{name: "inline allowed when authed", fsName: ":local:/etc", authenticated: true, wantErr: ""},
// Bare local paths allow arbitrary local file access
{name: "bare path unauth", fsName: "/etc/passwd", wantErr: "local paths"},
{name: "bare path allowed when authed", fsName: "/etc/passwd", authenticated: true, wantErr: ""},
// Connection string overrides can set command-executing options
{name: "connection string unauth", fsName: "remote,vendor=other:path", wantErr: "connection string"},
{name: "connection string allowed when authed", fsName: "remote,vendor=other:path", authenticated: true, wantErr: ""},
// global.* mutates process-wide config and is never allowed
{name: "global config unauth", fsName: "remote,global.http_proxy=x:path", wantErr: "global.http_proxy"},
{name: "global config blocked even when authed", fsName: "remote,global.http_proxy=x:path", authenticated: true, wantErr: "global.http_proxy"},
} {
t.Run(test.name, func(t *testing.T) {
err := checkServeRemote(test.fsName, test.authenticated)
if test.wantErr == "" {
assert.NoError(t, err)
} else {
require.Error(t, err)
assert.Contains(t, err.Error(), test.wantErr)
}
})
}
}
// On an unauthenticated server the serve path must not instantiate
// attacker-supplied inline remotes or local paths, but must still allow
// configured named remotes.
func TestServeRemoteUnauthenticated(t *testing.T) {
forbidden := regexp.MustCompile(`"status": 403`)
tests := []testRun{{
// An inline remote could run a command during initialisation
Name: "inline-remote-rejected",
URL: "[:local:" + testFs + "]/file.txt",
Status: http.StatusForbidden,
Contains: forbidden,
}, {
Name: "bare-local-path-rejected",
URL: remoteURL + "file.txt",
Status: http.StatusForbidden,
Contains: forbidden,
}, {
// A configured (here non-existent) named remote is allowed through to
// the backend, which then reports it isn't in the config file
Name: "named-remote-allowed-through",
URL: "[notfoundremote:]/",
Status: http.StatusInternalServerError,
Contains: regexp.MustCompile(`didn't find section in config file`),
}}
opt := newTestOpt()
opt.Serve = true
testServer(t, tests, &opt)
}
// With authentication configured the serve path may instantiate inline remotes
// (the request is authenticated) but must still refuse to mutate process-wide
// config via global.* options.
func TestServeRemoteWithAuth(t *testing.T) {
const user, pass = "user", "pass"
tests := []testRun{{
// Authenticated requests can serve bare local paths again
Name: "bare-local-path-served-when-authenticated",
URL: remoteURL + "file.txt",
User: user,
Pass: pass,
Status: http.StatusOK,
Expected: "this is file1.txt\n",
}, {
// global.* is blocked even for an authenticated request
Name: "global-config-blocked-when-authenticated",
URL: "[notfoundremote,global.http_proxy=x:]/",
User: user,
Pass: pass,
Status: http.StatusForbidden,
Contains: regexp.MustCompile(`global\.http_proxy`),
}, {
// A request without credentials is rejected before reaching the handler
Name: "unauthenticated-request-rejected",
URL: remoteURL + "file.txt",
Status: http.StatusUnauthorized,
Contains: regexp.MustCompile(``),
}}
opt := newTestOpt()
opt.Serve = true
opt.Files = testFs
opt.Auth.BasicUser = user
opt.Auth.BasicPass = pass
testServer(t, tests, &opt)
}
// The serve path must mark backend creation as a remote control (rc) request
// so a request-supplied remote can't change process-wide config via global.*
// options.
func TestServeRemoteMarksRCRequest(t *testing.T) {
configfile.Install()
opt := newTestOpt()
opt.Serve = true
opt.NoAuth = true // allow inline remotes so we reach backend creation
opt.Template.Path = defaultTestTemplate
rcServer, err := newServer(context.Background(), &opt, http.NewServeMux())
require.NoError(t, err)
ctx := context.Background()
original := fs.GetConfig(ctx).UserAgent
defer func() { fs.GetConfig(ctx).UserAgent = original }()
// serveRemote uses s.ctx, marked as an rc request, so global.* must not
// change the process-wide config.
rcServer.serveRemote(httptest.NewRecorder(), httptest.NewRequest("GET", "/file.txt", nil),
"file.txt", ":local,global.user_agent=rcservertest:"+testFs)
assert.Equal(t, original, fs.GetConfig(ctx).UserAgent,
"the serve path must not let global.* change the process-wide config")
}
func TestRC(t *testing.T) {
tests := []testRun{{
Name: "rc-root",
@@ -853,6 +982,7 @@ func TestServeModTime(t *testing.T) {
opt := newTestOpt()
opt.Serve = true
opt.Template.Path = "testdata/golden/testmodtime.html"
opt.NoAuth = true
tests := []testRun{{
Name: "modtime",
+7 -20
View File
@@ -392,26 +392,13 @@ func (s *syncCopyMove) pairChecker(in *pipe, out *pipe, fraction int, wg *sync.W
}
}
// Fix case for case insensitive filesystems
if s.ci.FixCase && !s.ci.Immutable && pair.Dst != nil && src.Remote() != pair.Dst.Remote() {
// NeedTransfer's equality check may have deleted pair.Dst as a precursor
// to re-uploading it (the way modtime updates are done on backends like
// Dropbox that can't set modtime in place). If so, there is nothing to
// rename - nil out pair.Dst so the upload below recreates the file at
// src.Remote() (the correctly-cased name).
if needTransfer {
if _, statErr := s.fdst.NewObject(s.ctx, pair.Dst.Remote()); errors.Is(statErr, fs.ErrorObjectNotFound) {
fs.Debugf(pair.Dst, "Skipping fix-case rename: destination removed for re-upload, will recreate at %s", src.Remote())
pair.Dst = nil
}
}
if pair.Dst != nil {
if newDst, err := operations.Move(s.ctx, s.fdst, nil, src.Remote(), pair.Dst); err != nil {
fs.Errorf(pair.Dst, "Error while attempting to rename to %s: %v", src.Remote(), err)
s.processError(err)
} else {
fs.Infof(pair.Dst, "Fixed case by renaming to: %s", src.Remote())
pair.Dst = newDst
}
if s.ci.FixCase && !s.ci.Immutable && src.Remote() != pair.Dst.Remote() {
if newDst, err := operations.Move(s.ctx, s.fdst, nil, src.Remote(), pair.Dst); err != nil {
fs.Errorf(pair.Dst, "Error while attempting to rename to %s: %v", src.Remote(), err)
s.processError(err)
} else {
fs.Infof(pair.Dst, "Fixed case by renaming to: %s", src.Remote())
pair.Dst = newDst
}
}
if needTransfer {
+2 -8
View File
@@ -432,10 +432,7 @@ func TestTransformFile(t *testing.T) {
err = transform.SetOptions(ctx, "all,trimprefix=tic", "all,trimprefix=tac")
require.NoError(t, err)
// Retry to wait for eventual consistency.
err = fstest.Retry(t, "TransformFile", func() error {
return operations.TransformFile(ctx, r.Fremote, "tictactoe/tictactoe/tictactoe.txt")
})
err = operations.TransformFile(ctx, r.Fremote, "tictactoe/tictactoe/tictactoe.txt")
require.NoError(t, err)
r.CheckLocalListing(t, []fstest.Item{}, []string{})
r.CheckRemoteListing(t, []fstest.Item{fstest.NewItem("toe/toe/toe.txt", "hello world", t1)}, []string{"tictacempty_dir", "tictactoe", "tictactoe/tictactoe", "toe", "toe/toe"})
@@ -465,10 +462,7 @@ func TestManualTransformFile(t *testing.T) {
err = transform.SetOptions(ctx, "all,trimprefix=tic", "all,trimprefix=tac")
require.NoError(t, err)
// Retry to wait for eventual consistency.
err = fstest.Retry(t, "TransformFile", func() error {
return operations.TransformFile(ctx, r.Fremote, "tictactoe/tictactoe/tictactoe.txt")
})
err = operations.TransformFile(ctx, r.Fremote, "tictactoe/tictactoe/tictactoe.txt")
require.NoError(t, err)
r.CheckLocalListing(t, []fstest.Item{}, []string{})
r.CheckRemoteListing(t, []fstest.Item{fstest.NewItem("toe/toe/toe.txt", "hello world", t1)}, []string{"tictacempty_dir", "tictactoe", "tictactoe/tictactoe", "toe", "toe/toe"})
+1 -1
View File
@@ -1,4 +1,4 @@
package fs
// VersionTag of rclone
var VersionTag = "v1.75.0"
var VersionTag = "v1.74.3"
+9 -22
View File
@@ -118,32 +118,19 @@ func newRun() *Run {
return r
}
// Retry calls f and retries with exponential backoff until it returns
// nil or *ListRetries attempts have been made. It is intended for tests
// that need to ride out eventual consistency in the backend (for example
// when an operation has just modified an asset and a subsequent lookup
// in another API has not caught up yet).
//
// The final error is returned so the caller can decide how to react.
func Retry(t *testing.T, what string, f func() error) error {
t.Helper()
// run f(), retrying it until it returns with no error or the limit
// expires and it calls t.Fatalf
func retry(t *testing.T, what string, f func() error) {
var err error
sleep := time.Second
retries := *ListRetries
for try := 1; try <= retries; try++ {
for try := 1; try <= *ListRetries; try++ {
err = f()
if err == nil {
return nil
return
}
if try == retries {
break
}
t.Logf("%s failed - try %d/%d: sleeping %v: %v", what, try, retries, sleep, err)
time.Sleep(sleep)
sleep = (sleep * 3) / 2
t.Logf("%s failed - try %d/%d: %v", what, try, *ListRetries, err)
time.Sleep(time.Second)
}
t.Logf("%s failed: %v", what, err)
return err
}
// newRunIndividual initialise the remote and local for testing and
@@ -169,7 +156,7 @@ func newRunIndividual(t *testing.T, individual bool) *Run {
for _, entry := range entries {
switch x := entry.(type) {
case fs.Object:
_ = Retry(t, fmt.Sprintf("removing file %q", x.Remote()), func() error { return x.Remove(ctx) })
retry(t, fmt.Sprintf("removing file %q", x.Remote()), func() error { return x.Remove(ctx) })
case fs.Directory:
toDelete = append(toDelete, x.Remote())
}
@@ -183,7 +170,7 @@ func newRunIndividual(t *testing.T, individual bool) *Run {
sort.Strings(toDelete)
for i := len(toDelete) - 1; i >= 0; i-- {
dir := toDelete[i]
_ = Retry(t, fmt.Sprintf("removing dir %q", dir), func() error {
retry(t, fmt.Sprintf("removing dir %q", dir), func() error {
return r.Fremote.Rmdir(ctx, dir)
})
}
+18 -23
View File
@@ -111,7 +111,6 @@ backends:
- backend: "cloudinary"
remote: "TestCloudinary:"
fastlist: false
listretries: 5
ignore:
# fs/operations
- TestCheckSum
@@ -158,16 +157,6 @@ backends:
- backend: "dropbox"
remote: "TestDropbox:"
fastlist: false
ignore:
# The bisync normalization test relies on uploading distinct NFC and NFD
# versions of the same filename and on having modtime updates that don't
# require a delete+re-upload. Dropbox normalizes unicode server-side
# (NFD -> NFC) and can't set modtime in place, so the test takes a
# different code path that produces a different log without functional
# difference - the file state ends up correct either way.
- TestBisyncRemoteLocal/normalization
- TestBisyncLocalRemote/normalization
- TestBisyncRemoteRemote/normalization
# - backend: "filefabric"
# remote: "TestFileFabric:"
# fastlist: false
@@ -490,17 +479,17 @@ backends:
ignoretests:
- cmd/bisync
- cmd/gitannex
# - backend: "webdav"
# remote: "TestWebdavInfiniteScale:"
# ignore:
# - TestIntegration/FsMkdir/FsEncoding/punctuation
# - TestIntegration/FsMkdir/FsEncoding/invalid_UTF-8
# env:
# - RCLONE_NO_CHECK_CERTIFICATE=true
# fastlist: false
# ignoretests:
# - cmd/bisync
# - cmd/gitannex
- backend: "webdav"
remote: "TestWebdavInfiniteScale:"
ignore:
- TestIntegration/FsMkdir/FsEncoding/punctuation
- TestIntegration/FsMkdir/FsEncoding/invalid_UTF-8
env:
- RCLONE_NO_CHECK_CERTIFICATE=true
fastlist: false
ignoretests:
- cmd/bisync
- cmd/gitannex
- backend: "webdav"
remote: "TestWebdavRclone:"
ignore:
@@ -583,6 +572,13 @@ backends:
- TestApplyTransforms
ignoretests:
- cmd/bisync
- backend: "seafile"
remote: "TestSeafileV6:"
fastlist: false
ignore:
- TestIntegration/FsMkdir/FsPutFiles/FsDirMove
ignoretests:
- cmd/gitannex
- backend: "seafile"
remote: "TestSeafile:"
fastlist: true
@@ -696,4 +692,3 @@ backends:
- cmd/bisync
fastlist: false
extratime: 2.0
listretries: 5
+10 -10
View File
@@ -42,7 +42,7 @@ require (
github.com/gdamore/tcell/v2 v2.13.8
github.com/go-chi/chi/v5 v5.2.5
github.com/go-darwin/apfs v0.0.0-20211011131704-f84b94dbf348
github.com/go-git/go-billy/v5 v5.8.0
github.com/go-git/go-billy/v5 v5.9.0
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/google/uuid v1.6.0
github.com/hanwen/go-fuse/v2 v2.9.0
@@ -73,7 +73,7 @@ require (
github.com/quasilyte/go-ruleguard/dsl v0.3.23
github.com/rclone/Proton-API-Bridge v1.0.3
github.com/rclone/go-proton-api v1.0.2
github.com/rclone/gofakes3 v0.0.4
github.com/rclone/gofakes3 v0.0.6
github.com/rfjakob/eme v1.2.0
github.com/rivo/uniseg v0.4.7
github.com/rogpeppe/go-internal v1.14.1
@@ -94,12 +94,12 @@ require (
github.com/zeebo/xxh3 v1.1.0
go.etcd.io/bbolt v1.4.3
goftp.io/server/v2 v2.0.2
golang.org/x/crypto v0.50.0
golang.org/x/net v0.53.0
golang.org/x/crypto v0.52.0
golang.org/x/net v0.55.0
golang.org/x/oauth2 v0.36.0
golang.org/x/sync v0.20.0
golang.org/x/sys v0.43.0
golang.org/x/text v0.36.0
golang.org/x/sys v0.45.0
golang.org/x/text v0.37.0
golang.org/x/time v0.15.0
google.golang.org/api v0.275.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
@@ -261,9 +261,9 @@ require (
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
go4.org v0.0.0-20260112195520-a5071408f32f // indirect
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
golang.org/x/image v0.39.0 // indirect
golang.org/x/tools v0.43.0 // indirect
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
golang.org/x/image v0.41.0 // indirect
golang.org/x/tools v0.44.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
google.golang.org/grpc v1.80.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
@@ -284,5 +284,5 @@ require (
github.com/pkg/xattr v0.4.12
github.com/pquerna/otp v1.5.0
golang.org/x/mobile v0.0.0-20260312152759-81488f6aeb60
golang.org/x/term v0.42.0
golang.org/x/term v0.43.0
)
+20 -20
View File
@@ -287,8 +287,8 @@ github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
github.com/go-darwin/apfs v0.0.0-20211011131704-f84b94dbf348 h1:JnrjqG5iR07/8k7NqrLNilRsl3s1EPRQEGvbPyOce68=
github.com/go-darwin/apfs v0.0.0-20211011131704-f84b94dbf348/go.mod h1:Czxo/d1g948LtrALAZdL04TL/HnkopquAjxYUuI02bo=
github.com/go-git/go-billy/v5 v5.8.0 h1:I8hjc3LbBlXTtVuFNJuwYuMiHvQJDq1AT6u4DwDzZG0=
github.com/go-git/go-billy/v5 v5.8.0/go.mod h1:RpvI/rw4Vr5QA+Z60c6d6LXH0rYJo0uD5SqfmrrheCY=
github.com/go-git/go-billy/v5 v5.9.0 h1:jItGXszUDRtR/AlferWPTMN4j38BQ88XnXKbilmmBPA=
github.com/go-git/go-billy/v5 v5.9.0/go.mod h1:jCnQMLj9eUgGU7+ludSTYoZL/GGmii14RxKFj7ROgHw=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -598,8 +598,8 @@ github.com/rclone/Proton-API-Bridge v1.0.3 h1:Bs7RC4xCFSN0BPIYVda/BNxp0qo3NV0gB2
github.com/rclone/Proton-API-Bridge v1.0.3/go.mod h1:26RAest751Ofk+F/d8xtl4UyWXrZvMQwn39U8rm/WKM=
github.com/rclone/go-proton-api v1.0.2 h1:cJtJUab0MGJ3C6q5kiEJs3pbyhSLnOKMyYOQehA0PBc=
github.com/rclone/go-proton-api v1.0.2/go.mod h1:LB2kCEaZMzNn3ocdz+qYfxXmuLxxN0ka62KJd2x53Bc=
github.com/rclone/gofakes3 v0.0.4 h1:LswpC49VY/UJ1zucoL5ktnOEX6lq3qK7e1aFIAfqCbk=
github.com/rclone/gofakes3 v0.0.4/go.mod h1:j/UoS+2/Mr7xAlfKhyVC58YyFQmh9uoQA5YZQXQUqmg=
github.com/rclone/gofakes3 v0.0.6 h1:gTW5Dq04EouaoKyyTSuSL+WS3VZU3k2QNOBn9ghX7kE=
github.com/rclone/gofakes3 v0.0.6/go.mod h1:M/uFc52GcEFuIP4stgrSR99SqqqxMR0ncgiTbj0eszc=
github.com/relvacode/iso8601 v1.7.0 h1:BXy+V60stMP6cpswc+a93Mq3e65PfXCgDFfhvNNGrdo=
github.com/relvacode/iso8601 v1.7.0/go.mod h1:FlNp+jz+TXpyRqgmM7tnzHHzBnz776kmAH2h3sZCn0I=
github.com/rfjakob/eme v1.2.0 h1:8dAHL+WVAw06+7DkRKnRiFp1JL3QjcJEZFqDnndUaSI=
@@ -773,8 +773,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988=
golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -785,12 +785,12 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a h1:ovFr6Z0MNmU7nH8VaX5xqw+05ST2uO1exVfZPVqRC5o=
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA=
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM=
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.39.0 h1:skVYidAEVKgn8lZ602XO75asgXBgLj9G/FE3RbuPFww=
golang.org/x/image v0.39.0/go.mod h1:sIbmppfU+xFLPIG0FoVUTvyBMmgng1/XAMhQ2ft0hpA=
golang.org/x/image v0.41.0 h1:8wS72eGJMJaBxK6okTzd4WaXumUlTVlb753MlsSvTCo=
golang.org/x/image v0.41.0/go.mod h1:uIc348UZMSvS5Z65CVZ7iDPaNobNFEPeJ4kbqTOszmA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -856,8 +856,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA=
golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -932,8 +932,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -945,8 +945,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY=
golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY=
golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -962,8 +962,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1017,8 +1017,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=
golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=
golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c=
golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-12
View File
@@ -199,18 +199,6 @@ func MiddlewareCORS(allowOrigin string) Middleware {
}
}
// MiddlewareResponseHeaders instantiates middleware that apply custom headers to every response
func MiddlewareResponseHeaders(headers []*fs.HTTPOption) Middleware {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
for _, header := range headers {
w.Header().Set(header.Key, header.Value)
}
next.ServeHTTP(w, r)
})
}
}
// MiddlewareStripPrefix instantiates middleware that removes the BaseURL from the path
func MiddlewareStripPrefix(prefix string) Middleware {
return func(next http.Handler) http.Handler {
-63
View File
@@ -583,66 +583,3 @@ func TestMiddlewareCORSWithAuth(t *testing.T) {
})
}
}
func TestMiddlewareResponseHeaders(t *testing.T) {
servers := []struct {
name string
http Config
header http.Header
}{
{
name: "SingleHeader",
http: Config{
ListenAddr: []string{"127.0.0.1:0"},
ResponseHeaders: []string{"X-Test-Header: test-value"},
},
header: http.Header{
"X-Test-Header": []string{"test-value"},
},
},
{
name: "MultipleHeaders",
http: Config{
ListenAddr: []string{"127.0.0.1:0"},
ResponseHeaders: []string{"X-Header-One: one", "X-Header-Two: two"},
},
header: http.Header{
"X-Header-One": []string{"one"},
"X-Header-Two": []string{"two"},
},
},
}
for _, ss := range servers {
t.Run(ss.name, func(t *testing.T) {
s, err := NewServer(context.Background(), WithConfig(ss.http))
require.NoError(t, err)
defer func() {
require.NoError(t, s.Shutdown())
}()
expected := []byte("header-test")
s.Router().Mount("/", testEchoHandler(expected))
s.Serve()
url := testGetServerURL(t, s)
client := &http.Client{}
req, err := http.NewRequest("GET", url, nil)
require.NoError(t, err)
resp, err := client.Do(req)
require.NoError(t, err)
defer func() {
_ = resp.Body.Close()
}()
require.Equal(t, http.StatusOK, resp.StatusCode, "should return ok")
testExpectRespBody(t, resp, expected)
for key, vals := range ss.header {
require.Contains(t, resp.Header, key, "response should contain custom header")
require.Equal(t, vals, resp.Header.Values(key), "header value should match")
}
})
}
}
+19 -34
View File
@@ -23,8 +23,6 @@ import (
"github.com/rclone/rclone/lib/atexit"
sdActivation "github.com/rclone/rclone/lib/sdactivation"
"github.com/spf13/pflag"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
)
// Help returns text describing the http server to add to the command
@@ -53,10 +51,6 @@ for a transfer.
` + "`--{{ .Prefix }}max-header-bytes`" + ` controls the maximum number of bytes the server will
accept in the HTTP header.
` + "`--{{ .Prefix }}response-header`" + ` can be used to set an HTTP header for all responses,
will overriding existing values. The flag may be repeated to add multiple
headers. Use the format ` + "`Header-Name: value`" + `.
` + "`--{{ .Prefix }}baseurl`" + ` controls the URL prefix that rclone serves from. By default
rclone will serve from the root. If you used ` + "`--{{ .Prefix }}baseurl \"/rclone\"`" + ` then
rclone would serve from a URL starting with "/rclone/". This is
@@ -171,10 +165,6 @@ var ConfigInfo = fs.Options{{
Name: "allow_origin",
Default: "",
Help: "Origin which cross-domain request (CORS) can be executed from",
}, {
Name: "response_header",
Default: []string{},
Help: "Set HTTP header for all responses, overriding existing values",
}}
// Config contains options for the http Server
@@ -189,9 +179,8 @@ type Config struct {
TLSCertBody []byte `config:"-"` // TLS PEM public key certificate body (can also include intermediate/CA certificates), ignores TLSCert
TLSKeyBody []byte `config:"-"` // TLS PEM private key body, ignores TLSKey
ClientCA string `config:"client_ca"` // Path to TLS PEM CA file with certificate authorities to verify clients with
MinTLSVersion string `config:"min_tls_version"` // MinTLSVersion contains the minimum TLS version that is acceptable
MinTLSVersion string `config:"min_tls_version"` // MinTLSVersion contains the minimum TLS version that is acceptable.
AllowOrigin string `config:"allow_origin"` // AllowOrigin sets the Access-Control-Allow-Origin header
ResponseHeaders []string `config:"response_header"` // Set HTTP header for all responses, overriding existing values
}
// AddFlagsPrefix adds flags for the httplib
@@ -206,7 +195,6 @@ func (cfg *Config) AddFlagsPrefix(flagSet *pflag.FlagSet, prefix string) {
flags.StringVarP(flagSet, &cfg.BaseURL, prefix+"baseurl", "", cfg.BaseURL, "Prefix for URLs - leave blank for root", prefix)
flags.StringVarP(flagSet, &cfg.MinTLSVersion, prefix+"min-tls-version", "", cfg.MinTLSVersion, "Minimum TLS version that is acceptable", prefix)
flags.StringVarP(flagSet, &cfg.AllowOrigin, prefix+"allow-origin", "", cfg.AllowOrigin, "Origin which cross-domain request (CORS) can be executed from", prefix)
flags.StringArrayVarP(flagSet, &cfg.ResponseHeaders, prefix+"response-header", "", cfg.ResponseHeaders, "Set HTTP header for all responses, overriding existing values", prefix)
}
// AddHTTPFlagsPrefix adds flags for the httplib
@@ -291,26 +279,29 @@ func newInstance(ctx context.Context, s *Server, listener net.Listener, tlsCfg *
listener = tls.NewListener(listener, tlsCfg)
}
var handler http.Handler = s.mux
httpServer := &http.Server{
Handler: s.mux,
ReadTimeout: time.Duration(s.cfg.ServerReadTimeout),
WriteTimeout: time.Duration(s.cfg.ServerWriteTimeout),
MaxHeaderBytes: s.cfg.MaxHeaderBytes,
ReadHeaderTimeout: 10 * time.Second, // time to send the headers
IdleTimeout: 60 * time.Second, // time to keep idle connections open
TLSConfig: tlsCfg,
BaseContext: NewBaseContext(ctx, url),
}
// Enable h2c (HTTP/2 cleartext) for non-TLS listeners
if tlsCfg == nil {
h2s := &http2.Server{}
handler = h2c.NewHandler(s.mux, h2s)
protocols := new(http.Protocols)
protocols.SetHTTP1(true)
protocols.SetUnencryptedHTTP2(true)
httpServer.Protocols = protocols
}
return &instance{
url: url,
listener: listener,
httpServer: &http.Server{
Handler: handler,
ReadTimeout: time.Duration(s.cfg.ServerReadTimeout),
WriteTimeout: time.Duration(s.cfg.ServerWriteTimeout),
MaxHeaderBytes: s.cfg.MaxHeaderBytes,
ReadHeaderTimeout: 10 * time.Second, // time to send the headers
IdleTimeout: 60 * time.Second, // time to keep idle connections open
TLSConfig: tlsCfg,
BaseContext: NewBaseContext(ctx, url),
},
url: url,
listener: listener,
httpServer: httpServer,
}
}
@@ -358,13 +349,7 @@ func NewServer(ctx context.Context, options ...Option) (*Server, error) {
return nil, err
}
responseHeaders, err := fs.ParseHeaders(s.cfg.ResponseHeaders)
if err != nil {
return nil, err
}
s.mux.Use(MiddlewareCORS(s.cfg.AllowOrigin))
s.mux.Use(MiddlewareResponseHeaders(responseHeaders))
s.initAuth()
+1 -1
View File
@@ -624,7 +624,7 @@ func ConfigOAuth(ctx context.Context, name string, m configmap.Mapper, ri *fs.Re
// See if already have a token
tokenString, ok := m.Get("token")
if ok && tokenString != "" {
return fs.ConfigConfirm(newState("*oauth-confirm"), true, "config_refresh_token", "Token already configured - replace it?")
return fs.ConfigConfirm(newState("*oauth-confirm"), true, "config_refresh_token", "Already have a token - refresh?")
}
return fs.ConfigGoto(newState("*oauth-confirm"))
case "*oauth-confirm":
+2 -2
View File
@@ -218,12 +218,12 @@ rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,command=e
```console
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}"
// Output: stories/The Quick Brown Fox!-20260501
// Output: stories/The Quick Brown Fox!-20260605
```
```console
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}"
// Output: stories/The Quick Brown Fox!-2026-05-01 0355PM
// Output: stories/The Quick Brown Fox!-2026-06-05 0419PM
```
```console
Generated
+482 -20
View File
@@ -15,7 +15,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
.TH "rclone" "1" "May 01, 2026" "User Manual" ""
.TH "rclone" "1" "Jun 05, 2026" "User Manual" ""
.hy
.SH NAME
.PP
@@ -6326,14 +6326,14 @@ rclone convmv \[dq]stories/The Quick Brown Fox!.txt\[dq] --name-transform \[dq]a
.nf
\f[C]
rclone convmv \[dq]stories/The Quick Brown Fox!\[dq] --name-transform \[dq]date=-{YYYYMMDD}\[dq]
// Output: stories/The Quick Brown Fox!-20260501
// Output: stories/The Quick Brown Fox!-20260605
\f[R]
.fi
.IP
.nf
\f[C]
rclone convmv \[dq]stories/The Quick Brown Fox!\[dq] --name-transform \[dq]date=-{macfriendlytime}\[dq]
// Output: stories/The Quick Brown Fox!-2026-05-01 0208PM
// Output: stories/The Quick Brown Fox!-2026-06-05 0414PM
\f[R]
.fi
.IP
@@ -21044,7 +21044,7 @@ then rclone will keep the configuration file in memory only.
.PP
You may see a log message \[dq]Config file not found - using
defaults\[dq] if there is no configuration file.
This can be supressed, e.g.
This can be suppressed, e.g.
if you are using rclone entirely with on the fly
remotes (https://rclone.org/docs/#backend-path-to-dir), by using
memory-only configuration file or by creating an empty configuration
@@ -25430,7 +25430,28 @@ see a listing of the remotes.
Objects may be requested from remotes using this syntax
\f[V]http://127.0.0.1:5572/[remote:path]/path/to/object\f[R]
.PP
Unless the rc server has authentication configured
(\f[V]--rc-user\f[R]/\f[V]--rc-pass\f[R] or \f[V]--rc-htpasswd\f[R]) or
the \f[V]--rc-no-auth\f[R] flag is set, only remotes already present in
the config file may be served this way.
Inline remotes (e.g.
\f[V][:webdav,url=...:]\f[R]), connection string parameters and bare
local paths are rejected, since instantiating them from an
unauthenticated request could run commands or read arbitrary local
files.
.PP
Default Off.
.SS global.* connection string options and the rc
.PP
Remotes instantiated by the rc do not let connection
string (https://rclone.org/docs/#connection-strings) \f[V]global.*\f[R]
options change rclone\[aq]s process-wide configuration.
Remotes created directly on the command line or defined in the config
file are unaffected.
.PP
A \f[V]global.*\f[R] option still takes effect for the individual
backend it is set on (exactly like an \f[V]override.*\f[R] option), it
just does not leak into the global config for the rest of the process.
.SS --rc-serve-no-modtime
.PP
Set this flag to skip reading the modification time (can speed things
@@ -30179,7 +30200,7 @@ Flags for general networking and HTTP stuff.
--tpslimit float Limit HTTP transactions per second to this
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
--use-cookies Enable session cookiejar
--user-agent string Set the user-agent to a specified string (default \[dq]rclone/v1.74.0\[dq])
--user-agent string Set the user-agent to a specified string (default \[dq]rclone/v1.74.3\[dq])
\f[R]
.fi
.SS Performance
@@ -30371,7 +30392,7 @@ Flags to control the Metrics HTTP endpoint..
.IP
.nf
\f[C]
--metrics-addr stringArray IPaddress:Port or :Port to bind metrics server to
--metrics-addr stringArray IPaddress:Port or :Port to bind server to
--metrics-allow-origin string Origin which cross-domain request (CORS) can be executed from
--metrics-baseurl string Prefix for URLs - leave blank for root
--metrics-cert string TLS PEM key (concatenation of certificate and CA certificate)
@@ -30577,7 +30598,7 @@ Backend-only flags (these can be set in the config file also).
--drime-list-chunk int Number of items to list in each call (default 1000)
--drime-root-folder-id string ID of the root folder
--drime-upload-concurrency int Concurrency for multipart uploads and copies (default 4)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 200Mi)
--drime-upload-cutoff SizeSuffix Cutoff for switching to chunked upload (default 5Mi)
--drime-workspace-id string Account ID
--drive-acknowledge-abuse Set to allow files which return cannotDownloadAbusiveFile to be downloaded
--drive-allow-import-name-change Allow the filetype to change when uploading Google docs
@@ -33477,13 +33498,37 @@ filename encodings.)
.PP
The following backends have known issues that need more investigation:
.IP \[bu] 2
\f[V]TestDropbox\f[R] (\f[V]dropbox\f[R])
\f[V]TestFilen\f[R] (\f[V]filen\f[R])
.RS 2
.IP \[bu] 2
\f[V]TestBisyncRemoteRemote/normalization\f[R] (https://pub.rclone.org/integration-tests/current/dropbox-cmd.bisync-TestDropbox-1.txt)
\f[V]TestBisyncRemoteRemote/resync_modes\f[R] (https://pub.rclone.org/integration-tests/current/filen-cmd.bisync-TestFilen-1.txt)
.IP \[bu] 2
\f[V]TestBisyncRemoteRemote/rmdirs\f[R] (https://pub.rclone.org/integration-tests/current/filen-cmd.bisync-TestFilen-1.txt)
.RE
.IP \[bu] 2
Updated: 2026-05-01-010013
\f[V]TestHuaweiDrive\f[R] (\f[V]huaweidrive\f[R])
.RS 2
.IP \[bu] 2
\f[V]TestBisyncRemoteLocal/ext_paths\f[R] (https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
.IP \[bu] 2
\f[V]TestBisyncRemoteLocal/extended_filenames\f[R] (https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
.IP \[bu] 2
\f[V]TestBisyncRemoteLocal/normalization\f[R] (https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
.IP \[bu] 2
\f[V]TestBisyncLocalRemote/ext_paths\f[R] (https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
.IP \[bu] 2
\f[V]TestBisyncLocalRemote/extended_filenames\f[R] (https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
.IP \[bu] 2
4 more (https://pub.rclone.org/integration-tests/current/)
.RE
.IP \[bu] 2
\f[V]TestSeafile\f[R] (\f[V]seafile\f[R])
.RS 2
.IP \[bu] 2
\f[V]TestBisyncLocalRemote/rmdirs\f[R] (https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafile-1.txt)
.RE
.IP \[bu] 2
Updated: 2026-06-05-010010
.PP
The following backends either have not been tested recently or have
known issues that are deemed unfixable for the time being:
@@ -34602,6 +34647,11 @@ Also note a number of academic publications by Benjamin
Pierce (http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization)
about \f[I]Unison\f[R] and synchronization in general.
.SS Changelog
.SS \f[V]v1.74.2\f[R]
.IP \[bu] 2
Fixed an issue causing \f[V]--conflict-loser pathname\f[R] to produce
unexpected behavior if using a non-default \f[V]--conflict-resolve\f[R]
value.
.SS \f[V]v1.74\f[R]
.IP \[bu] 2
Added several missing \f[V]rc\f[R] parameters.
@@ -37346,6 +37396,14 @@ EU South 1
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]eu-west-1\[dq]
.RS 2
.IP \[bu] 2
EU West 1
.IP \[bu] 2
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]jp-central-1\[dq]
.RS 2
.IP \[bu] 2
@@ -37378,6 +37436,14 @@ US East
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]us-east-1\[dq]
.RS 2
.IP \[bu] 2
US East 1
.IP \[bu] 2
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]us-west\[dq]
.RS 2
.IP \[bu] 2
@@ -37386,6 +37452,14 @@ US West
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]us-west-1\[dq]
.RS 2
.IP \[bu] 2
US West 1
.IP \[bu] 2
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]global\[dq]
.RS 2
.IP \[bu] 2
@@ -38891,6 +38965,14 @@ EU South 1
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]eu-west-1.object.fastlystorage.app\[dq]
.RS 2
.IP \[bu] 2
EU West 1
.IP \[bu] 2
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]jp-central-1.object.fastlystorage.app\[dq]
.RS 2
.IP \[bu] 2
@@ -38923,6 +39005,14 @@ US East
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]us-east-1.object.fastlystorage.app\[dq]
.RS 2
.IP \[bu] 2
US East 1
.IP \[bu] 2
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]us-west.object.fastlystorage.app\[dq]
.RS 2
.IP \[bu] 2
@@ -38931,6 +39021,14 @@ US West
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]us-west-1.object.fastlystorage.app\[dq]
.RS 2
.IP \[bu] 2
US West 1
.IP \[bu] 2
Provider: Fastly
.RE
.IP \[bu] 2
\[dq]s5lu.com\[dq]
.RS 2
.IP \[bu] 2
@@ -39951,10 +40049,66 @@ Fortaleza, CE (BR), br-ne1
Provider: Magalu
.RE
.IP \[bu] 2
\[dq]s3.eu-amsterdam.megas4.com\[dq]
.RS 2
.IP \[bu] 2
Mega S4 Amsterdam
.IP \[bu] 2
Provider: Mega
.RE
.IP \[bu] 2
\[dq]s3.eu-luxembourg.megas4.com\[dq]
.RS 2
.IP \[bu] 2
Mega S4 Luxembourg
.IP \[bu] 2
Provider: Mega
.RE
.IP \[bu] 2
\[dq]s3.eu-paris.megas4.com\[dq]
.RS 2
.IP \[bu] 2
Mega S4 Paris
.IP \[bu] 2
Provider: Mega
.RE
.IP \[bu] 2
\[dq]s3.eu-barcelona.megas4.com\[dq]
.RS 2
.IP \[bu] 2
Mega S4 Barcelona
.IP \[bu] 2
Provider: Mega
.RE
.IP \[bu] 2
\[dq]s3.ca-montreal.megas4.com\[dq]
.RS 2
.IP \[bu] 2
Mega S4 Montreal
.IP \[bu] 2
Provider: Mega
.RE
.IP \[bu] 2
\[dq]s3.ca-vancouver.megas4.com\[dq]
.RS 2
.IP \[bu] 2
Mega S4 Vancouver
.IP \[bu] 2
Provider: Mega
.RE
.IP \[bu] 2
\[dq]s3.ap-tokyo.megas4.com\[dq]
.RS 2
.IP \[bu] 2
Mega S4 Tokyo
.IP \[bu] 2
Provider: Mega
.RE
.IP \[bu] 2
\[dq]s3.eu-central-1.s4.mega.io\[dq]
.RS 2
.IP \[bu] 2
Mega S4 eu-central-1 (Amsterdam)
Mega S4 eu-central-1 (Amsterdam, legacy)
.IP \[bu] 2
Provider: Mega
.RE
@@ -39962,7 +40116,7 @@ Provider: Mega
\[dq]s3.eu-central-2.s4.mega.io\[dq]
.RS 2
.IP \[bu] 2
Mega S4 eu-central-2 (Bettembourg)
Mega S4 eu-central-2 (Bettembourg, legacy)
.IP \[bu] 2
Provider: Mega
.RE
@@ -39970,7 +40124,7 @@ Provider: Mega
\[dq]s3.ca-central-1.s4.mega.io\[dq]
.RS 2
.IP \[bu] 2
Mega S4 ca-central-1 (Montreal)
Mega S4 ca-central-1 (Montreal, legacy)
.IP \[bu] 2
Provider: Mega
.RE
@@ -39978,7 +40132,7 @@ Provider: Mega
\[dq]s3.ca-west-1.s4.mega.io\[dq]
.RS 2
.IP \[bu] 2
Mega S4 ca-west-1 (Vancouver)
Mega S4 ca-west-1 (Vancouver, legacy)
.IP \[bu] 2
Provider: Mega
.RE
@@ -42986,7 +43140,7 @@ If true use path style access if false use virtual hosted style.
If this is true (the default) then rclone will use path style access, if
false then rclone will use virtual path style.
See the AWS S3
docs (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro)
docs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html)
for more info.
.PP
Some providers (e.g.
@@ -51418,7 +51572,7 @@ start and finish the upload) and another 2 requests for each chunk:
/b2api/v1/b2_finish_large_file
\f[R]
.fi
.SS Versions
.SS Viewing versions with --b2-versions
.PP
Versions can be viewed with the \f[V]--b2-versions\f[R] flag.
When it is set rclone will show and act on older versions of files.
@@ -56983,7 +57137,7 @@ Env Var: RCLONE_DRIME_UPLOAD_CUTOFF
.IP \[bu] 2
Type: SizeSuffix
.IP \[bu] 2
Default: 200Mi
Default: 5Mi
.SS --drime-chunk-size
.PP
Chunk size to use for uploading.
@@ -69245,6 +69399,12 @@ MediaMarkt Cloud (mediamarkt.jottacloud.com)
.IP \[bu] 2
Let\[aq]s Go Cloud (letsgo.jotta.cloud)
.RE
.IP \[bu] 2
Phonero
.RS 2
.IP \[bu] 2
Phonero Sky (sky.phonero.no)
.RE
.PP
Paths are specified as \f[V]remote:path\f[R]
.PP
@@ -89990,6 +90150,307 @@ Options:
.IP \[bu] 2
\[dq]error\[dq]: Return an error based on option value.
.SH Changelog
.SS v1.74.3 - 2026-06-05
.PP
See commits (https://github.com/rclone/rclone/compare/v1.74.2...v1.74.3)
.IP \[bu] 2
Bug Fixes
.RS 2
.IP \[bu] 2
rc
.RS 2
.IP \[bu] 2
Fix unauthenticated command execution via \f[V]--rc-serve\f[R] inline
remotes CVE-2026-49980 (Nick Craig-Wood)
.IP \[bu] 2
Stop \f[V]global.*\f[R] connection string options changing config
CVE-2026-49980 (Nick Craig-Wood)
.RE
.IP \[bu] 2
build: Fix multiple CVEs by upgrading to go1.26.4 (Nick Craig-Wood)
.RS 2
.IP \[bu] 2
CVE-2026-42504: mime: quadratic complexity in WordDecoder.DecodeHeader
.IP \[bu] 2
CVE-2026-42507: net/textproto: arbitrary input are included in errors
without any escaping
.IP \[bu] 2
CVE-2026-27145: crypto/x509: split candidate hostname only once
.RE
.IP \[bu] 2
log: Fix wrong source \f[V]file:line\f[R] in JSON logs from release
builds (Nick Craig-Wood)
.IP \[bu] 2
mount2: Fix empty directory listings on re-read (Janne Beate Bakeng)
.IP \[bu] 2
serve s3: Fix multipart \f[V]ListParts\f[R] pagination returning wrong
part numbers (Nick Craig-Wood)
.IP \[bu] 2
serve sftp
.RS 2
.IP \[bu] 2
Fix file corruption when a client resumes an upload (Nick Craig-Wood)
.IP \[bu] 2
Fix truncate request being silently ignored (Nick Craig-Wood)
.RE
.RE
.IP \[bu] 2
Local
.RS 2
.IP \[bu] 2
Fix \f[V]getXattr\f[R] returning empty map instead of nil (Leon Brocard)
.RE
.IP \[bu] 2
Drime
.RS 2
.IP \[bu] 2
Fix server-side copy and move failing with Cloudflare 520 error (Nick
Craig-Wood)
.IP \[bu] 2
Fix files being uploaded to the wrong directory (Nick Craig-Wood)
.IP \[bu] 2
Remove duplicate upload_cutoff config option (Nick Craig-Wood)
.IP \[bu] 2
Fix directory rename leaving the renamed folder empty in VFS (Nick
Craig-Wood)
.RE
.IP \[bu] 2
Drive
.RS 2
.IP \[bu] 2
Fix server-side move failing on shared drives with duplicate dirs (Nick
Craig-Wood)
.RE
.IP \[bu] 2
Iclouddrive
.RS 2
.IP \[bu] 2
Fix ADP/PCS cookie acquisition for iCloud Drive (Yakov Till)
.IP \[bu] 2
Fix \[dq]Index has invalid data\[dq] error listing iCloud Photos (Nick
Craig-Wood)
.RE
.SS v1.74.2 - 2026-05-22
.PP
See commits (https://github.com/rclone/rclone/compare/v1.74.1...v1.74.2)
.IP \[bu] 2
Bug Fixes
.RS 2
.IP \[bu] 2
build
.RS 2
.IP \[bu] 2
Update golang.org/x/net to v0.55.0 to address:
.RS 2
.IP \[bu] 2
CVE-2026-42506: html: incorrect handling of namespaced elements in
foreign content
.IP \[bu] 2
CVE-2026-39821: idna: failure to reject ASCII-only Punycode-encoded
labels
.IP \[bu] 2
CVE-2026-42502: html: incorrect handling of HTML elements in foreign
content
.IP \[bu] 2
CVE-2026-25680: html: denial of service when parsing arbitrary HTML
.IP \[bu] 2
CVE-2026-25681: html: incorrect handling of character references in
DOCTYPE nodes
.IP \[bu] 2
CVE-2026-27136: html: duplicate attributes can cause XSS
.RE
.IP \[bu] 2
Update golang.org/x/crypto to v0.52.0 to address:
.RS 2
.IP \[bu] 2
CVE-2026-46598: ssh/agent: pathological inputs can lead to client panic
.IP \[bu] 2
CVE-2026-46597: ssh: byte arithmetic causes underflow and panic
.IP \[bu] 2
CVE-2026-39828: ssh: bypass of certificate restrictions
.IP \[bu] 2
CVE-2026-39835: ssh: server panic during CheckHostKey/Authenticate
.IP \[bu] 2
CVE-2026-39833: ssh/agent: key constraints not enforced
.IP \[bu] 2
CVE-2026-39832: ssh/agent: agent constraints dropped when forwarding
keys
.IP \[bu] 2
CVE-2026-39827: ssh: memory leak when rejecting channels can lead to DoS
.IP \[bu] 2
CVE-2026-39830: ssh: client can cause server deadlock on unexpected
responses
.IP \[bu] 2
CVE-2026-39829: ssh: pathological RSA/DSA parameters may cause DoS
.IP \[bu] 2
CVE-2026-39831: ssh: bypass of FIDO/U2F security keys physical
interaction
.IP \[bu] 2
CVE-2026-39834: ssh: infinite loop on large channel writes
.IP \[bu] 2
CVE-2026-42508: ssh/knownhosts: auth bypass via unenforced \[at]revoked
status
.IP \[bu] 2
CVE-2026-46595: ssh: VerifiedPublicKeyCallback permissions skip
enforcement
.RE
.IP \[bu] 2
Update golang.org/x/image to v0.41.0 to address:
.RS 2
.IP \[bu] 2
CVE-2026-42500: bmp: panic when reading out of bound palette index
.IP \[bu] 2
CVE-2026-33809: tiff: excessive resource consumption in PackBits
decompression
.RE
.IP \[bu] 2
Update golang.org/x/sys to version v0.45.0 to address:
.RS 2
.IP \[bu] 2
CVE-2026-39824: windows: integer overflow in NewNTUnicodeString
.RE
.IP \[bu] 2
Update github.com/go-git/go-billy/v5 to 5.9.0 to fix CVE-2026-44740
.IP \[bu] 2
bisync: Fix --conflict-loser pathname with --conflict-resolve newer
(nielash)
.IP \[bu] 2
gui: Update embedded release to 1.1.8 (Nick Craig-Wood)
.IP \[bu] 2
lib/http: Replace deprecated h2c.NewHandler with http.Server.Protocols
(Nick Craig-Wood)
.IP \[bu] 2
rc: Remove duplicate metrics_addr option registration (Nick Craig-Wood)
.IP \[bu] 2
vfs/vfscache: Fix silent write failure when mounting with remote:.
(Lucky945H)
.RE
.IP \[bu] 2
doc fixes (FTCHD, Iizuki, Leon Brocard, Nick Craig-Wood)
.RE
.IP \[bu] 2
Drime
.RS 2
.IP \[bu] 2
Fix file doesn\[aq]t exists error when trying to delete (John Volk)
.IP \[bu] 2
Fix 500 errors when listing shared folders (Alvinwylim)
.RE
.IP \[bu] 2
Jottacloud
.RS 2
.IP \[bu] 2
Support whitelabel service Phonero Sky (Tore Anderson)
.RE
.IP \[bu] 2
Protondrive
.RS 2
.IP \[bu] 2
Fix corrupted on transfer: sha1 hashes differ (William Tange)
.RE
.IP \[bu] 2
S3
.RS 2
.IP \[bu] 2
Add new MEGA S4 endpoints on megas4.com including Asia-Pacific region
(Nick Craig-Wood)
.RE
.IP \[bu] 2
WebDAV
.RS 2
.IP \[bu] 2
Honour auth_redirect on listAll PROPFIND (Sai Asish Y)
.RE
.SS v1.74.1 - 2026-05-08
.PP
See commits (https://github.com/rclone/rclone/compare/v1.74.0...v1.74.1)
.IP \[bu] 2
Bug Fixes
.RS 2
.IP \[bu] 2
bisync: Fix retryable without \f[V]--resync\f[R] error message when
\f[V]--resync\f[R] has a critical failure (Gustavo V.
F.)
.IP \[bu] 2
build
.RS 2
.IP \[bu] 2
Fix multiple CVEs by upgrading to go1.26.3 (Nick Craig-Wood)
.RS 2
.IP \[bu] 2
CVE-2026-42501: cmd/go: malicious module proxy can bypass checksum
database
.IP \[bu] 2
CVE-2026-39825: net/http/httputil: ReverseProxy forwards queries with
more than urlmaxqueryparams parameters
.IP \[bu] 2
CVE-2026-39836: net: panic in Dial and LookupPort when handling NUL byte
on Windows
.IP \[bu] 2
CVE-2026-42499: net/mail: quadratic string concatenation in
consumePhrase
.IP \[bu] 2
CVE-2026-39820: net/mail: quadratic string concatentation in
consumeComment
.IP \[bu] 2
CVE-2026-39819: cmd/go: \[dq]go bug\[dq] follows symlinks in predictable
temporary filenames
.IP \[bu] 2
CVE-2026-39817: cmd/go: \[dq]go tool pack\[dq] does not sanitize output
paths
.IP \[bu] 2
CVE-2026-33814: net/http: infinite loop in HTTP/2 transport when given
bad SETTINGS_MAX_FRAME_SIZE
.IP \[bu] 2
CVE-2026-39826: html/template: escaper bypass leads to XSS
.IP \[bu] 2
CVE-2026-33811: net: crash when handling long CNAME response
.IP \[bu] 2
CVE-2026-39823: html/template: bypass of meta content URL escaping
causes XSS
.RE
.IP \[bu] 2
Update golang.org/x/net to v0.53.0 to fix CVE-2026-33814 (Nick
Craig-Wood)
.RE
.IP \[bu] 2
cmd/serve/s3: Return object listings in key order (Leon Brocard)
.RE
.IP \[bu] 2
Cloudinary
.RS 2
.IP \[bu] 2
Fix retrying every error and fix pacer sleep units (Nick Craig-Wood)
.RE
.IP \[bu] 2
Drime
.RS 2
.IP \[bu] 2
Fix large file uploads landing in drive root instead of configured
folder (Nick Craig-Wood)
.IP \[bu] 2
Fix uploads of 100..200M files (Nick Craig-Wood)
.RE
.IP \[bu] 2
Protondrive
.RS 2
.IP \[bu] 2
Route HTTP through rclone\[aq]s transport (Nick Craig-Wood)
.IP \[bu] 2
Route library logging through rclone\[aq]s logger (Nick Craig-Wood)
.IP \[bu] 2
Fix segfault when copying files missing revision metadata (Nick
Craig-Wood)
.RE
.IP \[bu] 2
S3
.RS 2
.IP \[bu] 2
Fix STS call per request by caching AssumeRole credentials (Nick
Craig-Wood)
.IP \[bu] 2
Add new Fastly Object Storage regions (Leon Brocard)
.RE
.SS v1.74.0 - 2026-05-01
.PP
See commits (https://github.com/rclone/rclone/compare/v1.73.0...v1.74.0)
@@ -91300,7 +91761,7 @@ Zata (https://rclone.org/s3/#Zata) ($\[at]M\[at]RTH_)
New Features
.RS 2
.IP \[bu] 2
Allow global config to be overriden or set on backend
Allow global config to be overridden or set on backend
creation (https://rclone.org/docs/#globalconfig) (Nick Craig-Wood)
.IP \[bu] 2
bisync: Promoted from beta to stable (nielash)
@@ -91496,7 +91957,7 @@ config file.
Googlephotos
.RS 2
.IP \[bu] 2
Added warning for Google Photos compatability-fixes (raider13209)
Added warning for Google Photos compatibility-fixes (raider13209)
.RE
.IP \[bu] 2
Imagekit
@@ -95275,7 +95736,8 @@ Update drive service account guide (Juang, Yi-Lin)
.IP \[bu] 2
Fix change notify picking up files outside the root (Nick Craig-Wood)
.IP \[bu] 2
Fix trailing slash mis-identificaton of folder as file (Nick Craig-Wood)
Fix trailing slash mis-identification of folder as file (Nick
Craig-Wood)
.IP \[bu] 2
Fix incorrect remote after Update on object (Nick Craig-Wood)
.RE
+1
View File
@@ -97,6 +97,7 @@ func New(ctx context.Context, fremote fs.Fs, opt *vfscommon.Options, avFn AddVir
}
}
relativeDirPath = fremote.Name() + "/" + relativeDirPath
relativeDirPath = clean(relativeDirPath)
relativeDirOSPath := toOSPath(relativeDirPath)
// Create cache root dirs
+13
View File
@@ -0,0 +1,13 @@
//go:build !linux && !darwin && !freebsd
package vfstest
import (
"runtime"
"testing"
)
// TestDirRewind checks that re-reading a rewound directory works
func TestDirRewind(t *testing.T) {
t.Skip("not supported on " + runtime.GOOS)
}
+75
View File
@@ -0,0 +1,75 @@
//go:build linux || darwin || freebsd
package vfstest
import (
"syscall"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// countDirFd reads the directory referred to by fd to end-of-stream using
// raw getdents syscalls and returns the number of entries (excluding "." and
// ".." which ParseDirent skips).
//
// This deliberately uses syscall.ReadDirent rather than (*os.File).Readdir so
// that it exercises the kernel readdir path directly on a single file
// descriptor, the same way an in-process rewinddir does.
func countDirFd(t *testing.T, fd int) int {
buf := make([]byte, 8192)
var names []string
for {
n, err := syscall.ReadDirent(fd, buf)
require.NoError(t, err)
if n <= 0 {
break
}
_, _, names = syscall.ParseDirent(buf[:n], -1, names)
}
return len(names)
}
// TestDirRewind checks that re-reading a directory after rewinding the
// directory stream (lseek(fd, 0, SEEK_SET), as rewinddir(3) does) returns the
// same entries as the first read.
//
// This reproduces the bug where the mount2 backend returned an empty listing
// on every read after the first because go-fuse v2.9.0 rewinds a directory by
// calling Seekdir, which dirStream did not implement. See PR #9469 and
// https://github.com/hanwen/go-fuse/issues/549
func TestDirRewind(t *testing.T) {
run.skipIfVFS(t)
run.skipIfNoFUSE(t)
run.mkdir(t, "dir")
run.createFile(t, "dir/f1", "1")
run.createFile(t, "dir/f2", "2")
run.createFile(t, "dir/f3", "3")
run.checkDir(t, "dir/|dir/f1 1|dir/f2 1|dir/f3 1")
fh, err := run.os.Open(run.path("dir"))
require.NoError(t, err)
defer func() {
_ = fh.Close()
}()
fd := int(fh.Fd())
first := countDirFd(t, fd)
assert.Equal(t, 3, first, "first read should see all entries")
// rewinddir == lseek(fd, 0, SEEK_SET)
_, err = syscall.Seek(fd, 0, 0)
require.NoError(t, err)
second := countDirFd(t, fd)
assert.Equal(t, first, second, "re-read after rewind should match first read")
require.NoError(t, fh.Close())
run.rm(t, "dir/f1")
run.rm(t, "dir/f2")
run.rm(t, "dir/f3")
run.rmdir(t, "dir")
run.checkDir(t, "")
}
+1
View File
@@ -86,6 +86,7 @@ func RunTests(t *testing.T, useVFS bool, minimumRequiredCacheMode vfscommon.Cach
t.Run("TestDirRenameEmptyDir", TestDirRenameEmptyDir)
t.Run("TestDirRenameFullDir", TestDirRenameFullDir)
t.Run("TestDirModTime", TestDirModTime)
t.Run("TestDirRewind", TestDirRewind)
if enableCacheTests {
t.Run("TestDirCacheFlush", TestDirCacheFlush)
}