Compare commits

...
44 Commits
Author SHA1 Message Date
Nick Craig-Wood 55bd60019e Version v1.53.3 2020-11-19 17:01:56 +00:00
Nick Craig-Wood c8b11d27e1 random: seed math/rand in one place with crypto strong seed #4783
This shouldn't be read as encouraging the use of math/rand instead of
crypto/rand in security sensitive contexts, rather as a safer default
if that does happen by accident.
2020-11-19 16:51:26 +00:00
Nick Craig-Wood 4c215cc81e random: fix incorrect use of math/rand instead of crypto/rand CVE-2020-28924
For implications see the linked issue.

Fixes #4783
2020-11-19 16:49:51 +00:00
Nick Craig-Wood 4df333255a sharefile: fix backend due to API swapping integers for strings
For some reason the API started returning some integers as strings in
JSON. This is probably OK in Javascript but it upsets Go.

This is easily fixed with the `json:"name,size"` struct tag.
2020-11-18 15:50:12 +00:00
Nick Craig-Wood 843d684568 vfs: fix vfs/refresh calls with fs= parameter
Before this change rclone gave an error when the fs parameter was
provided.

This change removes the fs parameter from the parameters once it has
been read which avoids the error.

See: https://forum.rclone.org/t/precaching-with-vfs-refresh-fails-with-an-error-when-having-multiple-cloud-drives/20267
2020-11-07 14:27:47 +00:00
Nick Craig-Wood 46ea3d93b5 Start v1.53.3-DEV development 2020-10-26 15:40:37 +00:00
Nick Craig-Wood 89f2d43f17 Version v1.53.2 2020-10-26 13:26:58 +00:00
Nick Craig-Wood cfc5d76fca build: stop using set-env and set-path in the GitHub actions
A security problem was discovered when using set-env and
set-path. This has been deprecated by GitHub and a new mechanism
introduced.

This patch switches to using the new mechanism which will stop GitHub
warning about the use of the old mechanism.

See: https://github.com/actions/toolkit/security/advisories/GHSA-mfwh-5m23-j46w
2020-10-26 12:51:07 +00:00
Nick Craig-Wood 0af493f693 build: work around GitHub actions brew problem
Brew was failing with

    fatal: 'origin' does not appear to be a git repository
    fatal: Could not read from remote repository.

See: https://github.com/actions/virtual-environments/issues/1811
See: https://github.com/actions/virtual-environments/issues/1869
2020-10-26 10:37:42 +00:00
Nick Craig-Wood 51b3ee9a97 test: add ListRetries config parameter to integration tests
Occasionally the b2 tests fail because the integration tests don't
retry hard enough with their new setting of -list-retries 3. Override
this setting to 5 for the b2 tests only.
2020-10-25 16:15:41 +00:00
Nick Craig-Wood 6a4b49479d union: create root directories if none exist
This fixes the TestUnion: integration test if the /tmp/union[123] dirs
don't exist.
2020-10-25 16:02:52 +00:00
Nick Craig-Wood 4b03ee0f99 test: remove TestS3Ceph: and TestSwiftCeph: from integration tests
Unfortunately we don't have access to this server any more
2020-10-25 08:48:23 +00:00
albertony 2f6231f7ac jottacloud: avoid double url escaping of device/mountpoint - fixes #4697 2020-10-22 16:52:41 +01:00
Nick Craig-Wood c0e6f54f01 local: fix sizes and syncing with --links option on Windows - fixes #4581
Before this change rclone returned the size from the Stat call of the
link. On Windows this reads as 0 always, however on unix it reads as
the length of the text in the link. This caused errors like this when
syncing:

    Failed to copy: corrupted on transfer: sizes differ 0 vs 13

This change causes Windows platforms to read the link and use that as
the size of the link instead of 0 which fixes the problem.
2020-10-17 10:42:02 +01:00
Nick Craig-Wood def7b77d0f vfs: Fix --no-modtime to not attempt to set modtimes (as documented)
See: https://forum.rclone.org/t/rclone-mount-with-azure-blob-archive-tier/19414
2020-10-09 17:02:13 +01:00
Nick Craig-Wood 51b18a4a26 onedrive: fix disk usage for sharepoint
Some onedrive sharepoints appear to return all 0s for quota

    "quota":{"deleted":0,"remaining":0,"total":0,"used":0}

This commit detects this and returns unknown for all quota parts.

See: https://forum.rclone.org/t/zero-size-volume-when-mounting-onedrive-sharepoint/19597
2020-10-09 14:12:29 +01:00
buengese 7cb76f9054 jottacloud: remove clientSecret from config when upgrading to token based authentication - #4645 2020-10-08 11:53:27 +02:00
Anagh Kumar Baranwal 00ccc93482 s3: Add missing regions for AWS
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
2020-10-06 16:55:34 +01:00
Dov Murik f9fe494d93 docs: Box: explain about the backslash-like unicode character
Add the full name of the backslash-lookalike unicode character.
2020-10-06 16:55:31 +01:00
edwardxml 4a0c266787 crypt: update docs
Mostly tense, clarity and point of view proposed changes.

There is still some duplication and benefits that would accrue from further examples.
2020-10-06 16:43:06 +01:00
gyutw f48d0a518c fichier: increase maximum file size from 100GB to 300GB - fixes #4634 2020-10-06 16:43:06 +01:00
Russell Cattelan 99ff594773 cmd/mount2: fix the swapped UID / GID values 2020-10-06 16:43:06 +01:00
Christopher Stewart 6c140705e3 s3: fix spelling mistake
Fix spelling mistake "patific" => "pacific"
2020-10-06 16:43:06 +01:00
Leo Luan e76963a971 vfs: Add a missed update of used cache space
The missed update can cause incorrect before-cleaning cache stats
and a pre-mature condition broadcast in purgeOld before the cache
space use is reduced below the quota.
2020-10-06 16:43:06 +01:00
Leo Luan 43ad7b10a2 vfs: Add exponential backoff during ENOSPC retries
Add an exponentially increasing delay during retries up ENOSPC error
to avoid exhausting the 10 retries too soon when the cache space
recovery from item resets is not available from the file system yet
or consumed by other large cache writes.
2020-10-06 16:43:06 +01:00
Leo Luan f6970c65dd vfs: Fix missed concurrency control between some item operations and reset
Item reset is invoked by cache cleaner for synchronous recovery
from ENOSPC errors. The reset operation removes the cache file and
closes/reopens the downloaders.  Although most parts of reset and
other item operations are done with the item mutex held, the mutex
is released during fd.WriteAt and downloaders calls. We used preAccess
and postAccess calls to serialize Reset, ReadAt, and Open, but missed
some other item operations. The patch adds preAccess/postAccess
calls in Sync, Truncate, Close, WriteAt, and rename.
2020-10-06 16:43:06 +01:00
Leo Luan 6012179c67 vfs: Fix a race condition in retryFailedResets
A failed item reset is saved in the errItems for retryFailedResets
to process.  If the item gets closed before the retry, the item may
have been removed from the c.item array. Previous code did not
account for this condition. This patch adds the check for the
exitence of the retry items in retryFailedResets.
2020-10-06 16:43:06 +01:00
Leo Luan 3ecdd4516f vfs: Fix a deadlock vulnerability in downloaders.Close
The downloaders.Close() call acquires the downloaders' mutex before
calling the wait group wait and the main downloaders thread has a
periodical (5 seconds interval) call to kick its waiters and the
waiter dispatch function tries to get the mutex. So a deadlock can
occur if the Close() call starts, gets the mutex, while the main
downloader thread already got the timer's tick and proceeded to
call kickWaiters. The deadlock happens when the Close call gets
the mutex between the timer's kick and the main downloader thread
gets the mutex first. So it's a pretty short period of time and
it probably explains why the problem has not surfaced, maybe
something like tens of nanoseconds out of 5 seconds (~10^^-8).
It took 5 days of continued stressing the Close calls for the
deadlock to appear.
2020-10-06 16:43:06 +01:00
buengese 3b18ba1358 jottacloud: remove DirMove workaround as it's not required anymore - also fixes #4655 2020-10-05 21:32:04 +02:00
Nick Craig-Wood 5fbbab58ed operations: fix spurious "--checksum is in use but the source and destination have no hashes in common"
Before this change rclone would emit the message

    --checksum is in use but the source and destination have no hashes in common; falling back to --size-only

When the source or destination hash was missing as well as when the
source and destination had no hashes in common.

This first case is very confusing for users when the source and
destination do have a hash in common.

This change fixes that and makes sure the error message is not emitted
on missing hashes even when there is a hash in common.

See: https://forum.rclone.org/t/source-and-destination-have-no-hashes-in-common-for-unencrypted-drive-to-local-sync/19531
2020-10-05 16:08:15 +01:00
Nick Craig-Wood 80b93beedf operations: fix use of --suffix without --backup-dir
As part of the original work adding this feature it was overlooked
that this didn't actually work for full rclone copy/sync.

This commit fixes the problem and adds a test to make sure it stays
working.

