Compare commits

..
Author SHA1 Message Date
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
71 changed files with 1330 additions and 2252 deletions

No files matched your search

-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
+277 -25
View File
@@ -5,7 +5,7 @@
<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" />
<meta name="dcterms.date" content="2026-05-22" />
<title>rclone(1) User Manual</title>
<style>
html {
@@ -234,7 +234,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">May 22, 2026</p>
</header>
<h1 id="name">NAME</h1>
<p>rclone - manage files on cloud storage</p>
@@ -4576,9 +4576,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!-20260522</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-05-22 0431PM</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 +15125,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
@@ -21695,7 +21695,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.2&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 +21833,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 +22033,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 +24434,27 @@ 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>TestGoFile</code> (<code>gofile</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/gofile-cmd.bisync-TestGoFile-1.txt"><code>TestBisyncRemoteLocal/rclone_args</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>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/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt"><code>TestBisyncRemoteRemote/ext_paths</code></a></li>
<li><a href="https://pub.rclone.org/integration-tests/current/">2
more</a></li>
</ul></li>
<li>Updated: 2026-05-22-010013
<!--- 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 +25358,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 +27357,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 +27382,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 +28334,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 +28359,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 +29011,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 +30977,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 +37500,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 +41530,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 +45081,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 +50238,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 +50601,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 +55491,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 +65099,167 @@ the output.</p>
<!-- autogenerated options stop -->
<!-- markdownlint-disable line-length -->
<h1 id="changelog-1">Changelog</h1>
<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 +66218,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 +66353,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 +69112,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
+159 -21
View File
@@ -1,6 +1,6 @@
% rclone(1) User Manual
% Nick Craig-Wood
% May 01, 2026
% May 22, 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!-20260522
```
```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-05-22 0431PM
```
```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.
@@ -24985,7 +24985,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.2")
```
@@ -25177,7 +25177,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 +25383,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 +27772,16 @@ 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
- `TestGoFile` (`gofile`)
- [`TestBisyncRemoteLocal/rclone_args`](https://pub.rclone.org/integration-tests/current/gofile-cmd.bisync-TestGoFile-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)
- [`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)
- [`TestBisyncRemoteRemote/ext_paths`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [2 more](https://pub.rclone.org/integration-tests/current/)
- Updated: 2026-05-22-010013
<!--- 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 +28625,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 +30512,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 +30527,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 +31108,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 +31123,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 +31515,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 +32902,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 +40255,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 +44847,7 @@ Properties:
- Config: upload_cutoff
- Env Var: RCLONE_DRIME_UPLOAD_CUTOFF
- Type: SizeSuffix
- Default: 200Mi
- Default: 5Mi
#### --drime-chunk-size
@@ -48753,7 +48804,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 +54133,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 +70298,91 @@ Options:
# Changelog
## 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 +70883,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 +70950,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 +72307,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
+199 -19
View File
@@ -1,6 +1,6 @@
rclone(1) User Manual
Nick Craig-Wood
May 01, 2026
May 22, 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!-20260522
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-05-22 0431PM
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.
@@ -23140,7 +23140,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.2")
Performance
@@ -23305,7 +23305,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 +23508,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 +25839,16 @@ 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
- TestGoFile (gofile)
- TestBisyncRemoteLocal/rclone_args
- TestHuaweiDrive (huaweidrive)
- TestBisyncRemoteLocal/ext_paths
- TestBisyncRemoteLocal/extended_filenames
- TestBisyncLocalRemote/ext_paths
- TestBisyncLocalRemote/extended_filenames
- TestBisyncRemoteRemote/ext_paths
- 2 more
- Updated: 2026-05-22-010013
The following backends either have not been tested recently or have
known issues that are deemed unfixable for the time being:
@@ -26682,6 +26689,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 +28547,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 +28562,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 +29145,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 +29160,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 +29552,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 +38014,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 +42456,7 @@ Properties:
- Config: upload_cutoff
- Env Var: RCLONE_DRIME_UPLOAD_CUTOFF
- Type: SizeSuffix
- Default: 200Mi
- Default: 5Mi
--drime-chunk-size
@@ -51596,6 +51647,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 +67389,133 @@ Options:
Changelog
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 +68152,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 +68252,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 +70138,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.2
+1 -1
View File
@@ -588,7 +588,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)
+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) {
+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")
}
+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>`)
}
-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
+10 -3
View File
@@ -1053,9 +1053,16 @@ 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
- `TestGoFile` (`gofile`)
- [`TestBisyncRemoteLocal/rclone_args`](https://pub.rclone.org/integration-tests/current/gofile-cmd.bisync-TestGoFile-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)
- [`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)
- [`TestBisyncRemoteRemote/ext_paths`](https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
- [2 more](https://pub.rclone.org/integration-tests/current/)
- Updated: 2026-05-22-010013
<!--- 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
+54 -3
View File
@@ -6,6 +6,57 @@ description: "Rclone Changelog"
# Changelog
## 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 +591,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 +658,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 +2015,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.2")
-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!-20260522
```
```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-05-22 0431PM
```
```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.2")
```
@@ -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.
+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.2
-24
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() {
-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")
+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())
+5 -8
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
}
-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
+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.2"
+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
+9 -9
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
@@ -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
)
+18 -18
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=
@@ -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!-20260522
```
```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-05-22 0446PM
```
```console
Generated
+373 -20
View File
@@ -15,7 +15,7 @@
. ftr VB CB
. ftr VBI CBI
.\}
.TH "rclone" "1" "May 01, 2026" "User Manual" ""
.TH "rclone" "1" "May 22, 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!-20260522
\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-05-22 0431PM
\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
@@ -30179,7 +30179,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.2\[dq])
\f[R]
.fi
.SS Performance
@@ -30371,7 +30371,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 +30577,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 +33477,29 @@ 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]TestGoFile\f[R] (\f[V]gofile\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]TestBisyncRemoteLocal/rclone_args\f[R] (https://pub.rclone.org/integration-tests/current/gofile-cmd.bisync-TestGoFile-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]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
\f[V]TestBisyncRemoteRemote/ext_paths\f[R] (https://pub.rclone.org/integration-tests/current/huaweidrive-cmd.bisync-TestHuaweiDrive-1.txt)
.IP \[bu] 2
2 more (https://pub.rclone.org/integration-tests/current/)
.RE
.IP \[bu] 2
Updated: 2026-05-22-010013
.PP
The following backends either have not been tested recently or have
known issues that are deemed unfixable for the time being:
@@ -34602,6 +34618,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 +37367,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 +37407,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 +37423,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 +38936,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 +38976,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 +38992,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 +40020,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 +40087,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 +40095,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 +40103,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 +43111,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 +51543,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 +57108,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 +69370,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 +90121,227 @@ Options:
.IP \[bu] 2
\[dq]error\[dq]: Return an error based on option value.
.SH Changelog
.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 +91652,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 +91848,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 +95627,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