See: https://forum.rclone.org/t/suffix-not-working-on-folder-upload-via-ssh-sftp/19526
2020-10-05 16:08:15 +01:00
Nick Craig-Wood eb5c47fcfa mount: docs: remove incorrect statement about --vfs-cache-mode full
See: https://forum.rclone.org/t/is-this-documentation-correct/19376
2020-10-05 16:08:15 +01:00
Ivan Andreev c7335e780b chunker: disable ListR to fix missing files on GDrive (workaround #3972) 2020-09-26 15:20:05 +03:00
Ivan Andreev 878ebf3658 mailru: fix invalid timestamp on corrupted files (fixes #4229) 2020-09-26 15:14:08 +03:00
Nick Craig-Wood 1c860ef252 accounting: stabilize display order of transfers on Windows
Before this change we sorted transfers in the stats list solely on
time started. However if --check-first was in use then lots of
transfers could be started in the same millisecond. Because Windows
time resolution is only 1mS this caused the entries to sort equal and
bounce around in the list.

This change fixes the sort so that if the time is equal it uses the
name which should stabilize the order.

Fixes #4599
2020-09-24 19:11:29 +01:00
buengese a0494479f9 sftp: always convert the checksum to lower case - fixes #4518 2020-09-22 18:37:48 +02:00
Ivan Andreev 9a9a134188 Merge pull request #4608 from ivandeex/pr-chunker-crypt
chunker: fix upload over crypt (fixes #4570)
2020-09-18 18:30:30 +03:00
Ivan Andreev 41ccf01f29 mailru: re-enable fixed chunker tests
This reverts commit 9d3d397f50.
2020-09-18 18:30:24 +03:00
Ivan Andreev 06f3daa64b mailru: fix range requests after june changes on server 2020-09-18 18:30:17 +03:00
Ivan Andreev d5fe63c0a0 mailru: fix uploads after recent changes on server
similar fix: https://github.com/yar229/WebDavMailRuCloud/commit/5efa9958f1f8fae568908e3f547c2580f48d49dc
2020-09-18 18:30:11 +03:00
Muffin King b7f0e776f6 seafile: fix accessing libraries > 2GB on 32 bit systems - fixes #4588 2020-09-18 10:36:52 +01:00
Nick Craig-Wood b89f8c05cf vfs: detect and recover from a file being removed externally from the cache
Before this change if a file was removed from the cache while rclone
is running then rclone would not notice and proceed to re-create it
full of zeros.

This change notices files that we expect to have data in going missing
and if they do logs an ERROR recovers.

It isn't recommended deleting files from the cache manually with
rclone running!

See: https://forum.rclone.org/t/corrupted-data-streaming-after-vfs-meta-files-removed/18997
Fixes #4602
2020-09-18 10:36:35 +01:00
Nick Craig-Wood b81dc16484 acounting: fix incorrect speed and transferTime in core/stats
Before this change the code which summed up the existing transfers
over all the stats groups forgot to add the old transfer time and old
transfers in.

This meant that the speed and elapsedTime got increasingly inaccurate
over time due to the transfers being culled from the list but their
time not being accounted for.

This change adds the old transfers into the sum which fixes the
problem.

This was only a problem over the rc.

Fixes #4569
2020-09-15 12:02:21 +01:00
Nick Craig-Wood 0e121eeddb Start v1.53.2-DEV development 2020-09-13 10:23:47 +01:00
49 changed files with 1632 additions and 634 deletions

No files matched your search

+10 -8
View File
@@ -107,10 +107,10 @@ jobs:
- name: Set environment variables
shell: bash
run: |
echo '::set-env name=GOTAGS::${{ matrix.gotags }}'
echo '::set-env name=BUILD_FLAGS::${{ matrix.build_flags }}'
if [[ "${{ matrix.goarch }}" != "" ]]; then echo '::set-env name=GOARCH::${{ matrix.goarch }}' ; fi
if [[ "${{ matrix.cgo }}" != "" ]]; then echo '::set-env name=CGO_ENABLED::${{ matrix.cgo }}' ; fi
echo 'GOTAGS=${{ matrix.gotags }}' >> $GITHUB_ENV
echo 'BUILD_FLAGS=${{ matrix.build_flags }}' >> $GITHUB_ENV
if [[ "${{ matrix.goarch }}" != "" ]]; then echo 'GOARCH=${{ matrix.goarch }}' >> $GITHUB_ENV ; fi
if [[ "${{ matrix.cgo }}" != "" ]]; then echo 'CGO_ENABLED=${{ matrix.cgo }}' >> $GITHUB_ENV ; fi
- name: Install Libraries on Linux
shell: bash
@@ -124,6 +124,8 @@ jobs:
- name: Install Libraries on macOS
shell: bash
run: |
brew untap local/homebrew-openssl # workaround for https://github.com/actions/virtual-environments/issues/1811
brew untap local/homebrew-python2 # workaround for https://github.com/actions/virtual-environments/issues/1811
brew update
brew cask install osxfuse
if: matrix.os == 'macOS-latest'
@@ -133,10 +135,10 @@ jobs:
run: |
$ProgressPreference = 'SilentlyContinue'
choco install -y winfsp zip
Write-Host "::set-env name=CPATH::C:\Program Files\WinFsp\inc\fuse;C:\Program Files (x86)\WinFsp\inc\fuse"
echo "CPATH=C:\Program Files\WinFsp\inc\fuse;C:\Program Files (x86)\WinFsp\inc\fuse" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if ($env:GOARCH -eq "386") {
choco install -y mingw --forcex86 --force
Write-Host "::add-path::C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw32\\bin"
echo "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw32\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
# Copy mingw32-make.exe to make.exe so the same command line
# can be used on Windows as on macOS and Linux
@@ -223,8 +225,8 @@ jobs:
- name: Set environment variables
shell: bash
run: |
echo '::set-env name=GOPATH::${{ runner.workspace }}'
echo '::add-path::${{ runner.workspace }}/bin'
echo 'GOPATH=${{ runner.workspace }}' >> $GITHUB_ENV
echo '${{ runner.workspace }}/bin' >> $GITHUB_PATH
- name: Cross-compile rclone
run: |
Generated
+227 -43
View File
@@ -17,7 +17,7 @@
<header id="title-block-header">
<h1 class="title">rclone(1) User Manual</h1>
<p class="author">Nick Craig-Wood</p>
<p class="date">Sep 13, 2020</p>
<p class="date">Nov 19, 2020</p>
</header>
<h1 id="rclone-syncs-your-files-to-cloud-storage">Rclone syncs your files to cloud storage</h1>
<p><img width="50%" src="https://rclone.org/img/logo_on_light__horizontal_color.svg" alt="rclone logo" style="float:right; padding: 5px;" ></p>
@@ -1455,7 +1455,6 @@ umount /path/to/local/mount</code></pre>
<p>--vfs-read-chunk-size will enable reading the source objects in parts. This can reduce the used download quota for some remotes by requesting only chunks from the remote that are actually read at the cost of an increased number of requests.</p>
<p>When --vfs-read-chunk-size-limit is also specified and greater than --vfs-read-chunk-size, the chunk size for each open file will get doubled for each chunk read, until the specified value is reached. A value of -1 will disable the limit and the chunk size will grow indefinitely.</p>
<p>With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on. When --vfs-read-chunk-size-limit 500M is specified, the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.</p>
<p>Chunked reading will only work with --vfs-cache-mode &lt; full, as the file will always be copied to the vfs cache before opening with --vfs-cache-mode full.</p>
<h2 id="vfs---virtual-file-system">VFS - Virtual File System</h2>
<p>This command uses the VFS layer. This adapts the cloud storage objects that rclone uses into something which looks much more like a disk filing system.</p>
<p>Cloud storage objects have lots of properties which aren't like disk files - you can't extend them or write to the middle of them, so the VFS layer has to deal with that. Because there is no one right way of doing this there are various options explained below.</p>
@@ -3397,8 +3396,10 @@ y/n/s/!/q&gt; n</code></pre>
<p>The remote in use must support server side move or copy and you must use the same remote as the destination of the sync.</p>
<p>This is for use with files to add the suffix in the current directory or with <code>--backup-dir</code>. See <code>--backup-dir</code> for more info.</p>
<p>For example</p>
<pre><code>rclone sync -i /path/to/local/file remote:current --suffix .bak</code></pre>
<p>will sync <code>/path/to/local</code> to <code>remote:current</code>, but for any files which would have been updated or deleted have .bak added.</p>
<pre><code>rclone copy -i /path/to/local/file remote:current --suffix .bak</code></pre>
<p>will copy <code>/path/to/local</code> to <code>remote:current</code>, but for any files which would have been updated or deleted have .bak added.</p>
<p>If using <code>rclone sync</code> with <code>--suffix</code> and without <code>--backup-dir</code> then it is recommended to put a filter rule in excluding the suffix otherwise the <code>sync</code> will delete the backup files.</p>
<pre><code>rclone sync -i /path/to/local/file remote:current --suffix .bak --exclude &quot;*.bak&quot;</code></pre>
<h3 id="suffix-keep-extension">--suffix-keep-extension</h3>
<p>When using <code>--suffix</code>, setting this causes rclone put the SUFFIX before the extension of the files that it backs up rather than after.</p>
<p>So let's say we had <code>--suffix -2019-01-01</code>, without the flag <code>file.txt</code> would be backed up to <code>file.txt-2019-01-01</code> and with the flag it would be backed up to <code>file-2019-01-01.txt</code>. This can be helpful to make sure the suffixed files can still be opened.</p>
@@ -6290,7 +6291,7 @@ Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total
--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. The default is rclone/ version (default &quot;rclone/v1.53.1&quot;)
--user-agent string Set the user-agent to a specified string. The default is rclone/ version (default &quot;rclone/v1.53.3&quot;)
-v, --verbose count Print lots more stuff (repeat for more)</code></pre>
<h2 id="backend-flags">Backend Flags</h2>
<p>These flags are available for every command. They control the backends and may be set in the config file.</p>
@@ -7178,7 +7179,7 @@ Choose a number from below, or type in your own value
/ Asia Pacific (Mumbai)
13 | Needs location constraint ap-south-1.
\ &quot;ap-south-1&quot;
/ Asia Patific (Hong Kong) Region
/ Asia Pacific (Hong Kong) Region
14 | Needs location constraint ap-east-1.
\ &quot;ap-east-1&quot;
/ South America (Sao Paulo) Region
@@ -7553,16 +7554,16 @@ y/e/d&gt; </code></pre>
<li>US East (Ohio) Region</li>
<li>Needs location constraint us-east-2.</li>
</ul></li>
<li>"us-west-2"
<ul>
<li>US West (Oregon) Region</li>
<li>Needs location constraint us-west-2.</li>
</ul></li>
<li>"us-west-1"
<ul>
<li>US West (Northern California) Region</li>
<li>Needs location constraint us-west-1.</li>
</ul></li>
<li>"us-west-2"
<ul>
<li>US West (Oregon) Region</li>
<li>Needs location constraint us-west-2.</li>
</ul></li>
<li>"ca-central-1"
<ul>
<li>Canada (Central) Region</li>
@@ -7578,11 +7579,21 @@ y/e/d&gt; </code></pre>
<li>EU (London) Region</li>
<li>Needs location constraint eu-west-2.</li>
</ul></li>
<li>"eu-west-3"
<ul>
<li>EU (Paris) Region</li>
<li>Needs location constraint eu-west-3.</li>
</ul></li>
<li>"eu-north-1"
<ul>
<li>EU (Stockholm) Region</li>
<li>Needs location constraint eu-north-1.</li>
</ul></li>
<li>"eu-south-1"
<ul>
<li>EU (Milan) Region</li>
<li>Needs location constraint eu-south-1.</li>
</ul></li>
<li>"eu-central-1"
<ul>
<li>EU (Frankfurt) Region</li>
@@ -7608,6 +7619,11 @@ y/e/d&gt; </code></pre>
<li>Asia Pacific (Seoul)</li>
<li>Needs location constraint ap-northeast-2.</li>
</ul></li>
<li>"ap-northeast-3"
<ul>
<li>Asia Pacific (Osaka-Local)</li>
<li>Needs location constraint ap-northeast-3.</li>
</ul></li>
<li>"ap-south-1"
<ul>
<li>Asia Pacific (Mumbai)</li>
@@ -7615,7 +7631,7 @@ y/e/d&gt; </code></pre>
</ul></li>
<li>"ap-east-1"
<ul>
<li>Asia Patific (Hong Kong) Region</li>
<li>Asia Pacific (Hong Kong) Region</li>
<li>Needs location constraint ap-east-1.</li>
</ul></li>
<li>"sa-east-1"
@@ -7623,6 +7639,36 @@ y/e/d&gt; </code></pre>
<li>South America (Sao Paulo) Region</li>
<li>Needs location constraint sa-east-1.</li>
</ul></li>
<li>"me-south-1"
<ul>
<li>Middle East (Bahrain) Region</li>
<li>Needs location constraint me-south-1.</li>
</ul></li>
<li>"af-south-1"
<ul>
<li>Africa (Cape Town) Region</li>
<li>Needs location constraint af-south-1.</li>
</ul></li>
<li>"cn-north-1"
<ul>
<li>China (Beijing) Region</li>
<li>Needs location constraint cn-north-1.</li>
</ul></li>
<li>"cn-northwest-1"
<ul>
<li>China (Ningxia) Region</li>
<li>Needs location constraint cn-northwest-1.</li>
</ul></li>
<li>"us-gov-east-1"
<ul>
<li>AWS GovCloud (US-East) Region</li>
<li>Needs location constraint us-gov-east-1.</li>
</ul></li>
<li>"us-gov-west-1"
<ul>
<li>AWS GovCloud (US) Region</li>
<li>Needs location constraint us-gov-west-1.</li>
</ul></li>
</ul></li>
</ul>
<h4 id="s3-region-1">--s3-region</h4>
@@ -8202,14 +8248,14 @@ y/e/d&gt; </code></pre>
<ul>
<li>US East (Ohio) Region.</li>
</ul></li>
<li>"us-west-2"
<ul>
<li>US West (Oregon) Region.</li>
</ul></li>
<li>"us-west-1"
<ul>
<li>US West (Northern California) Region.</li>
</ul></li>
<li>"us-west-2"
<ul>
<li>US West (Oregon) Region.</li>
</ul></li>
<li>"ca-central-1"
<ul>
<li>Canada (Central) Region.</li>
@@ -8222,10 +8268,18 @@ y/e/d&gt; </code></pre>
<ul>
<li>EU (London) Region.</li>
</ul></li>
<li>"eu-west-3"
<ul>
<li>EU (Paris) Region.</li>
</ul></li>
<li>"eu-north-1"
<ul>
<li>EU (Stockholm) Region.</li>
</ul></li>
<li>"eu-south-1"
<ul>
<li>EU (Milan) Region.</li>
</ul></li>
<li>"EU"
<ul>
<li>EU Region.</li>
@@ -8244,20 +8298,48 @@ y/e/d&gt; </code></pre>
</ul></li>
<li>"ap-northeast-2"
<ul>
<li>Asia Pacific (Seoul)</li>
<li>Asia Pacific (Seoul) Region.</li>
</ul></li>
<li>"ap-northeast-3"
<ul>
<li>Asia Pacific (Osaka-Local) Region.</li>
</ul></li>
<li>"ap-south-1"
<ul>
<li>Asia Pacific (Mumbai)</li>
<li>Asia Pacific (Mumbai) Region.</li>
</ul></li>
<li>"ap-east-1"
<ul>
<li>Asia Pacific (Hong Kong)</li>
<li>Asia Pacific (Hong Kong) Region.</li>
</ul></li>
<li>"sa-east-1"
<ul>
<li>South America (Sao Paulo) Region.</li>
</ul></li>
<li>"me-south-1"
<ul>
<li>Middle East (Bahrain) Region.</li>
</ul></li>
<li>"af-south-1"
<ul>
<li>Africa (Cape Town) Region.</li>
</ul></li>
<li>"cn-north-1"
<ul>
<li>China (Beijing) Region</li>
</ul></li>
<li>"cn-northwest-1"
<ul>
<li>China (Ningxia) Region.</li>
</ul></li>
<li>"us-gov-east-1"
<ul>
<li>AWS GovCloud (US-East) Region.</li>
</ul></li>
<li>"us-gov-west-1"
<ul>
<li>AWS GovCloud (US) Region.</li>
</ul></li>
</ul></li>
</ul>
<h4 id="s3-location-constraint-1">--s3-location-constraint</h4>
@@ -10194,7 +10276,7 @@ y/e/d&gt; y</code></pre>
</ul>
<h3 id="limitations-3">Limitations</h3>
<p>Note that Box is case insensitive so you can't have a file called "Hello.doc" and one called "hello.doc".</p>
<p>Box file names can't have the <code>\</code> character in. rclone maps this to and from an identical looking unicode equivalent <code>\</code>.</p>
<p>Box file names can't have the <code>\</code> character in. rclone maps this to and from an identical looking unicode equivalent <code>\</code> (U+FF3C Fullwidth Reverse Solidus).</p>
<p>Box only supports filenames up to 255 characters in length.</p>
<h2 id="cache-beta">Cache (BETA)</h2>
<p>The <code>cache</code> remote wraps another existing remote and stores file structure and its data for long running tasks like <code>rclone mount</code>.</p>
@@ -11058,10 +11140,11 @@ y/e/d&gt; y</code></pre>
<li>Default: Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot</li>
</ul>
<h2 id="crypt">Crypt</h2>
<p>The <code>crypt</code> remote encrypts and decrypts another remote.</p>
<p>To use it first set up the underlying remote following the config instructions for that remote. You can also use a local pathname instead of a remote which will encrypt and decrypt from that directory which might be useful for encrypting onto a USB stick for example.</p>
<p>First check your chosen remote is working - we'll call it <code>remote:path</code> in these docs. Note that anything inside <code>remote:path</code> will be encrypted and anything outside won't. This means that if you are using a bucket based remote (eg S3, B2, swift) then you should probably put the bucket in the remote <code>s3:bucket</code>. If you just use <code>s3:</code> then rclone will make encrypted bucket names too (if using file name encryption) which may or may not be what you want.</p>
<p>Now configure <code>crypt</code> using <code>rclone config</code>. We will call this one <code>secret</code> to differentiate it from the <code>remote</code>.</p>
<p>Rclone <code>crypt</code> remotes encrypt and decrypt other remotes.</p>
<p>To use <code>crypt</code>, first set up the underlying remote. Follow the <code>rclone config</code> instructions for that remote.</p>
<p><code>crypt</code> applied to a local pathname instead of a remote will encrypt and decrypt that directory, and can be used to encrypt USB removable drives.</p>
<p>Before configuring the crypt remote, check the underlying remote is working. In this example the underlying remote is called <code>remote:path</code>. Anything inside <code>remote:path</code> will be encrypted and anything outside will not. In the case of an S3 based underlying remote (eg Amazon S3, B2, Swift) it is generally advisable to define a crypt remote in the underlying remote <code>s3:bucket</code>. If <code>s3:</code> alone is specified alongside file name encryption, rclone will encrypt the bucket name.</p>
<p>Configure <code>crypt</code> using <code>rclone config</code>. In this example the <code>crypt</code> remote is called <code>secret</code>, to differentiate it from the underlying <code>remote</code>.</p>
<pre><code>No remotes found - make a new one
n) New remote
s) Set configuration password
@@ -11131,21 +11214,20 @@ y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d&gt; y</code></pre>
<p><strong>Important</strong> The password is stored in the config file is lightly obscured so it isn't immediately obvious what it is. It is in no way secure unless you use config file encryption.</p>
<p>A long passphrase is recommended, or you can use a random one.</p>
<p>The obscured password is created by using AES-CTR with a static key, with the salt stored verbatim at the beginning of the obscured password. This static key is shared by between all versions of rclone.</p>
<p><strong>Important</strong> The crypt password stored in <code>rclone.conf</code> is lightly obscured. That only protects it from cursory inspection. It is not secure unless encryption of <code>rclone.conf</code> is specified.</p>
<p>A long passphrase is recommended, or <code>rclone config</code> can generate a random one.</p>
<p>The obscured password is created using AES-CTR with a static key. The salt is stored verbatim at the beginning of the obscured password. This static key is shared between all versions of rclone.</p>
<p>If you reconfigure rclone with the same passwords/passphrases elsewhere it will be compatible, but the obscured version will be different due to the different salt.</p>
<p>Note that rclone does not encrypt</p>
<p>Rclone does not encrypt</p>
<ul>
<li>file length - this can be calculated within 16 bytes</li>
<li>modification time - used for syncing</li>
</ul>
<h2 id="specifying-the-remote-1">Specifying the remote</h2>
<p>In normal use, make sure the remote has a <code>:</code> in. If you specify the remote without a <code>:</code> then rclone will use a local directory of that name. So if you use a remote of <code>/path/to/secret/files</code> then rclone will encrypt stuff to that directory. If you use a remote of <code>name</code> then rclone will put files in a directory called <code>name</code> in the current directory.</p>
<p>If you specify the remote as <code>remote:path/to/dir</code> then rclone will store encrypted files in <code>path/to/dir</code> on the remote. If you are using file name encryption, then when you save files to <code>secret:subdir/subfile</code> this will store them in the unencrypted path <code>path/to/dir</code> but the <code>subdir/subpath</code> bit will be encrypted.</p>
<p>Note that unless you want encrypted bucket names (which are difficult to manage because you won't know what directory they represent in web interfaces etc), you should probably specify a bucket, eg <code>remote:secretbucket</code> when using bucket based remotes such as S3, Swift, Hubic, B2, GCS.</p>
<p>In normal use, ensure the remote has a <code>:</code> in. If specified without, rclone uses a local directory of that name. For example if a remote <code>/path/to/secret/files</code> is specified, rclone encrypts content to that directory. If a remote <code>name</code> is specified, rclone targets a directory <code>name</code> in the current directory.</p>
<p>If remote <code>remote:path/to/dir</code> is specified, rclone stores encrypted files in <code>path/to/dir</code> on the remote. With file name encryption, files saved to <code>secret:subdir/subfile</code> are stored in the unencrypted path <code>path/to/dir</code> but the <code>subdir/subpath</code> element is encrypted.</p>
<h2 id="example">Example</h2>
<p>To test I made a little directory of files using "standard" file name encryption.</p>
<p>Create the following file structure using "standard" file name encryption.</p>
<pre><code>plaintext/
├── file0.txt
├── file1.txt
@@ -11154,7 +11236,7 @@ y/e/d&gt; y</code></pre>
├── file3.txt
└── subsubdir
└── file4.txt</code></pre>
<p>Copy these to the remote and list them back</p>
<p>Copy these to the remote, and list them</p>
<pre><code>$ rclone -q copy plaintext secret:
$ rclone -q ls secret:
7 file1.txt
@@ -11162,19 +11244,19 @@ $ rclone -q ls secret:
8 subdir/file2.txt
10 subdir/subsubdir/file4.txt
9 subdir/file3.txt</code></pre>
<p>Now see what that looked like when encrypted</p>
<p>The crypt remote looks like</p>
<pre><code>$ rclone -q ls remote:path
55 hagjclgavj2mbiqm6u6cnjjqcg
54 v05749mltvv1tf4onltun46gls
57 86vhrsv86mpbtd3a0akjuqslj8/dlj7fkq4kdq72emafg7a7s41uo
58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc
56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps</code></pre>
<p>Note that this retains the directory structure which means you can do this</p>
<p>The directory structure is preserved</p>
<pre><code>$ rclone -q ls secret:subdir
8 file2.txt
9 file3.txt
10 subsubdir/file4.txt</code></pre>
<p>If don't use file name encryption then the remote will look like this - note the <code>.bin</code> extensions added to prevent the cloud provider attempting to interpret the data.</p>
<p>Without file name encryption <code>.bin</code> extensions are added to underlying names. This prevents the cloud provider attempting to interpret file content.</p>
<pre><code>$ rclone -q ls remote:path
54 file0.txt.bin
57 subdir/file3.txt.bin
@@ -11182,7 +11264,6 @@ $ rclone -q ls secret:
58 subdir/subsubdir/file4.txt.bin
55 file1.txt.bin</code></pre>
<h3 id="file-name-encryption-modes">File name encryption modes</h3>
<p>Here are some of the features of the file name encryption modes</p>
<p>Off</p>
<ul>
<li>doesn't hide file names or directory structure</li>
@@ -11199,9 +11280,10 @@ $ rclone -q ls secret:
<li>can use shortcuts to shorten the directory recursion</li>
</ul>
<p>Obfuscation</p>
<p>This is a simple "rotate" of the filename, with each file having a rot distance based on the filename. We store the distance at the beginning of the filename. So a file called "hello" may become "53.jgnnq".</p>
<p>This is not a strong encryption of filenames, but it may stop automated scanning tools from picking up on filename patterns. As such it's an intermediate between "off" and "standard". The advantage is that it allows for longer path segment names.</p>
<p>There is a possibility with some unicode based filenames that the obfuscation is weak and may map lower case characters to upper case equivalents. You can not rely on this for strong protection.</p>
<p>This is a simple "rotate" of the filename, with each file having a rot distance based on the filename. Rclone stores the distance at the beginning of the filename. A file called "hello" may become "53.jgnnq".</p>
<p>Obfuscation is not a strong encryption of filenames, but hinders automated scanning tools picking up on filename patterns. It is an intermediate between "off" and "standard" which allows for longer path segment names.</p>
<p>There is a possibility with some unicode based filenames that the obfuscation is weak and may map lower case characters to upper case equivalents.</p>
<p>Obfuscation cannot be relied upon for strong protection.</p>
<ul>
<li>file names very lightly obfuscated</li>
<li>file names can be longer than standard encryption</li>
@@ -11209,8 +11291,8 @@ $ rclone -q ls secret:
<li>directory structure visible</li>
<li>identical files names will have identical uploaded names</li>
</ul>
<p>Cloud storage systems have various limits on file name length and total path length which you are more likely to hit using "Standard" file name encryption. If you keep your file names to below 156 characters in length then you should be OK on all providers.</p>
<p>There may be an even more secure file name encryption mode in the future which will address the long file name problem.</p>
<p>Cloud storage systems have limits on file name length and total path length which rclone is more likely to breach using "Standard" file name encryption. Where file names are less thn 156 characters in length issues should not be encountered, irrespective of cloud storage provider.</p>
<p>An alternative, future rclone file name encryption mode may tolerate backend provider path length limits.</p>
<h3 id="directory-name-encryption">Directory name encryption</h3>
<p>Crypt offers the option of encrypting dir names or leaving them intact. There are two options:</p>
<p>True</p>
@@ -11220,7 +11302,7 @@ $ rclone -q ls secret:
<h3 id="modified-time-and-hashes-3">Modified time and hashes</h3>
<p>Crypt stores modification times using the underlying remote so support depends on that.</p>
<p>Hashes are not stored for crypt. However the data integrity is protected by an extremely strong crypto authenticator.</p>
<p>Note that you should use the <code>rclone cryptcheck</code> command to check the integrity of a crypted remote instead of <code>rclone check</code> which can't check the checksums properly.</p>
<p>Use the <code>rclone cryptcheck</code> command to check the integrity of a crypted remote instead of <code>rclone check</code> which can't check the checksums properly.</p>
<h3 id="standard-options-9">Standard Options</h3>
<p>Here are the standard options specific to crypt (Encrypt/Decrypt a remote).</p>
<h4 id="crypt-remote">--crypt-remote</h4>
@@ -18470,6 +18552,108 @@ $ tree /tmp/b
<li>"error": return an error based on option value</li>
</ul>
<h1 id="changelog">Changelog</h1>
<h2 id="v1.53.3---2020-11-19">v1.53.3 - 2020-11-19</h2>
<p><a href="https://github.com/rclone/rclone/compare/v1.53.2...v1.53.3">See commits</a></p>
<ul>
<li>Bug Fixes
<ul>
<li>random: Fix incorrect use of math/rand instead of crypto/rand CVE-2020-28924 (Nick Craig-Wood)
<ul>
<li>Passwords you have generated with <code>rclone config</code> may be insecure</li>
<li>See <a href="https://github.com/rclone/rclone/issues/4783">issue #4783</a> for more details and a checking tool</li>
</ul></li>
<li>random: Seed math/rand in one place with crypto strong seed (Nick Craig-Wood)</li>
</ul></li>
<li>VFS
<ul>
<li>Fix vfs/refresh calls with fs= parameter (Nick Craig-Wood)</li>
</ul></li>
<li>Sharefile
<ul>
<li>Fix backend due to API swapping integers for strings (Nick Craig-Wood)</li>
</ul></li>
</ul>
<h2 id="v1.53.2---2020-10-26">v1.53.2 - 2020-10-26</h2>
<p><a href="https://github.com/rclone/rclone/compare/v1.53.1...v1.53.2">See commits</a></p>
<ul>
<li>Bug Fixes
<ul>
<li>acounting
<ul>
<li>Fix incorrect speed and transferTime in core/stats (Nick Craig-Wood)</li>
<li>Stabilize display order of transfers on Windows (Nick Craig-Wood)</li>
</ul></li>
<li>operations
<ul>
<li>Fix use of --suffix without --backup-dir (Nick Craig-Wood)</li>
<li>Fix spurious "--checksum is in use but the source and destination have no hashes in common" (Nick Craig-Wood)</li>
</ul></li>
<li>build
<ul>
<li>Work around GitHub actions brew problem (Nick Craig-Wood)</li>
<li>Stop using set-env and set-path in the GitHub actions (Nick Craig-Wood)</li>
</ul></li>
</ul></li>
<li>Mount
<ul>
<li>mount2: Fix the swapped UID / GID values (Russell Cattelan)</li>
</ul></li>
<li>VFS
<ul>
<li>Detect and recover from a file being removed externally from the cache (Nick Craig-Wood)</li>
<li>Fix a deadlock vulnerability in downloaders.Close (Leo Luan)</li>
<li>Fix a race condition in retryFailedResets (Leo Luan)</li>
<li>Fix missed concurrency control between some item operations and reset (Leo Luan)</li>
<li>Add exponential backoff during ENOSPC retries (Leo Luan)</li>
<li>Add a missed update of used cache space (Leo Luan)</li>
<li>Fix --no-modtime to not attempt to set modtimes (as documented) (Nick Craig-Wood)</li>
</ul></li>
<li>Local
<ul>
<li>Fix sizes and syncing with --links option on Windows (Nick Craig-Wood)</li>
</ul></li>
<li>Chunker
<ul>
<li>Disable ListR to fix missing files on GDrive (workaround) (Ivan Andreev)</li>
<li>Fix upload over crypt (Ivan Andreev)</li>
</ul></li>
<li>Fichier
<ul>
<li>Increase maximum file size from 100GB to 300GB (gyutw)</li>
</ul></li>
<li>Jottacloud
<ul>
<li>Remove clientSecret from config when upgrading to token based authentication (buengese)</li>
<li>Avoid double url escaping of device/mountpoint (albertony)</li>
<li>Remove DirMove workaround as it's not required anymore - also (buengese)</li>
</ul></li>
<li>Mailru
<ul>
<li>Fix uploads after recent changes on server (Ivan Andreev)</li>
<li>Fix range requests after june changes on server (Ivan Andreev)</li>
<li>Fix invalid timestamp on corrupted files (fixes) (Ivan Andreev)</li>
</ul></li>
<li>Onedrive
<ul>
<li>Fix disk usage for sharepoint (Nick Craig-Wood)</li>
</ul></li>
<li>S3
<ul>
<li>Add missing regions for AWS (Anagh Kumar Baranwal)</li>
</ul></li>
<li>Seafile
<ul>
<li>Fix accessing libraries &gt; 2GB on 32 bit systems (Muffin King)</li>
</ul></li>
<li>SFTP
<ul>
<li>Always convert the checksum to lower case (buengese)</li>
</ul></li>
<li>Union
<ul>
<li>Create root directories if none exist (Nick Craig-Wood)</li>
</ul></li>
</ul>
<h2 id="v1.53.1---2020-09-13">v1.53.1 - 2020-09-13</h2>
<p><a href="https://github.com/rclone/rclone/compare/v1.53.0...v1.53.1">See commits</a></p>
<ul>
Generated
+191 -81
View File
@@ -1,6 +1,6 @@
% rclone(1) User Manual
% Nick Craig-Wood
% Sep 13, 2020
% Nov 19, 2020
# Rclone syncs your files to cloud storage
@@ -2891,9 +2891,6 @@ parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on.
When --vfs-read-chunk-size-limit 500M is specified, the result would be
0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.
Chunked reading will only work with --vfs-cache-mode < full, as the file will always
be copied to the vfs cache before opening with --vfs-cache-mode full.
## VFS - Virtual File System
This command uses the VFS layer. This adapts the cloud storage objects
@@ -7033,11 +7030,17 @@ or with `--backup-dir`. See `--backup-dir` for more info.
For example
rclone sync -i /path/to/local/file remote:current --suffix .bak
rclone copy -i /path/to/local/file remote:current --suffix .bak
will sync `/path/to/local` to `remote:current`, but for any files
will copy `/path/to/local` to `remote:current`, but for any files
which would have been updated or deleted have .bak added.
If using `rclone sync` with `--suffix` and without `--backup-dir` then
it is recommended to put a filter rule in excluding the suffix
otherwise the `sync` will delete the backup files.
rclone sync -i /path/to/local/file remote:current --suffix .bak --exclude "*.bak"
### --suffix-keep-extension ###
When using `--suffix`, setting this causes rclone put the SUFFIX
@@ -10566,7 +10569,7 @@ These flags are available for every command.
--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. The default is rclone/ version (default "rclone/v1.53.1")
--user-agent string Set the user-agent to a specified string. The default is rclone/ version (default "rclone/v1.53.3")
-v, --verbose count Print lots more stuff (repeat for more)
```
@@ -11635,7 +11638,7 @@ Choose a number from below, or type in your own value
/ Asia Pacific (Mumbai)
13 | Needs location constraint ap-south-1.
\ "ap-south-1"
/ Asia Patific (Hong Kong) Region
/ Asia Pacific (Hong Kong) Region
14 | Needs location constraint ap-east-1.
\ "ap-east-1"
/ South America (Sao Paulo) Region
@@ -12041,12 +12044,12 @@ Region to connect to.
- "us-east-2"
- US East (Ohio) Region
- Needs location constraint us-east-2.
- "us-west-2"
- US West (Oregon) Region
- Needs location constraint us-west-2.
- "us-west-1"
- US West (Northern California) Region
- Needs location constraint us-west-1.
- "us-west-2"
- US West (Oregon) Region
- Needs location constraint us-west-2.
- "ca-central-1"
- Canada (Central) Region
- Needs location constraint ca-central-1.
@@ -12056,9 +12059,15 @@ Region to connect to.
- "eu-west-2"
- EU (London) Region
- Needs location constraint eu-west-2.
- "eu-west-3"
- EU (Paris) Region
- Needs location constraint eu-west-3.
- "eu-north-1"
- EU (Stockholm) Region
- Needs location constraint eu-north-1.
- "eu-south-1"
- EU (Milan) Region
- Needs location constraint eu-south-1.
- "eu-central-1"
- EU (Frankfurt) Region
- Needs location constraint eu-central-1.
@@ -12074,15 +12083,36 @@ Region to connect to.
- "ap-northeast-2"
- Asia Pacific (Seoul)
- Needs location constraint ap-northeast-2.
- "ap-northeast-3"
- Asia Pacific (Osaka-Local)
- Needs location constraint ap-northeast-3.
- "ap-south-1"
- Asia Pacific (Mumbai)
- Needs location constraint ap-south-1.
- "ap-east-1"
- Asia Patific (Hong Kong) Region
- Asia Pacific (Hong Kong) Region
- Needs location constraint ap-east-1.
- "sa-east-1"
- South America (Sao Paulo) Region
- Needs location constraint sa-east-1.
- "me-south-1"
- Middle East (Bahrain) Region
- Needs location constraint me-south-1.
- "af-south-1"
- Africa (Cape Town) Region
- Needs location constraint af-south-1.
- "cn-north-1"
- China (Beijing) Region
- Needs location constraint cn-north-1.
- "cn-northwest-1"
- China (Ningxia) Region
- Needs location constraint cn-northwest-1.
- "us-gov-east-1"
- AWS GovCloud (US-East) Region
- Needs location constraint us-gov-east-1.
- "us-gov-west-1"
- AWS GovCloud (US) Region
- Needs location constraint us-gov-west-1.
#### --s3-region
@@ -12423,18 +12453,22 @@ Used when creating buckets only.
- Empty for US Region, Northern Virginia or Pacific Northwest.
- "us-east-2"
- US East (Ohio) Region.
- "us-west-2"
- US West (Oregon) Region.
- "us-west-1"
- US West (Northern California) Region.
- "us-west-2"
- US West (Oregon) Region.
- "ca-central-1"
- Canada (Central) Region.
- "eu-west-1"
- EU (Ireland) Region.
- "eu-west-2"
- EU (London) Region.
- "eu-west-3"
- EU (Paris) Region.
- "eu-north-1"
- EU (Stockholm) Region.
- "eu-south-1"
- EU (Milan) Region.
- "EU"
- EU Region.
- "ap-southeast-1"
@@ -12444,13 +12478,27 @@ Used when creating buckets only.
- "ap-northeast-1"
- Asia Pacific (Tokyo) Region.
- "ap-northeast-2"
- Asia Pacific (Seoul)
- Asia Pacific (Seoul) Region.
- "ap-northeast-3"
- Asia Pacific (Osaka-Local) Region.
- "ap-south-1"
- Asia Pacific (Mumbai)
- Asia Pacific (Mumbai) Region.
- "ap-east-1"
- Asia Pacific (Hong Kong)
- Asia Pacific (Hong Kong) Region.
- "sa-east-1"
- South America (Sao Paulo) Region.
- "me-south-1"
- Middle East (Bahrain) Region.
- "af-south-1"
- Africa (Cape Town) Region.
- "cn-north-1"
- China (Beijing) Region
- "cn-northwest-1"
- China (Ningxia) Region.
- "us-gov-east-1"
- AWS GovCloud (US-East) Region.
- "us-gov-west-1"
- AWS GovCloud (US) Region.
#### --s3-location-constraint
@@ -14829,7 +14877,8 @@ Note that Box is case insensitive so you can't have a file called
"Hello.doc" and one called "hello.doc".
Box file names can't have the `\` character in. rclone maps this to
and from an identical looking unicode equivalent `\`.
and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth
Reverse Solidus).
Box only supports filenames up to 255 characters in length.
@@ -16111,23 +16160,26 @@ See: the [encoding section in the overview](https://rclone.org/overview/#encodin
Crypt
----------------------------------------
The `crypt` remote encrypts and decrypts another remote.
Rclone `crypt` remotes encrypt and decrypt other remotes.
To use it first set up the underlying remote following the config
instructions for that remote. You can also use a local pathname
instead of a remote which will encrypt and decrypt from that directory
which might be useful for encrypting onto a USB stick for example.
To use `crypt`, first set up the underlying remote. Follow the `rclone
config` instructions for that remote.
First check your chosen remote is working - we'll call it
`remote:path` in these docs. Note that anything inside `remote:path`
will be encrypted and anything outside won't. This means that if you
are using a bucket based remote (eg S3, B2, swift) then you should
probably put the bucket in the remote `s3:bucket`. If you just use
`s3:` then rclone will make encrypted bucket names too (if using file
name encryption) which may or may not be what you want.
`crypt` applied to a local pathname instead of a remote will
encrypt and decrypt that directory, and can be used to encrypt USB
removable drives.
Now configure `crypt` using `rclone config`. We will call this one
`secret` to differentiate it from the `remote`.
Before configuring the crypt remote, check the underlying remote is
working. In this example the underlying remote is called `remote:path`.
Anything inside `remote:path` will be encrypted and anything outside
will not. In the case of an S3 based underlying remote (eg Amazon S3,
B2, Swift) it is generally advisable to define a crypt remote in the
underlying remote `s3:bucket`. If `s3:` alone is specified alongside
file name encryption, rclone will encrypt the bucket name.
Configure `crypt` using `rclone config`. In this example the `crypt`
remote is called `secret`, to differentiate it from the underlying
`remote`.
```
No remotes found - make a new one
@@ -16201,49 +16253,42 @@ d) Delete this remote
y/e/d> y
```
**Important** The password is stored in the config file is lightly
obscured so it isn't immediately obvious what it is. It is in no way
secure unless you use config file encryption.
**Important** The crypt password stored in `rclone.conf` is lightly
obscured. That only protects it from cursory inspection. It is not
secure unless encryption of `rclone.conf` is specified.
A long passphrase is recommended, or you can use a random one.
A long passphrase is recommended, or `rclone config` can generate a
random one.
The obscured password is created by using AES-CTR with a static key, with
the salt stored verbatim at the beginning of the obscured password. This
static key is shared by between all versions of rclone.
The obscured password is created using AES-CTR with a static key. The
salt is stored verbatim at the beginning of the obscured password. This
static key is shared between all versions of rclone.
If you reconfigure rclone with the same passwords/passphrases
elsewhere it will be compatible, but the obscured version will be different
due to the different salt.
Note that rclone does not encrypt
Rclone does not encrypt
* file length - this can be calculated within 16 bytes
* modification time - used for syncing
## Specifying the remote ##
In normal use, make sure the remote has a `:` in. If you specify the
remote without a `:` then rclone will use a local directory of that
name. So if you use a remote of `/path/to/secret/files` then rclone
will encrypt stuff to that directory. If you use a remote of `name`
then rclone will put files in a directory called `name` in the current
directory.
In normal use, ensure the remote has a `:` in. If specified without,
rclone uses a local directory of that name. For example if a remote
`/path/to/secret/files` is specified, rclone encrypts content to that
directory. If a remote `name` is specified, rclone targets a directory
`name` in the current directory.
If you specify the remote as `remote:path/to/dir` then rclone will
store encrypted files in `path/to/dir` on the remote. If you are using
file name encryption, then when you save files to
`secret:subdir/subfile` this will store them in the unencrypted path
`path/to/dir` but the `subdir/subpath` bit will be encrypted.
Note that unless you want encrypted bucket names (which are difficult
to manage because you won't know what directory they represent in web
interfaces etc), you should probably specify a bucket, eg
`remote:secretbucket` when using bucket based remotes such as S3,
Swift, Hubic, B2, GCS.
If remote `remote:path/to/dir` is specified, rclone stores encrypted
files in `path/to/dir` on the remote. With file name encryption, files
saved to `secret:subdir/subfile` are stored in the unencrypted path
`path/to/dir` but the `subdir/subpath` element is encrypted.
## Example ##
To test I made a little directory of files using "standard" file name
Create the following file structure using "standard" file name
encryption.
```
@@ -16257,7 +16302,7 @@ plaintext/
└── file4.txt
```
Copy these to the remote and list them back
Copy these to the remote, and list them
```
$ rclone -q copy plaintext secret:
@@ -16269,7 +16314,7 @@ $ rclone -q ls secret:
9 subdir/file3.txt
```
Now see what that looked like when encrypted
The crypt remote looks like
```
$ rclone -q ls remote:path
@@ -16280,7 +16325,7 @@ $ rclone -q ls remote:path
56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps
```
Note that this retains the directory structure which means you can do this
The directory structure is preserved
```
$ rclone -q ls secret:subdir
@@ -16289,9 +16334,9 @@ $ rclone -q ls secret:subdir
10 subsubdir/file4.txt
```
If don't use file name encryption then the remote will look like this
- note the `.bin` extensions added to prevent the cloud provider
attempting to interpret the data.
Without file name encryption `.bin` extensions are added to underlying
names. This prevents the cloud provider attempting to interpret file
content.
```
$ rclone -q ls remote:path
@@ -16304,8 +16349,6 @@ $ rclone -q ls remote:path
### File name encryption modes ###
Here are some of the features of the file name encryption modes
Off
* doesn't hide file names or directory structure
@@ -16324,17 +16367,19 @@ Standard
Obfuscation
This is a simple "rotate" of the filename, with each file having a rot
distance based on the filename. We store the distance at the beginning
of the filename. So a file called "hello" may become "53.jgnnq".
distance based on the filename. Rclone stores the distance at the
beginning of the filename. A file called "hello" may become "53.jgnnq".
This is not a strong encryption of filenames, but it may stop automated
scanning tools from picking up on filename patterns. As such it's an
intermediate between "off" and "standard". The advantage is that it
allows for longer path segment names.
Obfuscation is not a strong encryption of filenames, but hinders
automated scanning tools picking up on filename patterns. It is an
intermediate between "off" and "standard" which allows for longer path
segment names.
There is a possibility with some unicode based filenames that the
obfuscation is weak and may map lower case characters to upper case
equivalents. You can not rely on this for strong protection.
equivalents.
Obfuscation cannot be relied upon for strong protection.
* file names very lightly obfuscated
* file names can be longer than standard encryption
@@ -16342,13 +16387,14 @@ equivalents. You can not rely on this for strong protection.
* directory structure visible
* identical files names will have identical uploaded names
Cloud storage systems have various limits on file name length and
total path length which you are more likely to hit using "Standard"
file name encryption. If you keep your file names to below 156
characters in length then you should be OK on all providers.
Cloud storage systems have limits on file name length and
total path length which rclone is more likely to breach using
"Standard" file name encryption. Where file names are less thn 156
characters in length issues should not be encountered, irrespective of
cloud storage provider.
There may be an even more secure file name encryption mode in the
future which will address the long file name problem.
An alternative, future rclone file name encryption mode may tolerate
backend provider path length limits.
### Directory name encryption ###
Crypt offers the option of encrypting dir names or leaving them intact.
@@ -16374,10 +16420,10 @@ Example:
Crypt stores modification times using the underlying remote so support
depends on that.
Hashes are not stored for crypt. However the data integrity is
Hashes are not stored for crypt. However the data integrity is
protected by an extremely strong crypto authenticator.
Note that you should use the `rclone cryptcheck` command to check the
Use the `rclone cryptcheck` command to check the
integrity of a crypted remote instead of `rclone check` which can't
check the checksums properly.
@@ -25681,6 +25727,70 @@ Options:
# Changelog
## v1.53.3 - 2020-11-19
[See commits](https://github.com/rclone/rclone/compare/v1.53.2...v1.53.3)
* Bug Fixes
* random: Fix incorrect use of math/rand instead of crypto/rand CVE-2020-28924 (Nick Craig-Wood)
* Passwords you have generated with `rclone config` may be insecure
* See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more details and a checking tool
* random: Seed math/rand in one place with crypto strong seed (Nick Craig-Wood)
* VFS
* Fix vfs/refresh calls with fs= parameter (Nick Craig-Wood)
* Sharefile
* Fix backend due to API swapping integers for strings (Nick Craig-Wood)
## v1.53.2 - 2020-10-26
[See commits](https://github.com/rclone/rclone/compare/v1.53.1...v1.53.2)
* Bug Fixes
* acounting
* Fix incorrect speed and transferTime in core/stats (Nick Craig-Wood)
* Stabilize display order of transfers on Windows (Nick Craig-Wood)
* operations
* Fix use of --suffix without --backup-dir (Nick Craig-Wood)
* Fix spurious "--checksum is in use but the source and destination have no hashes in common" (Nick Craig-Wood)
* build
* Work around GitHub actions brew problem (Nick Craig-Wood)
* Stop using set-env and set-path in the GitHub actions (Nick Craig-Wood)
* Mount
* mount2: Fix the swapped UID / GID values (Russell Cattelan)
* VFS
* Detect and recover from a file being removed externally from the cache (Nick Craig-Wood)
* Fix a deadlock vulnerability in downloaders.Close (Leo Luan)
* Fix a race condition in retryFailedResets (Leo Luan)
* Fix missed concurrency control between some item operations and reset (Leo Luan)
* Add exponential backoff during ENOSPC retries (Leo Luan)
* Add a missed update of used cache space (Leo Luan)
* Fix --no-modtime to not attempt to set modtimes (as documented) (Nick Craig-Wood)
* Local
* Fix sizes and syncing with --links option on Windows (Nick Craig-Wood)
* Chunker
* Disable ListR to fix missing files on GDrive (workaround) (Ivan Andreev)
* Fix upload over crypt (Ivan Andreev)
* Fichier
* Increase maximum file size from 100GB to 300GB (gyutw)
* Jottacloud
* Remove clientSecret from config when upgrading to token based authentication (buengese)
* Avoid double url escaping of device/mountpoint (albertony)
* Remove DirMove workaround as it's not required anymore - also (buengese)
* Mailru
* Fix uploads after recent changes on server (Ivan Andreev)
* Fix range requests after june changes on server (Ivan Andreev)
* Fix invalid timestamp on corrupted files (fixes) (Ivan Andreev)
* Onedrive
* Fix disk usage for sharepoint (Nick Craig-Wood)
* S3
* Add missing regions for AWS (Anagh Kumar Baranwal)
* Seafile
* Fix accessing libraries > 2GB on 32 bit systems (Muffin King)
* SFTP
* Always convert the checksum to lower case (buengese)
* Union
* Create root directories if none exist (Nick Craig-Wood)
## v1.53.1 - 2020-09-13
[See commits](https://github.com/rclone/rclone/compare/v1.53.0...v1.53.1)
Generated
+206 -83
View File
@@ -1,6 +1,6 @@
rclone(1) User Manual
Nick Craig-Wood
Sep 13, 2020
Nov 19, 2020
@@ -2929,10 +2929,6 @@ following parts will be downloaded: 0-100M, 100M-200M, 200M-300M,
the result would be 0-100M, 100M-300M, 300M-700M, 700M-1200M,
1200M-1700M and so on.
Chunked reading will only work with --vfs-cache-mode < full, as the file
will always be copied to the vfs cache before opening with
--vfs-cache-mode full.
VFS - Virtual File System
@@ -7150,11 +7146,17 @@ with --backup-dir. See --backup-dir for more info.
For example
rclone sync -i /path/to/local/file remote:current --suffix .bak
rclone copy -i /path/to/local/file remote:current --suffix .bak
will sync /path/to/local to remote:current, but for any files which
will copy /path/to/local to remote:current, but for any files which
would have been updated or deleted have .bak added.
If using rclone sync with --suffix and without --backup-dir then it is
recommended to put a filter rule in excluding the suffix otherwise the
sync will delete the backup files.
rclone sync -i /path/to/local/file remote:current --suffix .bak --exclude "*.bak"
--suffix-keep-extension
When using --suffix, setting this causes rclone put the SUFFIX before
@@ -10658,7 +10660,7 @@ These flags are available for every command.
--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. The default is rclone/ version (default "rclone/v1.53.1")
--user-agent string Set the user-agent to a specified string. The default is rclone/ version (default "rclone/v1.53.3")
-v, --verbose count Print lots more stuff (repeat for more)
@@ -11706,7 +11708,7 @@ This will guide you through an interactive setup process.
/ Asia Pacific (Mumbai)
13 | Needs location constraint ap-south-1.
\ "ap-south-1"
/ Asia Patific (Hong Kong) Region
/ Asia Pacific (Hong Kong) Region
14 | Needs location constraint ap-east-1.
\ "ap-east-1"
/ South America (Sao Paulo) Region
@@ -12118,12 +12120,12 @@ Region to connect to.
- "us-east-2"
- US East (Ohio) Region
- Needs location constraint us-east-2.
- "us-west-2"
- US West (Oregon) Region
- Needs location constraint us-west-2.
- "us-west-1"
- US West (Northern California) Region
- Needs location constraint us-west-1.
- "us-west-2"
- US West (Oregon) Region
- Needs location constraint us-west-2.
- "ca-central-1"
- Canada (Central) Region
- Needs location constraint ca-central-1.
@@ -12133,9 +12135,15 @@ Region to connect to.
- "eu-west-2"
- EU (London) Region
- Needs location constraint eu-west-2.
- "eu-west-3"
- EU (Paris) Region
- Needs location constraint eu-west-3.
- "eu-north-1"
- EU (Stockholm) Region
- Needs location constraint eu-north-1.
- "eu-south-1"
- EU (Milan) Region
- Needs location constraint eu-south-1.
- "eu-central-1"
- EU (Frankfurt) Region
- Needs location constraint eu-central-1.
@@ -12151,15 +12159,36 @@ Region to connect to.
- "ap-northeast-2"
- Asia Pacific (Seoul)
- Needs location constraint ap-northeast-2.
- "ap-northeast-3"
- Asia Pacific (Osaka-Local)
- Needs location constraint ap-northeast-3.
- "ap-south-1"
- Asia Pacific (Mumbai)
- Needs location constraint ap-south-1.
- "ap-east-1"
- Asia Patific (Hong Kong) Region
- Asia Pacific (Hong Kong) Region
- Needs location constraint ap-east-1.
- "sa-east-1"
- South America (Sao Paulo) Region
- Needs location constraint sa-east-1.
- "me-south-1"
- Middle East (Bahrain) Region
- Needs location constraint me-south-1.
- "af-south-1"
- Africa (Cape Town) Region
- Needs location constraint af-south-1.
- "cn-north-1"
- China (Beijing) Region
- Needs location constraint cn-north-1.
- "cn-northwest-1"
- China (Ningxia) Region
- Needs location constraint cn-northwest-1.
- "us-gov-east-1"
- AWS GovCloud (US-East) Region
- Needs location constraint us-gov-east-1.
- "us-gov-west-1"
- AWS GovCloud (US) Region
- Needs location constraint us-gov-west-1.
--s3-region
@@ -12500,18 +12529,22 @@ creating buckets only.
- Empty for US Region, Northern Virginia or Pacific Northwest.
- "us-east-2"
- US East (Ohio) Region.
- "us-west-2"
- US West (Oregon) Region.
- "us-west-1"
- US West (Northern California) Region.
- "us-west-2"
- US West (Oregon) Region.
- "ca-central-1"
- Canada (Central) Region.
- "eu-west-1"
- EU (Ireland) Region.
- "eu-west-2"
- EU (London) Region.
- "eu-west-3"
- EU (Paris) Region.
- "eu-north-1"
- EU (Stockholm) Region.
- "eu-south-1"
- EU (Milan) Region.
- "EU"
- EU Region.
- "ap-southeast-1"
@@ -12521,13 +12554,27 @@ creating buckets only.
- "ap-northeast-1"
- Asia Pacific (Tokyo) Region.
- "ap-northeast-2"
- Asia Pacific (Seoul)
- Asia Pacific (Seoul) Region.
- "ap-northeast-3"
- Asia Pacific (Osaka-Local) Region.
- "ap-south-1"
- Asia Pacific (Mumbai)
- Asia Pacific (Mumbai) Region.
- "ap-east-1"
- Asia Pacific (Hong Kong)
- Asia Pacific (Hong Kong) Region.
- "sa-east-1"
- South America (Sao Paulo) Region.
- "me-south-1"
- Middle East (Bahrain) Region.
- "af-south-1"
- Africa (Cape Town) Region.
- "cn-north-1"
- China (Beijing) Region
- "cn-northwest-1"
- China (Ningxia) Region.
- "us-gov-east-1"
- AWS GovCloud (US-East) Region.
- "us-gov-west-1"
- AWS GovCloud (US) Region.
--s3-location-constraint
@@ -14845,7 +14892,8 @@ Note that Box is case insensitive so you can't have a file called
"Hello.doc" and one called "hello.doc".
Box file names can't have the \ character in. rclone maps this to and
from an identical looking unicode equivalent \.
from an identical looking unicode equivalent \ (U+FF3C Fullwidth
Reverse Solidus).
Box only supports filenames up to 255 characters in length.
@@ -16132,23 +16180,24 @@ See: the encoding section in the overview for more info.
Crypt
The crypt remote encrypts and decrypts another remote.
Rclone crypt remotes encrypt and decrypt other remotes.
To use it first set up the underlying remote following the config
instructions for that remote. You can also use a local pathname instead
of a remote which will encrypt and decrypt from that directory which
might be useful for encrypting onto a USB stick for example.
To use crypt, first set up the underlying remote. Follow the
rclone config instructions for that remote.
First check your chosen remote is working - we'll call it remote:path in
these docs. Note that anything inside remote:path will be encrypted and
anything outside won't. This means that if you are using a bucket based
remote (eg S3, B2, swift) then you should probably put the bucket in the
remote s3:bucket. If you just use s3: then rclone will make encrypted
bucket names too (if using file name encryption) which may or may not be
what you want.
crypt applied to a local pathname instead of a remote will encrypt and
decrypt that directory, and can be used to encrypt USB removable drives.
Now configure crypt using rclone config. We will call this one secret to
differentiate it from the remote.
Before configuring the crypt remote, check the underlying remote is
working. In this example the underlying remote is called remote:path.
Anything inside remote:path will be encrypted and anything outside will
not. In the case of an S3 based underlying remote (eg Amazon S3, B2,
Swift) it is generally advisable to define a crypt remote in the
underlying remote s3:bucket. If s3: alone is specified alongside file
name encryption, rclone will encrypt the bucket name.
Configure crypt using rclone config. In this example the crypt remote is
called secret, to differentiate it from the underlying remote.
No remotes found - make a new one
n) New remote
@@ -16220,21 +16269,22 @@ differentiate it from the remote.
d) Delete this remote
y/e/d> y
IMPORTANT The password is stored in the config file is lightly obscured
so it isn't immediately obvious what it is. It is in no way secure
unless you use config file encryption.
IMPORTANT The crypt password stored in rclone.conf is lightly obscured.
That only protects it from cursory inspection. It is not secure unless
encryption of rclone.conf is specified.
A long passphrase is recommended, or you can use a random one.
A long passphrase is recommended, or rclone config can generate a random
one.
The obscured password is created by using AES-CTR with a static key,
with the salt stored verbatim at the beginning of the obscured password.
This static key is shared by between all versions of rclone.
The obscured password is created using AES-CTR with a static key. The
salt is stored verbatim at the beginning of the obscured password. This
static key is shared between all versions of rclone.
If you reconfigure rclone with the same passwords/passphrases elsewhere
it will be compatible, but the obscured version will be different due to
the different salt.
Note that rclone does not encrypt
Rclone does not encrypt
- file length - this can be calculated within 16 bytes
- modification time - used for syncing
@@ -16242,28 +16292,21 @@ Note that rclone does not encrypt
Specifying the remote
In normal use, make sure the remote has a : in. If you specify the
remote without a : then rclone will use a local directory of that name.
So if you use a remote of /path/to/secret/files then rclone will encrypt
stuff to that directory. If you use a remote of name then rclone will
put files in a directory called name in the current directory.
In normal use, ensure the remote has a : in. If specified without,
rclone uses a local directory of that name. For example if a remote
/path/to/secret/files is specified, rclone encrypts content to that
directory. If a remote name is specified, rclone targets a directory
name in the current directory.
If you specify the remote as remote:path/to/dir then rclone will store
encrypted files in path/to/dir on the remote. If you are using file name
encryption, then when you save files to secret:subdir/subfile this will
store them in the unencrypted path path/to/dir but the subdir/subpath
bit will be encrypted.
Note that unless you want encrypted bucket names (which are difficult to
manage because you won't know what directory they represent in web
interfaces etc), you should probably specify a bucket, eg
remote:secretbucket when using bucket based remotes such as S3, Swift,
Hubic, B2, GCS.
If remote remote:path/to/dir is specified, rclone stores encrypted files
in path/to/dir on the remote. With file name encryption, files saved to
secret:subdir/subfile are stored in the unencrypted path path/to/dir but
the subdir/subpath element is encrypted.
Example
To test I made a little directory of files using "standard" file name
Create the following file structure using "standard" file name
encryption.
plaintext/
@@ -16275,7 +16318,7 @@ encryption.
└── subsubdir
└── file4.txt
Copy these to the remote and list them back
Copy these to the remote, and list them
$ rclone -q copy plaintext secret:
$ rclone -q ls secret:
@@ -16285,7 +16328,7 @@ Copy these to the remote and list them back
10 subdir/subsubdir/file4.txt
9 subdir/file3.txt
Now see what that looked like when encrypted
The crypt remote looks like
$ rclone -q ls remote:path
55 hagjclgavj2mbiqm6u6cnjjqcg
@@ -16294,17 +16337,16 @@ Now see what that looked like when encrypted
58 86vhrsv86mpbtd3a0akjuqslj8/7uu829995du6o42n32otfhjqp4/b9pausrfansjth5ob3jkdqd4lc
56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps
Note that this retains the directory structure which means you can do
this
The directory structure is preserved
$ rclone -q ls secret:subdir
8 file2.txt
9 file3.txt
10 subsubdir/file4.txt
If don't use file name encryption then the remote will look like this -
note the .bin extensions added to prevent the cloud provider attempting
to interpret the data.
Without file name encryption .bin extensions are added to underlying
names. This prevents the cloud provider attempting to interpret file
content.
$ rclone -q ls remote:path
54 file0.txt.bin
@@ -16315,8 +16357,6 @@ to interpret the data.
File name encryption modes
Here are some of the features of the file name encryption modes
Off
- doesn't hide file names or directory structure
@@ -16335,17 +16375,19 @@ Standard
Obfuscation
This is a simple "rotate" of the filename, with each file having a rot
distance based on the filename. We store the distance at the beginning
of the filename. So a file called "hello" may become "53.jgnnq".
distance based on the filename. Rclone stores the distance at the
beginning of the filename. A file called "hello" may become "53.jgnnq".
This is not a strong encryption of filenames, but it may stop automated
scanning tools from picking up on filename patterns. As such it's an
intermediate between "off" and "standard". The advantage is that it
allows for longer path segment names.
Obfuscation is not a strong encryption of filenames, but hinders
automated scanning tools picking up on filename patterns. It is an
intermediate between "off" and "standard" which allows for longer path
segment names.
There is a possibility with some unicode based filenames that the
obfuscation is weak and may map lower case characters to upper case
equivalents. You can not rely on this for strong protection.
equivalents.
Obfuscation cannot be relied upon for strong protection.
- file names very lightly obfuscated
- file names can be longer than standard encryption
@@ -16353,13 +16395,14 @@ equivalents. You can not rely on this for strong protection.
- directory structure visible
- identical files names will have identical uploaded names
Cloud storage systems have various limits on file name length and total
path length which you are more likely to hit using "Standard" file name
encryption. If you keep your file names to below 156 characters in
length then you should be OK on all providers.
Cloud storage systems have limits on file name length and total path
length which rclone is more likely to breach using "Standard" file name
encryption. Where file names are less thn 156 characters in length
issues should not be encountered, irrespective of cloud storage
provider.
There may be an even more secure file name encryption mode in the future
which will address the long file name problem.
An alternative, future rclone file name encryption mode may tolerate
backend provider path length limits.
Directory name encryption
@@ -16385,9 +16428,8 @@ depends on that.
Hashes are not stored for crypt. However the data integrity is protected
by an extremely strong crypto authenticator.
Note that you should use the rclone cryptcheck command to check the
integrity of a crypted remote instead of rclone check which can't check
the checksums properly.
Use the rclone cryptcheck command to check the integrity of a crypted
remote instead of rclone check which can't check the checksums properly.
Standard Options
@@ -25658,6 +25700,87 @@ Options:
CHANGELOG
v1.53.3 - 2020-11-19
See commits
- Bug Fixes
- random: Fix incorrect use of math/rand instead of crypto/rand
CVE-2020-28924 (Nick Craig-Wood)
- Passwords you have generated with rclone config may be
insecure
- See issue #4783 for more details and a checking tool
- random: Seed math/rand in one place with crypto strong seed
(Nick Craig-Wood)
- VFS
- Fix vfs/refresh calls with fs= parameter (Nick Craig-Wood)
- Sharefile
- Fix backend due to API swapping integers for strings (Nick
Craig-Wood)
v1.53.2 - 2020-10-26
See commits
- Bug Fixes
- acounting
- Fix incorrect speed and transferTime in core/stats (Nick
Craig-Wood)
- Stabilize display order of transfers on Windows (Nick
Craig-Wood)
- operations
- Fix use of --suffix without --backup-dir (Nick Craig-Wood)
- Fix spurious "--checksum is in use but the source and
destination have no hashes in common" (Nick Craig-Wood)
- build
- Work around GitHub actions brew problem (Nick Craig-Wood)
- Stop using set-env and set-path in the GitHub actions (Nick
Craig-Wood)
- Mount
- mount2: Fix the swapped UID / GID values (Russell Cattelan)
- VFS
- Detect and recover from a file being removed externally from the
cache (Nick Craig-Wood)
- Fix a deadlock vulnerability in downloaders.Close (Leo Luan)
- Fix a race condition in retryFailedResets (Leo Luan)
- Fix missed concurrency control between some item operations and
reset (Leo Luan)
- Add exponential backoff during ENOSPC retries (Leo Luan)
- Add a missed update of used cache space (Leo Luan)
- Fix --no-modtime to not attempt to set modtimes (as documented)
(Nick Craig-Wood)
- Local
- Fix sizes and syncing with --links option on Windows (Nick
Craig-Wood)
- Chunker
- Disable ListR to fix missing files on GDrive (workaround) (Ivan
Andreev)
- Fix upload over crypt (Ivan Andreev)
- Fichier
- Increase maximum file size from 100GB to 300GB (gyutw)
- Jottacloud
- Remove clientSecret from config when upgrading to token based
authentication (buengese)
- Avoid double url escaping of device/mountpoint (albertony)
- Remove DirMove workaround as it's not required anymore - also
(buengese)
- Mailru
- Fix uploads after recent changes on server (Ivan Andreev)
- Fix range requests after june changes on server (Ivan Andreev)
- Fix invalid timestamp on corrupted files (fixes) (Ivan Andreev)
- Onedrive
- Fix disk usage for sharepoint (Nick Craig-Wood)
- S3
- Add missing regions for AWS (Anagh Kumar Baranwal)
- Seafile
- Fix accessing libraries > 2GB on 32 bit systems (Muffin King)
- SFTP
- Always convert the checksum to lower case (buengese)
- Union
- Create root directories if none exist (Nick Craig-Wood)
v1.53.1 - 2020-09-13
See commits
+1 -1
View File
@@ -1 +1 @@
v1.53.1
v1.53.3
+9 -1
View File
@@ -296,6 +296,8 @@ func NewFs(name, rpath string, m configmap.Mapper) (fs.Fs, error) {
ServerSideAcrossConfigs: true,
}).Fill(f).Mask(baseFs).WrapsFs(f, baseFs)
f.features.Disable("ListR") // Recursive listing may cause chunker skip files
return f, err
}
@@ -958,6 +960,8 @@ func (f *Fs) put(ctx context.Context, in io.Reader, src fs.ObjectInfo, remote st
}
info := f.wrapInfo(src, chunkRemote, size)
// Refill chunkLimit and let basePut repeatedly call chunkingReader.Read()
c.chunkLimit = c.chunkSize
// TODO: handle range/limit options
chunk, errChunk := basePut(ctx, wrapIn, info, options...)
if errChunk != nil {
@@ -1166,10 +1170,14 @@ func (c *chunkingReader) updateHashes() {
func (c *chunkingReader) Read(buf []byte) (bytesRead int, err error) {
if c.chunkLimit <= 0 {
// Chunk complete - switch to next one.
// Note #1:
// We might not get here because some remotes (eg. box multi-uploader)
// read the specified size exactly and skip the concluding EOF Read.
// Then a check in the put loop will kick in.
c.chunkLimit = c.chunkSize
// Note #2:
// The crypt backend after receiving EOF here will call Read again
// and we must insist on returning EOF, so we postpone refilling
// chunkLimit to the main loop.
return 0, io.EOF
}
if int64(len(buf)) > c.chunkLimit {
+1 -1
View File
@@ -323,7 +323,7 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options .
// This will create a duplicate if we upload a new file without
// checking to see if there is one already - use Put() for that.
func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, remote string, size int64, options ...fs.OpenOption) (fs.Object, error) {
if size > int64(100e9) {
if size > int64(300e9) {
return nil, errors.New("File too big, cant upload")
} else if size == 0 {
return nil, fs.ErrorCantUploadEmptyFiles
+5 -16
View File
@@ -373,6 +373,9 @@ func v2config(ctx context.Context, name string, m configmap.Mapper) {
fmt.Printf("Login Token> ")
loginToken := config.ReadLine()
m.Set(configClientID, "jottacli")
m.Set(configClientSecret, "")
token, err := doAuthV2(ctx, srv, loginToken, m)
if err != nil {
log.Fatalf("Failed to get oauth token: %s", err)
@@ -384,7 +387,6 @@ func v2config(ctx context.Context, name string, m configmap.Mapper) {
fmt.Printf("\nDo you want to use a non standard device/mountpoint e.g. for accessing files uploaded using the official Jottacloud client?\n\n")
if config.Confirm(false) {
oauthConfig.ClientID = "jottacli"
oAuthClient, _, err := oauthutil.NewClient(name, m, oauthConfig)
if err != nil {
log.Fatalf("Failed to load oAuthClient: %s", err)
@@ -551,7 +553,7 @@ func (f *Fs) setEndpointURL() {
if f.opt.Mountpoint == "" {
f.opt.Mountpoint = defaultMountpoint
}
f.endpointURL = urlPathEscape(path.Join(f.user, f.opt.Device, f.opt.Mountpoint))
f.endpointURL = path.Join(f.user, f.opt.Device, f.opt.Mountpoint)
}
// readMetaDataForPath reads the metadata from the path
@@ -1087,8 +1089,7 @@ func (f *Fs) copyOrMove(ctx context.Context, method, src, dest string) (info *ap
var resp *http.Response
err = f.pacer.Call(func() (bool, error) {
resp, err = f.srv.CallXML(ctx, &opts, nil, &info)
retry, _ := shouldRetry(resp, err)
return (retry && resp.StatusCode != 500), err
return shouldRetry(resp, err)
})
if err != nil {
return nil, err
@@ -1192,18 +1193,6 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
_, err = f.copyOrMove(ctx, "mvDir", path.Join(f.endpointURL, f.opt.Enc.FromStandardPath(srcPath))+"/", dstRemote)
// surprise! jottacloud fucked up dirmove - the api spits out an error but
// dir gets moved regardless
if apiErr, ok := err.(*api.Error); ok {
if apiErr.StatusCode == 500 {
_, err := f.NewObject(ctx, dstRemote)
if err == fs.ErrorNotAFile {
log.Printf("FIXME: ignoring DirMove error - move succeeded anyway\n")
return nil
}
return err
}
}
if err != nil {
return errors.Wrap(err, "couldn't move directory")
}
+9
View File
@@ -1231,6 +1231,15 @@ func (o *Object) setMetadata(info os.FileInfo) {
o.modTime = info.ModTime()
o.mode = info.Mode()
o.fs.objectMetaMu.Unlock()
// On Windows links read as 0 size so set the correct size here
if runtime.GOOS == "windows" && o.translatedLink {
linkdst, err := os.Readlink(o.path)
if err != nil {
fs.Errorf(o, "Failed to read link size: %v", err)
} else {
o.size = int64(len(linkdst))
}
}
}
// Stat an Object into info
+1 -10
View File
@@ -6,7 +6,6 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"testing"
"time"
@@ -89,9 +88,6 @@ func TestSymlink(t *testing.T) {
// Object viewed as symlink
file2 := fstest.NewItem("symlink.txt"+linkSuffix, "file.txt", modTime2)
if runtime.GOOS == "windows" {
file2.Size = 0 // symlinks are 0 length under Windows
}
// Object viewed as destination
file2d := fstest.NewItem("symlink.txt", "hello", modTime1)
@@ -121,9 +117,6 @@ func TestSymlink(t *testing.T) {
// Create a symlink
modTime3 := fstest.Time("2002-03-03T04:05:10.123123123Z")
file3 := r.WriteObjectTo(ctx, r.Flocal, "symlink2.txt"+linkSuffix, "file.txt", modTime3, false)
if runtime.GOOS == "windows" {
file3.Size = 0 // symlinks are 0 length under Windows
}
fstest.CheckListingWithPrecision(t, r.Flocal, []fstest.Item{file1, file2, file3}, nil, fs.ModTimeNotSupported)
if haveLChtimes {
fstest.CheckItems(t, r.Flocal, file1, file2, file3)
@@ -142,9 +135,7 @@ func TestSymlink(t *testing.T) {
o, err := r.Flocal.NewObject(ctx, "symlink2.txt"+linkSuffix)
require.NoError(t, err)
assert.Equal(t, "symlink2.txt"+linkSuffix, o.Remote())
if runtime.GOOS != "windows" {
assert.Equal(t, int64(8), o.Size())
}
assert.Equal(t, int64(8), o.Size())
// Check that NewObject doesn't see the non suffixed version
_, err = r.Flocal.NewObject(ctx, "symlink2.txt")
+1 -66
View File
@@ -117,7 +117,7 @@ type ListItem struct {
Name string `json:"name"`
Home string `json:"home"`
Size int64 `json:"size"`
Mtime int64 `json:"mtime,omitempty"`
Mtime uint64 `json:"mtime,omitempty"`
Hash string `json:"hash,omitempty"`
VirusScan string `json:"virus_scan,omitempty"`
Tree string `json:"tree,omitempty"`
@@ -159,71 +159,6 @@ type FolderInfoResponse struct {
Email string `json:"email"`
}
// ShardInfoResponse ...
type ShardInfoResponse struct {
Email string `json:"email"`
Body struct {
Video []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"video"`
ViewDirect []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"view_direct"`
WeblinkView []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"weblink_view"`
WeblinkVideo []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"weblink_video"`
WeblinkGet []struct {
Count int `json:"count"`
URL string `json:"url"`
} `json:"weblink_get"`
Stock []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"stock"`
WeblinkThumbnails []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"weblink_thumbnails"`
PublicUpload []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"public_upload"`
Auth []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"auth"`
Web []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"web"`
View []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"view"`
Upload []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"upload"`
Get []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"get"`
Thumbnails []struct {
Count string `json:"count"`
URL string `json:"url"`
} `json:"thumbnails"`
} `json:"body"`
Time int64 `json:"time"`
Status int `json:"status"`
}
// CleanupResponse ...
type CleanupResponse struct {
Email string `json:"email"`
+57 -25
View File
@@ -37,6 +37,7 @@ import (
"github.com/rclone/rclone/lib/encoder"
"github.com/rclone/rclone/lib/oauthutil"
"github.com/rclone/rclone/lib/pacer"
"github.com/rclone/rclone/lib/readers"
"github.com/rclone/rclone/lib/rest"
"github.com/pkg/errors"
@@ -655,9 +656,14 @@ func (f *Fs) itemToDirEntry(ctx context.Context, item *api.ListItem) (entry fs.D
if err != nil {
return nil, -1, err
}
mTime := int64(item.Mtime)
if mTime < 0 {
fs.Debugf(f, "Fixing invalid timestamp %d on mailru file %q", mTime, remote)
mTime = 0
}
switch item.Kind {
case "folder":
dir := fs.NewDir(remote, time.Unix(item.Mtime, 0)).SetSize(item.Size)
dir := fs.NewDir(remote, time.Unix(mTime, 0)).SetSize(item.Size)
dirSize := item.Count.Files + item.Count.Folders
return dir, dirSize, nil
case "file":
@@ -671,7 +677,7 @@ func (f *Fs) itemToDirEntry(ctx context.Context, item *api.ListItem) (entry fs.D
hasMetaData: true,
size: item.Size,
mrHash: binHash,
modTime: time.Unix(item.Mtime, 0),
modTime: time.Unix(mTime, 0),
}
return file, -1, nil
default:
@@ -1861,30 +1867,30 @@ func (f *Fs) uploadShard(ctx context.Context) (string, error) {
return f.shardURL, nil
}
token, err := f.accessToken()
if err != nil {
return "", err
}
opts := rest.Opts{
Method: "GET",
Path: "/api/m1/dispatcher",
Parameters: url.Values{
"client_id": {api.OAuthClientID},
"access_token": {token},
},
RootURL: api.DispatchServerURL,
Method: "GET",
Path: "/u",
}
var info api.ShardInfoResponse
var (
res *http.Response
url string
err error
)
err = f.pacer.Call(func() (bool, error) {
res, err := f.srv.CallJSON(ctx, &opts, nil, &info)
return shouldRetry(res, err, f, &opts)
res, err = f.srv.Call(ctx, &opts)
if err == nil {
url, err = readBodyWord(res)
}
return fserrors.ShouldRetry(err), err
})
if err != nil {
closeBody(res)
return "", err
}
f.shardURL = info.Body.Upload[0].URL
f.shardURL = url
f.shardExpiry = time.Now().Add(shardExpirySec * time.Second)
fs.Debugf(f, "new upload shard: %s", f.shardURL)
@@ -2116,7 +2122,18 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
return nil, err
}
start, end, partial := getTransferRange(o.size, options...)
start, end, partialRequest := getTransferRange(o.size, options...)
headers := map[string]string{
"Accept": "*/*",
"Content-Type": "application/octet-stream",
}
if partialRequest {
rangeStr := fmt.Sprintf("bytes=%d-%d", start, end-1)
headers["Range"] = rangeStr
// headers["Content-Range"] = rangeStr
headers["Accept-Ranges"] = "bytes"
}
// TODO: set custom timeouts
opts := rest.Opts{
@@ -2127,10 +2144,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
"client_id": {api.OAuthClientID},
"token": {token},
},
ExtraHeaders: map[string]string{
"Accept": "*/*",
"Range": fmt.Sprintf("bytes=%d-%d", start, end-1),
},
ExtraHeaders: headers,
}
var res *http.Response
@@ -2151,18 +2165,36 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
return nil, err
}
var hasher gohash.Hash
if !partial {
// Server should respond with Status 206 and Content-Range header to a range
// request. Status 200 (and no Content-Range) means a full-content response.
partialResponse := res.StatusCode == 206
var (
hasher gohash.Hash
wrapStream io.ReadCloser
)
if !partialResponse {
// Cannot check hash of partial download
hasher = mrhash.New()
}
wrapStream := &endHandler{
wrapStream = &endHandler{
ctx: ctx,
stream: res.Body,
hasher: hasher,
o: o,
server: server,
}
if partialRequest && !partialResponse {
fs.Debugf(o, "Server returned full content instead of range")
if start > 0 {
// Discard the beginning of the data
_, err = io.CopyN(ioutil.Discard, wrapStream, start)
if err != nil {
return nil, err
}
}
wrapStream = readers.NewLimitedReadCloser(wrapStream, end-start)
}
return wrapStream, nil
}
+4
View File
@@ -1247,6 +1247,10 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) {
return nil, errors.Wrap(err, "about failed")
}
q := drive.Quota
// On (some?) Onedrive sharepoints these are all 0 so return unknown in that case
if q.Total == 0 && q.Used == 0 && q.Deleted == 0 && q.Remaining == 0 {
return &fs.Usage{}, nil
}
usage = &fs.Usage{
Total: fs.NewUsageValue(q.Total), // quota of bytes that can be used
Used: fs.NewUsageValue(q.Used), // bytes in use
+67 -10
View File
@@ -122,6 +122,9 @@ func init() {
Name: "secret_access_key",
Help: "AWS Secret Access Key (password)\nLeave blank for anonymous access or runtime credentials.",
}, {
// References:
// 1. https://docs.aws.amazon.com/general/latest/gr/rande.html
// 2. https://docs.aws.amazon.com/general/latest/gr/s3.html
Name: "region",
Help: "Region to connect to.",
Provider: "AWS",
@@ -131,12 +134,12 @@ func init() {
}, {
Value: "us-east-2",
Help: "US East (Ohio) Region\nNeeds location constraint us-east-2.",
}, {
Value: "us-west-2",
Help: "US West (Oregon) Region\nNeeds location constraint us-west-2.",
}, {
Value: "us-west-1",
Help: "US West (Northern California) Region\nNeeds location constraint us-west-1.",
}, {
Value: "us-west-2",
Help: "US West (Oregon) Region\nNeeds location constraint us-west-2.",
}, {
Value: "ca-central-1",
Help: "Canada (Central) Region\nNeeds location constraint ca-central-1.",
@@ -146,9 +149,15 @@ func init() {
}, {
Value: "eu-west-2",
Help: "EU (London) Region\nNeeds location constraint eu-west-2.",
}, {
Value: "eu-west-3",
Help: "EU (Paris) Region\nNeeds location constraint eu-west-3.",
}, {
Value: "eu-north-1",
Help: "EU (Stockholm) Region\nNeeds location constraint eu-north-1.",
}, {
Value: "eu-south-1",
Help: "EU (Milan) Region\nNeeds location constraint eu-south-1.",
}, {
Value: "eu-central-1",
Help: "EU (Frankfurt) Region\nNeeds location constraint eu-central-1.",
@@ -164,15 +173,36 @@ func init() {
}, {
Value: "ap-northeast-2",
Help: "Asia Pacific (Seoul)\nNeeds location constraint ap-northeast-2.",
}, {
Value: "ap-northeast-3",
Help: "Asia Pacific (Osaka-Local)\nNeeds location constraint ap-northeast-3.",
}, {
Value: "ap-south-1",
Help: "Asia Pacific (Mumbai)\nNeeds location constraint ap-south-1.",
}, {
Value: "ap-east-1",
Help: "Asia Patific (Hong Kong) Region\nNeeds location constraint ap-east-1.",
Help: "Asia Pacific (Hong Kong) Region\nNeeds location constraint ap-east-1.",
}, {
Value: "sa-east-1",
Help: "South America (Sao Paulo) Region\nNeeds location constraint sa-east-1.",
}, {
Value: "me-south-1",
Help: "Middle East (Bahrain) Region\nNeeds location constraint me-south-1.",
}, {
Value: "af-south-1",
Help: "Africa (Cape Town) Region\nNeeds location constraint af-south-1.",
}, {
Value: "cn-north-1",
Help: "China (Beijing) Region\nNeeds location constraint cn-north-1.",
}, {
Value: "cn-northwest-1",
Help: "China (Ningxia) Region\nNeeds location constraint cn-northwest-1.",
}, {
Value: "us-gov-east-1",
Help: "AWS GovCloud (US-East) Region\nNeeds location constraint us-gov-east-1.",
}, {
Value: "us-gov-west-1",
Help: "AWS GovCloud (US) Region\nNeeds location constraint us-gov-west-1.",
}},
}, {
Name: "region",
@@ -585,12 +615,12 @@ func init() {
}, {
Value: "us-east-2",
Help: "US East (Ohio) Region.",
}, {
Value: "us-west-2",
Help: "US West (Oregon) Region.",
}, {
Value: "us-west-1",
Help: "US West (Northern California) Region.",
}, {
Value: "us-west-2",
Help: "US West (Oregon) Region.",
}, {
Value: "ca-central-1",
Help: "Canada (Central) Region.",
@@ -600,9 +630,15 @@ func init() {
}, {
Value: "eu-west-2",
Help: "EU (London) Region.",
}, {
Value: "eu-west-3",
Help: "EU (Paris) Region.",
}, {
Value: "eu-north-1",
Help: "EU (Stockholm) Region.",
}, {
Value: "eu-south-1",
Help: "EU (Milan) Region.",
}, {
Value: "EU",
Help: "EU Region.",
@@ -617,16 +653,37 @@ func init() {
Help: "Asia Pacific (Tokyo) Region.",
}, {
Value: "ap-northeast-2",
Help: "Asia Pacific (Seoul)",
Help: "Asia Pacific (Seoul) Region.",
}, {
Value: "ap-northeast-3",
Help: "Asia Pacific (Osaka-Local) Region.",
}, {
Value: "ap-south-1",
Help: "Asia Pacific (Mumbai)",
Help: "Asia Pacific (Mumbai) Region.",
}, {
Value: "ap-east-1",
Help: "Asia Pacific (Hong Kong)",
Help: "Asia Pacific (Hong Kong) Region.",
}, {
Value: "sa-east-1",
Help: "South America (Sao Paulo) Region.",
}, {
Value: "me-south-1",
Help: "Middle East (Bahrain) Region.",
}, {
Value: "af-south-1",
Help: "Africa (Cape Town) Region.",
}, {
Value: "cn-north-1",
Help: "China (Beijing) Region",
}, {
Value: "cn-northwest-1",
Help: "China (Ningxia) Region.",
}, {
Value: "us-gov-east-1",
Help: "AWS GovCloud (US-East) Region.",
}, {
Value: "us-gov-west-1",
Help: "AWS GovCloud (US) Region.",
}},
}, {
Name: "location_constraint",
+1 -1
View File
@@ -46,7 +46,7 @@ type Library struct {
Encrypted bool `json:"encrypted"`
Owner string `json:"owner"`
ID string `json:"id"`
Size int `json:"size"`
Size int64 `json:"size"`
Name string `json:"name"`
Modified int64 `json:"mtime"`
}
+1 -1
View File
@@ -1004,7 +1004,7 @@ func (f *Fs) listLibraries(ctx context.Context) (entries fs.DirEntries, err erro
for _, library := range libraries {
d := fs.NewDir(library.Name, time.Unix(library.Modified, 0))
d.SetSize(int64(library.Size))
d.SetSize(library.Size)
entries = append(entries, d)
}
+1 -1
View File
@@ -1087,7 +1087,7 @@ func shellEscape(str string) string {
func parseHash(bytes []byte) string {
// For strings with backslash *sum writes a leading \
// https://unix.stackexchange.com/q/313733/94054
return strings.Split(strings.TrimLeft(string(bytes), "\\"), " ")[0] // Split at hash / filename separator
return strings.ToLower(strings.Split(strings.TrimLeft(string(bytes), "\\"), " ")[0]) // Split at hash / filename separator / all convert to lowercase
}
// Parses the byte array output from the SSH session
+2 -2
View File
@@ -106,7 +106,7 @@ type UploadSpecification struct {
type UploadFinishResponse struct {
Error bool `json:"error"`
ErrorMessage string `json:"errorMessage"`
ErrorCode int `json:"errorCode"`
ErrorCode int `json:"errorCode,string"`
Value []struct {
UploadID string `json:"uploadid"`
ParentID string `json:"parentid"`
@@ -114,7 +114,7 @@ type UploadFinishResponse struct {
StreamID string `json:"streamid"`
FileName string `json:"filename"`
DisplayName string `json:"displayname"`
Size int `json:"size"`
Size int `json:"size,string"`
Md5 string `json:"md5"`
} `json:"value"`
}
-3
View File
@@ -3,7 +3,6 @@ package policy
import (
"context"
"math/rand"
"time"
"github.com/rclone/rclone/backend/union/upstream"
"github.com/rclone/rclone/fs"
@@ -20,12 +19,10 @@ type EpRand struct {
}
func (p *EpRand) rand(upstreams []*upstream.Fs) *upstream.Fs {
rand.Seed(time.Now().Unix())
return upstreams[rand.Intn(len(upstreams))]
}
func (p *EpRand) randEntries(entries []upstream.Entry) upstream.Entry {
rand.Seed(time.Now().Unix())
return entries[rand.Intn(len(entries))]
}
+10 -4
View File
@@ -145,11 +145,16 @@ func (f *Fs) Hashes() hash.Set {
// Mkdir makes the root directory of the Fs object
func (f *Fs) Mkdir(ctx context.Context, dir string) error {
upstreams, err := f.create(ctx, dir)
if err == fs.ErrorObjectNotFound && dir != parentDir(dir) {
if err := f.Mkdir(ctx, parentDir(dir)); err != nil {
return err
if err == fs.ErrorObjectNotFound {
if dir != parentDir(dir) {
if err := f.Mkdir(ctx, parentDir(dir)); err != nil {
return err
}
upstreams, err = f.create(ctx, dir)
} else if dir == "" {
// If root dirs not created then create them
upstreams, err = f.upstreams, nil
}
upstreams, err = f.create(ctx, dir)
}
if err != nil {
return err
@@ -818,6 +823,7 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) {
if err != nil {
return nil, err
}
fs.Debugf(f, "actionPolicy = %T, createPolicy = %T, searchPolicy = %T", f.actionPolicy, f.createPolicy, f.searchPolicy)
var features = (&fs.Features{
CaseInsensitive: true,
DuplicateFiles: false,
+4 -2
View File
@@ -9,7 +9,6 @@ package cmd
import (
"fmt"
"log"
"math/rand"
"os"
"os/exec"
"path"
@@ -35,6 +34,7 @@ import (
"github.com/rclone/rclone/fs/rc/rcflags"
"github.com/rclone/rclone/fs/rc/rcserver"
"github.com/rclone/rclone/lib/atexit"
"github.com/rclone/rclone/lib/random"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
@@ -512,7 +512,9 @@ func AddBackendFlags() {
// Main runs rclone interpreting flags and commands out of os.Args
func Main() {
rand.Seed(time.Now().Unix())
if err := random.Seed(); err != nil {
log.Fatalf("Fatal error: %v", err)
}
setupRootCommand(Root)
AddBackendFlags()
if err := Root.Execute(); err != nil {
+2 -2
View File
@@ -67,8 +67,8 @@ func setAttr(node vfs.Node, attr *fuse.Attr) {
modTime := node.ModTime()
// set attributes
vfs := node.VFS()
attr.Owner.Gid = vfs.Opt.UID
attr.Owner.Uid = vfs.Opt.GID
attr.Owner.Gid = vfs.Opt.GID
attr.Owner.Uid = vfs.Opt.UID
attr.Mode = getMode(node)
attr.Size = Size
attr.Nlink = 1
-3
View File
@@ -336,9 +336,6 @@ With --vfs-read-chunk-size 100M and --vfs-read-chunk-size-limit 0 the following
parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on.
When --vfs-read-chunk-size-limit 500M is specified, the result would be
0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.
Chunked reading will only work with --vfs-cache-mode < full, as the file will always
be copied to the vfs cache before opening with --vfs-cache-mode full.
` + vfs.Help,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(2, 2, command, args)
+2 -1
View File
@@ -404,6 +404,7 @@ Note that Box is case insensitive so you can't have a file called
"Hello.doc" and one called "hello.doc".
Box file names can't have the `\` character in. rclone maps this to
and from an identical looking unicode equivalent `\`.
and from an identical looking unicode equivalent `\` (U+FF3C Fullwidth
Reverse Solidus).
Box only supports filenames up to 255 characters in length.
+64
View File
@@ -5,6 +5,70 @@ description: "Rclone Changelog"
# Changelog
## v1.53.3 - 2020-11-19
[See commits](https://github.com/rclone/rclone/compare/v1.53.2...v1.53.3)
* Bug Fixes
* random: Fix incorrect use of math/rand instead of crypto/rand CVE-2020-28924 (Nick Craig-Wood)
* Passwords you have generated with `rclone config` may be insecure
* See [issue #4783](https://github.com/rclone/rclone/issues/4783) for more details and a checking tool
* random: Seed math/rand in one place with crypto strong seed (Nick Craig-Wood)
* VFS
* Fix vfs/refresh calls with fs= parameter (Nick Craig-Wood)
* Sharefile
* Fix backend due to API swapping integers for strings (Nick Craig-Wood)
## v1.53.2 - 2020-10-26
[See commits](https://github.com/rclone/rclone/compare/v1.53.1...v1.53.2)
* Bug Fixes
* acounting
* Fix incorrect speed and transferTime in core/stats (Nick Craig-Wood)
* Stabilize display order of transfers on Windows (Nick Craig-Wood)
* operations
* Fix use of --suffix without --backup-dir (Nick Craig-Wood)
* Fix spurious "--checksum is in use but the source and destination have no hashes in common" (Nick Craig-Wood)
* build
* Work around GitHub actions brew problem (Nick Craig-Wood)
* Stop using set-env and set-path in the GitHub actions (Nick Craig-Wood)
* Mount
* mount2: Fix the swapped UID / GID values (Russell Cattelan)
* VFS
* Detect and recover from a file being removed externally from the cache (Nick Craig-Wood)
* Fix a deadlock vulnerability in downloaders.Close (Leo Luan)
* Fix a race condition in retryFailedResets (Leo Luan)
* Fix missed concurrency control between some item operations and reset (Leo Luan)
* Add exponential backoff during ENOSPC retries (Leo Luan)
* Add a missed update of used cache space (Leo Luan)
* Fix --no-modtime to not attempt to set modtimes (as documented) (Nick Craig-Wood)
* Local
* Fix sizes and syncing with --links option on Windows (Nick Craig-Wood)
* Chunker
* Disable ListR to fix missing files on GDrive (workaround) (Ivan Andreev)
* Fix upload over crypt (Ivan Andreev)
* Fichier
* Increase maximum file size from 100GB to 300GB (gyutw)
* Jottacloud
* Remove clientSecret from config when upgrading to token based authentication (buengese)
* Avoid double url escaping of device/mountpoint (albertony)
* Remove DirMove workaround as it's not required anymore - also (buengese)
* Mailru
* Fix uploads after recent changes on server (Ivan Andreev)
* Fix range requests after june changes on server (Ivan Andreev)
* Fix invalid timestamp on corrupted files (fixes) (Ivan Andreev)
* Onedrive
* Fix disk usage for sharepoint (Nick Craig-Wood)
* S3
* Add missing regions for AWS (Anagh Kumar Baranwal)
* Seafile
* Fix accessing libraries > 2GB on 32 bit systems (Muffin King)
* SFTP
* Always convert the checksum to lower case (buengese)
* Union
* Create root directories if none exist (Nick Craig-Wood)
## v1.53.1 - 2020-09-13
[See commits](https://github.com/rclone/rclone/compare/v1.53.0...v1.53.1)
-3
View File
@@ -194,9 +194,6 @@ parts will be downloaded: 0-100M, 100M-200M, 200M-300M, 300M-400M and so on.
When --vfs-read-chunk-size-limit 500M is specified, the result would be
0-100M, 100M-300M, 300M-700M, 700M-1200M, 1200M-1700M and so on.
Chunked reading will only work with --vfs-cache-mode < full, as the file will always
be copied to the vfs cache before opening with --vfs-cache-mode full.
## VFS - Virtual File System
This command uses the VFS layer. This adapts the cloud storage objects
+60 -63
View File
@@ -6,23 +6,26 @@ description: "Encryption overlay remote"
{{< icon "fa fa-lock" >}}Crypt
----------------------------------------
The `crypt` remote encrypts and decrypts another remote.
Rclone `crypt` remotes encrypt and decrypt other remotes.
To use it first set up the underlying remote following the config
instructions for that remote. You can also use a local pathname
instead of a remote which will encrypt and decrypt from that directory
which might be useful for encrypting onto a USB stick for example.
To use `crypt`, first set up the underlying remote. Follow the `rclone
config` instructions for that remote.
First check your chosen remote is working - we'll call it
`remote:path` in these docs. Note that anything inside `remote:path`
will be encrypted and anything outside won't. This means that if you
are using a bucket based remote (eg S3, B2, swift) then you should
probably put the bucket in the remote `s3:bucket`. If you just use
`s3:` then rclone will make encrypted bucket names too (if using file
name encryption) which may or may not be what you want.
`crypt` applied to a local pathname instead of a remote will
encrypt and decrypt that directory, and can be used to encrypt USB
removable drives.
Now configure `crypt` using `rclone config`. We will call this one
`secret` to differentiate it from the `remote`.
Before configuring the crypt remote, check the underlying remote is
working. In this example the underlying remote is called `remote:path`.
Anything inside `remote:path` will be encrypted and anything outside
will not. In the case of an S3 based underlying remote (eg Amazon S3,
B2, Swift) it is generally advisable to define a crypt remote in the
underlying remote `s3:bucket`. If `s3:` alone is specified alongside
file name encryption, rclone will encrypt the bucket name.
Configure `crypt` using `rclone config`. In this example the `crypt`
remote is called `secret`, to differentiate it from the underlying
`remote`.
```
No remotes found - make a new one
@@ -96,49 +99,42 @@ d) Delete this remote
y/e/d> y
```
**Important** The password is stored in the config file is lightly
obscured so it isn't immediately obvious what it is. It is in no way
secure unless you use config file encryption.
**Important** The crypt password stored in `rclone.conf` is lightly
obscured. That only protects it from cursory inspection. It is not
secure unless encryption of `rclone.conf` is specified.
A long passphrase is recommended, or you can use a random one.
A long passphrase is recommended, or `rclone config` can generate a
random one.
The obscured password is created by using AES-CTR with a static key, with
the salt stored verbatim at the beginning of the obscured password. This
static key is shared by between all versions of rclone.
The obscured password is created using AES-CTR with a static key. The
salt is stored verbatim at the beginning of the obscured password. This
static key is shared between all versions of rclone.
If you reconfigure rclone with the same passwords/passphrases
elsewhere it will be compatible, but the obscured version will be different
due to the different salt.
Note that rclone does not encrypt
Rclone does not encrypt
* file length - this can be calculated within 16 bytes
* modification time - used for syncing
## Specifying the remote ##
In normal use, make sure the remote has a `:` in. If you specify the
remote without a `:` then rclone will use a local directory of that
name. So if you use a remote of `/path/to/secret/files` then rclone
will encrypt stuff to that directory. If you use a remote of `name`
then rclone will put files in a directory called `name` in the current
directory.
In normal use, ensure the remote has a `:` in. If specified without,
rclone uses a local directory of that name. For example if a remote
`/path/to/secret/files` is specified, rclone encrypts content to that
directory. If a remote `name` is specified, rclone targets a directory
`name` in the current directory.
If you specify the remote as `remote:path/to/dir` then rclone will
store encrypted files in `path/to/dir` on the remote. If you are using
file name encryption, then when you save files to
`secret:subdir/subfile` this will store them in the unencrypted path
`path/to/dir` but the `subdir/subpath` bit will be encrypted.
Note that unless you want encrypted bucket names (which are difficult
to manage because you won't know what directory they represent in web
interfaces etc), you should probably specify a bucket, eg
`remote:secretbucket` when using bucket based remotes such as S3,
Swift, Hubic, B2, GCS.
If remote `remote:path/to/dir` is specified, rclone stores encrypted
files in `path/to/dir` on the remote. With file name encryption, files
saved to `secret:subdir/subfile` are stored in the unencrypted path
`path/to/dir` but the `subdir/subpath` element is encrypted.
## Example ##
To test I made a little directory of files using "standard" file name
Create the following file structure using "standard" file name
encryption.
```
@@ -152,7 +148,7 @@ plaintext/
└── file4.txt
```
Copy these to the remote and list them back
Copy these to the remote, and list them
```
$ rclone -q copy plaintext secret:
@@ -164,7 +160,7 @@ $ rclone -q ls secret:
9 subdir/file3.txt
```
Now see what that looked like when encrypted
The crypt remote looks like
```
$ rclone -q ls remote:path
@@ -175,7 +171,7 @@ $ rclone -q ls remote:path
56 86vhrsv86mpbtd3a0akjuqslj8/8njh1sk437gttmep3p70g81aps
```
Note that this retains the directory structure which means you can do this
The directory structure is preserved
```
$ rclone -q ls secret:subdir
@@ -184,9 +180,9 @@ $ rclone -q ls secret:subdir
10 subsubdir/file4.txt
```
If don't use file name encryption then the remote will look like this
- note the `.bin` extensions added to prevent the cloud provider
attempting to interpret the data.
Without file name encryption `.bin` extensions are added to underlying
names. This prevents the cloud provider attempting to interpret file
content.
```
$ rclone -q ls remote:path
@@ -199,8 +195,6 @@ $ rclone -q ls remote:path
### File name encryption modes ###
Here are some of the features of the file name encryption modes
Off
* doesn't hide file names or directory structure
@@ -219,17 +213,19 @@ Standard
Obfuscation
This is a simple "rotate" of the filename, with each file having a rot
distance based on the filename. We store the distance at the beginning
of the filename. So a file called "hello" may become "53.jgnnq".
distance based on the filename. Rclone stores the distance at the
beginning of the filename. A file called "hello" may become "53.jgnnq".
This is not a strong encryption of filenames, but it may stop automated
scanning tools from picking up on filename patterns. As such it's an
intermediate between "off" and "standard". The advantage is that it
allows for longer path segment names.
Obfuscation is not a strong encryption of filenames, but hinders
automated scanning tools picking up on filename patterns. It is an
intermediate between "off" and "standard" which allows for longer path
segment names.
There is a possibility with some unicode based filenames that the
obfuscation is weak and may map lower case characters to upper case
equivalents. You can not rely on this for strong protection.
equivalents.
Obfuscation cannot be relied upon for strong protection.
* file names very lightly obfuscated
* file names can be longer than standard encryption
@@ -237,13 +233,14 @@ equivalents. You can not rely on this for strong protection.
* directory structure visible
* identical files names will have identical uploaded names
Cloud storage systems have various limits on file name length and
total path length which you are more likely to hit using "Standard"
file name encryption. If you keep your file names to below 156
characters in length then you should be OK on all providers.
Cloud storage systems have limits on file name length and
total path length which rclone is more likely to breach using
"Standard" file name encryption. Where file names are less thn 156
characters in length issues should not be encountered, irrespective of
cloud storage provider.
There may be an even more secure file name encryption mode in the
future which will address the long file name problem.
An alternative, future rclone file name encryption mode may tolerate
backend provider path length limits.
### Directory name encryption ###
Crypt offers the option of encrypting dir names or leaving them intact.
@@ -269,10 +266,10 @@ Example:
Crypt stores modification times using the underlying remote so support
depends on that.
Hashes are not stored for crypt. However the data integrity is
Hashes are not stored for crypt. However the data integrity is
protected by an extremely strong crypto authenticator.
Note that you should use the `rclone cryptcheck` command to check the
Use the `rclone cryptcheck` command to check the
integrity of a crypted remote instead of `rclone check` which can't
check the checksums properly.
+8 -2
View File
@@ -1253,11 +1253,17 @@ or with `--backup-dir`. See `--backup-dir` for more info.
For example
rclone sync -i /path/to/local/file remote:current --suffix .bak
rclone copy -i /path/to/local/file remote:current --suffix .bak
will sync `/path/to/local` to `remote:current`, but for any files
will copy `/path/to/local` to `remote:current`, but for any files
which would have been updated or deleted have .bak added.
If using `rclone sync` with `--suffix` and without `--backup-dir` then
it is recommended to put a filter rule in excluding the suffix
otherwise the `sync` will delete the backup files.
rclone sync -i /path/to/local/file remote:current --suffix .bak --exclude "*.bak"
### --suffix-keep-extension ###
When using `--suffix`, setting this causes rclone put the SUFFIX
+1 -1
View File
@@ -147,7 +147,7 @@ These flags are available for every command.
--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. The default is rclone/ version (default "rclone/v1.53.1")
--user-agent string Set the user-agent to a specified string. The default is rclone/ version (default "rclone/v1.53.3")
-v, --verbose count Print lots more stuff (repeat for more)
```
+55 -10
View File
@@ -139,7 +139,7 @@ Choose a number from below, or type in your own value
/ Asia Pacific (Mumbai)
13 | Needs location constraint ap-south-1.
\ "ap-south-1"
/ Asia Patific (Hong Kong) Region
/ Asia Pacific (Hong Kong) Region
14 | Needs location constraint ap-east-1.
\ "ap-east-1"
/ South America (Sao Paulo) Region
@@ -545,12 +545,12 @@ Region to connect to.
- "us-east-2"
- US East (Ohio) Region
- Needs location constraint us-east-2.
- "us-west-2"
- US West (Oregon) Region
- Needs location constraint us-west-2.
- "us-west-1"
- US West (Northern California) Region
- Needs location constraint us-west-1.
- "us-west-2"
- US West (Oregon) Region
- Needs location constraint us-west-2.
- "ca-central-1"
- Canada (Central) Region
- Needs location constraint ca-central-1.
@@ -560,9 +560,15 @@ Region to connect to.
- "eu-west-2"
- EU (London) Region
- Needs location constraint eu-west-2.
- "eu-west-3"
- EU (Paris) Region
- Needs location constraint eu-west-3.
- "eu-north-1"
- EU (Stockholm) Region
- Needs location constraint eu-north-1.
- "eu-south-1"
- EU (Milan) Region
- Needs location constraint eu-south-1.
- "eu-central-1"
- EU (Frankfurt) Region
- Needs location constraint eu-central-1.
@@ -578,15 +584,36 @@ Region to connect to.
- "ap-northeast-2"
- Asia Pacific (Seoul)
- Needs location constraint ap-northeast-2.
- "ap-northeast-3"
- Asia Pacific (Osaka-Local)
- Needs location constraint ap-northeast-3.
- "ap-south-1"
- Asia Pacific (Mumbai)
- Needs location constraint ap-south-1.
- "ap-east-1"
- Asia Patific (Hong Kong) Region
- Asia Pacific (Hong Kong) Region
- Needs location constraint ap-east-1.
- "sa-east-1"
- South America (Sao Paulo) Region
- Needs location constraint sa-east-1.
- "me-south-1"
- Middle East (Bahrain) Region
- Needs location constraint me-south-1.
- "af-south-1"
- Africa (Cape Town) Region
- Needs location constraint af-south-1.
- "cn-north-1"
- China (Beijing) Region
- Needs location constraint cn-north-1.
- "cn-northwest-1"
- China (Ningxia) Region
- Needs location constraint cn-northwest-1.
- "us-gov-east-1"
- AWS GovCloud (US-East) Region
- Needs location constraint us-gov-east-1.
- "us-gov-west-1"
- AWS GovCloud (US) Region
- Needs location constraint us-gov-west-1.
#### --s3-region
@@ -927,18 +954,22 @@ Used when creating buckets only.
- Empty for US Region, Northern Virginia or Pacific Northwest.
- "us-east-2"
- US East (Ohio) Region.
- "us-west-2"
- US West (Oregon) Region.
- "us-west-1"
- US West (Northern California) Region.
- "us-west-2"
- US West (Oregon) Region.
- "ca-central-1"
- Canada (Central) Region.
- "eu-west-1"
- EU (Ireland) Region.
- "eu-west-2"
- EU (London) Region.
- "eu-west-3"
- EU (Paris) Region.
- "eu-north-1"
- EU (Stockholm) Region.
- "eu-south-1"
- EU (Milan) Region.
- "EU"
- EU Region.
- "ap-southeast-1"
@@ -948,13 +979,27 @@ Used when creating buckets only.
- "ap-northeast-1"
- Asia Pacific (Tokyo) Region.
- "ap-northeast-2"
- Asia Pacific (Seoul)
- Asia Pacific (Seoul) Region.
- "ap-northeast-3"
- Asia Pacific (Osaka-Local) Region.
- "ap-south-1"
- Asia Pacific (Mumbai)
- Asia Pacific (Mumbai) Region.
- "ap-east-1"
- Asia Pacific (Hong Kong)
- Asia Pacific (Hong Kong) Region.
- "sa-east-1"
- South America (Sao Paulo) Region.
- "me-south-1"
- Middle East (Bahrain) Region.
- "af-south-1"
- Africa (Cape Town) Region.
- "cn-north-1"
- China (Beijing) Region
- "cn-northwest-1"
- China (Ningxia) Region.
- "us-gov-east-1"
- AWS GovCloud (US-East) Region.
- "us-gov-west-1"
- AWS GovCloud (US) Region.
#### --s3-location-constraint
+1 -1
View File
@@ -1 +1 @@
v1.53.1
v1.53.3
+2
View File
@@ -366,6 +366,8 @@ func (sg *statsGroups) sum() *StatsInfo {
sum.lastError = stats.lastError
}
sum.startedTransfers = append(sum.startedTransfers, stats.startedTransfers...)
sum.oldDuration += stats.oldDuration
sum.oldTimeRanges = append(sum.oldTimeRanges, stats.oldTimeRanges...)
}
stats.mu.RUnlock()
}
+17 -6
View File
@@ -4,8 +4,10 @@ import (
"fmt"
"runtime"
"testing"
"time"
"github.com/rclone/rclone/fstest/testy"
"github.com/stretchr/testify/assert"
)
func TestStatsGroupOperations(t *testing.T) {
@@ -43,17 +45,26 @@ func TestStatsGroupOperations(t *testing.T) {
t.Parallel()
stats1 := NewStats()
stats1.bytes = 5
stats1.errors = 5
stats1.errors = 6
stats1.oldDuration = time.Second
stats1.oldTimeRanges = []timeRange{{time.Now(), time.Now().Add(time.Second)}}
stats2 := NewStats()
stats2.bytes = 10
stats2.errors = 12
stats2.oldDuration = 2 * time.Second
stats2.oldTimeRanges = []timeRange{{time.Now(), time.Now().Add(2 * time.Second)}}
sg := newStatsGroups()
sg.set("test1", stats1)
sg.set("test2", stats2)
sum := sg.sum()
if sum.bytes != stats1.bytes+stats2.bytes {
t.Fatalf("sum() => bytes %d, expected %d", sum.bytes, stats1.bytes+stats2.bytes)
}
if sum.errors != stats1.errors+stats2.errors {
t.Fatalf("sum() => errors %d, expected %d", sum.errors, stats1.errors+stats2.errors)
assert.Equal(t, stats1.bytes+stats2.bytes, sum.bytes)
assert.Equal(t, stats1.errors+stats2.errors, sum.errors)
assert.Equal(t, stats1.oldDuration+stats2.oldDuration, sum.oldDuration)
// dict can iterate in either order
a := timeRanges{stats1.oldTimeRanges[0], stats2.oldTimeRanges[0]}
b := timeRanges{stats2.oldTimeRanges[0], stats1.oldTimeRanges[0]}
if !assert.ObjectsAreEqual(a, sum.oldTimeRanges) {
assert.Equal(t, b, sum.oldTimeRanges)
}
})
+9 -1
View File
@@ -72,8 +72,16 @@ func (tm *transferMap) _sortedSlice() []*Transfer {
for _, tr := range tm.items {
s = append(s, tr)
}
// sort by time first and if equal by name. Note that the relatively
// low time resolution on Windows can cause equal times.
sort.Slice(s, func(i, j int) bool {
return s[i].startedAt.Before(s[j].startedAt)
a, b := s[i], s[j]
if a.startedAt.Before(b.startedAt) {
return true
} else if !a.startedAt.Equal(b.startedAt) {
return false
}
return a.remote < b.remote
})
return s
}
+9 -7
View File
@@ -172,9 +172,12 @@ func equal(ctx context.Context, src fs.ObjectInfo, dst fs.Object, opt equalOpt)
return false
}
if ht == hash.None {
checksumWarning.Do(func() {
fs.Logf(dst.Fs(), "--checksum is in use but the source and destination have no hashes in common; falling back to --size-only")
})
common := src.Fs().Hashes().Overlap(dst.Fs().Hashes())
if common.Count() == 0 {
checksumWarning.Do(func() {
fs.Logf(dst.Fs(), "--checksum is in use but the source and destination have no hashes in common; falling back to --size-only")
})
}
fs.Debugf(src, "Size of src and dst objects identical")
} else {
fs.Debugf(src, "Size and %v of src and dst objects identical", ht)
@@ -1522,12 +1525,11 @@ func BackupDir(fdst fs.Fs, fsrc fs.Fs, srcFileName string) (backupDir fs.Fs, err
}
}
}
} else {
if srcFileName == "" {
return nil, fserrors.FatalError(errors.New("--suffix must be used with a file or with --backup-dir"))
}
} else if fs.Config.Suffix != "" {
// --backup-dir is not set but --suffix is - use the destination as the backupDir
backupDir = fdst
} else {
return nil, fserrors.FatalError(errors.New("internal error: BackupDir called when --backup-dir and --suffix both empty"))
}
if !CanServerSideMove(backupDir) {
return nil, fserrors.FatalError(errors.New("can't use --backup-dir on a remote which doesn't support server side move or copy"))
+34 -11
View File
@@ -1590,7 +1590,7 @@ func TestSyncCopyDest(t *testing.T) {
}
// Test with BackupDir set
func testSyncBackupDir(t *testing.T, suffix string, suffixKeepExtension bool) {
func testSyncBackupDir(t *testing.T, backupDir string, suffix string, suffixKeepExtension bool) {
r := fstest.NewRun(t)
defer r.Finalise()
@@ -1599,7 +1599,23 @@ func testSyncBackupDir(t *testing.T, suffix string, suffixKeepExtension bool) {
}
r.Mkdir(context.Background(), r.Fremote)
fs.Config.BackupDir = r.FremoteName + "/backup"
if backupDir != "" {
fs.Config.BackupDir = r.FremoteName + "/" + backupDir
backupDir += "/"
} else {
fs.Config.BackupDir = ""
backupDir = "dst/"
// Exclude the suffix from the sync otherwise the sync
// deletes the old backup files
flt, err := filter.NewFilter(nil)
require.NoError(t, err)
require.NoError(t, flt.AddRule("- *"+suffix))
oldFlt := filter.Active
filter.Active = flt
defer func() {
filter.Active = oldFlt
}()
}
fs.Config.Suffix = suffix
fs.Config.SuffixKeepExtension = suffixKeepExtension
defer func() {
@@ -1627,14 +1643,14 @@ func testSyncBackupDir(t *testing.T, suffix string, suffixKeepExtension bool) {
require.NoError(t, err)
// one should be moved to the backup dir and the new one installed
file1.Path = "backup/one" + suffix
file1.Path = backupDir + "one" + suffix
file1a.Path = "dst/one"
// two should be unchanged
// three should be moved to the backup dir
if suffixKeepExtension {
file3.Path = "backup/three" + suffix + ".txt"
file3.Path = backupDir + "three" + suffix + ".txt"
} else {
file3.Path = "backup/three.txt" + suffix
file3.Path = backupDir + "three.txt" + suffix
}
fstest.CheckItems(t, r.Fremote, file1, file2, file3, file1a)
@@ -1652,22 +1668,29 @@ func testSyncBackupDir(t *testing.T, suffix string, suffixKeepExtension bool) {
require.NoError(t, err)
// one should be moved to the backup dir and the new one installed
file1a.Path = "backup/one" + suffix
file1a.Path = backupDir + "one" + suffix
file1b.Path = "dst/one"
// two should be unchanged
// three should be moved to the backup dir
if suffixKeepExtension {
file3a.Path = "backup/three" + suffix + ".txt"
file3a.Path = backupDir + "three" + suffix + ".txt"
} else {
file3a.Path = "backup/three.txt" + suffix
file3a.Path = backupDir + "three.txt" + suffix
}
fstest.CheckItems(t, r.Fremote, file1b, file2, file3a, file1a)
}
func TestSyncBackupDir(t *testing.T) { testSyncBackupDir(t, "", false) }
func TestSyncBackupDirWithSuffix(t *testing.T) { testSyncBackupDir(t, ".bak", false) }
func TestSyncBackupDir(t *testing.T) {
testSyncBackupDir(t, "backup", "", false)
}
func TestSyncBackupDirWithSuffix(t *testing.T) {
testSyncBackupDir(t, "backup", ".bak", false)
}
func TestSyncBackupDirWithSuffixKeepExtension(t *testing.T) {
testSyncBackupDir(t, "-2019-01-01", true)
testSyncBackupDir(t, "backup", "-2019-01-01", true)
}
func TestSyncBackupDirSuffixOnly(t *testing.T) {
testSyncBackupDir(t, "", ".bak", false)
}
// Test with Suffix set
+1 -1
View File
@@ -1,4 +1,4 @@
package fs
// Version of rclone
var Version = "v1.53.1-DEV"
var Version = "v1.53.3-DEV"
+21 -19
View File
@@ -27,15 +27,16 @@ type Test struct {
//
// FIXME make bucket based remotes set sub-dir automatically???
type Backend struct {
Backend string // name of the backend directory
Remote string // name of the test remote
FastList bool // set to test with -fast-list
Short bool // set to test with -short
OneOnly bool // set to run only one backend test at once
MaxFile string // file size limit
CleanUp bool // when running clean, run cleanup first
Ignore []string // test names to ignore the failure of
Tests []string // paths of tests to run, blank for all
Backend string // name of the backend directory
Remote string // name of the test remote
FastList bool // set to test with -fast-list
Short bool // set to test with -short
OneOnly bool // set to run only one backend test at once
MaxFile string // file size limit
CleanUp bool // when running clean, run cleanup first
Ignore []string // test names to ignore the failure of
Tests []string // paths of tests to run, blank for all
ListRetries int // -list-retries if > 0
}
// includeTest returns true if this backend should be included in this
@@ -79,16 +80,17 @@ func (b *Backend) MakeRuns(t *Test) (runs []*Run) {
continue
}
run := &Run{
Remote: b.Remote,
Backend: b.Backend,
Path: t.Path,
FastList: fastlist,
Short: (b.Short && t.Short),
NoRetries: t.NoRetries,
OneOnly: b.OneOnly,
NoBinary: t.NoBinary,
SizeLimit: int64(maxSize),
Ignore: ignore,
Remote: b.Remote,
Backend: b.Backend,
Path: t.Path,
FastList: fastlist,
Short: (b.Short && t.Short),
NoRetries: t.NoRetries,
OneOnly: b.OneOnly,
NoBinary: t.NoBinary,
SizeLimit: int64(maxSize),
Ignore: ignore,
ListRetries: b.ListRetries,
}
if t.AddBackend {
run.Path = path.Join(run.Path, b.Backend)
+23 -20
View File
@@ -20,6 +20,7 @@ backends:
- backend: "b2"
remote: "TestB2:"
fastlist: true
listretries: 5
- backend: "crypt"
remote: "TestCryptDrive:"
fastlist: true
@@ -41,15 +42,13 @@ backends:
remote: "TestChunkerChunk3bNometaLocal:"
fastlist: true
maxfile: 6k
# Disable chunker with mailru tests until Mailru is fixed - see
# https://github.com/rclone/rclone/issues/4376
# - backend: "chunker"
# remote: "TestChunkerMailru:"
# fastlist: true
# - backend: "chunker"
# remote: "TestChunkerChunk50bMailru:"
# fastlist: true
# maxfile: 10k
- backend: "chunker"
remote: "TestChunkerMailru:"
fastlist: true
- backend: "chunker"
remote: "TestChunkerChunk50bMailru:"
fastlist: true
maxfile: 10k
- backend: "chunker"
remote: "TestChunkerChunk50bYandex:"
fastlist: true
@@ -73,6 +72,10 @@ backends:
remote: "TestChunkerChunk50bSHA1HashS3:"
fastlist: true
maxfile: 1k
- backend: "chunker"
remote: "TestChunkerOverCrypt:"
fastlist: true
maxfile: 6k
- backend: "chunker"
remote: "TestChunkerChunk50bMD5QuickS3:"
fastlist: true
@@ -144,12 +147,12 @@ backends:
# ignore:
# - TestIntegration/FsMkdir/FsPutFiles/FsCopy
# - TestIntegration/FsMkdir/FsPutFiles/SetTier
- backend: "s3"
remote: "TestS3Ceph:"
fastlist: true
ignore:
- TestIntegration/FsMkdir/FsPutFiles/FsCopy
- TestIntegration/FsMkdir/FsPutFiles/SetTier
# - backend: "s3"
# remote: "TestS3Ceph:"
# fastlist: true
# ignore:
# - TestIntegration/FsMkdir/FsPutFiles/FsCopy
# - TestIntegration/FsMkdir/FsPutFiles/SetTier
- backend: "s3"
remote: "TestS3Alibaba:"
fastlist: true
@@ -170,11 +173,11 @@ backends:
- backend: "swift"
remote: "TestSwift:"
fastlist: true
- backend: "swift"
remote: "TestSwiftCeph:"
fastlist: true
ignore:
- TestIntegration/FsMkdir/FsPutFiles/FsCopy
# - backend: "swift"
# remote: "TestSwiftCeph:"
# fastlist: true
# ignore:
# - TestIntegration/FsMkdir/FsPutFiles/FsCopy
- backend: "yandex"
remote: "TestYandex:"
fastlist: false
+17 -12
View File
@@ -35,16 +35,17 @@ var (
// if retries are needed.
type Run struct {
// Config
Remote string // name of the test remote
Backend string // name of the backend
Path string // path to the source directory
FastList bool // add -fast-list to tests
Short bool // add -short
NoRetries bool // don't retry if set
OneOnly bool // only run test for this backend at once
NoBinary bool // set to not build a binary
SizeLimit int64 // maximum test file size
Ignore map[string]struct{}
Remote string // name of the test remote
Backend string // name of the backend
Path string // path to the source directory
FastList bool // add -fast-list to tests
Short bool // add -short
NoRetries bool // don't retry if set
OneOnly bool // only run test for this backend at once
NoBinary bool // set to not build a binary
SizeLimit int64 // maximum test file size
Ignore map[string]struct{}
ListRetries int // -list-retries if > 0
// Internals
CmdLine []string
CmdString string
@@ -336,8 +337,12 @@ func (r *Run) Init() {
r.CmdLine = []string{"./" + r.BinaryName()}
}
r.CmdLine = append(r.CmdLine, prefix+"v", prefix+"timeout", timeout.String(), "-remote", r.Remote)
if *listRetries > 0 {
r.CmdLine = append(r.CmdLine, "-list-retries", fmt.Sprint(*listRetries))
listRetries := *listRetries
if r.ListRetries > 0 {
listRetries = r.ListRetries
}
if listRetries > 0 {
r.CmdLine = append(r.CmdLine, "-list-retries", fmt.Sprint(listRetries))
}
r.Try = 1
if *verbose {
+21 -3
View File
@@ -2,8 +2,10 @@
package random
import (
cryptorand "crypto/rand"
"encoding/base64"
"math/rand"
"encoding/binary"
mathrand "math/rand"
"github.com/pkg/errors"
)
@@ -23,7 +25,7 @@ func String(n int) string {
for i := range out {
source := pattern[p]
p = (p + 1) % len(pattern)
out[i] = source[rand.Intn(len(source))]
out[i] = source[mathrand.Intn(len(source))]
}
return string(out)
}
@@ -41,7 +43,7 @@ func Password(bits int) (password string, err error) {
bytes++
}
var pw = make([]byte, bytes)
n, err := rand.Read(pw)
n, err := cryptorand.Read(pw)
if err != nil {
return "", errors.Wrap(err, "password read failed")
}
@@ -51,3 +53,19 @@ func Password(bits int) (password string, err error) {
password = base64.RawURLEncoding.EncodeToString(pw)
return password, nil
}
// Seed the global math/rand with crypto strong data
//
// This doesn't make it OK to use math/rand in crypto sensitive
// environments - don't do that! However it does help to mitigate the
// problem if that happens accidentally. This would have helped with
// CVE-2020-28924 - #4783
func Seed() error {
var seed int64
err := binary.Read(cryptorand.Reader, binary.LittleEndian, &seed)
if err != nil {
return errors.Wrap(err, "failed to read random seed")
}
mathrand.Seed(seed)
return nil
}
+14
View File
@@ -1,6 +1,7 @@
package random
import (
"math/rand"
"testing"
"github.com/stretchr/testify/assert"
@@ -48,3 +49,16 @@ func TestPasswordDuplicates(t *testing.T) {
seen[s] = true
}
}
func TestSeed(t *testing.T) {
// seed 100 times and check the first random number doesn't repeat
// This test could fail with a probability of ~ 10**-15
const n = 100
var seen = map[int64]bool{}
for i := 0; i < n; i++ {
assert.NoError(t, Seed())
first := rand.Int63()
assert.False(t, seen[first])
seen[first] = true
}
}
Generated
+394 -101
View File
@@ -1,7 +1,7 @@
.\"t
.\" Automatically generated by Pandoc 2.5
.\"
.TH "rclone" "1" "Sep 13, 2020" "User Manual" ""
.TH "rclone" "1" "Nov 19, 2020" "User Manual" ""
.hy
.SH Rclone syncs your files to cloud storage
.PP
@@ -3549,10 +3549,6 @@ downloaded: 0\-100M, 100M\-200M, 200M\-300M, 300M\-400M and so on.
When \-\-vfs\-read\-chunk\-size\-limit 500M is specified, the result
would be 0\-100M, 100M\-300M, 300M\-700M, 700M\-1200M, 1200M\-1700M and
so on.
.PP
Chunked reading will only work with \-\-vfs\-cache\-mode < full, as the
file will always be copied to the vfs cache before opening with
\-\-vfs\-cache\-mode full.
.SS VFS \- Virtual File System
.PP
This command uses the VFS layer.
@@ -8564,12 +8560,23 @@ For example
.IP
.nf
\f[C]
rclone sync \-i /path/to/local/file remote:current \-\-suffix .bak
rclone copy \-i /path/to/local/file remote:current \-\-suffix .bak
\f[R]
.fi
.PP
will sync \f[C]/path/to/local\f[R] to \f[C]remote:current\f[R], but for
will copy \f[C]/path/to/local\f[R] to \f[C]remote:current\f[R], but for
any files which would have been updated or deleted have .bak added.
.PP
If using \f[C]rclone sync\f[R] with \f[C]\-\-suffix\f[R] and without
\f[C]\-\-backup\-dir\f[R] then it is recommended to put a filter rule in
excluding the suffix otherwise the \f[C]sync\f[R] will delete the backup
files.
.IP
.nf
\f[C]
rclone sync \-i /path/to/local/file remote:current \-\-suffix .bak \-\-exclude \[dq]*.bak\[dq]
\f[R]
.fi
.SS \-\-suffix\-keep\-extension
.PP
When using \f[C]\-\-suffix\f[R], setting this causes rclone put the
@@ -14147,7 +14154,7 @@ These flags are available for every command.
\-\-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. The default is rclone/ version (default \[dq]rclone/v1.53.1\[dq])
\-\-user\-agent string Set the user\-agent to a specified string. The default is rclone/ version (default \[dq]rclone/v1.53.3\[dq])
\-v, \-\-verbose count Print lots more stuff (repeat for more)
\f[R]
.fi
@@ -15415,7 +15422,7 @@ Choose a number from below, or type in your own value
/ Asia Pacific (Mumbai)
13 | Needs location constraint ap\-south\-1.
\[rs] \[dq]ap\-south\-1\[dq]
/ Asia Patific (Hong Kong) Region
/ Asia Pacific (Hong Kong) Region
14 | Needs location constraint ap\-east\-1.
\[rs] \[dq]ap\-east\-1\[dq]
/ South America (Sao Paulo) Region
@@ -16005,14 +16012,6 @@ US East (Ohio) Region
Needs location constraint us\-east\-2.
.RE
.IP \[bu] 2
\[dq]us\-west\-2\[dq]
.RS 2
.IP \[bu] 2
US West (Oregon) Region
.IP \[bu] 2
Needs location constraint us\-west\-2.
.RE
.IP \[bu] 2
\[dq]us\-west\-1\[dq]
.RS 2
.IP \[bu] 2
@@ -16021,6 +16020,14 @@ US West (Northern California) Region
Needs location constraint us\-west\-1.
.RE
.IP \[bu] 2
\[dq]us\-west\-2\[dq]
.RS 2
.IP \[bu] 2
US West (Oregon) Region
.IP \[bu] 2
Needs location constraint us\-west\-2.
.RE
.IP \[bu] 2
\[dq]ca\-central\-1\[dq]
.RS 2
.IP \[bu] 2
@@ -16045,6 +16052,14 @@ EU (London) Region
Needs location constraint eu\-west\-2.
.RE
.IP \[bu] 2
\[dq]eu\-west\-3\[dq]
.RS 2
.IP \[bu] 2
EU (Paris) Region
.IP \[bu] 2
Needs location constraint eu\-west\-3.
.RE
.IP \[bu] 2
\[dq]eu\-north\-1\[dq]
.RS 2
.IP \[bu] 2
@@ -16053,6 +16068,14 @@ EU (Stockholm) Region
Needs location constraint eu\-north\-1.
.RE
.IP \[bu] 2
\[dq]eu\-south\-1\[dq]
.RS 2
.IP \[bu] 2
EU (Milan) Region
.IP \[bu] 2
Needs location constraint eu\-south\-1.
.RE
.IP \[bu] 2
\[dq]eu\-central\-1\[dq]
.RS 2
.IP \[bu] 2
@@ -16093,6 +16116,14 @@ Asia Pacific (Seoul)
Needs location constraint ap\-northeast\-2.
.RE
.IP \[bu] 2
\[dq]ap\-northeast\-3\[dq]
.RS 2
.IP \[bu] 2
Asia Pacific (Osaka\-Local)
.IP \[bu] 2
Needs location constraint ap\-northeast\-3.
.RE
.IP \[bu] 2
\[dq]ap\-south\-1\[dq]
.RS 2
.IP \[bu] 2
@@ -16104,7 +16135,7 @@ Needs location constraint ap\-south\-1.
\[dq]ap\-east\-1\[dq]
.RS 2
.IP \[bu] 2
Asia Patific (Hong Kong) Region
Asia Pacific (Hong Kong) Region
.IP \[bu] 2
Needs location constraint ap\-east\-1.
.RE
@@ -16116,6 +16147,54 @@ South America (Sao Paulo) Region
.IP \[bu] 2
Needs location constraint sa\-east\-1.
.RE
.IP \[bu] 2
\[dq]me\-south\-1\[dq]
.RS 2
.IP \[bu] 2
Middle East (Bahrain) Region
.IP \[bu] 2
Needs location constraint me\-south\-1.
.RE
.IP \[bu] 2
\[dq]af\-south\-1\[dq]
.RS 2
.IP \[bu] 2
Africa (Cape Town) Region
.IP \[bu] 2
Needs location constraint af\-south\-1.
.RE
.IP \[bu] 2
\[dq]cn\-north\-1\[dq]
.RS 2
.IP \[bu] 2
China (Beijing) Region
.IP \[bu] 2
Needs location constraint cn\-north\-1.
.RE
.IP \[bu] 2
\[dq]cn\-northwest\-1\[dq]
.RS 2
.IP \[bu] 2
China (Ningxia) Region
.IP \[bu] 2
Needs location constraint cn\-northwest\-1.
.RE
.IP \[bu] 2
\[dq]us\-gov\-east\-1\[dq]
.RS 2
.IP \[bu] 2
AWS GovCloud (US\-East) Region
.IP \[bu] 2
Needs location constraint us\-gov\-east\-1.
.RE
.IP \[bu] 2
\[dq]us\-gov\-west\-1\[dq]
.RS 2
.IP \[bu] 2
AWS GovCloud (US) Region
.IP \[bu] 2
Needs location constraint us\-gov\-west\-1.
.RE
.RE
.SS \-\-s3\-region
.PP
@@ -16978,18 +17057,18 @@ Empty for US Region, Northern Virginia or Pacific Northwest.
US East (Ohio) Region.
.RE
.IP \[bu] 2
\[dq]us\-west\-2\[dq]
.RS 2
.IP \[bu] 2
US West (Oregon) Region.
.RE
.IP \[bu] 2
\[dq]us\-west\-1\[dq]
.RS 2
.IP \[bu] 2
US West (Northern California) Region.
.RE
.IP \[bu] 2
\[dq]us\-west\-2\[dq]
.RS 2
.IP \[bu] 2
US West (Oregon) Region.
.RE
.IP \[bu] 2
\[dq]ca\-central\-1\[dq]
.RS 2
.IP \[bu] 2
@@ -17008,12 +17087,24 @@ EU (Ireland) Region.
EU (London) Region.
.RE
.IP \[bu] 2
\[dq]eu\-west\-3\[dq]
.RS 2
.IP \[bu] 2
EU (Paris) Region.
.RE
.IP \[bu] 2
\[dq]eu\-north\-1\[dq]
.RS 2
.IP \[bu] 2
EU (Stockholm) Region.
.RE
.IP \[bu] 2
\[dq]eu\-south\-1\[dq]
.RS 2
.IP \[bu] 2
EU (Milan) Region.
.RE
.IP \[bu] 2
\[dq]EU\[dq]
.RS 2
.IP \[bu] 2
@@ -17041,19 +17132,25 @@ Asia Pacific (Tokyo) Region.
\[dq]ap\-northeast\-2\[dq]
.RS 2
.IP \[bu] 2
Asia Pacific (Seoul)
Asia Pacific (Seoul) Region.
.RE
.IP \[bu] 2
\[dq]ap\-northeast\-3\[dq]
.RS 2
.IP \[bu] 2
Asia Pacific (Osaka\-Local) Region.
.RE
.IP \[bu] 2
\[dq]ap\-south\-1\[dq]
.RS 2
.IP \[bu] 2
Asia Pacific (Mumbai)
Asia Pacific (Mumbai) Region.
.RE
.IP \[bu] 2
\[dq]ap\-east\-1\[dq]
.RS 2
.IP \[bu] 2
Asia Pacific (Hong Kong)
Asia Pacific (Hong Kong) Region.
.RE
.IP \[bu] 2
\[dq]sa\-east\-1\[dq]
@@ -17061,6 +17158,42 @@ Asia Pacific (Hong Kong)
.IP \[bu] 2
South America (Sao Paulo) Region.
.RE
.IP \[bu] 2
\[dq]me\-south\-1\[dq]
.RS 2
.IP \[bu] 2
Middle East (Bahrain) Region.
.RE
.IP \[bu] 2
\[dq]af\-south\-1\[dq]
.RS 2
.IP \[bu] 2
Africa (Cape Town) Region.
.RE
.IP \[bu] 2
\[dq]cn\-north\-1\[dq]
.RS 2
.IP \[bu] 2
China (Beijing) Region
.RE
.IP \[bu] 2
\[dq]cn\-northwest\-1\[dq]
.RS 2
.IP \[bu] 2
China (Ningxia) Region.
.RE
.IP \[bu] 2
\[dq]us\-gov\-east\-1\[dq]
.RS 2
.IP \[bu] 2
AWS GovCloud (US\-East) Region.
.RE
.IP \[bu] 2
\[dq]us\-gov\-west\-1\[dq]
.RS 2
.IP \[bu] 2
AWS GovCloud (US) Region.
.RE
.RE
.SS \-\-s3\-location\-constraint
.PP
@@ -20227,7 +20360,7 @@ Note that Box is case insensitive so you can\[aq]t have a file called
.PP
Box file names can\[aq]t have the \f[C]\[rs]\f[R] character in.
rclone maps this to and from an identical looking unicode equivalent
\f[C]\[uFF3C]\f[R].
\f[C]\[uFF3C]\f[R] (U+FF3C Fullwidth Reverse Solidus).
.PP
Box only supports filenames up to 255 characters in length.
.SS Cache (BETA)
@@ -21896,28 +22029,29 @@ Default:
Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,BackSlash,Ctl,LeftSpace,LeftPeriod,RightSpace,RightPeriod,InvalidUtf8,Dot
.SS Crypt
.PP
The \f[C]crypt\f[R] remote encrypts and decrypts another remote.
Rclone \f[C]crypt\f[R] remotes encrypt and decrypt other remotes.
.PP
To use it first set up the underlying remote following the config
instructions for that remote.
You can also use a local pathname instead of a remote which will encrypt
and decrypt from that directory which might be useful for encrypting
onto a USB stick for example.
To use \f[C]crypt\f[R], first set up the underlying remote.
Follow the \f[C]rclone config\f[R] instructions for that remote.
.PP
First check your chosen remote is working \- we\[aq]ll call it
\f[C]remote:path\f[R] in these docs.
Note that anything inside \f[C]remote:path\f[R] will be encrypted and
anything outside won\[aq]t.
This means that if you are using a bucket based remote (eg S3, B2,
swift) then you should probably put the bucket in the remote
\f[C]s3:bucket\f[R].
If you just use \f[C]s3:\f[R] then rclone will make encrypted bucket
names too (if using file name encryption) which may or may not be what
you want.
\f[C]crypt\f[R] applied to a local pathname instead of a remote will
encrypt and decrypt that directory, and can be used to encrypt USB
removable drives.
.PP
Now configure \f[C]crypt\f[R] using \f[C]rclone config\f[R].
We will call this one \f[C]secret\f[R] to differentiate it from the
\f[C]remote\f[R].
Before configuring the crypt remote, check the underlying remote is
working.
In this example the underlying remote is called \f[C]remote:path\f[R].
Anything inside \f[C]remote:path\f[R] will be encrypted and anything
outside will not.
In the case of an S3 based underlying remote (eg Amazon S3, B2, Swift)
it is generally advisable to define a crypt remote in the underlying
remote \f[C]s3:bucket\f[R].
If \f[C]s3:\f[R] alone is specified alongside file name encryption,
rclone will encrypt the bucket name.
.PP
Configure \f[C]crypt\f[R] using \f[C]rclone config\f[R].
In this example the \f[C]crypt\f[R] remote is called \f[C]secret\f[R],
to differentiate it from the underlying \f[C]remote\f[R].
.IP
.nf
\f[C]
@@ -21993,51 +22127,47 @@ y/e/d> y
\f[R]
.fi
.PP
\f[B]Important\f[R] The password is stored in the config file is lightly
obscured so it isn\[aq]t immediately obvious what it is.
It is in no way secure unless you use config file encryption.
\f[B]Important\f[R] The crypt password stored in \f[C]rclone.conf\f[R]
is lightly obscured.
That only protects it from cursory inspection.
It is not secure unless encryption of \f[C]rclone.conf\f[R] is
specified.
.PP
A long passphrase is recommended, or you can use a random one.
A long passphrase is recommended, or \f[C]rclone config\f[R] can
generate a random one.
.PP
The obscured password is created by using AES\-CTR with a static key,
with the salt stored verbatim at the beginning of the obscured password.
This static key is shared by between all versions of rclone.
The obscured password is created using AES\-CTR with a static key.
The salt is stored verbatim at the beginning of the obscured password.
This static key is shared between all versions of rclone.
.PP
If you reconfigure rclone with the same passwords/passphrases elsewhere
it will be compatible, but the obscured version will be different due to
the different salt.
.PP
Note that rclone does not encrypt
Rclone does not encrypt
.IP \[bu] 2
file length \- this can be calculated within 16 bytes
.IP \[bu] 2
modification time \- used for syncing
.SS Specifying the remote
.PP
In normal use, make sure the remote has a \f[C]:\f[R] in.
If you specify the remote without a \f[C]:\f[R] then rclone will use a
local directory of that name.
So if you use a remote of \f[C]/path/to/secret/files\f[R] then rclone
will encrypt stuff to that directory.
If you use a remote of \f[C]name\f[R] then rclone will put files in a
directory called \f[C]name\f[R] in the current directory.
In normal use, ensure the remote has a \f[C]:\f[R] in.
If specified without, rclone uses a local directory of that name.
For example if a remote \f[C]/path/to/secret/files\f[R] is specified,
rclone encrypts content to that directory.
If a remote \f[C]name\f[R] is specified, rclone targets a directory
\f[C]name\f[R] in the current directory.
.PP
If you specify the remote as \f[C]remote:path/to/dir\f[R] then rclone
will store encrypted files in \f[C]path/to/dir\f[R] on the remote.
If you are using file name encryption, then when you save files to
\f[C]secret:subdir/subfile\f[R] this will store them in the unencrypted
path \f[C]path/to/dir\f[R] but the \f[C]subdir/subpath\f[R] bit will be
If remote \f[C]remote:path/to/dir\f[R] is specified, rclone stores
encrypted files in \f[C]path/to/dir\f[R] on the remote.
With file name encryption, files saved to
\f[C]secret:subdir/subfile\f[R] are stored in the unencrypted path
\f[C]path/to/dir\f[R] but the \f[C]subdir/subpath\f[R] element is
encrypted.
.PP
Note that unless you want encrypted bucket names (which are difficult to
manage because you won\[aq]t know what directory they represent in web
interfaces etc), you should probably specify a bucket, eg
\f[C]remote:secretbucket\f[R] when using bucket based remotes such as
S3, Swift, Hubic, B2, GCS.
.SS Example
.PP
To test I made a little directory of files using \[dq]standard\[dq] file
name encryption.
Create the following file structure using \[dq]standard\[dq] file name
encryption.
.IP
.nf
\f[C]
@@ -22052,7 +22182,7 @@ plaintext/
\f[R]
.fi
.PP
Copy these to the remote and list them back
Copy these to the remote, and list them
.IP
.nf
\f[C]
@@ -22066,7 +22196,7 @@ $ rclone \-q ls secret:
\f[R]
.fi
.PP
Now see what that looked like when encrypted
The crypt remote looks like
.IP
.nf
\f[C]
@@ -22079,8 +22209,7 @@ $ rclone \-q ls remote:path
\f[R]
.fi
.PP
Note that this retains the directory structure which means you can do
this
The directory structure is preserved
.IP
.nf
\f[C]
@@ -22091,9 +22220,9 @@ $ rclone \-q ls secret:subdir
\f[R]
.fi
.PP
If don\[aq]t use file name encryption then the remote will look like
this \- note the \f[C].bin\f[R] extensions added to prevent the cloud
provider attempting to interpret the data.
Without file name encryption \f[C].bin\f[R] extensions are added to
underlying names.
This prevents the cloud provider attempting to interpret file content.
.IP
.nf
\f[C]
@@ -22107,8 +22236,6 @@ $ rclone \-q ls remote:path
.fi
.SS File name encryption modes
.PP
Here are some of the features of the file name encryption modes
.PP
Off
.IP \[bu] 2
doesn\[aq]t hide file names or directory structure
@@ -22135,19 +22262,19 @@ Obfuscation
.PP
This is a simple \[dq]rotate\[dq] of the filename, with each file having
a rot distance based on the filename.
We store the distance at the beginning of the filename.
So a file called \[dq]hello\[dq] may become \[dq]53.jgnnq\[dq].
Rclone stores the distance at the beginning of the filename.
A file called \[dq]hello\[dq] may become \[dq]53.jgnnq\[dq].
.PP
This is not a strong encryption of filenames, but it may stop automated
scanning tools from picking up on filename patterns.
As such it\[aq]s an intermediate between \[dq]off\[dq] and
\[dq]standard\[dq].
The advantage is that it allows for longer path segment names.
Obfuscation is not a strong encryption of filenames, but hinders
automated scanning tools picking up on filename patterns.
It is an intermediate between \[dq]off\[dq] and \[dq]standard\[dq] which
allows for longer path segment names.
.PP
There is a possibility with some unicode based filenames that the
obfuscation is weak and may map lower case characters to upper case
equivalents.
You can not rely on this for strong protection.
.PP
Obfuscation cannot be relied upon for strong protection.
.IP \[bu] 2
file names very lightly obfuscated
.IP \[bu] 2
@@ -22159,14 +22286,14 @@ directory structure visible
.IP \[bu] 2
identical files names will have identical uploaded names
.PP
Cloud storage systems have various limits on file name length and total
path length which you are more likely to hit using \[dq]Standard\[dq]
Cloud storage systems have limits on file name length and total path
length which rclone is more likely to breach using \[dq]Standard\[dq]
file name encryption.
If you keep your file names to below 156 characters in length then you
should be OK on all providers.
Where file names are less thn 156 characters in length issues should not
be encountered, irrespective of cloud storage provider.
.PP
There may be an even more secure file name encryption mode in the future
which will address the long file name problem.
An alternative, future rclone file name encryption mode may tolerate
backend provider path length limits.
.SS Directory name encryption
.PP
Crypt offers the option of encrypting dir names or leaving them intact.
@@ -22192,9 +22319,9 @@ Hashes are not stored for crypt.
However the data integrity is protected by an extremely strong crypto
authenticator.
.PP
Note that you should use the \f[C]rclone cryptcheck\f[R] command to
check the integrity of a crypted remote instead of
\f[C]rclone check\f[R] which can\[aq]t check the checksums properly.
Use the \f[C]rclone cryptcheck\f[R] command to check the integrity of a
crypted remote instead of \f[C]rclone check\f[R] which can\[aq]t check
the checksums properly.
.SS Standard Options
.PP
Here are the standard options specific to crypt (Encrypt/Decrypt a
@@ -34961,6 +35088,172 @@ Options:
.IP \[bu] 2
\[dq]error\[dq]: return an error based on option value
.SH Changelog
.SS v1.53.3 \- 2020\-11\-19
.PP
See commits (https://github.com/rclone/rclone/compare/v1.53.2...v1.53.3)
.IP \[bu] 2
Bug Fixes
.RS 2
.IP \[bu] 2
random: Fix incorrect use of math/rand instead of crypto/rand
CVE\-2020\-28924 (Nick Craig\-Wood)
.RS 2
.IP \[bu] 2
Passwords you have generated with \f[C]rclone config\f[R] may be
insecure
.IP \[bu] 2
See issue #4783 (https://github.com/rclone/rclone/issues/4783) for more
details and a checking tool
.RE
.IP \[bu] 2
random: Seed math/rand in one place with crypto strong seed (Nick
Craig\-Wood)
.RE
.IP \[bu] 2
VFS
.RS 2
.IP \[bu] 2
Fix vfs/refresh calls with fs= parameter (Nick Craig\-Wood)
.RE
.IP \[bu] 2
Sharefile
.RS 2
.IP \[bu] 2
Fix backend due to API swapping integers for strings (Nick Craig\-Wood)
.RE
.SS v1.53.2 \- 2020\-10\-26
.PP
See commits (https://github.com/rclone/rclone/compare/v1.53.1...v1.53.2)
.IP \[bu] 2
Bug Fixes
.RS 2
.IP \[bu] 2
acounting
.RS 2
.IP \[bu] 2
Fix incorrect speed and transferTime in core/stats (Nick Craig\-Wood)
.IP \[bu] 2
Stabilize display order of transfers on Windows (Nick Craig\-Wood)
.RE
.IP \[bu] 2
operations
.RS 2
.IP \[bu] 2
Fix use of \-\-suffix without \-\-backup\-dir (Nick Craig\-Wood)
.IP \[bu] 2
Fix spurious \[dq]\-\-checksum is in use but the source and destination
have no hashes in common\[dq] (Nick Craig\-Wood)
.RE
.IP \[bu] 2
build
.RS 2
.IP \[bu] 2
Work around GitHub actions brew problem (Nick Craig\-Wood)
.IP \[bu] 2
Stop using set\-env and set\-path in the GitHub actions (Nick
Craig\-Wood)
.RE
.RE
.IP \[bu] 2
Mount
.RS 2
.IP \[bu] 2
mount2: Fix the swapped UID / GID values (Russell Cattelan)
.RE
.IP \[bu] 2
VFS
.RS 2
.IP \[bu] 2
Detect and recover from a file being removed externally from the cache
(Nick Craig\-Wood)
.IP \[bu] 2
Fix a deadlock vulnerability in downloaders.Close (Leo Luan)
.IP \[bu] 2
Fix a race condition in retryFailedResets (Leo Luan)
.IP \[bu] 2
Fix missed concurrency control between some item operations and reset
(Leo Luan)
.IP \[bu] 2
Add exponential backoff during ENOSPC retries (Leo Luan)
.IP \[bu] 2
Add a missed update of used cache space (Leo Luan)
.IP \[bu] 2
Fix \-\-no\-modtime to not attempt to set modtimes (as documented) (Nick
Craig\-Wood)
.RE
.IP \[bu] 2
Local
.RS 2
.IP \[bu] 2
Fix sizes and syncing with \-\-links option on Windows (Nick
Craig\-Wood)
.RE
.IP \[bu] 2
Chunker
.RS 2
.IP \[bu] 2
Disable ListR to fix missing files on GDrive (workaround) (Ivan Andreev)
.IP \[bu] 2
Fix upload over crypt (Ivan Andreev)
.RE
.IP \[bu] 2
Fichier
.RS 2
.IP \[bu] 2
Increase maximum file size from 100GB to 300GB (gyutw)
.RE
.IP \[bu] 2
Jottacloud
.RS 2
.IP \[bu] 2
Remove clientSecret from config when upgrading to token based
authentication (buengese)
.IP \[bu] 2
Avoid double url escaping of device/mountpoint (albertony)
.IP \[bu] 2
Remove DirMove workaround as it\[aq]s not required anymore \- also
(buengese)
.RE
.IP \[bu] 2
Mailru
.RS 2
.IP \[bu] 2
Fix uploads after recent changes on server (Ivan Andreev)
.IP \[bu] 2
Fix range requests after june changes on server (Ivan Andreev)
.IP \[bu] 2
Fix invalid timestamp on corrupted files (fixes) (Ivan Andreev)
.RE
.IP \[bu] 2
Onedrive
.RS 2
.IP \[bu] 2
Fix disk usage for sharepoint (Nick Craig\-Wood)
.RE
.IP \[bu] 2
S3
.RS 2
.IP \[bu] 2
Add missing regions for AWS (Anagh Kumar Baranwal)
.RE
.IP \[bu] 2
Seafile
.RS 2
.IP \[bu] 2
Fix accessing libraries > 2GB on 32 bit systems (Muffin King)
.RE
.IP \[bu] 2
SFTP
.RS 2
.IP \[bu] 2
Always convert the checksum to lower case (buengese)
.RE
.IP \[bu] 2
Union
.RS 2
.IP \[bu] 2
Create root directories if none exist (Nick Craig\-Wood)
.RE
.SS v1.53.1 \- 2020\-09\-13
.PP
See commits (https://github.com/rclone/rclone/compare/v1.53.0...v1.53.1)
+5
View File
@@ -342,9 +342,14 @@ func (f *File) Size() int64 {
}
// SetModTime sets the modtime for the file
//
// if NoModTime is set then it does nothing
func (f *File) SetModTime(modTime time.Time) error {
f.mu.Lock()
defer f.mu.Unlock()
if f.d.vfs.Opt.NoModTime {
return nil
}
if f.d.vfs.Opt.ReadOnly {
return EROFS
}
+3
View File
@@ -23,6 +23,8 @@ must be supplied.`
//
// If "fs" is not set and there is one and only one VFS in the active
// cache then it returns it. This is for backwards compatibility.
//
// This deletes the "fs" parameter from in if it is valid
func getVFS(in rc.Params) (vfs *VFS, err error) {
fsString, err := in.GetString("fs")
if rc.IsErrParamNotFound(err) {
@@ -46,6 +48,7 @@ func getVFS(in rc.Params) (vfs *VFS, err error) {
} else if len(activeVFS) > 1 {
return nil, errors.Errorf("more than one VFS active with name %q", fsString)
}
delete(in, "fs") // delete the fs parameter
return activeVFS[0], nil
}
+5 -2
View File
@@ -57,6 +57,7 @@ func TestRcGetVFS(t *testing.T) {
assert.Contains(t, err.Error(), "more than one VFS active - need")
assert.Nil(t, vfs)
inPresent = rc.Params{"fs": fs.ConfigString(r.Fremote)}
vfs, err = getVFS(inPresent)
require.Error(t, err)
assert.Contains(t, err.Error(), "more than one VFS active with name")
@@ -67,7 +68,8 @@ func TestRcForget(t *testing.T) {
r, vfs, cleanup, call := rcNewRun(t, "vfs/forget")
defer cleanup()
_, _ = r, vfs
out, err := call.Fn(context.Background(), nil)
in := rc.Params{"fs": fs.ConfigString(r.Fremote)}
out, err := call.Fn(context.Background(), in)
require.NoError(t, err)
assert.Equal(t, rc.Params{
"forgotten": []string{},
@@ -79,7 +81,8 @@ func TestRcRefresh(t *testing.T) {
r, vfs, cleanup, call := rcNewRun(t, "vfs/refresh")
defer cleanup()
_, _ = r, vfs
out, err := call.Fn(context.Background(), nil)
in := rc.Params{"fs": fs.ConfigString(r.Fremote)}
out, err := call.Fn(context.Background(), in)
require.NoError(t, err)
assert.Equal(t, rc.Params{
"result": map[string]string{
+10 -4
View File
@@ -466,9 +466,15 @@ func (c *Cache) retryFailedResets() {
if len(c.errItems) != 0 {
fs.Debugf(nil, "vfs cache reset: before redoing reset errItems = %v", c.errItems)
for itemName := range c.errItems {
_, _, err := c.item[itemName].Reset()
if err == nil || !fserrors.IsErrNoSpace(err) {
// TODO: not trying to handle non-ENOSPC errors yet
if retryItem, ok := c.item[itemName]; ok {
_, _, err := retryItem.Reset()
if err == nil || !fserrors.IsErrNoSpace(err) {
// TODO: not trying to handle non-ENOSPC errors yet
delete(c.errItems, itemName)
}
} else {
// The retry item was deleted because it was closed.
// No need to redo the failed reset now.
delete(c.errItems, itemName)
}
}
@@ -603,7 +609,7 @@ func (c *Cache) clean(removeCleanFiles bool) {
if os.IsNotExist(err) {
return
}
c.updateUsed()
c.mu.Lock()
oldItems, oldUsed := len(c.item), fs.SizeSuffix(c.used)
c.mu.Unlock()
+4
View File
@@ -230,7 +230,11 @@ func (dls *Downloaders) Close(inErr error) (err error) {
}
}
dls.cancel()
// dls may have entered the periodical (every 5 seconds) kickWaiters() call
// unlock the mutex to allow it to finish so that we can get its dls.wg.Done()
dls.mu.Unlock()
dls.wg.Wait()
dls.mu.Lock()
dls.dls = nil
dls._dispatchWaiters()
dls._closeWaiters(inErr)
+42 -2
View File
@@ -43,6 +43,13 @@ import (
// be taken before Item.mu. writeback may call into Item but Item may
// **not** call writeback methods with Item.mu held
// LL Item reset is invoked by cache cleaner for synchronous recovery
// from ENOSPC errors. The reset operation removes the cache file and
// closes/reopens the downloaders. Although most parts of reset and
// other item operations are done with the item mutex held, the mutex
// is released during fd.WriteAt and downloaders calls. We use preAccess
// and postAccess calls to serialize reset and other item operations.
// Item is stored in the item map
//
// The Info field is written to the backing store to store status
@@ -239,8 +246,23 @@ func (item *Item) _truncate(size int64) (err error) {
// Use open handle if available
fd := item.fd
if fd == nil {
// If the metadata says we have some blockes cached then the
// file should exist, so open without O_CREATE
oFlags := os.O_WRONLY
if item.info.Rs.Size() == 0 {
oFlags |= os.O_CREATE
}
osPath := item.c.toOSPath(item.name) // No locking in Cache
fd, err = file.OpenFile(osPath, os.O_CREATE|os.O_WRONLY, 0600)
fd, err = file.OpenFile(osPath, oFlags, 0600)
if err != nil && os.IsNotExist(err) {
// If the metadata has info but the file doesn't
// not exist then it has been externally removed
fs.Errorf(item.name, "vfs cache: detected external removal of cache file")
item.info.Rs = nil // show we have no blocks cached
item.info.Dirty = false // file can't be dirty if it doesn't exist
item._removeMeta("cache file externally deleted")
fd, err = file.OpenFile(osPath, os.O_CREATE|os.O_WRONLY, 0600)
}
if err != nil {
return errors.Wrap(err, "vfs cache: truncate: failed to open cache file")
}
@@ -295,6 +317,8 @@ func (item *Item) _truncateToCurrentSize() (err error) {
// extended and the extended data will be filled with zeros. The
// object will be marked as dirty in this case also.
func (item *Item) Truncate(size int64) (err error) {
item.preAccess()
defer item.postAccess()
item.mu.Lock()
defer item.mu.Unlock()
@@ -414,6 +438,8 @@ func (item *Item) _dirty() {
// Dirty marks the item as changed and needing writeback
func (item *Item) Dirty() {
item.preAccess()
defer item.postAccess()
item.mu.Lock()
item._dirty()
item.mu.Unlock()
@@ -597,6 +623,8 @@ func (item *Item) store(ctx context.Context, storeFn StoreFn) (err error) {
// Close the cache file
func (item *Item) Close(storeFn StoreFn) (err error) {
// defer log.Trace(item.o, "Item.Close")("err=%v", &err)
item.preAccess()
defer item.postAccess()
var (
downloaders *downloaders.Downloaders
syncWriteBack = item.c.opt.WriteBack <= 0
@@ -1154,6 +1182,7 @@ func (item *Item) setModTime(modTime time.Time) {
// ReadAt bytes from the file at off
func (item *Item) ReadAt(b []byte, off int64) (n int, err error) {
n = 0
var expBackOff int
for retries := 0; retries < fs.Config.LowLevelRetries; retries++ {
item.preAccess()
n, err = item.readAt(b, off)
@@ -1167,6 +1196,12 @@ func (item *Item) ReadAt(b []byte, off int64) (n int, err error) {
break
}
item.c.KickCleaner()
expBackOff = 2 << uint(retries)
time.Sleep(time.Duration(expBackOff) * time.Millisecond) // Exponential back-off the retries
}
if fserrors.IsErrNoSpace(err) {
fs.Errorf(item.name, "vfs cache: failed to _ensure cache after retries %v", err)
}
return n, err
@@ -1198,6 +1233,8 @@ func (item *Item) readAt(b []byte, off int64) (n int, err error) {
// WriteAt bytes to the file at off
func (item *Item) WriteAt(b []byte, off int64) (n int, err error) {
item.preAccess()
defer item.postAccess()
item.mu.Lock()
if item.fd == nil {
item.mu.Unlock()
@@ -1288,6 +1325,8 @@ func (item *Item) WriteAtNoOverwrite(b []byte, off int64) (n int, skipped int, e
// this means flushing the file system's in-memory copy of recently written
// data to disk.
func (item *Item) Sync() (err error) {
item.preAccess()
defer item.postAccess()
item.mu.Lock()
defer item.mu.Unlock()
if item.fd == nil {
@@ -1307,6 +1346,8 @@ func (item *Item) Sync() (err error) {
// rename the item
func (item *Item) rename(name string, newName string, newObj fs.Object) (err error) {
item.preAccess()
defer item.postAccess()
item.mu.Lock()
// stop downloader
@@ -1336,6 +1377,5 @@ func (item *Item) rename(name string, newName string, newObj fs.Object) (err err
_ = downloaders.Close(nil)
}
item.c.writeback.Rename(id, newName)
return err
}