Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13a1d23bb8 | ||
|
|
e11a066e00 | ||
|
|
f0dfe9280c | ||
|
|
b8d2ce8962 | ||
|
|
f60b09e7ab | ||
|
|
307f1edaf4 | ||
|
|
a7a3bee488 | ||
|
|
8e24a21ef2 | ||
|
|
239dae97db | ||
|
|
7056989972 | ||
|
|
056adc97d6 | ||
|
|
c2fd08192b | ||
|
|
9e0054983c | ||
|
|
7c336fdb6f | ||
|
|
5d07f521dc | ||
|
|
0d759d1280 | ||
|
|
93b1c50c14 | ||
|
|
d6819d9d46 | ||
|
|
65f2f59734 | ||
|
|
ac177f70cb | ||
|
|
9be4fc8c2b | ||
|
|
cf240b6c0f | ||
|
|
6159ea9cf5 | ||
|
|
be1fb99aee | ||
|
|
01095a539b | ||
|
|
6578f0ad08 | ||
|
|
f4ffa54952 | ||
|
|
abed695720 | ||
|
|
77892a8289 | ||
|
|
9f9569ad6f | ||
|
|
80cdc4dd06 | ||
|
|
216c9de2c4 | ||
|
|
7952910e40 | ||
|
|
7eed0b6825 | ||
|
|
c7da3ab77f | ||
|
|
879913da41 | ||
|
|
576e6145fc | ||
|
|
be73a72f93 | ||
|
|
36913cda94 | ||
|
|
699e4cfb23 | ||
|
|
bc5cad8792 | ||
|
|
9024962fc4 | ||
|
|
aa1f4ace64 | ||
|
|
dd1d750c55 | ||
|
|
5a2564c6e2 | ||
|
|
82cc80cc6f | ||
|
|
7d0a8bf850 | ||
|
|
fd8b28d36d | ||
|
|
c63ecace41 | ||
|
|
0c8c3d8fb9 | ||
|
|
5042f360f0 | ||
|
|
9601dbce87 | ||
|
|
e06f0b0595 | ||
|
|
b2866f0291 | ||
|
|
cf97f250df | ||
|
|
627b763d4b | ||
|
|
f14945f9c1 | ||
|
|
391661fdb4 | ||
|
|
faffd0a6f1 | ||
|
|
6cc3356f8e | ||
|
|
07e76419c9 | ||
|
|
60c4f35b56 | ||
|
|
15a9c0fd36 | ||
|
|
8b85ffbf03 | ||
|
|
26fb659fe4 | ||
|
|
7aa3d8a32f | ||
|
|
b7ebec865b | ||
|
|
a60d09c43d | ||
|
|
14a47937c0 | ||
|
|
64d6916161 | ||
|
|
ae778f1413 | ||
|
|
33859568d6 | ||
|
|
4b3aa5aea0 | ||
|
|
349487bb7f | ||
|
|
b70b2fff16 | ||
|
|
32307e9226 | ||
|
|
2bd6630c2e | ||
|
|
54c2078f25 | ||
|
|
4f284614a4 | ||
|
|
eef0b39a2c | ||
|
|
37f6336636 | ||
|
|
1049f88a1d | ||
|
|
327ca25a4d | ||
|
|
673e24a60f | ||
|
|
43db4c5dc7 | ||
|
|
88b484722a | ||
|
|
ed5bd327c0 | ||
|
|
341ce61a2a | ||
|
|
9abf9d38c0 |
No files matched your search
@@ -29,12 +29,12 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os']
|
||||
job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.25']
|
||||
|
||||
include:
|
||||
- job_name: linux
|
||||
os: ubuntu-latest
|
||||
go: '~1.25.9'
|
||||
go: '~1.26.0'
|
||||
gotags: cmount
|
||||
build_flags: '-include "^linux/"'
|
||||
check: true
|
||||
@@ -45,14 +45,14 @@ jobs:
|
||||
|
||||
- job_name: linux_386
|
||||
os: ubuntu-latest
|
||||
go: '~1.25.9'
|
||||
go: '~1.26.0'
|
||||
goarch: 386
|
||||
gotags: cmount
|
||||
quicktest: true
|
||||
|
||||
- job_name: mac_amd64
|
||||
os: macos-latest
|
||||
go: '~1.25.9'
|
||||
go: '~1.26.0'
|
||||
gotags: 'cmount'
|
||||
build_flags: '-include "^darwin/amd64" -cgo'
|
||||
quicktest: true
|
||||
@@ -61,14 +61,14 @@ jobs:
|
||||
|
||||
- job_name: mac_arm64
|
||||
os: macos-latest
|
||||
go: '~1.25.9'
|
||||
go: '~1.26.0'
|
||||
gotags: 'cmount'
|
||||
build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib'
|
||||
deploy: true
|
||||
|
||||
- job_name: windows
|
||||
os: windows-latest
|
||||
go: '~1.25.9'
|
||||
go: '~1.26.0'
|
||||
gotags: cmount
|
||||
cgo: '0'
|
||||
build_flags: '-include "^windows/"'
|
||||
@@ -78,11 +78,17 @@ jobs:
|
||||
|
||||
- job_name: other_os
|
||||
os: ubuntu-latest
|
||||
go: '~1.25.9'
|
||||
go: '~1.26.0'
|
||||
build_flags: '-exclude "^(windows/|darwin/|linux/)"'
|
||||
compile_all: true
|
||||
deploy: true
|
||||
|
||||
- job_name: go1.25
|
||||
os: ubuntu-latest
|
||||
go: '~1.25.7'
|
||||
quicktest: true
|
||||
racequicktest: true
|
||||
|
||||
name: ${{ matrix.job_name }}
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -218,7 +224,7 @@ jobs:
|
||||
id: setup-go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '~1.25.9'
|
||||
go-version: '~1.26.0'
|
||||
check-latest: true
|
||||
cache: false
|
||||
|
||||
@@ -309,7 +315,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: '~1.25.9'
|
||||
go-version: '~1.26.0'
|
||||
|
||||
- name: Set global environment variables
|
||||
run: |
|
||||
|
||||
@@ -183,7 +183,7 @@ jobs:
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload Image Digest
|
||||
uses: actions/upload-artifact@v6
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: digests-${{ env.PLATFORM }}
|
||||
path: /tmp/digests/*
|
||||
@@ -198,7 +198,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download Image Digests
|
||||
uses: actions/download-artifact@v7
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: /tmp/digests
|
||||
pattern: digests-*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
% rclone(1) User Manual
|
||||
% Nick Craig-Wood
|
||||
% Apr 19, 2026
|
||||
% Jan 30, 2026
|
||||
|
||||
# NAME
|
||||
|
||||
@@ -3768,26 +3768,6 @@ Flags for anything which can copy a file
|
||||
-u, --update Skip files that are newer on the destination
|
||||
```
|
||||
|
||||
### Sync Options
|
||||
|
||||
Flags used for sync commands
|
||||
|
||||
```text
|
||||
--backup-dir string Make backups into hierarchy based in DIR
|
||||
--delete-after When synchronizing, delete files on destination after transferring (default)
|
||||
--delete-before When synchronizing, delete files on destination before transferring
|
||||
--delete-during When synchronizing, delete files during transfer
|
||||
--fix-case Force rename of case insensitive dest to match source
|
||||
--ignore-errors Delete even if there are I/O errors
|
||||
--list-cutoff int To save memory, sort directory listings on disk above this threshold (default 1000000)
|
||||
--max-delete int When synchronizing, limit the number of deletes (default -1)
|
||||
--max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off)
|
||||
--suffix string Suffix to add to changed files
|
||||
--suffix-keep-extension Preserve the extension when using --suffix
|
||||
--track-renames When synchronizing, track file renames and do a server-side move if possible
|
||||
--track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash")
|
||||
```
|
||||
|
||||
### Important Options
|
||||
|
||||
Important flags useful for most commands
|
||||
@@ -5408,12 +5388,12 @@ rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,command=e
|
||||
|
||||
```console
|
||||
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}"
|
||||
// Output: stories/The Quick Brown Fox!-20260419
|
||||
// Output: stories/The Quick Brown Fox!-20260130
|
||||
```
|
||||
|
||||
```console
|
||||
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}"
|
||||
// Output: stories/The Quick Brown Fox!-2026-04-19 1137AM
|
||||
// Output: stories/The Quick Brown Fox!-2026-01-30 0825PM
|
||||
```
|
||||
|
||||
```console
|
||||
@@ -5861,15 +5841,6 @@ Note that `--stdout` and `--print-filename` are incompatible with `--urls`.
|
||||
This will do `--transfers` copies in parallel. Note that if `--auto-filename`
|
||||
is desired for all URLs then a file with only URLs and no filename can be used.
|
||||
|
||||
Each FILENAME in the CSV file can start with a relative path which will be appended
|
||||
to the destination path provided at the command line. For example, running the command
|
||||
shown above with the following CSV file will write two files to the destination:
|
||||
`remote:dir/local/path/bar.json` and `remote:dir/another/local/directory/qux.json`
|
||||
```csv
|
||||
https://example.org/foo/bar.json,local/path/bar.json
|
||||
https://example.org/qux/baz.json,another/local/directory/qux.json
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you can't get `rclone copyurl` to work then here are some things you can try:
|
||||
@@ -6921,8 +6892,7 @@ Mount the remote as file system on a mountpoint.
|
||||
Rclone mount allows Linux, FreeBSD, macOS and Windows to
|
||||
mount any of Rclone's cloud storage systems as a file system with FUSE.
|
||||
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls`
|
||||
etc.
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls` etc.
|
||||
|
||||
On Linux and macOS, you can run mount in either foreground or background (aka
|
||||
daemon) mode. Mount runs in foreground mode by default. Use the `--daemon` flag
|
||||
@@ -6950,8 +6920,8 @@ The following examples will mount to an automatically assigned drive,
|
||||
to specific drive letter `X:`, to path `C:\path\parent\mount`
|
||||
(where parent directory or drive must exist, and mount must **not** exist,
|
||||
and is not supported when [mounting as a network drive](#mounting-modes-on-windows)),
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to
|
||||
an automatically assigned drive:
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to an
|
||||
automatically assigned drive:
|
||||
|
||||
```console
|
||||
rclone mount remote:path/to/files *
|
||||
@@ -7057,8 +7027,8 @@ rclone mount remote:path/to/files X: --volname \\server\share
|
||||
|
||||
You may also specify the network share UNC path as the mountpoint itself. Then rclone
|
||||
will automatically assign a drive letter, same as with `*` and use that as
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it
|
||||
were specified with the `--volname` option. This will also implicitly set
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it were
|
||||
specified with the `--volname` option. This will also implicitly set
|
||||
the `--network-mode` option. This means the following two examples have same result:
|
||||
|
||||
```console
|
||||
@@ -7189,7 +7159,7 @@ does not suffer from the same limitations.
|
||||
|
||||
Mounting on macOS can be done either via [built-in NFS server](https://rclone.org/commands/rclone_serve_nfs/),
|
||||
[macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or
|
||||
[FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing
|
||||
[FUSE-T](https://www.fuse-t.org/).macFUSE is a traditional FUSE driver utilizing
|
||||
a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which
|
||||
"mounts" via an NFSv4 local server.
|
||||
|
||||
@@ -7232,30 +7202,29 @@ current as of FUSE-T version 1.0.14.
|
||||
|
||||
As per the [FUSE-T wiki](https://github.com/macos-fuse-t/fuse-t/wiki#caveats):
|
||||
|
||||
> File access and modification times cannot be set separately as it seems to be
|
||||
> an issue with the NFS client which always modifies both. Can be reproduced
|
||||
> with `touch -m` and `touch -a` commands
|
||||
> File access and modification times cannot be set separately as it seems to be an
|
||||
> issue with the NFS client which always modifies both. Can be reproduced with
|
||||
> 'touch -m' and 'touch -a' commands
|
||||
|
||||
This means that viewing files with various tools, notably macOS Finder, will
|
||||
cause rlcone to update the modification time of the file. This may make rclone
|
||||
upload a full new copy of the file.
|
||||
This means that viewing files with various tools, notably macOS Finder, will cause
|
||||
rlcone to update the modification time of the file. This may make rclone upload a
|
||||
full new copy of the file.
|
||||
|
||||
#### Read Only mounts
|
||||
|
||||
When mounting with `--read-only`, attempts to write to files will fail *silently*
|
||||
as opposed to with a clear warning as in macFUSE.
|
||||
|
||||
## Mounting on Linux
|
||||
# Mounting on Linux
|
||||
|
||||
On newer versions of Ubuntu, you may encounter the following error when running
|
||||
`rclone mount`:
|
||||
|
||||
> NOTICE: mount helper error: fusermount3: mount failed: Permission denied
|
||||
> CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
|
||||
|
||||
This may be due to newer [Apparmor](https://wiki.ubuntu.com/AppArmor) restrictions,
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need
|
||||
to `sudo apt install apparmor-utils` beforehand).
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need to
|
||||
`sudo apt install apparmor-utils` beforehand).
|
||||
|
||||
## Limitations
|
||||
|
||||
@@ -8365,8 +8334,7 @@ Mount the remote as file system on a mountpoint.
|
||||
Rclone nfsmount allows Linux, FreeBSD, macOS and Windows to
|
||||
mount any of Rclone's cloud storage systems as a file system with FUSE.
|
||||
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls`
|
||||
etc.
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls` etc.
|
||||
|
||||
On Linux and macOS, you can run mount in either foreground or background (aka
|
||||
daemon) mode. Mount runs in foreground mode by default. Use the `--daemon` flag
|
||||
@@ -8394,8 +8362,8 @@ The following examples will mount to an automatically assigned drive,
|
||||
to specific drive letter `X:`, to path `C:\path\parent\mount`
|
||||
(where parent directory or drive must exist, and mount must **not** exist,
|
||||
and is not supported when [mounting as a network drive](#mounting-modes-on-windows)),
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to
|
||||
an automatically assigned drive:
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to an
|
||||
automatically assigned drive:
|
||||
|
||||
```console
|
||||
rclone nfsmount remote:path/to/files *
|
||||
@@ -8501,8 +8469,8 @@ rclone nfsmount remote:path/to/files X: --volname \\server\share
|
||||
|
||||
You may also specify the network share UNC path as the mountpoint itself. Then rclone
|
||||
will automatically assign a drive letter, same as with `*` and use that as
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it
|
||||
were specified with the `--volname` option. This will also implicitly set
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it were
|
||||
specified with the `--volname` option. This will also implicitly set
|
||||
the `--network-mode` option. This means the following two examples have same result:
|
||||
|
||||
```console
|
||||
@@ -8633,7 +8601,7 @@ does not suffer from the same limitations.
|
||||
|
||||
Mounting on macOS can be done either via [built-in NFS server](https://rclone.org/commands/rclone_serve_nfs/),
|
||||
[macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or
|
||||
[FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing
|
||||
[FUSE-T](https://www.fuse-t.org/).macFUSE is a traditional FUSE driver utilizing
|
||||
a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which
|
||||
"mounts" via an NFSv4 local server.
|
||||
|
||||
@@ -8676,30 +8644,29 @@ current as of FUSE-T version 1.0.14.
|
||||
|
||||
As per the [FUSE-T wiki](https://github.com/macos-fuse-t/fuse-t/wiki#caveats):
|
||||
|
||||
> File access and modification times cannot be set separately as it seems to be
|
||||
> an issue with the NFS client which always modifies both. Can be reproduced
|
||||
> with `touch -m` and `touch -a` commands
|
||||
> File access and modification times cannot be set separately as it seems to be an
|
||||
> issue with the NFS client which always modifies both. Can be reproduced with
|
||||
> 'touch -m' and 'touch -a' commands
|
||||
|
||||
This means that viewing files with various tools, notably macOS Finder, will
|
||||
cause rlcone to update the modification time of the file. This may make rclone
|
||||
upload a full new copy of the file.
|
||||
This means that viewing files with various tools, notably macOS Finder, will cause
|
||||
rlcone to update the modification time of the file. This may make rclone upload a
|
||||
full new copy of the file.
|
||||
|
||||
#### Read Only mounts
|
||||
|
||||
When mounting with `--read-only`, attempts to write to files will fail *silently*
|
||||
as opposed to with a clear warning as in macFUSE.
|
||||
|
||||
## Mounting on Linux
|
||||
# Mounting on Linux
|
||||
|
||||
On newer versions of Ubuntu, you may encounter the following error when running
|
||||
`rclone mount`:
|
||||
|
||||
> NOTICE: mount helper error: fusermount3: mount failed: Permission denied
|
||||
> CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
|
||||
|
||||
This may be due to newer [Apparmor](https://wiki.ubuntu.com/AppArmor) restrictions,
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need
|
||||
to `sudo apt install apparmor-utils` beforehand).
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need to
|
||||
`sudo apt install apparmor-utils` beforehand).
|
||||
|
||||
## Limitations
|
||||
|
||||
@@ -18718,7 +18685,7 @@ This is the default.
|
||||
`CAUTIOUS` will try to prevent rclone from reaching the limit. Only applicable
|
||||
for `--max-transfer`.
|
||||
|
||||
### -M, --metadata
|
||||
## -M, --metadata
|
||||
|
||||
Setting this flag enables rclone to copy the metadata from the source
|
||||
to the destination. For local backends this is ownership, permissions,
|
||||
@@ -19620,10 +19587,6 @@ knowing the local file is newer than the time it was last uploaded to the
|
||||
remote is sufficient. In those cases, this flag can speed up the process and
|
||||
reduce the number of API calls necessary.
|
||||
|
||||
This flag is only supported on certain backends and will be silently
|
||||
ignored on unsupported backends. Supported backends include
|
||||
`azureblob`, `oracleobjectstorage`, `s3`, `swift`.
|
||||
|
||||
Using this flag on a sync operation without also using `--update` would cause
|
||||
all files modified at any time other than the last upload time to be uploaded
|
||||
again, which is probably not what you want.
|
||||
@@ -23086,8 +23049,6 @@ This command does not have a command line equivalent so use this instead:
|
||||
|
||||
rclone rc --loopback operations/fsinfo fs=remote:
|
||||
|
||||
**Authentication is required for this call.**
|
||||
|
||||
### operations/hashsum: Produces a hashsum file for all the objects in the path. {#operations-hashsum}
|
||||
|
||||
Produces a hash file for all the objects in the path using the hash
|
||||
@@ -23409,8 +23370,6 @@ And this sets NOTICE level logs (normal without -v)
|
||||
|
||||
rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}'
|
||||
|
||||
**Authentication is required for this call.**
|
||||
|
||||
### pluginsctl/addPlugin: Add a plugin using url {#pluginsctl-addPlugin}
|
||||
|
||||
Used for adding a plugin to the webgui.
|
||||
@@ -24817,7 +24776,7 @@ Flags for general networking and HTTP stuff.
|
||||
--tpslimit float Limit HTTP transactions per second to this
|
||||
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
|
||||
--use-cookies Enable session cookiejar
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.73.5")
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.73.0")
|
||||
```
|
||||
|
||||
|
||||
@@ -25301,11 +25260,9 @@ Backend-only flags (these can be set in the config file also).
|
||||
--filefabric-token-expiry string Token expiry time
|
||||
--filefabric-url string URL of the Enterprise File Fabric to connect to
|
||||
--filefabric-version string Version read from the file fabric
|
||||
--filelu-chunk-size SizeSuffix Chunk size to use for uploading. Used for multipart uploads (default 64Mi)
|
||||
--filelu-description string Description of the remote
|
||||
--filelu-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,Colon,Question,Asterisk,Pipe,Hash,Percent,BackSlash,CrLf,Del,Ctl,LeftSpace,LeftPeriod,LeftTilde,LeftCrLfHtVt,RightSpace,RightPeriod,RightCrLfHtVt,InvalidUtf8,Dot,SquareBracket,Semicolon,Exclamation)
|
||||
--filelu-key string Your FileLu Rclone key from My Account
|
||||
--filelu-upload-cutoff SizeSuffix Cutoff for switching to chunked upload. Any files larger than this will be uploaded in chunks of chunk_size (default 500Mi)
|
||||
--filen-api-key string API Key for your Filen account (obscured)
|
||||
--filen-auth-version string Authentication Version (internal use only)
|
||||
--filen-base-folder-uuid string UUID of Account Root Directory (internal use only)
|
||||
@@ -27571,9 +27528,11 @@ The following backends have known issues that need more investigation:
|
||||
<!--- start list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
|
||||
- `TestDropbox` (`dropbox`)
|
||||
- [`TestBisyncRemoteRemote/normalization`](https://pub.rclone.org/integration-tests/current/dropbox-cmd.bisync-TestDropbox-1.txt)
|
||||
- `TestSeafile` (`seafile`)
|
||||
- [`TestBisyncLocalRemote/volatile`](https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafile-1.txt)
|
||||
- `TestSeafileV6` (`seafile`)
|
||||
- [`TestBisyncLocalRemote/rmdirs`](https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafileV6-1.txt)
|
||||
- Updated: 2026-04-19-010011
|
||||
- [`TestBisyncLocalRemote/volatile`](https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafileV6-1.txt)
|
||||
- Updated: 2026-01-30-010015
|
||||
<!--- end list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
|
||||
|
||||
The following backends either have not been tested recently or have known issues
|
||||
@@ -29690,20 +29649,6 @@ work with the SDK properly:
|
||||
| . | . |
|
||||
| .. | .. |
|
||||
|
||||
#### Important note about double slashes (`//`)
|
||||
|
||||
Object keys containing consecutive forward slashes (`//`) are **not supported** by rclone.
|
||||
|
||||
When rclone encounters an object key with `//` (e.g., `a//b`), it will normalize the path to use a single slash (e.g., `a/b`). This normalization can cause "object not found" errors when trying to access the original object, as rclone will look for the normalized path instead of the actual object key.
|
||||
|
||||
**Example:**
|
||||
- Original S3 object key: `folder//file.txt`
|
||||
- rclone interprets it as: `folder/file.txt`
|
||||
- Result: "object not found" error when trying to access `folder//file.txt`
|
||||
|
||||
**Workaround:**
|
||||
Avoid using consecutive forward slashes (`//`) in S3 object keys when using rclone. If you have existing objects with `//` in their keys, you will need to rename them to use single slashes or access them through other means.
|
||||
|
||||
### Multipart uploads
|
||||
|
||||
rclone supports multipart uploads with S3 which means that it can
|
||||
@@ -30724,9 +30669,6 @@ Properties:
|
||||
- "s3.cubbit.eu"
|
||||
- Cubbit DS3 Object Storage endpoint
|
||||
- Provider: Cubbit
|
||||
- "s3.{tenant_name}.cubbit.eu"
|
||||
- Multi-tenant endpoint - replace {tenant_name} with your actual tenant name. Do not select this directly
|
||||
- Provider: Cubbit
|
||||
- "syd1.digitaloceanspaces.com"
|
||||
- DigitalOcean Spaces Sydney 1
|
||||
- Provider: DigitalOcean
|
||||
@@ -34123,9 +34065,7 @@ can follow this [guide](https://docs.cubbit.io/getting-started/quickstart#api-ke
|
||||
to retrieve these keys. They will be needed when prompted by `rclone config`.
|
||||
|
||||
Default region will correspond to `eu-west-1` and the endpoint has to be specified
|
||||
as `s3.cubbit.eu`. If you set a custom tenant endpoint, you must use
|
||||
`s3.{tenant_name}.cubbit.eu`, because the generic `s3.cubbit.eu` endpoint will not
|
||||
work in this case.
|
||||
as `s3.cubbit.eu`.
|
||||
|
||||
Going through the whole process of creating a new remote by running `rclone config`,
|
||||
each prompt should be answered as shown below:
|
||||
@@ -34138,7 +34078,7 @@ env_auth> false
|
||||
access_key_id> YOUR_ACCESS_KEY
|
||||
secret_access_key> YOUR_SECRET_KEY
|
||||
region> eu-west-1 (or leave empty)
|
||||
endpoint> s3.cubbit.eu (or s3.{tenant_name}.cubbit.eu)
|
||||
endpoint> s3.cubbit.eu
|
||||
acl>
|
||||
```
|
||||
|
||||
@@ -38025,15 +37965,6 @@ To configure access to Tencent COS, follow the steps below:
|
||||
cos s3
|
||||
```
|
||||
|
||||
#### Tencent COS Global Acceleration Endpoint
|
||||
|
||||
When using the Global Acceleration Endpoint (`cos.accelerate.myqcloud.com`),
|
||||
rclone automatically sets `no_check_bucket = true` because this acceleration
|
||||
endpoint does not support the `CreateBucket` call which is used for ensuring
|
||||
a bucket's existence by rclone. Global Acceleration is a per-bucket feature,
|
||||
so you should first create the bucket in one physical region, then enable it
|
||||
in the Tencent Cloud console.
|
||||
|
||||
### Wasabi
|
||||
|
||||
[Wasabi](https://wasabi.com) is a cloud-based object storage service for a
|
||||
@@ -44762,28 +44693,6 @@ Properties:
|
||||
|
||||
Here are the Advanced options specific to filelu (FileLu Cloud Storage).
|
||||
|
||||
#### --filelu-upload-cutoff
|
||||
|
||||
Cutoff for switching to chunked upload. Any files larger than this will be uploaded in chunks of chunk_size.
|
||||
|
||||
Properties:
|
||||
|
||||
- Config: upload_cutoff
|
||||
- Env Var: RCLONE_FILELU_UPLOAD_CUTOFF
|
||||
- Type: SizeSuffix
|
||||
- Default: 500Mi
|
||||
|
||||
#### --filelu-chunk-size
|
||||
|
||||
Chunk size to use for uploading. Used for multipart uploads.
|
||||
|
||||
Properties:
|
||||
|
||||
- Config: chunk_size
|
||||
- Env Var: RCLONE_FILELU_CHUNK_SIZE
|
||||
- Type: SizeSuffix
|
||||
- Default: 64Mi
|
||||
|
||||
#### --filelu-encoding
|
||||
|
||||
The encoding for the backend.
|
||||
@@ -44825,8 +44734,6 @@ The initial setup for Filen requires that you get an API key for your account,
|
||||
currently this is only possible using the [Filen CLI](https://github.com/FilenCloudDienste/filen-cli).
|
||||
This means you must first download the CLI, login, and then run the `export-api-key` command.
|
||||
|
||||
**Note:** If you change your Filen account password, you will need to update your rclone configuration with the new password and a re-exported API key (via `export-api-key`).
|
||||
|
||||
Here is an example of how to make a remote called `FilenRemote`. First run:
|
||||
|
||||
rclone config
|
||||
@@ -52073,7 +51980,7 @@ its own datacenters in Norway.
|
||||
In addition to the official service at [jottacloud.com](https://www.jottacloud.com/),
|
||||
it also provides white-label solutions to different companies. The following
|
||||
are currently supported by this backend, using a different authentication setup
|
||||
as described [below](#traditional):
|
||||
as described [below](#whitelabel-authentication):
|
||||
|
||||
- Elkjøp (with subsidiaries):
|
||||
- Elkjøp Cloud (cloud.elkjop.no)
|
||||
@@ -67462,7 +67369,7 @@ handling file names.
|
||||
| / | 0x2F | / |
|
||||
|
||||
When running on Windows the following characters are replaced. This
|
||||
list is based on the [Windows file naming conventions](https://docs.microsoft.com/windows/desktop/FileIO/naming-a-file#naming-conventions).
|
||||
list is based on the [Windows file naming conventions](https://docs.microsoft.com/de-de/windows/desktop/FileIO/naming-a-file#naming-conventions).
|
||||
|
||||
| Character | Value | Replacement |
|
||||
| --------- |:-----:|:-----------:|
|
||||
@@ -68151,121 +68058,6 @@ Options:
|
||||
|
||||
# Changelog
|
||||
|
||||
## v1.73.5 - 2026-04-19
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.4...v1.73.5)
|
||||
|
||||
- Bug Fixes
|
||||
- operations: Add AuthRequired to operations/fsinfo to prevent backend creation CVE-2026-41179 (Nick Craig-Wood)
|
||||
- rc
|
||||
- Add AuthRequired to options/set to prevent auth bypass CVE-2026-41176 (Nick Craig-Wood)
|
||||
- Snapshot NoAuth at startup to prevent runtime auth bypass CVE-2026-41176 (Nick Craig-Wood)
|
||||
- filter: Fix debug logs that fire before logger is configured (Nick Craig-Wood)
|
||||
- Azureblob
|
||||
- Add Microsoft Partner Network User-Agent prefix (Nick Craig-Wood)
|
||||
- Drime
|
||||
- Fix User.EntryPermissions JSON unmarshalling (a1pcm)
|
||||
- Iclouddrive
|
||||
- Fix 'directory not found' error when the directory contains accent marks (Brais Couce)
|
||||
- S3
|
||||
- Fix TencentCOS CDN endpoint failing on bucket check (Mozi)
|
||||
- Fix empty delimiter parameter rejected by Archiware P5 server (Nick Craig-Wood)
|
||||
|
||||
## v1.73.4 - 2026-04-08
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.3...v1.73.4)
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to go 1.25.9 to fix multiple CVEs (Nick Craig-Wood)
|
||||
- CVE-2026-32282: os: Root.Chmod can follow symlinks out of the root on Linux
|
||||
- CVE-2026-32289: html/template: JS template literal context incorrectly tracked
|
||||
- CVE-2026-33810: crypto/x509: excluded DNS constraints not properly applied to wildcard domains
|
||||
- CVE-2026-27144: cmd/compile: no-op interface conversion bypasses overlap checking
|
||||
- CVE-2026-27143: cmd/compile: possible memory corruption after bound check elimination
|
||||
- CVE-2026-32288: archive/tar: unbounded allocation when parsing old format GNU sparse map
|
||||
- CVE-2026-32283: crypto/tls: multiple key update handshake messages can cause connection to deadlock
|
||||
- CVE-2026-27140: cmd/go: trust layer bypass when using cgo and SWIG
|
||||
- CVE-2026-32280: crypto/x509: unexpected work during chain building
|
||||
- CVE-2026-32281: crypto/x509: inefficient policy validation
|
||||
- Fix Denial of Service due to Panic in AWS SDK for Go v2 SDK EventStream Decoder (dependabot[bot])
|
||||
- Update golang.org/x/image to 0.38.0 to fix CVE-2026-33809 (dependabot[bot])
|
||||
- docs
|
||||
- Fix header level for metadata option (Clément Notin)
|
||||
- Fix markdown issues in mount docs (albertony)
|
||||
- Fix link to not be language specific (Ross Smith II)
|
||||
- Note macOS 10.15 (Catalina) support with version v1.70.3 (kapitainsky)
|
||||
- Filen
|
||||
- Update SDK version (Enduriel)
|
||||
|
||||
## v1.73.3 - 2026-03-23
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.2...v1.73.3)
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to google.golang.org/grpc 1.79.3 to fix CVE-2026-33186 (dependabot[bot])
|
||||
- Update to github.com/buger/jsonparser 1.1.2 to fix GHSA-6g7g-w4f8-9c9x (dependabot[bot])
|
||||
- doc fixes
|
||||
- Added text to the label showing version-introduced info (Jan-Philipp Reßler)
|
||||
- Clarify Filen password change requires updating both password and API key in rclone config (Jason)
|
||||
- s3: clarify multi tenant support for Cubbit (Marco Ferretti)
|
||||
- jottacloud: Fix broken link (albertony)
|
||||
- lib/rest: Fix URLPathEscapeAll breaking WebDAV servers (eg nzbdav) with strict path matching (Andrew Furman)
|
||||
- list: Fix nil pointer panic in Sorter when temp file creation fails (Nick Craig-Wood)
|
||||
|
||||
## v1.73.2 - 2026-03-06
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.1...v1.73.2)
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to go 1.25.8 to fix CVE-2026-27137 CVE-2026-27138 CVE-2026-25679 CVE-2026-27142 (Nick Craig-Wood)
|
||||
- Update github.com/cloudflare/circl to v1.6.3 to fix CVE-2026-1229 (Nick Craig-Wood)
|
||||
- Update to golang.org/x/net v0.51.0 to fix CVE-2026-27141 (Nick Craig-Wood)
|
||||
- docs fixes:
|
||||
- bisync: Add group Sync to the bisync command (Jan-Philipp Reßler)
|
||||
- Note that --use-server-modtime only works on some backends (Nick Craig-Wood)
|
||||
- Document unsupported S3 object keys with double slashes (Adam Kasztenny)
|
||||
- Fix headers hierarchy for mount.md (Dark Dragon)
|
||||
- Fix new drive flag typo in changelog (razorloves)
|
||||
- Archive
|
||||
- Extract: fix extraction with "./" prefix from tar entry paths (Varun Chawla)
|
||||
- Drime
|
||||
- Fix chunk-uploaded files ignoring workspace ID (a1pcm)
|
||||
- Internxt
|
||||
- Fix Entry doesn't belong in directory errors on windows (jzunigax2)
|
||||
- WebDAV
|
||||
- Escape reserved characters in URL path segments (Varun Chawla)
|
||||
- Add missing headers for CORS (Romāns Potašovs)
|
||||
|
||||
## v1.73.1 - 2026-02-17
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.0...v1.73.1)
|
||||
|
||||
- Bug Fixes
|
||||
- accounting: Fix missing server side stats from core/stats rc (Nick Craig-Wood)
|
||||
- build
|
||||
- Fix CVE-2025-68121 by updating go to 1.25.7 or later (Nick Craig-Wood)
|
||||
- Bump github.com/go-chi/chi/v5 from 5.2.3 to 5.2.5 to fix GO-2026-4316 (albertony)
|
||||
- docs: Extend copyurl docs with an example of CSV FILENAMEs starting with a path. (Jack Kelly)
|
||||
- march: Fix runtime: program exceeds 10000-thread limit (Nick Craig-Wood)
|
||||
- pacer
|
||||
- Fix deadlock between pacer token and --max-connections (Nick Craig-Wood)
|
||||
- Re-read the sleep time as it may be stale (Nick Craig-Wood)
|
||||
- Drime
|
||||
- Fix files and directories being created in the default workspace (Nick Craig-Wood)
|
||||
- Filelu
|
||||
- Avoid buffering entire file in memory (kingston125)
|
||||
- Add multipart upload support with configurable cutoff (kingston125)
|
||||
- Filen
|
||||
- Fix 32 bit targets not being able to list directories (Enduriel)
|
||||
- Fix potential panic in case of error during upload (Enduriel)
|
||||
- Internxt
|
||||
- Implement re-login under refresh logic, improve retry logic (José Zúniga)
|
||||
-S3
|
||||
- Set list_version to 2 for FileLu S3 configuration (kingston125)
|
||||
|
||||
## v1.73.0 - 2026-01-30
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.72.0...v1.73.0)
|
||||
@@ -68296,7 +68088,7 @@ Options:
|
||||
- B2
|
||||
- Support authentication with new bucket restricted application keys (DianaNites)
|
||||
- Drive
|
||||
- Add `--drive-metadata-enforce-expansive-access` flag (Nick Craig-Wood)
|
||||
- Add `--drive-metadata-force-expansive-access` flag (Nick Craig-Wood)
|
||||
- Fix crash when trying to creating shortcut to a Google doc (Nick Craig-Wood)
|
||||
- FTP
|
||||
- Add http proxy authentication support (Nicolas Dessart)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
rclone(1) User Manual
|
||||
Nick Craig-Wood
|
||||
Apr 19, 2026
|
||||
Jan 30, 2026
|
||||
|
||||
NAME
|
||||
|
||||
@@ -3277,24 +3277,6 @@ Flags for anything which can copy a file
|
||||
--streaming-upload-cutoff SizeSuffix Cutoff for switching to chunked upload if file size is unknown, upload starts after reaching cutoff or when file ends (default 100Ki)
|
||||
-u, --update Skip files that are newer on the destination
|
||||
|
||||
Sync Options
|
||||
|
||||
Flags used for sync commands
|
||||
|
||||
--backup-dir string Make backups into hierarchy based in DIR
|
||||
--delete-after When synchronizing, delete files on destination after transferring (default)
|
||||
--delete-before When synchronizing, delete files on destination before transferring
|
||||
--delete-during When synchronizing, delete files during transfer
|
||||
--fix-case Force rename of case insensitive dest to match source
|
||||
--ignore-errors Delete even if there are I/O errors
|
||||
--list-cutoff int To save memory, sort directory listings on disk above this threshold (default 1000000)
|
||||
--max-delete int When synchronizing, limit the number of deletes (default -1)
|
||||
--max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off)
|
||||
--suffix string Suffix to add to changed files
|
||||
--suffix-keep-extension Preserve the extension when using --suffix
|
||||
--track-renames When synchronizing, track file renames and do a server-side move if possible
|
||||
--track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash")
|
||||
|
||||
Important Options
|
||||
|
||||
Important flags useful for most commands
|
||||
@@ -4625,10 +4607,10 @@ Examples:
|
||||
// Output: stories/The Quick Brown Fox!.txt
|
||||
|
||||
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}"
|
||||
// Output: stories/The Quick Brown Fox!-20260419
|
||||
// Output: stories/The Quick Brown Fox!-20260130
|
||||
|
||||
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}"
|
||||
// Output: stories/The Quick Brown Fox!-2026-04-19 1137AM
|
||||
// Output: stories/The Quick Brown Fox!-2026-01-30 0825PM
|
||||
|
||||
rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,regex=[\\.\\w]/ab"
|
||||
// Output: ababababababab/ababab ababababab ababababab ababab!abababab
|
||||
@@ -5050,15 +5032,6 @@ incompatible with --urls. This will do --transfers copies in parallel.
|
||||
Note that if --auto-filename is desired for all URLs then a file with
|
||||
only URLs and no filename can be used.
|
||||
|
||||
Each FILENAME in the CSV file can start with a relative path which will
|
||||
be appended to the destination path provided at the command line. For
|
||||
example, running the command shown above with the following CSV file
|
||||
will write two files to the destination: remote:dir/local/path/bar.json
|
||||
and remote:dir/another/local/directory/qux.json
|
||||
|
||||
https://example.org/foo/bar.json,local/path/bar.json
|
||||
https://example.org/qux/baz.json,another/local/directory/qux.json
|
||||
|
||||
Troubleshooting
|
||||
|
||||
If you can't get rclone copyurl to work then here are some things you
|
||||
@@ -6200,7 +6173,7 @@ not suffer from the same limitations.
|
||||
Mounting on macOS
|
||||
|
||||
Mounting on macOS can be done either via built-in NFS server, macFUSE
|
||||
(also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver
|
||||
(also known as osxfuse) or FUSE-T.macFUSE is a traditional FUSE driver
|
||||
utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE
|
||||
system which "mounts" via an NFSv4 local server.
|
||||
|
||||
@@ -6245,7 +6218,7 @@ As per the FUSE-T wiki:
|
||||
|
||||
File access and modification times cannot be set separately as it
|
||||
seems to be an issue with the NFS client which always modifies both.
|
||||
Can be reproduced with touch -m and touch -a commands
|
||||
Can be reproduced with 'touch -m' and 'touch -a' commands
|
||||
|
||||
This means that viewing files with various tools, notably macOS Finder,
|
||||
will cause rlcone to update the modification time of the file. This may
|
||||
@@ -6263,11 +6236,9 @@ running rclone mount:
|
||||
|
||||
NOTICE: mount helper error: fusermount3: mount failed: Permission
|
||||
denied CRITICAL: Fatal error: failed to mount FUSE fs: fusermount:
|
||||
exit status 1
|
||||
|
||||
This may be due to newer Apparmor restrictions, which can be disabled
|
||||
with sudo aa-disable /usr/bin/fusermount3 (you may need to
|
||||
sudo apt install apparmor-utils beforehand).
|
||||
exit status 1 This may be due to newer Apparmor restrictions, which
|
||||
can be disabled with sudo aa-disable /usr/bin/fusermount3 (you may
|
||||
need to sudo apt install apparmor-utils beforehand).
|
||||
|
||||
Limitations
|
||||
|
||||
@@ -7551,7 +7522,7 @@ not suffer from the same limitations.
|
||||
Mounting on macOS
|
||||
|
||||
Mounting on macOS can be done either via built-in NFS server, macFUSE
|
||||
(also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver
|
||||
(also known as osxfuse) or FUSE-T.macFUSE is a traditional FUSE driver
|
||||
utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE
|
||||
system which "mounts" via an NFSv4 local server.
|
||||
|
||||
@@ -7596,7 +7567,7 @@ As per the FUSE-T wiki:
|
||||
|
||||
File access and modification times cannot be set separately as it
|
||||
seems to be an issue with the NFS client which always modifies both.
|
||||
Can be reproduced with touch -m and touch -a commands
|
||||
Can be reproduced with 'touch -m' and 'touch -a' commands
|
||||
|
||||
This means that viewing files with various tools, notably macOS Finder,
|
||||
will cause rlcone to update the modification time of the file. This may
|
||||
@@ -7614,11 +7585,9 @@ running rclone mount:
|
||||
|
||||
NOTICE: mount helper error: fusermount3: mount failed: Permission
|
||||
denied CRITICAL: Fatal error: failed to mount FUSE fs: fusermount:
|
||||
exit status 1
|
||||
|
||||
This may be due to newer Apparmor restrictions, which can be disabled
|
||||
with sudo aa-disable /usr/bin/fusermount3 (you may need to
|
||||
sudo apt install apparmor-utils beforehand).
|
||||
exit status 1 This may be due to newer Apparmor restrictions, which
|
||||
can be disabled with sudo aa-disable /usr/bin/fusermount3 (you may
|
||||
need to sudo apt install apparmor-utils beforehand).
|
||||
|
||||
Limitations
|
||||
|
||||
@@ -17887,10 +17856,6 @@ server's modified time. In cases such as a local to remote sync using
|
||||
uploaded to the remote is sufficient. In those cases, this flag can
|
||||
speed up the process and reduce the number of API calls necessary.
|
||||
|
||||
This flag is only supported on certain backends and will be silently
|
||||
ignored on unsupported backends. Supported backends include azureblob,
|
||||
oracleobjectstorage, s3, swift.
|
||||
|
||||
Using this flag on a sync operation without also using --update would
|
||||
cause all files modified at any time other than the last upload time to
|
||||
be uploaded again, which is probably not what you want.
|
||||
@@ -21256,8 +21221,6 @@ instead:
|
||||
|
||||
rclone rc --loopback operations/fsinfo fs=remote:
|
||||
|
||||
Authentication is required for this call.
|
||||
|
||||
operations/hashsum: Produces a hashsum file for all the objects in the path.
|
||||
|
||||
Produces a hash file for all the objects in the path using the hash
|
||||
@@ -21586,8 +21549,6 @@ And this sets NOTICE level logs (normal without -v)
|
||||
|
||||
rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}'
|
||||
|
||||
Authentication is required for this call.
|
||||
|
||||
pluginsctl/addPlugin: Add a plugin using url
|
||||
|
||||
Used for adding a plugin to the webgui.
|
||||
@@ -23001,7 +22962,7 @@ Flags for general networking and HTTP stuff.
|
||||
--tpslimit float Limit HTTP transactions per second to this
|
||||
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
|
||||
--use-cookies Enable session cookiejar
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.73.5")
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.73.0")
|
||||
|
||||
Performance
|
||||
|
||||
@@ -23455,11 +23416,9 @@ Backend-only flags (these can be set in the config file also).
|
||||
--filefabric-token-expiry string Token expiry time
|
||||
--filefabric-url string URL of the Enterprise File Fabric to connect to
|
||||
--filefabric-version string Version read from the file fabric
|
||||
--filelu-chunk-size SizeSuffix Chunk size to use for uploading. Used for multipart uploads (default 64Mi)
|
||||
--filelu-description string Description of the remote
|
||||
--filelu-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,Colon,Question,Asterisk,Pipe,Hash,Percent,BackSlash,CrLf,Del,Ctl,LeftSpace,LeftPeriod,LeftTilde,LeftCrLfHtVt,RightSpace,RightPeriod,RightCrLfHtVt,InvalidUtf8,Dot,SquareBracket,Semicolon,Exclamation)
|
||||
--filelu-key string Your FileLu Rclone key from My Account
|
||||
--filelu-upload-cutoff SizeSuffix Cutoff for switching to chunked upload. Any files larger than this will be uploaded in chunks of chunk_size (default 500Mi)
|
||||
--filen-api-key string API Key for your Filen account (obscured)
|
||||
--filen-auth-version string Authentication Version (internal use only)
|
||||
--filen-base-folder-uuid string UUID of Account Root Directory (internal use only)
|
||||
@@ -25667,9 +25626,11 @@ The following backends have known issues that need more investigation:
|
||||
|
||||
- TestDropbox (dropbox)
|
||||
- TestBisyncRemoteRemote/normalization
|
||||
- TestSeafile (seafile)
|
||||
- TestBisyncLocalRemote/volatile
|
||||
- TestSeafileV6 (seafile)
|
||||
- TestBisyncLocalRemote/rmdirs
|
||||
- Updated: 2026-04-19-010011
|
||||
- TestBisyncLocalRemote/volatile
|
||||
- Updated: 2026-01-30-010015
|
||||
|
||||
The following backends either have not been tested recently or have
|
||||
known issues that are deemed unfixable for the time being:
|
||||
@@ -27729,26 +27690,6 @@ work with the SDK properly:
|
||||
. .
|
||||
.. ..
|
||||
|
||||
Important note about double slashes (//)
|
||||
|
||||
Object keys containing consecutive forward slashes (//) are not
|
||||
supported by rclone.
|
||||
|
||||
When rclone encounters an object key with // (e.g., a//b), it will
|
||||
normalize the path to use a single slash (e.g., a/b). This normalization
|
||||
can cause "object not found" errors when trying to access the original
|
||||
object, as rclone will look for the normalized path instead of the
|
||||
actual object key.
|
||||
|
||||
Example: - Original S3 object key: folder//file.txt - rclone interprets
|
||||
it as: folder/file.txt - Result: "object not found" error when trying to
|
||||
access folder//file.txt
|
||||
|
||||
Workaround: Avoid using consecutive forward slashes (//) in S3 object
|
||||
keys when using rclone. If you have existing objects with // in their
|
||||
keys, you will need to rename them to use single slashes or access them
|
||||
through other means.
|
||||
|
||||
Multipart uploads
|
||||
|
||||
rclone supports multipart uploads with S3 which means that it can upload
|
||||
@@ -28783,10 +28724,6 @@ Properties:
|
||||
- "s3.cubbit.eu"
|
||||
- Cubbit DS3 Object Storage endpoint
|
||||
- Provider: Cubbit
|
||||
- "s3.{tenant_name}.cubbit.eu"
|
||||
- Multi-tenant endpoint - replace {tenant_name} with your
|
||||
actual tenant name. Do not select this directly
|
||||
- Provider: Cubbit
|
||||
- "syd1.digitaloceanspaces.com"
|
||||
- DigitalOcean Spaces Sydney 1
|
||||
- Provider: DigitalOcean
|
||||
@@ -32139,9 +32076,7 @@ pair. You can follow this guide to retrieve these keys. They will be
|
||||
needed when prompted by rclone config.
|
||||
|
||||
Default region will correspond to eu-west-1 and the endpoint has to be
|
||||
specified as s3.cubbit.eu. If you set a custom tenant endpoint, you must
|
||||
use s3.{tenant_name}.cubbit.eu, because the generic s3.cubbit.eu
|
||||
endpoint will not work in this case.
|
||||
specified as s3.cubbit.eu.
|
||||
|
||||
Going through the whole process of creating a new remote by running
|
||||
rclone config, each prompt should be answered as shown below:
|
||||
@@ -32153,7 +32088,7 @@ rclone config, each prompt should be answered as shown below:
|
||||
access_key_id> YOUR_ACCESS_KEY
|
||||
secret_access_key> YOUR_SECRET_KEY
|
||||
region> eu-west-1 (or leave empty)
|
||||
endpoint> s3.cubbit.eu (or s3.{tenant_name}.cubbit.eu)
|
||||
endpoint> s3.cubbit.eu
|
||||
acl>
|
||||
|
||||
The resulting configuration file should look like:
|
||||
@@ -35764,16 +35699,6 @@ To configure access to Tencent COS, follow the steps below:
|
||||
==== ====
|
||||
cos s3
|
||||
|
||||
Tencent COS Global Acceleration Endpoint
|
||||
|
||||
When using the Global Acceleration Endpoint
|
||||
(cos.accelerate.myqcloud.com), rclone automatically sets
|
||||
no_check_bucket = true because this acceleration endpoint does not
|
||||
support the CreateBucket call which is used for ensuring a bucket's
|
||||
existence by rclone. Global Acceleration is a per-bucket feature, so you
|
||||
should first create the bucket in one physical region, then enable it in
|
||||
the Tencent Cloud console.
|
||||
|
||||
Wasabi
|
||||
|
||||
Wasabi is a cloud-based object storage service for a broad range of
|
||||
@@ -42336,29 +42261,6 @@ Advanced options
|
||||
|
||||
Here are the Advanced options specific to filelu (FileLu Cloud Storage).
|
||||
|
||||
--filelu-upload-cutoff
|
||||
|
||||
Cutoff for switching to chunked upload. Any files larger than this will
|
||||
be uploaded in chunks of chunk_size.
|
||||
|
||||
Properties:
|
||||
|
||||
- Config: upload_cutoff
|
||||
- Env Var: RCLONE_FILELU_UPLOAD_CUTOFF
|
||||
- Type: SizeSuffix
|
||||
- Default: 500Mi
|
||||
|
||||
--filelu-chunk-size
|
||||
|
||||
Chunk size to use for uploading. Used for multipart uploads.
|
||||
|
||||
Properties:
|
||||
|
||||
- Config: chunk_size
|
||||
- Env Var: RCLONE_FILELU_CHUNK_SIZE
|
||||
- Type: SizeSuffix
|
||||
- Default: 64Mi
|
||||
|
||||
--filelu-encoding
|
||||
|
||||
The encoding for the backend.
|
||||
@@ -42402,10 +42304,6 @@ account, currently this is only possible using the Filen CLI. This means
|
||||
you must first download the CLI, login, and then run the export-api-key
|
||||
command.
|
||||
|
||||
Note: If you change your Filen account password, you will need to update
|
||||
your rclone configuration with the new password and a re-exported API
|
||||
key (via export-api-key).
|
||||
|
||||
Here is an example of how to make a remote called FilenRemote. First
|
||||
run:
|
||||
|
||||
@@ -65202,163 +65100,6 @@ Options:
|
||||
|
||||
Changelog
|
||||
|
||||
v1.73.5 - 2026-04-19
|
||||
|
||||
See commits
|
||||
|
||||
- Bug Fixes
|
||||
- operations: Add AuthRequired to operations/fsinfo to prevent
|
||||
backend creation CVE-2026-41179 (Nick Craig-Wood)
|
||||
- rc
|
||||
- Add AuthRequired to options/set to prevent auth bypass
|
||||
CVE-2026-41176 (Nick Craig-Wood)
|
||||
- Snapshot NoAuth at startup to prevent runtime auth bypass
|
||||
CVE-2026-41176 (Nick Craig-Wood)
|
||||
- filter: Fix debug logs that fire before logger is configured
|
||||
(Nick Craig-Wood)
|
||||
- Azureblob
|
||||
- Add Microsoft Partner Network User-Agent prefix (Nick
|
||||
Craig-Wood)
|
||||
- Drime
|
||||
- Fix User.EntryPermissions JSON unmarshalling (a1pcm)
|
||||
- Iclouddrive
|
||||
- Fix 'directory not found' error when the directory contains
|
||||
accent marks (Brais Couce)
|
||||
- S3
|
||||
- Fix TencentCOS CDN endpoint failing on bucket check (Mozi)
|
||||
- Fix empty delimiter parameter rejected by Archiware P5 server
|
||||
(Nick Craig-Wood)
|
||||
|
||||
v1.73.4 - 2026-04-08
|
||||
|
||||
See commits
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to go 1.25.9 to fix multiple CVEs (Nick Craig-Wood)
|
||||
- CVE-2026-32282: os: Root.Chmod can follow symlinks out
|
||||
of the root on Linux
|
||||
- CVE-2026-32289: html/template: JS template literal
|
||||
context incorrectly tracked
|
||||
- CVE-2026-33810: crypto/x509: excluded DNS constraints
|
||||
not properly applied to wildcard domains
|
||||
- CVE-2026-27144: cmd/compile: no-op interface conversion
|
||||
bypasses overlap checking
|
||||
- CVE-2026-27143: cmd/compile: possible memory corruption
|
||||
after bound check elimination
|
||||
- CVE-2026-32288: archive/tar: unbounded allocation when
|
||||
parsing old format GNU sparse map
|
||||
- CVE-2026-32283: crypto/tls: multiple key update
|
||||
handshake messages can cause connection to deadlock
|
||||
- CVE-2026-27140: cmd/go: trust layer bypass when using
|
||||
cgo and SWIG
|
||||
- CVE-2026-32280: crypto/x509: unexpected work during
|
||||
chain building
|
||||
- CVE-2026-32281: crypto/x509: inefficient policy
|
||||
validation
|
||||
- Fix Denial of Service due to Panic in AWS SDK for Go v2 SDK
|
||||
EventStream Decoder (dependabot[bot])
|
||||
- Update golang.org/x/image to 0.38.0 to fix CVE-2026-33809
|
||||
(dependabot[bot])
|
||||
- docs
|
||||
- Fix header level for metadata option (Clément Notin)
|
||||
- Fix markdown issues in mount docs (albertony)
|
||||
- Fix link to not be language specific (Ross Smith II)
|
||||
- Note macOS 10.15 (Catalina) support with version v1.70.3
|
||||
(kapitainsky)
|
||||
- Filen
|
||||
- Update SDK version (Enduriel)
|
||||
|
||||
v1.73.3 - 2026-03-23
|
||||
|
||||
See commits
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to google.golang.org/grpc 1.79.3 to fix
|
||||
CVE-2026-33186 (dependabot[bot])
|
||||
- Update to github.com/buger/jsonparser 1.1.2 to fix
|
||||
GHSA-6g7g-w4f8-9c9x (dependabot[bot])
|
||||
- doc fixes
|
||||
- Added text to the label showing version-introduced info
|
||||
(Jan-Philipp Reßler)
|
||||
- Clarify Filen password change requires updating both
|
||||
password and API key in rclone config (Jason)
|
||||
- s3: clarify multi tenant support for Cubbit (Marco Ferretti)
|
||||
- jottacloud: Fix broken link (albertony)
|
||||
- lib/rest: Fix URLPathEscapeAll breaking WebDAV servers (eg
|
||||
nzbdav) with strict path matching (Andrew Furman)
|
||||
- list: Fix nil pointer panic in Sorter when temp file creation
|
||||
fails (Nick Craig-Wood)
|
||||
|
||||
v1.73.2 - 2026-03-06
|
||||
|
||||
See commits
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to go 1.25.8 to fix CVE-2026-27137 CVE-2026-27138
|
||||
CVE-2026-25679 CVE-2026-27142 (Nick Craig-Wood)
|
||||
- Update github.com/cloudflare/circl to v1.6.3 to fix
|
||||
CVE-2026-1229 (Nick Craig-Wood)
|
||||
- Update to golang.org/x/net v0.51.0 to fix CVE-2026-27141
|
||||
(Nick Craig-Wood)
|
||||
- docs fixes:
|
||||
- bisync: Add group Sync to the bisync command (Jan-Philipp
|
||||
Reßler)
|
||||
- Note that --use-server-modtime only works on some backends
|
||||
(Nick Craig-Wood)
|
||||
- Document unsupported S3 object keys with double slashes
|
||||
(Adam Kasztenny)
|
||||
- Fix headers hierarchy for mount.md (Dark Dragon)
|
||||
- Fix new drive flag typo in changelog (razorloves)
|
||||
- Archive
|
||||
- Extract: fix extraction with "./" prefix from tar entry paths
|
||||
(Varun Chawla)
|
||||
- Drime
|
||||
- Fix chunk-uploaded files ignoring workspace ID (a1pcm)
|
||||
- Internxt
|
||||
- Fix Entry doesn't belong in directory errors on windows
|
||||
(jzunigax2)
|
||||
- WebDAV
|
||||
- Escape reserved characters in URL path segments (Varun Chawla)
|
||||
- Add missing headers for CORS (Romāns Potašovs)
|
||||
|
||||
v1.73.1 - 2026-02-17
|
||||
|
||||
See commits
|
||||
|
||||
- Bug Fixes
|
||||
- accounting: Fix missing server side stats from core/stats rc
|
||||
(Nick Craig-Wood)
|
||||
- build
|
||||
- Fix CVE-2025-68121 by updating go to 1.25.7 or later (Nick
|
||||
Craig-Wood)
|
||||
- Bump github.com/go-chi/chi/v5 from 5.2.3 to 5.2.5 to fix
|
||||
GO-2026-4316 (albertony)
|
||||
- docs: Extend copyurl docs with an example of CSV FILENAMEs
|
||||
starting with a path. (Jack Kelly)
|
||||
- march: Fix runtime: program exceeds 10000-thread limit (Nick
|
||||
Craig-Wood)
|
||||
- pacer
|
||||
- Fix deadlock between pacer token and --max-connections (Nick
|
||||
Craig-Wood)
|
||||
- Re-read the sleep time as it may be stale (Nick Craig-Wood)
|
||||
- Drime
|
||||
- Fix files and directories being created in the default workspace
|
||||
(Nick Craig-Wood)
|
||||
- Filelu
|
||||
- Avoid buffering entire file in memory (kingston125)
|
||||
- Add multipart upload support with configurable cutoff
|
||||
(kingston125)
|
||||
- Filen
|
||||
- Fix 32 bit targets not being able to list directories (Enduriel)
|
||||
- Fix potential panic in case of error during upload (Enduriel)
|
||||
- Internxt
|
||||
- Implement re-login under refresh logic, improve retry logic
|
||||
(José Zúniga) -S3
|
||||
- Set list_version to 2 for FileLu S3 configuration (kingston125)
|
||||
|
||||
v1.73.0 - 2026-01-30
|
||||
|
||||
See commits
|
||||
@@ -65394,7 +65135,7 @@ See commits
|
||||
- Support authentication with new bucket restricted application
|
||||
keys (DianaNites)
|
||||
- Drive
|
||||
- Add --drive-metadata-enforce-expansive-access flag (Nick
|
||||
- Add --drive-metadata-force-expansive-access flag (Nick
|
||||
Craig-Wood)
|
||||
- Fix crash when trying to creating shortcut to a Google doc (Nick
|
||||
Craig-Wood)
|
||||
|
||||
@@ -44,6 +44,7 @@ directories to and from different cloud storage providers.
|
||||
- Dropbox [:page_facing_up:](https://rclone.org/dropbox/)
|
||||
- Enterprise File Fabric [:page_facing_up:](https://rclone.org/filefabric/)
|
||||
- Exaba [:page_facing_up:](https://rclone.org/s3/#exaba)
|
||||
- Fastly Object Storage [:page_facing_up:](https://rclone.org/s3/#fastly)
|
||||
- Fastmail Files [:page_facing_up:](https://rclone.org/webdav/#fastmail-files)
|
||||
- FileLu [:page_facing_up:](https://rclone.org/filelu/)
|
||||
- Filen [:page_facing_up:](https://rclone.org/filen/)
|
||||
@@ -117,7 +118,6 @@ directories to and from different cloud storage providers.
|
||||
- Shade [:page_facing_up:](https://rclone.org/shade/)
|
||||
- SMB / CIFS [:page_facing_up:](https://rclone.org/smb/)
|
||||
- Spectra Logic [:page_facing_up:](https://rclone.org/s3/#spectralogic)
|
||||
- StackPath [:page_facing_up:](https://rclone.org/s3/#stackpath)
|
||||
- Storj [:page_facing_up:](https://rclone.org/storj/)
|
||||
- SugarSync [:page_facing_up:](https://rclone.org/sugarsync/)
|
||||
- Synology C2 Object Storage [:page_facing_up:](https://rclone.org/s3/#synology-c2)
|
||||
@@ -126,6 +126,7 @@ directories to and from different cloud storage providers.
|
||||
- Wasabi [:page_facing_up:](https://rclone.org/s3/#wasabi)
|
||||
- WebDAV [:page_facing_up:](https://rclone.org/webdav/)
|
||||
- Yandex Disk [:page_facing_up:](https://rclone.org/yandex/)
|
||||
- Zadara Object Storage [:page_facing_up:](https://rclone.org/s3/#zadara)
|
||||
- Zoho WorkDrive [:page_facing_up:](https://rclone.org/zoho/)
|
||||
- Zata.ai [:page_facing_up:](https://rclone.org/s3/#Zata)
|
||||
- The local filesystem [:page_facing_up:](https://rclone.org/local/)
|
||||
|
||||
@@ -32,11 +32,10 @@ This file describes how to make the various kinds of releases
|
||||
- make sign_upload
|
||||
- make check_sign
|
||||
- make upload
|
||||
- make upload_test_website # check sponsors are correct/unchanged
|
||||
- make upload_website
|
||||
- make upload_github
|
||||
- make startdev # make startstable for stable branch
|
||||
- \# announce with forum post, twitter post, and post to annoucements list
|
||||
- \# announce with forum post, twitter post, patreon post
|
||||
|
||||
## Update dependencies
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
|
||||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
|
||||
@@ -284,9 +283,6 @@ type transporter struct {
|
||||
|
||||
// Make a new transporter
|
||||
func newTransporter(ctx context.Context) transporter {
|
||||
// Set the User-Agent to include the Microsoft Partner Network prefix
|
||||
ctx, ci := fs.AddConfig(ctx)
|
||||
ci.UserAgent = "APN/1.0 rclone/1.0 rclone/" + strings.TrimPrefix(fs.Version, "v")
|
||||
return transporter{
|
||||
RoundTripper: fshttp.NewTransport(ctx),
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"net/http"
|
||||
"path"
|
||||
"slices"
|
||||
@@ -46,6 +47,7 @@ import (
|
||||
"github.com/rclone/rclone/lib/multipart"
|
||||
"github.com/rclone/rclone/lib/pacer"
|
||||
"github.com/rclone/rclone/lib/pool"
|
||||
"github.com/rclone/rclone/lib/transferaccounter"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
@@ -184,6 +186,16 @@ In tests, copy speed increases almost linearly with copy
|
||||
concurrency.`,
|
||||
Default: 512,
|
||||
Advanced: true,
|
||||
}, {
|
||||
Name: "copy_total_concurrency",
|
||||
Help: `Global concurrency limit for multipart copy chunks.
|
||||
|
||||
This limits the total number of multipart copy chunks running at once
|
||||
across all files.
|
||||
|
||||
Set to 0 to disable this limiter.`,
|
||||
Default: 0,
|
||||
Advanced: true,
|
||||
}, {
|
||||
Name: "use_copy_blob",
|
||||
Help: `Whether to use the Copy Blob API when copying to the same storage account.
|
||||
@@ -345,21 +357,22 @@ rclone does if you know the container exists already.
|
||||
// Options defines the configuration for this backend
|
||||
type Options struct {
|
||||
auth.Options
|
||||
ChunkSize fs.SizeSuffix `config:"chunk_size"`
|
||||
CopyCutoff fs.SizeSuffix `config:"copy_cutoff"`
|
||||
CopyConcurrency int `config:"copy_concurrency"`
|
||||
UseCopyBlob bool `config:"use_copy_blob"`
|
||||
UploadConcurrency int `config:"upload_concurrency"`
|
||||
ListChunkSize uint `config:"list_chunk"`
|
||||
AccessTier string `config:"access_tier"`
|
||||
ArchiveTierDelete bool `config:"archive_tier_delete"`
|
||||
DisableCheckSum bool `config:"disable_checksum"`
|
||||
Enc encoder.MultiEncoder `config:"encoding"`
|
||||
PublicAccess string `config:"public_access"`
|
||||
DirectoryMarkers bool `config:"directory_markers"`
|
||||
NoCheckContainer bool `config:"no_check_container"`
|
||||
NoHeadObject bool `config:"no_head_object"`
|
||||
DeleteSnapshots string `config:"delete_snapshots"`
|
||||
ChunkSize fs.SizeSuffix `config:"chunk_size"`
|
||||
CopyCutoff fs.SizeSuffix `config:"copy_cutoff"`
|
||||
CopyConcurrency int `config:"copy_concurrency"`
|
||||
CopyTotalConcurrency int `config:"copy_total_concurrency"`
|
||||
UseCopyBlob bool `config:"use_copy_blob"`
|
||||
UploadConcurrency int `config:"upload_concurrency"`
|
||||
ListChunkSize uint `config:"list_chunk"`
|
||||
AccessTier string `config:"access_tier"`
|
||||
ArchiveTierDelete bool `config:"archive_tier_delete"`
|
||||
DisableCheckSum bool `config:"disable_checksum"`
|
||||
Enc encoder.MultiEncoder `config:"encoding"`
|
||||
PublicAccess string `config:"public_access"`
|
||||
DirectoryMarkers bool `config:"directory_markers"`
|
||||
NoCheckContainer bool `config:"no_check_container"`
|
||||
NoHeadObject bool `config:"no_head_object"`
|
||||
DeleteSnapshots string `config:"delete_snapshots"`
|
||||
}
|
||||
|
||||
// Fs represents a remote azure server
|
||||
@@ -381,6 +394,7 @@ type Fs struct {
|
||||
cache *bucket.Cache // cache for container creation status
|
||||
pacer *fs.Pacer // To pace and retry the API calls
|
||||
uploadToken *pacer.TokenDispenser // control concurrency
|
||||
copyToken *pacer.TokenDispenser // global multipart copy concurrency limiter
|
||||
publicAccess container.PublicAccessType // Container Public Access Level
|
||||
|
||||
// user delegation cache
|
||||
@@ -586,6 +600,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
ci: ci,
|
||||
pacer: fs.NewPacer(ctx, pacer.NewS3(pacer.MinSleep(minSleep), pacer.MaxSleep(maxSleep), pacer.DecayConstant(decayConstant))),
|
||||
uploadToken: pacer.NewTokenDispenser(ci.Transfers),
|
||||
copyToken: pacer.NewTokenDispenser(opt.CopyTotalConcurrency),
|
||||
cache: bucket.NewCache(),
|
||||
cntSVCcache: make(map[string]*container.Client, 1),
|
||||
}
|
||||
@@ -729,8 +744,8 @@ func parseXMsTags(s string) (map[string]string, error) {
|
||||
return map[string]string{}, nil
|
||||
}
|
||||
out := make(map[string]string)
|
||||
parts := strings.Split(s, ",")
|
||||
for _, p := range parts {
|
||||
parts := strings.SplitSeq(s, ",")
|
||||
for p := range parts {
|
||||
p = strings.TrimSpace(p)
|
||||
if p == "" {
|
||||
continue
|
||||
@@ -893,9 +908,7 @@ func assembleCopyParams(ctx context.Context, f *Fs, src fs.Object, srcProps *blo
|
||||
if meta == nil {
|
||||
meta = make(map[string]*string, len(userMeta))
|
||||
}
|
||||
for k, v := range userMeta {
|
||||
meta[k] = v
|
||||
}
|
||||
maps.Copy(meta, userMeta)
|
||||
}
|
||||
// Apply tags if any
|
||||
if len(mappedTags) > 0 {
|
||||
@@ -992,9 +1005,7 @@ func (o *Object) applyMappedMetadata(ctx context.Context, src fs.ObjectInfo, ui
|
||||
if o.tags == nil {
|
||||
o.tags = make(map[string]string, len(tags))
|
||||
}
|
||||
for k, v := range tags {
|
||||
o.tags[k] = v
|
||||
}
|
||||
maps.Copy(o.tags, tags)
|
||||
}
|
||||
|
||||
if mappedModTime != nil {
|
||||
@@ -1745,18 +1756,26 @@ func (f *Fs) copyMultipart(ctx context.Context, remote, dstContainer, dstPath st
|
||||
blockIDs = make([]string, numParts) // list of blocks for finalize
|
||||
g, gCtx = errgroup.WithContext(ctx)
|
||||
checker = newCheckForInvalidBlockOrBlob("copy", o)
|
||||
account = transferaccounter.Get(ctx)
|
||||
)
|
||||
g.SetLimit(f.opt.CopyConcurrency)
|
||||
|
||||
fs.Debugf(o, "Starting multipart copy with %d parts of size %v", numParts, fs.SizeSuffix(partSize))
|
||||
account.Start()
|
||||
for partNum := uint64(0); partNum < uint64(numParts); partNum++ {
|
||||
// Fail fast, in case an errgroup managed function returns an error
|
||||
// gCtx is cancelled. There is no point in uploading all the other parts.
|
||||
if gCtx.Err() != nil {
|
||||
break
|
||||
}
|
||||
if f.opt.CopyTotalConcurrency > 0 {
|
||||
f.copyToken.Get()
|
||||
}
|
||||
partNum := partNum // for closure
|
||||
g.Go(func() error {
|
||||
if f.opt.CopyTotalConcurrency > 0 {
|
||||
defer f.copyToken.Put()
|
||||
}
|
||||
blockID := bic.newBlockID(partNum)
|
||||
options := blockblob.StageBlockFromURLOptions{
|
||||
Range: blob.HTTPRange{
|
||||
@@ -1790,6 +1809,7 @@ func (f *Fs) copyMultipart(ctx context.Context, remote, dstContainer, dstPath st
|
||||
return fmt.Errorf("multipart copy: failed to copy chunk %d with %v bytes: %w", partNum+1, -1, err)
|
||||
}
|
||||
blockIDs[partNum] = blockID
|
||||
account.Add(options.Range.Count)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -1859,9 +1879,7 @@ func (f *Fs) copySinglepart(ctx context.Context, remote, dstContainer, dstPath s
|
||||
// Apply tags and post-copy headers only when mapping requested changes
|
||||
if len(tags) > 0 {
|
||||
options.BlobTags = make(map[string]string, len(tags))
|
||||
for k, v := range tags {
|
||||
options.BlobTags[k] = v
|
||||
}
|
||||
maps.Copy(options.BlobTags, tags)
|
||||
}
|
||||
if hadMapping {
|
||||
// Only set metadata explicitly when mapping was requested; otherwise
|
||||
@@ -2062,9 +2080,7 @@ func (o *Object) Metadata(ctx context.Context) (fs.Metadata, error) {
|
||||
|
||||
// Merge user metadata (already lower-cased keys)
|
||||
metadataMu.Lock()
|
||||
for k, v := range o.meta {
|
||||
m[k] = v
|
||||
}
|
||||
maps.Copy(m, o.meta)
|
||||
metadataMu.Unlock()
|
||||
|
||||
return m, nil
|
||||
|
||||
@@ -287,13 +287,13 @@ type StartLargeFileRequest struct {
|
||||
|
||||
// StartLargeFileResponse is the response to StartLargeFileRequest
|
||||
type StartLargeFileResponse struct {
|
||||
ID string `json:"fileId"` // The unique identifier for this version of this file. Used with b2_get_file_info, b2_download_file_by_id, and b2_delete_file_version.
|
||||
Name string `json:"fileName"` // The name of this file, which can be used with b2_download_file_by_name.
|
||||
AccountID string `json:"accountId"` // The identifier for the account.
|
||||
BucketID string `json:"bucketId"` // The unique ID of the bucket.
|
||||
ContentType string `json:"contentType"` // The MIME type of the file.
|
||||
Info map[string]string `json:"fileInfo"` // The custom information that was uploaded with the file. This is a JSON object, holding the name/value pairs that were uploaded with the file.
|
||||
UploadTimestamp Timestamp `json:"uploadTimestamp,omitempty"` // This is a UTC time when this file was uploaded.
|
||||
ID string `json:"fileId"` // The unique identifier for this version of this file. Used with b2_get_file_info, b2_download_file_by_id, and b2_delete_file_version.
|
||||
Name string `json:"fileName"` // The name of this file, which can be used with b2_download_file_by_name.
|
||||
AccountID string `json:"accountId"` // The identifier for the account.
|
||||
BucketID string `json:"bucketId"` // The unique ID of the bucket.
|
||||
ContentType string `json:"contentType"` // The MIME type of the file.
|
||||
Info map[string]string `json:"fileInfo"` // The custom information that was uploaded with the file. This is a JSON object, holding the name/value pairs that were uploaded with the file.
|
||||
UploadTimestamp Timestamp `json:"uploadTimestamp"` // This is a UTC time when this file was uploaded.
|
||||
}
|
||||
|
||||
// GetUploadPartURLRequest is passed to b2_get_upload_part_url
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/rclone/rclone/lib/atexit"
|
||||
"github.com/rclone/rclone/lib/pool"
|
||||
"github.com/rclone/rclone/lib/rest"
|
||||
"github.com/rclone/rclone/lib/transferaccounter"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
@@ -499,10 +500,12 @@ func (up *largeUpload) Copy(ctx context.Context) (err error) {
|
||||
defer atexit.OnError(&err, func() { _ = up.Abort(ctx) })()
|
||||
fs.Debugf(up.o, "Starting %s of large file in %d chunks (id %q)", up.what, up.parts, up.id)
|
||||
var (
|
||||
account = transferaccounter.Get(ctx)
|
||||
g, gCtx = errgroup.WithContext(ctx)
|
||||
remaining = up.size
|
||||
)
|
||||
g.SetLimit(up.f.opt.UploadConcurrency)
|
||||
account.Start()
|
||||
for part := range up.parts {
|
||||
// Fail fast, in case an errgroup managed function returns an error
|
||||
// gCtx is cancelled. There is no point in copying all the other parts.
|
||||
@@ -514,7 +517,11 @@ func (up *largeUpload) Copy(ctx context.Context) (err error) {
|
||||
|
||||
part := part // for the closure
|
||||
g.Go(func() (err error) {
|
||||
return up.copyChunk(gCtx, part, reqSize)
|
||||
err = up.copyChunk(gCtx, part, reqSize)
|
||||
if err == nil {
|
||||
account.Add(reqSize)
|
||||
}
|
||||
return err
|
||||
})
|
||||
remaining -= reqSize
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ type User struct {
|
||||
Avatar string `json:"avatar"`
|
||||
ModelType string `json:"model_type"`
|
||||
OwnsEntry bool `json:"owns_entry"`
|
||||
EntryPermissions any `json:"entry_permissions"`
|
||||
EntryPermissions []any `json:"entry_permissions"`
|
||||
DisplayName string `json:"display_name"`
|
||||
}
|
||||
|
||||
@@ -237,3 +237,11 @@ type MultiPartAbort struct {
|
||||
UploadID string `json:"uploadId"`
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
// SpaceUsageResponse is returned by GET /user/space-usage
|
||||
type SpaceUsageResponse struct {
|
||||
Used int64 `json:"used"`
|
||||
Available int64 `json:"available"`
|
||||
Status string `json:"status"`
|
||||
SEO any `json:"seo"`
|
||||
}
|
||||
@@ -1362,6 +1362,37 @@ func (s *drimeChunkWriter) Abort(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// About gets quota information
|
||||
func (f *Fs) About(ctx context.Context) (*fs.Usage, error) {
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/user/space-usage",
|
||||
Parameters: url.Values{},
|
||||
}
|
||||
if f.opt.WorkspaceID != "" {
|
||||
opts.Parameters.Set("workspaceId", f.opt.WorkspaceID)
|
||||
}
|
||||
|
||||
var resp *http.Response
|
||||
var result api.SpaceUsageResponse
|
||||
var err error
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
resp, err = f.srv.CallJSON(ctx, &opts, nil, &result)
|
||||
return shouldRetry(ctx, resp, err)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get Drime Quota: %w", err)
|
||||
}
|
||||
|
||||
usage := &fs.Usage{
|
||||
Total: fs.NewUsageValue(result.Available),
|
||||
Used: fs.NewUsageValue(result.Used),
|
||||
Free: fs.NewUsageValue(result.Available - result.Used),
|
||||
}
|
||||
|
||||
return usage, nil
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
// Fs returns the parent Fs
|
||||
@@ -1574,6 +1605,7 @@ var (
|
||||
_ fs.Mover = (*Fs)(nil)
|
||||
_ fs.DirMover = (*Fs)(nil)
|
||||
_ fs.DirCacheFlusher = (*Fs)(nil)
|
||||
_ fs.Abouter = (*Fs)(nil)
|
||||
_ fs.OpenChunkWriter = (*Fs)(nil)
|
||||
_ fs.Object = (*Object)(nil)
|
||||
_ fs.IDer = (*Object)(nil)
|
||||
|
||||
@@ -643,6 +643,44 @@ func (f *Fs) InternalTestAgeQuery(t *testing.T) {
|
||||
assert.Contains(t, subFs.lastQuery, timeQuery)
|
||||
}
|
||||
|
||||
// TestIntegration/FsMkdir/FsPutFiles/Internal/SingleQuoteFolder
|
||||
func (f *Fs) InternalTestSingleQuoteFolder(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
// Test various folder names containing single quotes
|
||||
for _, name := range []string{
|
||||
"'",
|
||||
"''",
|
||||
"'a'",
|
||||
"it's a test",
|
||||
} {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
dir := "singleQuoteTest/" + name
|
||||
err := f.Mkdir(ctx, dir)
|
||||
require.NoError(t, err)
|
||||
defer func() {
|
||||
err := f.Rmdir(ctx, dir)
|
||||
assert.NoError(t, err)
|
||||
}()
|
||||
|
||||
entries, err := f.List(ctx, "singleQuoteTest")
|
||||
require.NoError(t, err)
|
||||
|
||||
found := false
|
||||
for _, entry := range entries {
|
||||
if entry.Remote() == dir {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
assert.True(t, found, "directory %q not found in listing", name)
|
||||
})
|
||||
}
|
||||
|
||||
err := f.Rmdir(ctx, "singleQuoteTest")
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func (f *Fs) InternalTest(t *testing.T) {
|
||||
// These tests all depend on each other so run them as nested tests
|
||||
t.Run("DocumentImport", func(t *testing.T) {
|
||||
@@ -662,6 +700,7 @@ func (f *Fs) InternalTest(t *testing.T) {
|
||||
t.Run("CopyOrMoveID", f.InternalTestCopyOrMoveID)
|
||||
t.Run("Query", f.InternalTestQuery)
|
||||
t.Run("AgeQuery", f.InternalTestAgeQuery)
|
||||
t.Run("SingleQuoteFolder", f.InternalTestSingleQuoteFolder)
|
||||
t.Run("ShouldRetry", f.InternalTestShouldRetry)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package filelu
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -72,37 +70,26 @@ func (f *Fs) completeMultipart(ctx context.Context, server string, uploadID stri
|
||||
// createFolder creates a folder at the specified path.
|
||||
func (f *Fs) createFolder(ctx context.Context, dirPath string) (*api.CreateFolderResponse, error) {
|
||||
encodedDir := f.fromStandardPath(dirPath)
|
||||
apiURL := fmt.Sprintf("%s/folder/create?folder_path=%s&key=%s",
|
||||
f.endpoint,
|
||||
url.QueryEscape(encodedDir),
|
||||
url.QueryEscape(f.opt.Key), // assuming f.opt.Key is the correct field
|
||||
)
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", apiURL, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create request: %w", err)
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/folder/create",
|
||||
Parameters: url.Values{
|
||||
"folder_path": {encodedDir},
|
||||
"key": {f.opt.Key},
|
||||
},
|
||||
}
|
||||
|
||||
var resp *http.Response
|
||||
result := api.CreateFolderResponse{}
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
var innerErr error
|
||||
resp, innerErr = f.client.Do(req)
|
||||
return fserrors.ShouldRetry(innerErr), innerErr
|
||||
var result api.CreateFolderResponse
|
||||
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
_, err := f.srv.CallJSON(ctx, &opts, nil, &result)
|
||||
return fserrors.ShouldRetry(err), err
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("request failed: %w", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
fs.Logf(nil, "Failed to close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
err = json.NewDecoder(resp.Body).Decode(&result)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error decoding response: %w", err)
|
||||
}
|
||||
if result.Status != 200 {
|
||||
return nil, fmt.Errorf("error: %s", result.Msg)
|
||||
}
|
||||
@@ -114,44 +101,29 @@ func (f *Fs) createFolder(ctx context.Context, dirPath string) (*api.CreateFolde
|
||||
// getFolderList List both files and folders in a directory.
|
||||
func (f *Fs) getFolderList(ctx context.Context, path string) (*api.FolderListResponse, error) {
|
||||
encodedDir := f.fromStandardPath(path)
|
||||
apiURL := fmt.Sprintf("%s/folder/list?folder_path=%s&key=%s",
|
||||
f.endpoint,
|
||||
url.QueryEscape(encodedDir),
|
||||
url.QueryEscape(f.opt.Key),
|
||||
)
|
||||
|
||||
var body []byte
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/folder/list",
|
||||
Parameters: url.Values{
|
||||
"folder_path": {encodedDir},
|
||||
"key": {f.opt.Key},
|
||||
},
|
||||
}
|
||||
|
||||
var response api.FolderListResponse
|
||||
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", apiURL, nil)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to create request: %w", err)
|
||||
}
|
||||
|
||||
resp, err := f.client.Do(req)
|
||||
_, err := f.srv.CallJSON(ctx, &opts, nil, &response)
|
||||
if err != nil {
|
||||
return shouldRetry(err), fmt.Errorf("failed to list directory: %w", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
fs.Logf(nil, "Failed to close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
body, err = io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
|
||||
return shouldRetryHTTP(resp.StatusCode), nil
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var response api.FolderListResponse
|
||||
if err := json.NewDecoder(bytes.NewReader(body)).Decode(&response); err != nil {
|
||||
return nil, fmt.Errorf("error decoding response: %w", err)
|
||||
}
|
||||
if response.Status != 200 {
|
||||
if strings.Contains(response.Msg, "Folder not found") {
|
||||
return nil, fs.ErrorDirNotFound
|
||||
@@ -168,42 +140,28 @@ func (f *Fs) getFolderList(ctx context.Context, path string) (*api.FolderListRes
|
||||
}
|
||||
|
||||
return &response, nil
|
||||
|
||||
}
|
||||
|
||||
// deleteFolder deletes a folder at the specified path.
|
||||
func (f *Fs) deleteFolder(ctx context.Context, fullPath string) error {
|
||||
fullPath = f.fromStandardPath(fullPath)
|
||||
deleteURL := fmt.Sprintf("%s/folder/delete?folder_path=%s&key=%s",
|
||||
f.endpoint,
|
||||
url.QueryEscape(fullPath),
|
||||
url.QueryEscape(f.opt.Key),
|
||||
)
|
||||
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/folder/delete",
|
||||
Parameters: url.Values{
|
||||
"folder_path": {fullPath},
|
||||
"key": {f.opt.Key},
|
||||
},
|
||||
}
|
||||
|
||||
delResp := api.DeleteFolderResponse{}
|
||||
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", deleteURL, nil)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
resp, err := f.client.Do(req)
|
||||
_, err := f.srv.CallJSON(ctx, &opts, nil, &delResp)
|
||||
if err != nil {
|
||||
return fserrors.ShouldRetry(err), err
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
fs.Logf(nil, "Failed to close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(body, &delResp); err != nil {
|
||||
return false, fmt.Errorf("error decoding delete response: %w", err)
|
||||
}
|
||||
if delResp.Status != 200 {
|
||||
return false, fmt.Errorf("delete error: %s", delResp.Msg)
|
||||
}
|
||||
@@ -220,38 +178,27 @@ func (f *Fs) deleteFolder(ctx context.Context, fullPath string) error {
|
||||
// getDirectLink of file from FileLu to download.
|
||||
func (f *Fs) getDirectLink(ctx context.Context, filePath string) (string, int64, error) {
|
||||
filePath = f.fromStandardPath(filePath)
|
||||
apiURL := fmt.Sprintf("%s/file/direct_link?file_path=%s&key=%s",
|
||||
f.endpoint,
|
||||
url.QueryEscape(filePath),
|
||||
url.QueryEscape(f.opt.Key),
|
||||
)
|
||||
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/file/direct_link",
|
||||
Parameters: url.Values{
|
||||
"file_path": {filePath},
|
||||
"key": {f.opt.Key},
|
||||
},
|
||||
}
|
||||
|
||||
result := api.FileDirectLinkResponse{}
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", apiURL, nil)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to create request: %w", err)
|
||||
}
|
||||
|
||||
resp, err := f.client.Do(req)
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
_, err := f.srv.CallJSON(ctx, &opts, nil, &result)
|
||||
if err != nil {
|
||||
return shouldRetry(err), fmt.Errorf("failed to fetch direct link: %w", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
fs.Logf(nil, "Failed to close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
|
||||
return false, fmt.Errorf("error decoding response: %w", err)
|
||||
}
|
||||
|
||||
if result.Status != 200 {
|
||||
return false, fmt.Errorf("API error: %s", result.Msg)
|
||||
}
|
||||
|
||||
return shouldRetryHTTP(resp.StatusCode), nil
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
return "", 0, err
|
||||
@@ -263,39 +210,31 @@ func (f *Fs) getDirectLink(ctx context.Context, filePath string) (string, int64,
|
||||
// deleteFile deletes a file based on filePath
|
||||
func (f *Fs) deleteFile(ctx context.Context, filePath string) error {
|
||||
filePath = f.fromStandardPath(filePath)
|
||||
apiURL := fmt.Sprintf("%s/file/remove?file_path=%s&key=%s",
|
||||
f.endpoint,
|
||||
url.QueryEscape(filePath),
|
||||
url.QueryEscape(f.opt.Key),
|
||||
)
|
||||
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/file/remove",
|
||||
Parameters: url.Values{
|
||||
"file_path": {filePath},
|
||||
"key": {f.opt.Key},
|
||||
},
|
||||
}
|
||||
|
||||
result := api.DeleteFileResponse{}
|
||||
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", apiURL, nil)
|
||||
_, err := f.srv.CallJSON(ctx, &opts, nil, &result)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to create request: %w", err)
|
||||
}
|
||||
|
||||
resp, err := f.client.Do(req)
|
||||
if err != nil {
|
||||
return shouldRetry(err), fmt.Errorf("failed to fetch direct link: %w", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
fs.Logf(nil, "Failed to close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
|
||||
return false, fmt.Errorf("error decoding response: %w", err)
|
||||
return shouldRetry(err), fmt.Errorf("failed to delete file: %w", err)
|
||||
}
|
||||
|
||||
if result.Status != 200 {
|
||||
return false, fmt.Errorf("API error: %s", result.Msg)
|
||||
}
|
||||
|
||||
return shouldRetryHTTP(resp.StatusCode), nil
|
||||
return false, nil
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -328,46 +267,28 @@ func (f *Fs) getAccountInfo(ctx context.Context) (*api.AccountInfoResponse, erro
|
||||
|
||||
// getFileInfo retrieves file information based on file code
|
||||
func (f *Fs) getFileInfo(ctx context.Context, fileCode string) (*api.FileInfoResponse, error) {
|
||||
u, _ := url.Parse(f.endpoint + "/file/info2")
|
||||
q := u.Query()
|
||||
q.Set("file_code", fileCode) // raw path — Go handles escaping properly here
|
||||
q.Set("key", f.opt.Key)
|
||||
u.RawQuery = q.Encode()
|
||||
|
||||
apiURL := f.endpoint + "/file/info2?" + u.RawQuery
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/file/info2",
|
||||
Parameters: url.Values{
|
||||
"file_code": {fileCode},
|
||||
"key": {f.opt.Key},
|
||||
},
|
||||
}
|
||||
|
||||
result := api.FileInfoResponse{}
|
||||
|
||||
var body []byte
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", apiURL, nil)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to create request: %w", err)
|
||||
}
|
||||
|
||||
resp, err := f.client.Do(req)
|
||||
_, err := f.srv.CallJSON(ctx, &opts, nil, &result)
|
||||
if err != nil {
|
||||
return shouldRetry(err), fmt.Errorf("failed to fetch file info: %w", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
fs.Logf(nil, "Failed to close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
body, err = io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
|
||||
return shouldRetryHTTP(resp.StatusCode), nil
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := api.FileInfoResponse{}
|
||||
|
||||
if err := json.NewDecoder(bytes.NewReader(body)).Decode(&result); err != nil {
|
||||
return nil, fmt.Errorf("error decoding response: %w", err)
|
||||
}
|
||||
|
||||
if result.Status != 200 || len(result.Result) == 0 {
|
||||
return nil, fs.ErrorObjectNotFound
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/lib/rest"
|
||||
)
|
||||
|
||||
// multipartUpload uploads a file in fixed-size chunks using the multipart API.
|
||||
@@ -168,9 +169,15 @@ func (f *Fs) uploadFile(ctx context.Context, fileContent io.Reader, fileFullPath
|
||||
return nil
|
||||
}
|
||||
|
||||
// getUploadServer gets the upload server URL with proper key authentication
|
||||
func (f *Fs) getUploadServer(ctx context.Context) (string, string, error) {
|
||||
apiURL := fmt.Sprintf("%s/upload/server?key=%s", f.endpoint, url.QueryEscape(f.opt.Key))
|
||||
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/upload/server",
|
||||
Parameters: url.Values{
|
||||
"key": {f.opt.Key},
|
||||
},
|
||||
}
|
||||
|
||||
var result struct {
|
||||
Status int `json:"status"`
|
||||
@@ -180,36 +187,21 @@ func (f *Fs) getUploadServer(ctx context.Context) (string, string, error) {
|
||||
}
|
||||
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", apiURL, nil)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to create request: %w", err)
|
||||
}
|
||||
|
||||
resp, err := f.client.Do(req)
|
||||
_, err := f.srv.CallJSON(ctx, &opts, nil, &result)
|
||||
if err != nil {
|
||||
return shouldRetry(err), fmt.Errorf("failed to get upload server: %w", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
fs.Logf(nil, "Failed to close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
|
||||
return false, fmt.Errorf("error decoding response: %w", err)
|
||||
}
|
||||
|
||||
if result.Status != 200 {
|
||||
return false, fmt.Errorf("API error: %s", result.Msg)
|
||||
}
|
||||
|
||||
return shouldRetryHTTP(resp.StatusCode), nil
|
||||
return false, nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
if result.Status != 200 {
|
||||
return "", "", fmt.Errorf("API error: %s", result.Msg)
|
||||
}
|
||||
|
||||
return result.Result, result.SessID, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package filelu
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -15,6 +14,7 @@ import (
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/hash"
|
||||
"github.com/rclone/rclone/lib/rest"
|
||||
)
|
||||
|
||||
// Object describes a FileLu object
|
||||
@@ -194,8 +194,14 @@ func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) {
|
||||
return "", fmt.Errorf("no valid file code found in the remote path")
|
||||
}
|
||||
|
||||
apiURL := fmt.Sprintf("%s/file/info?file_code=%s&key=%s",
|
||||
o.fs.endpoint, url.QueryEscape(fileCode), url.QueryEscape(o.fs.opt.Key))
|
||||
opts := rest.Opts{
|
||||
Method: "GET",
|
||||
Path: "/file/info",
|
||||
Parameters: url.Values{
|
||||
"file_code": {fileCode},
|
||||
"key": {o.fs.opt.Key},
|
||||
},
|
||||
}
|
||||
|
||||
var result struct {
|
||||
Status int `json:"status"`
|
||||
@@ -204,29 +210,18 @@ func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) {
|
||||
Hash string `json:"hash"`
|
||||
} `json:"result"`
|
||||
}
|
||||
|
||||
err := o.fs.pacer.Call(func() (bool, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", apiURL, nil)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
resp, err := o.fs.client.Do(req)
|
||||
_, err := o.fs.srv.CallJSON(ctx, &opts, nil, &result)
|
||||
if err != nil {
|
||||
return shouldRetry(err), err
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
fs.Logf(nil, "Failed to close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := json.NewDecoder(resp.Body).Decode(&result); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return shouldRetryHTTP(resp.StatusCode), nil
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if result.Status != 200 || len(result.Result) == 0 {
|
||||
return "", fmt.Errorf("error: unable to fetch hash: %s", result.Msg)
|
||||
}
|
||||
|
||||
@@ -116,8 +116,8 @@ type Date struct {
|
||||
type DateFilter struct {
|
||||
Dates []Date `json:"dates,omitempty"`
|
||||
Ranges []struct {
|
||||
StartDate Date `json:"startDate,omitempty"`
|
||||
EndDate Date `json:"endDate,omitempty"`
|
||||
StartDate Date `json:"startDate"`
|
||||
EndDate Date `json:"endDate"`
|
||||
} `json:"ranges,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -583,9 +583,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
|
||||
entriesMu.Unlock()
|
||||
}
|
||||
for range checkers {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for remote := range in {
|
||||
file := &Object{
|
||||
fs: f,
|
||||
@@ -601,7 +599,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
|
||||
fs.Debugf(remote, "skipping because of error: %v", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
for _, name := range names {
|
||||
isDir := name[len(name)-1] == '/'
|
||||
|
||||
@@ -599,7 +599,7 @@ type UpdateFileInfo struct {
|
||||
Signature string `json:"signature,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
WrappingKey string `json:"wrapping_key,omitempty"`
|
||||
} `json:"data,omitempty"`
|
||||
} `json:"data"`
|
||||
DocumentID string `json:"document_id"`
|
||||
FileFlags FileFlags `json:"file_flags"`
|
||||
Mtime int64 `json:"mtime"`
|
||||
@@ -849,10 +849,10 @@ type DriveItem struct {
|
||||
NumberOfItems int64 `json:"numberOfItems"`
|
||||
Status string `json:"status"`
|
||||
Extension string `json:"extension,omitempty"`
|
||||
DateModified time.Time `json:"dateModified,omitempty"`
|
||||
DateChanged time.Time `json:"dateChanged,omitempty"`
|
||||
DateModified time.Time `json:"dateModified"`
|
||||
DateChanged time.Time `json:"dateChanged"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
LastOpenTime time.Time `json:"lastOpenTime,omitempty"`
|
||||
LastOpenTime time.Time `json:"lastOpenTime"`
|
||||
Urls struct {
|
||||
URLDownload string `json:"url_download"`
|
||||
} `json:"urls"`
|
||||
|
||||
@@ -27,8 +27,6 @@ import (
|
||||
"github.com/rclone/rclone/lib/dircache"
|
||||
"github.com/rclone/rclone/lib/encoder"
|
||||
"github.com/rclone/rclone/lib/pacer"
|
||||
|
||||
"golang.org/x/text/unicode/norm"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -227,8 +225,7 @@ func (f *Fs) findLeafItem(ctx context.Context, pathID string, leaf string) (item
|
||||
return nil, false, err
|
||||
}
|
||||
for _, item := range items {
|
||||
// iCloud returns file names in NFD Unicode normalization, so normalized to NFC for consistent comparison
|
||||
if strings.EqualFold(norm.NFC.String(item.FullName()), leaf) {
|
||||
if strings.EqualFold(item.FullName(), leaf) {
|
||||
return item, true, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,12 +33,10 @@ func TestRemove(t *testing.T) {
|
||||
assert.True(t, exists())
|
||||
// close the file in the background
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
require.NoError(t, fd.Close())
|
||||
}()
|
||||
})
|
||||
// delete the open file
|
||||
err = remove(name)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
func remove(name string) (err error) {
|
||||
const maxTries = 10
|
||||
var sleepTime = 1 * time.Millisecond
|
||||
for i := 0; i < maxTries; i++ {
|
||||
for i := range maxTries {
|
||||
err = os.Remove(name)
|
||||
if err == nil {
|
||||
break
|
||||
|
||||
@@ -112,7 +112,7 @@ type ListItem struct {
|
||||
Count struct {
|
||||
Folders int `json:"folders"`
|
||||
Files int `json:"files"`
|
||||
} `json:"count,omitempty"`
|
||||
} `json:"count"`
|
||||
Kind string `json:"kind"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
@@ -154,7 +154,7 @@ type FolderInfoResponse struct {
|
||||
Type string `json:"type"`
|
||||
Home string `json:"home"`
|
||||
List []ListItem `json:"list"`
|
||||
} `json:"body,omitempty"`
|
||||
} `json:"body"`
|
||||
Time int64 `json:"time"`
|
||||
Status int `json:"status"`
|
||||
Email string `json:"email"`
|
||||
|
||||
@@ -284,7 +284,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
}
|
||||
err = srv.LoginWithKeys(opt.SessionID, decodedMasterKey)
|
||||
if err != nil {
|
||||
fs.Debugf(f, "login with previous auth keys failed: %v", err)
|
||||
return nil, fmt.Errorf("couldn't login with session ID and master key: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,6 +341,8 @@ func (f *Fs) findDir(rootNode *mega.Node, dir string) (node *mega.Node, err erro
|
||||
node, err = f.findNode(rootNode, dir)
|
||||
if err == mega.ENOENT {
|
||||
return nil, fs.ErrorDirNotFound
|
||||
} else if err == nil && node == nil {
|
||||
return nil, fs.ErrorDirNotFound
|
||||
} else if err == nil && node.GetType() == mega.FILE {
|
||||
return nil, fs.ErrorIsFile
|
||||
}
|
||||
@@ -352,6 +354,8 @@ func (f *Fs) findObject(rootNode *mega.Node, file string) (node *mega.Node, err
|
||||
node, err = f.findNode(rootNode, file)
|
||||
if err == mega.ENOENT {
|
||||
return nil, fs.ErrorObjectNotFound
|
||||
} else if err == nil && node == nil {
|
||||
return nil, fs.ErrorObjectNotFound
|
||||
} else if err == nil && node.GetType() != mega.FILE {
|
||||
return nil, fs.ErrorIsDir // all other node types are directories
|
||||
}
|
||||
@@ -446,6 +450,9 @@ func (f *Fs) findRoot(ctx context.Context, create bool) (*mega.Node, error) {
|
||||
|
||||
// Check for preexisting root
|
||||
absRoot := f.srv.FS.GetRoot()
|
||||
if absRoot == nil {
|
||||
return nil, errors.New("couldn't find root directory: filesystem not initialized (is the account authenticated?)")
|
||||
}
|
||||
node, err := f.findDir(absRoot, f.root)
|
||||
//log.Printf("findRoot findDir %p %v", node, err)
|
||||
if err == nil {
|
||||
|
||||
@@ -50,12 +50,12 @@ type Identity struct {
|
||||
// to represent a set of identities associated with various events for
|
||||
// an item, such as created by or last modified by.
|
||||
type IdentitySet struct {
|
||||
User Identity `json:"user,omitempty"`
|
||||
Application Identity `json:"application,omitempty"`
|
||||
Device Identity `json:"device,omitempty"`
|
||||
Group Identity `json:"group,omitempty"`
|
||||
SiteGroup Identity `json:"siteGroup,omitempty"` // The SharePoint group associated with this action. Optional.
|
||||
SiteUser Identity `json:"siteUser,omitempty"` // The SharePoint user associated with this action. Optional.
|
||||
User Identity `json:"user"`
|
||||
Application Identity `json:"application"`
|
||||
Device Identity `json:"device"`
|
||||
Group Identity `json:"group"`
|
||||
SiteGroup Identity `json:"siteGroup"` // The SharePoint group associated with this action. Optional.
|
||||
SiteUser Identity `json:"siteUser"` // The SharePoint user associated with this action. Optional.
|
||||
}
|
||||
|
||||
// Quota groups storage space quota-related information on OneDrive into a single structure.
|
||||
@@ -155,8 +155,8 @@ type FileFacet struct {
|
||||
// facet can be used to specify the last modified date or created date
|
||||
// of the item as it was on the local device.
|
||||
type FileSystemInfoFacet struct {
|
||||
CreatedDateTime Timestamp `json:"createdDateTime,omitempty"` // The UTC date and time the file was created on a client.
|
||||
LastModifiedDateTime Timestamp `json:"lastModifiedDateTime,omitempty"` // The UTC date and time the file was last modified on a client.
|
||||
CreatedDateTime Timestamp `json:"createdDateTime"` // The UTC date and time the file was created on a client.
|
||||
LastModifiedDateTime Timestamp `json:"lastModifiedDateTime"` // The UTC date and time the file was last modified on a client.
|
||||
}
|
||||
|
||||
// DeletedFacet indicates that the item on OneDrive has been
|
||||
@@ -175,10 +175,10 @@ type PackageFacet struct {
|
||||
// SharedType indicates a DriveItem has been shared with others. The resource includes information about how the item is shared.
|
||||
// If a Driveitem has a non-null shared facet, the item has been shared.
|
||||
type SharedType struct {
|
||||
Owner IdentitySet `json:"owner,omitempty"` // The identity of the owner of the shared item. Read-only.
|
||||
Scope string `json:"scope,omitempty"` // Indicates the scope of how the item is shared: anonymous, organization, or users. Read-only.
|
||||
SharedBy IdentitySet `json:"sharedBy,omitempty"` // The identity of the user who shared the item. Read-only.
|
||||
SharedDateTime Timestamp `json:"sharedDateTime,omitempty"` // The UTC date and time when the item was shared. Read-only.
|
||||
Owner IdentitySet `json:"owner"` // The identity of the owner of the shared item. Read-only.
|
||||
Scope string `json:"scope,omitempty"` // Indicates the scope of how the item is shared: anonymous, organization, or users. Read-only.
|
||||
SharedBy IdentitySet `json:"sharedBy"` // The identity of the user who shared the item. Read-only.
|
||||
SharedDateTime Timestamp `json:"sharedDateTime"` // The UTC date and time when the item was shared. Read-only.
|
||||
}
|
||||
|
||||
// SharingInvitationType groups invitation-related data items into a single structure.
|
||||
|
||||
@@ -75,8 +75,8 @@ type ErrorDetails struct {
|
||||
Type string `json:"@type,omitempty"`
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Metadata struct{} `json:"metadata,omitempty"` // TODO: undiscovered yet
|
||||
Locale string `json:"locale,omitempty"` // e.g. "en"
|
||||
Metadata struct{} `json:"metadata"` // TODO: undiscovered yet
|
||||
Locale string `json:"locale,omitempty"` // e.g. "en"
|
||||
Message string `json:"message,omitempty"`
|
||||
StackEntries []any `json:"stack_entries,omitempty"` // TODO: undiscovered yet
|
||||
Detail string `json:"detail,omitempty"`
|
||||
@@ -189,8 +189,8 @@ type File struct {
|
||||
Apps []*FileApp `json:"apps,omitempty"`
|
||||
Audit *FileAudit `json:"audit,omitempty"`
|
||||
Collection string `json:"collection,omitempty"` // TODO
|
||||
CreatedTime Time `json:"created_time,omitempty"`
|
||||
DeleteTime Time `json:"delete_time,omitempty"`
|
||||
CreatedTime Time `json:"created_time"`
|
||||
DeleteTime Time `json:"delete_time"`
|
||||
FileCategory string `json:"file_category,omitempty"` // "AUDIO", "VIDEO"
|
||||
FileExtension string `json:"file_extension,omitempty"`
|
||||
FolderType string `json:"folder_type,omitempty"`
|
||||
@@ -202,7 +202,7 @@ type File struct {
|
||||
Md5Checksum string `json:"md5_checksum,omitempty"`
|
||||
Medias []*Media `json:"medias,omitempty"`
|
||||
MimeType string `json:"mime_type,omitempty"`
|
||||
ModifiedTime Time `json:"modified_time,omitempty"` // updated when renamed or moved
|
||||
ModifiedTime Time `json:"modified_time"` // updated when renamed or moved
|
||||
Name string `json:"name,omitempty"`
|
||||
OriginalFileIndex int `json:"original_file_index,omitempty"` // TODO
|
||||
OriginalURL string `json:"original_url,omitempty"`
|
||||
@@ -221,7 +221,7 @@ type File struct {
|
||||
ThumbnailLink string `json:"thumbnail_link,omitempty"`
|
||||
Trashed bool `json:"trashed,omitempty"`
|
||||
UserID string `json:"user_id,omitempty"`
|
||||
UserModifiedTime Time `json:"user_modified_time,omitempty"`
|
||||
UserModifiedTime Time `json:"user_modified_time"`
|
||||
WebContentLink string `json:"web_content_link,omitempty"`
|
||||
Writable bool `json:"writable,omitempty"`
|
||||
}
|
||||
@@ -252,7 +252,7 @@ type Media struct {
|
||||
AudioCodec string `json:"audio_codec,omitempty"` // "pcm_bluray", "aac"
|
||||
VideoType string `json:"video_type,omitempty"` // "mpegts"
|
||||
HdrType string `json:"hdr_type,omitempty"`
|
||||
} `json:"video,omitempty"`
|
||||
} `json:"video"`
|
||||
Link *Link `json:"link,omitempty"`
|
||||
NeedMoreQuota bool `json:"need_more_quota,omitempty"`
|
||||
VipTypes []any `json:"vip_types,omitempty"` // TODO maybe list of something?
|
||||
@@ -290,11 +290,11 @@ type FileApp struct {
|
||||
NeedMoreQuota bool `json:"need_more_quota,omitempty"`
|
||||
IconLink string `json:"icon_link,omitempty"`
|
||||
IsDefault bool `json:"is_default,omitempty"`
|
||||
Params struct{} `json:"params,omitempty"` // TODO
|
||||
Params struct{} `json:"params"` // TODO
|
||||
CategoryIDs []any `json:"category_ids,omitempty"`
|
||||
AdSceneType int `json:"ad_scene_type,omitempty"`
|
||||
Space string `json:"space,omitempty"`
|
||||
Links struct{} `json:"links,omitempty"` // TODO
|
||||
Links struct{} `json:"links"` // TODO
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
@@ -320,8 +320,8 @@ type Task struct {
|
||||
FileName string `json:"file_name,omitempty"`
|
||||
FileSize string `json:"file_size,omitempty"`
|
||||
Message string `json:"message,omitempty"` // e.g. "Saving"
|
||||
CreatedTime Time `json:"created_time,omitempty"`
|
||||
UpdatedTime Time `json:"updated_time,omitempty"`
|
||||
CreatedTime Time `json:"created_time"`
|
||||
UpdatedTime Time `json:"updated_time"`
|
||||
ThirdTaskID string `json:"third_task_id,omitempty"` // TODO
|
||||
Phase string `json:"phase,omitempty"` // e.g. "PHASE_TYPE_RUNNING"
|
||||
Progress int `json:"progress,omitempty"`
|
||||
@@ -368,7 +368,7 @@ type ResumableParams struct {
|
||||
AccessKeySecret string `json:"access_key_secret,omitempty"`
|
||||
Bucket string `json:"bucket,omitempty"`
|
||||
Endpoint string `json:"endpoint,omitempty"`
|
||||
Expiration Time `json:"expiration,omitempty"`
|
||||
Expiration Time `json:"expiration"`
|
||||
Key string `json:"key,omitempty"`
|
||||
SecurityToken string `json:"security_token,omitempty"`
|
||||
}
|
||||
@@ -409,7 +409,7 @@ type About struct {
|
||||
Kind string `json:"kind,omitempty"` // "drive#about"
|
||||
Quota *Quota `json:"quota,omitempty"`
|
||||
ExpiresAt string `json:"expires_at,omitempty"`
|
||||
Quotas struct{} `json:"quotas,omitempty"` // maybe []*Quota?
|
||||
Quotas struct{} `json:"quotas"` // maybe []*Quota?
|
||||
}
|
||||
|
||||
// Quota informs drive quota
|
||||
@@ -445,8 +445,8 @@ type User struct {
|
||||
PhoneNumber string `json:"phone_number,omitempty"`
|
||||
Password string `json:"password,omitempty"` // "SET" if configured
|
||||
Status string `json:"status,omitempty"` // "ACTIVE"
|
||||
CreatedAt Time `json:"created_at,omitempty"`
|
||||
PasswordUpdatedAt Time `json:"password_updated_at,omitempty"`
|
||||
CreatedAt Time `json:"created_at"`
|
||||
PasswordUpdatedAt Time `json:"password_updated_at"`
|
||||
}
|
||||
|
||||
// UserProvider details third-party authentication
|
||||
@@ -464,11 +464,11 @@ type VIP struct {
|
||||
Message string `json:"message,omitempty"`
|
||||
RedirectURI string `json:"redirect_uri,omitempty"`
|
||||
Data struct {
|
||||
Expire Time `json:"expire,omitempty"`
|
||||
Expire Time `json:"expire"`
|
||||
Status string `json:"status,omitempty"` // "invalid" or "ok"
|
||||
Type string `json:"type,omitempty"` // "novip" or "platinum"
|
||||
UserID string `json:"user_id,omitempty"` // same as User.Sub
|
||||
} `json:"data,omitempty"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
// DecompressResult is a response to RequestDecompress
|
||||
@@ -538,7 +538,7 @@ type CaptchaToken struct {
|
||||
CaptchaToken string `json:"captcha_token"`
|
||||
ExpiresIn int64 `json:"expires_in"` // currently 300s
|
||||
// API doesn't provide Expiry field and thus it should be populated from ExpiresIn on retrieval
|
||||
Expiry time.Time `json:"expiry,omitempty"`
|
||||
Expiry time.Time `json:"expiry"`
|
||||
URL string `json:"url,omitempty"` // a link for users to solve captcha
|
||||
}
|
||||
|
||||
|
||||
@@ -1608,7 +1608,7 @@ func (f *Fs) UserInfo(ctx context.Context) (userInfo map[string]string, err erro
|
||||
// ------------------------------------------------------------
|
||||
|
||||
// add offline download task for url
|
||||
func (f *Fs) addURL(ctx context.Context, url, path string) (*api.Task, error) {
|
||||
func (f *Fs) addURL(ctx context.Context, url, name, path string) (*api.Task, error) {
|
||||
req := api.RequestNewTask{
|
||||
Kind: api.KindOfFile,
|
||||
UploadType: "UPLOAD_TYPE_URL",
|
||||
@@ -1617,6 +1617,9 @@ func (f *Fs) addURL(ctx context.Context, url, path string) (*api.Task, error) {
|
||||
},
|
||||
FolderType: "DOWNLOAD",
|
||||
}
|
||||
if name != "" {
|
||||
req.Name = f.opt.Enc.FromStandardName(name)
|
||||
}
|
||||
if parentID, err := f.dirCache.FindDir(ctx, path, false); err == nil {
|
||||
req.ParentID = parentIDForRequest(parentID)
|
||||
req.FolderType = ""
|
||||
@@ -1681,14 +1684,18 @@ var commandHelp = []fs.CommandHelp{{
|
||||
Short: "Add offline download task for url.",
|
||||
Long: `This command adds offline download task for url.
|
||||
|
||||
Usage example:
|
||||
Usage examples:
|
||||
|
||||
` + "```console" + `
|
||||
rclone backend addurl pikpak:dirpath url
|
||||
rclone backend addurl pikpak:dirpath url -o name=custom_filename.zip
|
||||
` + "```" + `
|
||||
|
||||
Downloads will be stored in 'dirpath'. If 'dirpath' is invalid,
|
||||
download will fallback to default 'My Pack' folder.`,
|
||||
Opts: map[string]string{
|
||||
"name": "Custom filename for the downloaded file.",
|
||||
},
|
||||
}, {
|
||||
Name: "decompress",
|
||||
Short: "Request decompress of a file/files in a folder.",
|
||||
@@ -1732,7 +1739,11 @@ func (f *Fs) Command(ctx context.Context, name string, arg []string, opt map[str
|
||||
if len(arg) != 1 {
|
||||
return nil, errors.New("need exactly 1 argument")
|
||||
}
|
||||
return f.addURL(ctx, arg[0], "")
|
||||
filename := ""
|
||||
if name, ok := opt["name"]; ok {
|
||||
filename = name
|
||||
}
|
||||
return f.addURL(ctx, arg[0], filename, "")
|
||||
case "decompress":
|
||||
filename := ""
|
||||
if len(arg) > 0 {
|
||||
|
||||
@@ -170,6 +170,7 @@ In `backend/s3/provider/YourProvider.yaml`
|
||||
UseUnsignedPayload *bool `yaml:"use_unsigned_payload,omitempty"`
|
||||
UseXID *bool `yaml:"use_x_id,omitempty"`
|
||||
SignAcceptEncoding *bool `yaml:"sign_accept_encoding,omitempty"`
|
||||
EtagIsNotMD5 *bool `yaml:"etag_is_not_md5,omitempty"`
|
||||
CopyCutoff *int64 `yaml:"copy_cutoff,omitempty"`
|
||||
MaxUploadParts *int `yaml:"max_upload_parts,omitempty"`
|
||||
MinChunkSize *int64 `yaml:"min_chunk_size,omitempty"`
|
||||
|
||||
@@ -4,7 +4,6 @@ region:
|
||||
eu-west-1: Europe West
|
||||
endpoint:
|
||||
s3.cubbit.eu: Cubbit DS3 Object Storage endpoint
|
||||
s3.{tenant_name}.cubbit.eu: Multi-tenant endpoint - replace {tenant_name} with your actual tenant name. Do not select this directly
|
||||
acl: {}
|
||||
bucket_acl: true
|
||||
quirks:
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
name: Fastly
|
||||
description: Fastly Object Storage
|
||||
region:
|
||||
au-east-1: AU East 1
|
||||
eu-central: EU Central
|
||||
eu-south-1: EU South 1
|
||||
jp-central-1: JP Central 1
|
||||
uk-east-1: UK East 1
|
||||
us-central-1: US Central 1
|
||||
us-east: US East
|
||||
us-west: US West
|
||||
endpoint:
|
||||
au-east-1.object.fastlystorage.app: AU East 1
|
||||
eu-central.object.fastlystorage.app: EU Central
|
||||
eu-south-1.object.fastlystorage.app: EU South 1
|
||||
jp-central-1.object.fastlystorage.app: JP Central 1
|
||||
uk-east-1.object.fastlystorage.app: UK East 1
|
||||
us-central-1.object.fastlystorage.app: US Central 1
|
||||
us-east.object.fastlystorage.app: US East
|
||||
us-west.object.fastlystorage.app: US West
|
||||
quirks:
|
||||
force_path_style: true
|
||||
use_already_exists: false
|
||||
use_multipart_etag: false
|
||||
use_multipart_uploads: false
|
||||
etag_is_not_md5: true
|
||||
@@ -3,11 +3,17 @@ description: IONOS Cloud
|
||||
region:
|
||||
de: Frankfurt, Germany
|
||||
eu-central-2: Berlin, Germany
|
||||
eu-central-3: Berlin, Germany
|
||||
eu-central-4: Frankfurt, Germany
|
||||
eu-south-2: Logrono, Spain
|
||||
us-central-1: Lenexa, USA
|
||||
endpoint:
|
||||
s3-eu-central-1.ionoscloud.com: Frankfurt, Germany
|
||||
s3-eu-central-2.ionoscloud.com: Berlin, Germany
|
||||
s3-eu-south-2.ionoscloud.com: Logrono, Spain
|
||||
s3.eu-central-1.ionoscloud.com: Frankfurt, Germany
|
||||
s3.eu-central-2.ionoscloud.com: Berlin, Germany
|
||||
s3.eu-central-3.ionoscloud.com: Berlin, Germany
|
||||
s3.eu-central-4.ionoscloud.com: Frankfurt, Germany
|
||||
s3.eu-south-2.ionoscloud.com: Logrono, Spain
|
||||
s3.us-central-1.ionoscloud.com: Lenexa, USA
|
||||
acl: {}
|
||||
bucket_acl: true
|
||||
quirks:
|
||||
|
||||
@@ -18,11 +18,11 @@ storage_class:
|
||||
GLACIER: |-
|
||||
Archived storage.
|
||||
Prices are lower, but it needs to be restored first to be accessed.
|
||||
Available in FR-PAR and NL-AMS regions.
|
||||
Available in the FR-PAR region only.
|
||||
ONEZONE_IA: |-
|
||||
One Zone - Infrequent Access.
|
||||
A good choice for storing secondary backup copies or easily re-creatable data.
|
||||
Available in the FR-PAR region only.
|
||||
Available in all regions.
|
||||
bucket_acl: true
|
||||
quirks:
|
||||
max_upload_parts: 1000
|
||||
@@ -1,14 +0,0 @@
|
||||
name: StackPath
|
||||
description: StackPath Object Storage
|
||||
region: {}
|
||||
endpoint:
|
||||
s3.us-east-2.stackpathstorage.com: US East Endpoint
|
||||
s3.us-west-1.stackpathstorage.com: US West Endpoint
|
||||
s3.eu-central-1.stackpathstorage.com: EU Endpoint
|
||||
acl: {}
|
||||
bucket_acl: true
|
||||
quirks:
|
||||
list_version: 1
|
||||
force_path_style: true
|
||||
list_url_encode: false
|
||||
use_already_exists: false
|
||||
@@ -0,0 +1,9 @@
|
||||
name: Zadara
|
||||
description: Zadara Object Storage
|
||||
region:
|
||||
us-east-1: |-
|
||||
The default region.
|
||||
Leave location constraint empty.
|
||||
endpoint: {}
|
||||
quirks:
|
||||
force_path_style: true
|
||||
@@ -32,6 +32,7 @@ type Quirks struct {
|
||||
UseUnsignedPayload *bool `yaml:"use_unsigned_payload,omitempty"`
|
||||
UseXID *bool `yaml:"use_x_id,omitempty"`
|
||||
SignAcceptEncoding *bool `yaml:"sign_accept_encoding,omitempty"`
|
||||
EtagIsNotMD5 *bool `yaml:"etag_is_not_md5,omitempty"`
|
||||
CopyCutoff *int64 `yaml:"copy_cutoff,omitempty"`
|
||||
MaxUploadParts *int `yaml:"max_upload_parts,omitempty"`
|
||||
MinChunkSize *int64 `yaml:"min_chunk_size,omitempty"`
|
||||
|
||||
@@ -63,6 +63,7 @@ import (
|
||||
"github.com/rclone/rclone/lib/pool"
|
||||
"github.com/rclone/rclone/lib/readers"
|
||||
"github.com/rclone/rclone/lib/rest"
|
||||
"github.com/rclone/rclone/lib/transferaccounter"
|
||||
"github.com/rclone/rclone/lib/version"
|
||||
)
|
||||
|
||||
@@ -828,6 +829,107 @@ use |-vv| to see the debug level logs.
|
||||
}, {
|
||||
Name: "ibm_resource_instance_id",
|
||||
Help: "IBM service instance id",
|
||||
}, {
|
||||
Name: "object_lock_mode",
|
||||
Help: `Object Lock mode to apply when uploading or copying objects.
|
||||
|
||||
Set this to apply Object Lock retention mode to objects.
|
||||
If not set, no Object Lock mode is applied (even with --metadata).
|
||||
|
||||
Note: To enable Object Lock retention, you must set BOTH object_lock_mode
|
||||
AND object_lock_retain_until_date. Setting only one has no effect.
|
||||
|
||||
- GOVERNANCE: Set Object Lock mode to GOVERNANCE
|
||||
- COMPLIANCE: Set Object Lock mode to COMPLIANCE
|
||||
- copy: Copy the mode from the source object (requires --metadata)
|
||||
|
||||
See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html`,
|
||||
Advanced: true,
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "GOVERNANCE",
|
||||
Help: "Set Object Lock mode to GOVERNANCE",
|
||||
}, {
|
||||
Value: "COMPLIANCE",
|
||||
Help: "Set Object Lock mode to COMPLIANCE",
|
||||
}, {
|
||||
Value: "copy",
|
||||
Help: "Copy from source object (requires --metadata)",
|
||||
}},
|
||||
}, {
|
||||
Name: "object_lock_retain_until_date",
|
||||
Help: `Object Lock retention until date to apply when uploading or copying objects.
|
||||
|
||||
Set this to apply Object Lock retention date to objects.
|
||||
If not set, no retention date is applied (even with --metadata).
|
||||
|
||||
Note: To enable Object Lock retention, you must set BOTH object_lock_mode
|
||||
AND object_lock_retain_until_date. Setting only one has no effect.
|
||||
|
||||
Accepts:
|
||||
- RFC 3339 format: 2030-01-02T15:04:05Z
|
||||
- Duration from now: 365d, 1y, 6M (days, years, months)
|
||||
- copy: Copy the date from the source object (requires --metadata)
|
||||
|
||||
See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html`,
|
||||
Advanced: true,
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "copy",
|
||||
Help: "Copy from source object (requires --metadata)",
|
||||
}, {
|
||||
Value: "2030-01-01T00:00:00Z",
|
||||
Help: "Set specific date (RFC 3339 format)",
|
||||
}, {
|
||||
Value: "365d",
|
||||
Help: "Set retention for 365 days from now",
|
||||
}, {
|
||||
Value: "1y",
|
||||
Help: "Set retention for 1 year from now",
|
||||
}},
|
||||
}, {
|
||||
Name: "object_lock_legal_hold_status",
|
||||
Help: `Object Lock legal hold status to apply when uploading or copying objects.
|
||||
|
||||
Set this to apply Object Lock legal hold to objects.
|
||||
If not set, no legal hold is applied (even with --metadata).
|
||||
|
||||
Note: Legal hold is independent of retention and can be set separately.
|
||||
|
||||
- ON: Enable legal hold
|
||||
- OFF: Disable legal hold
|
||||
- copy: Copy the legal hold status from the source object (requires --metadata)
|
||||
|
||||
See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html`,
|
||||
Advanced: true,
|
||||
Examples: []fs.OptionExample{{
|
||||
Value: "ON",
|
||||
Help: "Enable legal hold",
|
||||
}, {
|
||||
Value: "OFF",
|
||||
Help: "Disable legal hold",
|
||||
}, {
|
||||
Value: "copy",
|
||||
Help: "Copy from source object (requires --metadata)",
|
||||
}},
|
||||
}, {
|
||||
Name: "bypass_governance_retention",
|
||||
Help: `Allow deleting or modifying objects locked with GOVERNANCE mode.`,
|
||||
Default: false,
|
||||
Advanced: true,
|
||||
}, {
|
||||
Name: "bucket_object_lock_enabled",
|
||||
Help: `Enable Object Lock when creating new buckets.`,
|
||||
Default: false,
|
||||
}, {
|
||||
Name: "object_lock_set_after_upload",
|
||||
Help: `Set Object Lock via separate API calls after upload.
|
||||
|
||||
Use this for S3-compatible providers that don't support setting Object Lock
|
||||
headers during PUT operations. When enabled, Object Lock is set via separate
|
||||
PutObjectRetention and PutObjectLegalHold API calls after the upload completes.
|
||||
|
||||
This adds extra API calls per object, so only enable if your provider requires it.`,
|
||||
Default: false,
|
||||
Advanced: true,
|
||||
},
|
||||
}}))
|
||||
}
|
||||
@@ -922,6 +1024,21 @@ var systemMetadataInfo = map[string]fs.MetadataHelp{
|
||||
Example: "2006-01-02T15:04:05.999999999Z07:00",
|
||||
ReadOnly: true,
|
||||
},
|
||||
"object-lock-mode": {
|
||||
Help: "Object Lock mode: GOVERNANCE or COMPLIANCE",
|
||||
Type: "string",
|
||||
Example: "GOVERNANCE",
|
||||
},
|
||||
"object-lock-retain-until-date": {
|
||||
Help: "Object Lock retention until date",
|
||||
Type: "RFC 3339",
|
||||
Example: "2030-01-02T15:04:05Z",
|
||||
},
|
||||
"object-lock-legal-hold-status": {
|
||||
Help: "Object Lock legal hold status: ON or OFF",
|
||||
Type: "string",
|
||||
Example: "OFF",
|
||||
},
|
||||
}
|
||||
|
||||
// Options defines the configuration for this backend
|
||||
@@ -992,6 +1109,12 @@ type Options struct {
|
||||
IBMInstanceID string `config:"ibm_resource_instance_id"`
|
||||
UseXID fs.Tristate `config:"use_x_id"`
|
||||
SignAcceptEncoding fs.Tristate `config:"sign_accept_encoding"`
|
||||
ObjectLockMode string `config:"object_lock_mode"`
|
||||
ObjectLockRetainUntilDate string `config:"object_lock_retain_until_date"`
|
||||
ObjectLockLegalHoldStatus string `config:"object_lock_legal_hold_status"`
|
||||
BypassGovernanceRetention bool `config:"bypass_governance_retention"`
|
||||
BucketObjectLockEnabled bool `config:"bucket_object_lock_enabled"`
|
||||
ObjectLockSetAfterUpload bool `config:"object_lock_set_after_upload"`
|
||||
}
|
||||
|
||||
// Fs represents a remote s3 server
|
||||
@@ -1036,6 +1159,11 @@ type Object struct {
|
||||
contentDisposition *string // Content-Disposition: header
|
||||
contentEncoding *string // Content-Encoding: header
|
||||
contentLanguage *string // Content-Language: header
|
||||
|
||||
// Object Lock metadata
|
||||
objectLockMode *string // Object Lock mode: GOVERNANCE or COMPLIANCE
|
||||
objectLockRetainUntilDate *time.Time // Object Lock retention until date
|
||||
objectLockLegalHoldStatus *string // Object Lock legal hold: ON or OFF
|
||||
}
|
||||
|
||||
// safely dereference the pointer, returning a zero T if nil
|
||||
@@ -1056,6 +1184,21 @@ func getHTTPStatusCode(err error) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
// parseRetainUntilDate parses a retain until date from a string.
|
||||
// It accepts RFC 3339 format or duration strings like "365d", "1y", "6m".
|
||||
func parseRetainUntilDate(s string) (time.Time, error) {
|
||||
// First try RFC 3339 format
|
||||
if t, err := time.Parse(time.RFC3339, s); err == nil {
|
||||
return t, nil
|
||||
}
|
||||
// Try as a duration from now
|
||||
d, err := fs.ParseDuration(s)
|
||||
if err != nil {
|
||||
return time.Time{}, fmt.Errorf("can't parse %q as RFC 3339 date or duration: %w", s, err)
|
||||
}
|
||||
return time.Now().Add(d), nil
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
// Name of the remote (as passed into NewFs)
|
||||
@@ -1664,6 +1807,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
// MD5 digest of their object data.
|
||||
f.etagIsNotMD5 = true
|
||||
}
|
||||
if provider.Quirks.EtagIsNotMD5 != nil && *provider.Quirks.EtagIsNotMD5 {
|
||||
// Provider always returns ETags that are not MD5 (e.g., mandatory encryption)
|
||||
f.etagIsNotMD5 = true
|
||||
}
|
||||
if opt.DirectoryBucket {
|
||||
// Objects uploaded to directory buckets appear to have random ETags
|
||||
//
|
||||
@@ -1688,12 +1835,11 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
if opt.Provider == "AWS" {
|
||||
f.features.DoubleSlash = true
|
||||
}
|
||||
if opt.Provider == "Rabata" {
|
||||
if opt.Provider == "Fastly" {
|
||||
f.features.Copy = nil
|
||||
}
|
||||
if opt.Provider == "TencentCOS" && strings.Contains(opt.Endpoint, "cos.accelerate.myqcloud.com") {
|
||||
// Global Acceleration endpoint does not support bucket creation.
|
||||
f.opt.NoCheckBucket = true
|
||||
if opt.Provider == "Rabata" {
|
||||
f.features.Copy = nil
|
||||
}
|
||||
if opt.DirectoryMarkers {
|
||||
f.features.CanHaveEmptyDirectories = true
|
||||
@@ -2173,11 +2319,9 @@ func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error {
|
||||
opt.directory += "/"
|
||||
}
|
||||
}
|
||||
// Use nil delimiter for recursive listings to omit the parameter
|
||||
// entirely. Some S3-compatible servers reject an empty delimiter.
|
||||
var delimiter *string
|
||||
delimiter := ""
|
||||
if !opt.recurse {
|
||||
delimiter = aws.String("/")
|
||||
delimiter = "/"
|
||||
}
|
||||
// URL encode the listings so we can use control characters in object names
|
||||
// See: https://github.com/aws/aws-sdk-go/issues/1914
|
||||
@@ -2197,7 +2341,7 @@ func (f *Fs) list(ctx context.Context, opt listOpt, fn listFn) error {
|
||||
urlEncodeListings := f.opt.ListURLEncode.Value
|
||||
req := s3.ListObjectsV2Input{
|
||||
Bucket: &opt.bucket,
|
||||
Delimiter: delimiter,
|
||||
Delimiter: &delimiter,
|
||||
Prefix: &opt.directory,
|
||||
MaxKeys: &f.opt.ListChunk,
|
||||
}
|
||||
@@ -2648,8 +2792,9 @@ func (f *Fs) makeBucket(ctx context.Context, bucket string) error {
|
||||
}
|
||||
return f.cache.Create(bucket, func() error {
|
||||
req := s3.CreateBucketInput{
|
||||
Bucket: &bucket,
|
||||
ACL: types.BucketCannedACL(f.opt.BucketACL),
|
||||
Bucket: &bucket,
|
||||
ACL: types.BucketCannedACL(f.opt.BucketACL),
|
||||
ObjectLockEnabledForBucket: &f.opt.BucketObjectLockEnabled,
|
||||
}
|
||||
if f.opt.LocationConstraint != "" {
|
||||
req.CreateBucketConfiguration = &types.CreateBucketConfiguration{
|
||||
@@ -2768,6 +2913,24 @@ func (f *Fs) copy(ctx context.Context, req *s3.CopyObjectInput, dstBucket, dstPa
|
||||
req.StorageClass = types.StorageClass(f.opt.StorageClass)
|
||||
}
|
||||
|
||||
// Apply Object Lock options via headers (unless ObjectLockSetAfterUpload is set)
|
||||
// "copy" means: keep the value from source (passed via req from prepareUpload/setFrom functions)
|
||||
if !f.opt.ObjectLockSetAfterUpload {
|
||||
if f.opt.ObjectLockMode != "" && !strings.EqualFold(f.opt.ObjectLockMode, "copy") {
|
||||
req.ObjectLockMode = types.ObjectLockMode(strings.ToUpper(f.opt.ObjectLockMode))
|
||||
}
|
||||
if f.opt.ObjectLockRetainUntilDate != "" && !strings.EqualFold(f.opt.ObjectLockRetainUntilDate, "copy") {
|
||||
retainDate, err := parseRetainUntilDate(f.opt.ObjectLockRetainUntilDate)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid object_lock_retain_until_date: %w", err)
|
||||
}
|
||||
req.ObjectLockRetainUntilDate = &retainDate
|
||||
}
|
||||
if f.opt.ObjectLockLegalHoldStatus != "" && !strings.EqualFold(f.opt.ObjectLockLegalHoldStatus, "copy") {
|
||||
req.ObjectLockLegalHoldStatus = types.ObjectLockLegalHoldStatus(strings.ToUpper(f.opt.ObjectLockLegalHoldStatus))
|
||||
}
|
||||
}
|
||||
|
||||
if src.bytes >= int64(f.opt.CopyCutoff) {
|
||||
return f.copyMultipart(ctx, req, dstBucket, dstPath, srcBucket, srcPath, src)
|
||||
}
|
||||
@@ -2844,6 +3007,8 @@ func (f *Fs) copyMultipart(ctx context.Context, copyReq *s3.CopyObjectInput, dst
|
||||
numParts := (srcSize-1)/partSize + 1
|
||||
|
||||
fs.Debugf(src, "Starting multipart copy with %d parts", numParts)
|
||||
account := transferaccounter.Get(ctx)
|
||||
account.Start()
|
||||
|
||||
var (
|
||||
parts = make([]types.CompletedPart, numParts)
|
||||
@@ -2878,6 +3043,11 @@ func (f *Fs) copyMultipart(ctx context.Context, copyReq *s3.CopyObjectInput, dst
|
||||
PartNumber: &partNum,
|
||||
ETag: uout.CopyPartResult.ETag,
|
||||
}
|
||||
copied := partSize
|
||||
if int64(partNum) == numParts {
|
||||
copied = srcSize - (numParts-1)*partSize
|
||||
}
|
||||
account.Add(copied)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -2950,7 +3120,15 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
|
||||
}
|
||||
|
||||
setFrom_s3CopyObjectInput_s3PutObjectInput(&req, ui.req)
|
||||
if ci.Metadata {
|
||||
// Use REPLACE directive if metadata is being modified, otherwise S3 ignores our values
|
||||
// This is needed when:
|
||||
// 1. --metadata flag is set
|
||||
// 2. Any Object Lock option is set (to override or explicitly copy)
|
||||
needsReplace := ci.Metadata ||
|
||||
f.opt.ObjectLockMode != "" ||
|
||||
f.opt.ObjectLockRetainUntilDate != "" ||
|
||||
f.opt.ObjectLockLegalHoldStatus != ""
|
||||
if needsReplace {
|
||||
req.MetadataDirective = types.MetadataDirectiveReplace
|
||||
}
|
||||
|
||||
@@ -2958,7 +3136,21 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return f.NewObject(ctx, remote)
|
||||
dstObj, err := f.NewObject(ctx, remote)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Set Object Lock via separate API calls if requested
|
||||
if f.opt.ObjectLockSetAfterUpload {
|
||||
if dstObject, ok := dstObj.(*Object); ok {
|
||||
if err := dstObject.setObjectLockAfterUpload(ctx, srcObj); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dstObj, nil
|
||||
}
|
||||
|
||||
// Hashes returns the supported hash sets.
|
||||
@@ -3837,6 +4029,19 @@ func (o *Object) setMetaData(resp *s3.HeadObjectOutput) {
|
||||
o.contentEncoding = stringClonePointer(removeAWSChunked(resp.ContentEncoding))
|
||||
o.contentLanguage = stringClonePointer(resp.ContentLanguage)
|
||||
|
||||
// Set Object Lock metadata
|
||||
if resp.ObjectLockMode != "" {
|
||||
mode := string(resp.ObjectLockMode)
|
||||
o.objectLockMode = &mode
|
||||
}
|
||||
if resp.ObjectLockRetainUntilDate != nil {
|
||||
o.objectLockRetainUntilDate = resp.ObjectLockRetainUntilDate
|
||||
}
|
||||
if resp.ObjectLockLegalHoldStatus != "" {
|
||||
status := string(resp.ObjectLockLegalHoldStatus)
|
||||
o.objectLockLegalHoldStatus = &status
|
||||
}
|
||||
|
||||
// If decompressing then size and md5sum are unknown
|
||||
if o.fs.opt.Decompress && deref(o.contentEncoding) == "gzip" {
|
||||
o.bytes = -1
|
||||
@@ -4555,6 +4760,26 @@ func (o *Object) prepareUpload(ctx context.Context, src fs.ObjectInfo, options [
|
||||
case "btime":
|
||||
// write as metadata since we can't set it
|
||||
ui.req.Metadata[k] = v
|
||||
case "object-lock-mode":
|
||||
// Only apply if option is set to "copy" and not using after-upload API
|
||||
if strings.EqualFold(o.fs.opt.ObjectLockMode, "copy") && !o.fs.opt.ObjectLockSetAfterUpload {
|
||||
ui.req.ObjectLockMode = types.ObjectLockMode(v)
|
||||
}
|
||||
case "object-lock-retain-until-date":
|
||||
// Only apply if option is set to "copy" and not using after-upload API
|
||||
if strings.EqualFold(o.fs.opt.ObjectLockRetainUntilDate, "copy") && !o.fs.opt.ObjectLockSetAfterUpload {
|
||||
retainDate, err := time.Parse(time.RFC3339, v)
|
||||
if err != nil {
|
||||
fs.Debugf(o, "failed to parse object-lock-retain-until-date %q: %v", v, err)
|
||||
} else {
|
||||
ui.req.ObjectLockRetainUntilDate = &retainDate
|
||||
}
|
||||
}
|
||||
case "object-lock-legal-hold-status":
|
||||
// Only apply if option is set to "copy" and not using after-upload API
|
||||
if strings.EqualFold(o.fs.opt.ObjectLockLegalHoldStatus, "copy") && !o.fs.opt.ObjectLockSetAfterUpload {
|
||||
ui.req.ObjectLockLegalHoldStatus = types.ObjectLockLegalHoldStatus(v)
|
||||
}
|
||||
default:
|
||||
ui.req.Metadata[k] = v
|
||||
}
|
||||
@@ -4620,6 +4845,25 @@ func (o *Object) prepareUpload(ctx context.Context, src fs.ObjectInfo, options [
|
||||
if o.fs.opt.StorageClass != "" {
|
||||
ui.req.StorageClass = types.StorageClass(o.fs.opt.StorageClass)
|
||||
}
|
||||
|
||||
// Apply Object Lock options via headers (unless ObjectLockSetAfterUpload is set)
|
||||
// "copy" means: keep the value from metadata (already applied above in the switch)
|
||||
if !o.fs.opt.ObjectLockSetAfterUpload {
|
||||
if o.fs.opt.ObjectLockMode != "" && !strings.EqualFold(o.fs.opt.ObjectLockMode, "copy") {
|
||||
ui.req.ObjectLockMode = types.ObjectLockMode(strings.ToUpper(o.fs.opt.ObjectLockMode))
|
||||
}
|
||||
if o.fs.opt.ObjectLockRetainUntilDate != "" && !strings.EqualFold(o.fs.opt.ObjectLockRetainUntilDate, "copy") {
|
||||
retainDate, err := parseRetainUntilDate(o.fs.opt.ObjectLockRetainUntilDate)
|
||||
if err != nil {
|
||||
return ui, fmt.Errorf("invalid object_lock_retain_until_date %q: %w", o.fs.opt.ObjectLockRetainUntilDate, err)
|
||||
}
|
||||
ui.req.ObjectLockRetainUntilDate = &retainDate
|
||||
}
|
||||
if o.fs.opt.ObjectLockLegalHoldStatus != "" && !strings.EqualFold(o.fs.opt.ObjectLockLegalHoldStatus, "copy") {
|
||||
ui.req.ObjectLockLegalHoldStatus = types.ObjectLockLegalHoldStatus(strings.ToUpper(o.fs.opt.ObjectLockLegalHoldStatus))
|
||||
}
|
||||
}
|
||||
|
||||
// Apply upload options
|
||||
for _, option := range options {
|
||||
key, value := option.Header()
|
||||
@@ -4743,6 +4987,14 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||
}
|
||||
fs.Debugf(o, "Multipart upload Etag: %s OK", wantETag)
|
||||
}
|
||||
|
||||
// Set Object Lock via separate API calls if requested
|
||||
if o.fs.opt.ObjectLockSetAfterUpload {
|
||||
if err := o.setObjectLockAfterUpload(ctx, src); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -4760,6 +5012,9 @@ func (o *Object) Remove(ctx context.Context) error {
|
||||
if o.fs.opt.RequesterPays {
|
||||
req.RequestPayer = types.RequestPayerRequester
|
||||
}
|
||||
if o.fs.opt.BypassGovernanceRetention {
|
||||
req.BypassGovernanceRetention = &o.fs.opt.BypassGovernanceRetention
|
||||
}
|
||||
err := o.fs.pacer.Call(func() (bool, error) {
|
||||
_, err := o.fs.c.DeleteObject(ctx, &req)
|
||||
return o.fs.shouldRetry(ctx, err)
|
||||
@@ -4767,6 +5022,120 @@ func (o *Object) Remove(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// setObjectRetention sets Object Lock retention on an object via PutObjectRetention API
|
||||
//
|
||||
// Note: We use smithyhttp.AddContentChecksumMiddleware to ensure Content-MD5 is
|
||||
// calculated for the request body. The AWS SDK v2 switched from MD5 to CRC32 as
|
||||
// the default checksum algorithm, but some S3-compatible providers (e.g. MinIO)
|
||||
// still require Content-MD5 for PutObjectRetention requests.
|
||||
// See: https://github.com/aws/aws-sdk-go-v2/discussions/2960
|
||||
func (o *Object) setObjectRetention(ctx context.Context, mode types.ObjectLockRetentionMode, retainUntilDate time.Time) error {
|
||||
bucket, bucketPath := o.split()
|
||||
req := s3.PutObjectRetentionInput{
|
||||
Bucket: &bucket,
|
||||
Key: &bucketPath,
|
||||
VersionId: o.versionID,
|
||||
Retention: &types.ObjectLockRetention{
|
||||
Mode: mode,
|
||||
RetainUntilDate: &retainUntilDate,
|
||||
},
|
||||
}
|
||||
if o.fs.opt.RequesterPays {
|
||||
req.RequestPayer = types.RequestPayerRequester
|
||||
}
|
||||
if o.fs.opt.BypassGovernanceRetention {
|
||||
req.BypassGovernanceRetention = &o.fs.opt.BypassGovernanceRetention
|
||||
}
|
||||
return o.fs.pacer.Call(func() (bool, error) {
|
||||
_, err := o.fs.c.PutObjectRetention(ctx, &req,
|
||||
s3.WithAPIOptions(smithyhttp.AddContentChecksumMiddleware))
|
||||
return o.fs.shouldRetry(ctx, err)
|
||||
})
|
||||
}
|
||||
|
||||
// setObjectLegalHold sets Object Lock legal hold on an object via PutObjectLegalHold API
|
||||
//
|
||||
// Note: We use smithyhttp.AddContentChecksumMiddleware to ensure Content-MD5 is
|
||||
// calculated for the request body. The AWS SDK v2 switched from MD5 to CRC32 as
|
||||
// the default checksum algorithm, but some S3-compatible providers (e.g. MinIO)
|
||||
// still require Content-MD5 for PutObjectLegalHold requests.
|
||||
// See: https://github.com/aws/aws-sdk-go-v2/discussions/2960
|
||||
func (o *Object) setObjectLegalHold(ctx context.Context, status types.ObjectLockLegalHoldStatus) error {
|
||||
bucket, bucketPath := o.split()
|
||||
req := s3.PutObjectLegalHoldInput{
|
||||
Bucket: &bucket,
|
||||
Key: &bucketPath,
|
||||
VersionId: o.versionID,
|
||||
LegalHold: &types.ObjectLockLegalHold{
|
||||
Status: status,
|
||||
},
|
||||
}
|
||||
if o.fs.opt.RequesterPays {
|
||||
req.RequestPayer = types.RequestPayerRequester
|
||||
}
|
||||
return o.fs.pacer.Call(func() (bool, error) {
|
||||
_, err := o.fs.c.PutObjectLegalHold(ctx, &req,
|
||||
s3.WithAPIOptions(smithyhttp.AddContentChecksumMiddleware))
|
||||
return o.fs.shouldRetry(ctx, err)
|
||||
})
|
||||
}
|
||||
|
||||
// setObjectLockAfterUpload sets Object Lock via separate API calls after upload
|
||||
// This is for S3 providers that don't support Object Lock headers during PUT
|
||||
func (o *Object) setObjectLockAfterUpload(ctx context.Context, src fs.ObjectInfo) error {
|
||||
// Determine the mode
|
||||
var mode types.ObjectLockRetentionMode
|
||||
modeOpt := o.fs.opt.ObjectLockMode
|
||||
if strings.EqualFold(modeOpt, "copy") {
|
||||
if srcObj, ok := src.(*Object); ok && srcObj.objectLockMode != nil {
|
||||
mode = types.ObjectLockRetentionMode(*srcObj.objectLockMode)
|
||||
}
|
||||
} else if modeOpt != "" {
|
||||
mode = types.ObjectLockRetentionMode(strings.ToUpper(modeOpt))
|
||||
}
|
||||
|
||||
// Determine the retain until date
|
||||
var retainUntilDate time.Time
|
||||
dateOpt := o.fs.opt.ObjectLockRetainUntilDate
|
||||
if strings.EqualFold(dateOpt, "copy") {
|
||||
if srcObj, ok := src.(*Object); ok && srcObj.objectLockRetainUntilDate != nil {
|
||||
retainUntilDate = *srcObj.objectLockRetainUntilDate
|
||||
}
|
||||
} else if dateOpt != "" {
|
||||
var err error
|
||||
retainUntilDate, err = parseRetainUntilDate(dateOpt)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid object_lock_retain_until_date %q: %w", dateOpt, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Set retention if both mode and date are set
|
||||
if mode != "" && !retainUntilDate.IsZero() {
|
||||
if err := o.setObjectRetention(ctx, mode, retainUntilDate); err != nil {
|
||||
return fmt.Errorf("failed to set object retention: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Determine and set legal hold
|
||||
var legalHold types.ObjectLockLegalHoldStatus
|
||||
legalHoldOpt := o.fs.opt.ObjectLockLegalHoldStatus
|
||||
if strings.EqualFold(legalHoldOpt, "copy") {
|
||||
if srcObj, ok := src.(*Object); ok && srcObj.objectLockLegalHoldStatus != nil {
|
||||
legalHold = types.ObjectLockLegalHoldStatus(*srcObj.objectLockLegalHoldStatus)
|
||||
}
|
||||
} else if legalHoldOpt != "" {
|
||||
legalHold = types.ObjectLockLegalHoldStatus(strings.ToUpper(legalHoldOpt))
|
||||
}
|
||||
|
||||
if legalHold != "" {
|
||||
if err := o.setObjectLegalHold(ctx, legalHold); err != nil {
|
||||
return fmt.Errorf("failed to set legal hold: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MimeType of an Object if known, "" otherwise
|
||||
func (o *Object) MimeType(ctx context.Context) string {
|
||||
err := o.readMetaData(ctx)
|
||||
@@ -4810,7 +5179,7 @@ func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
metadata = make(fs.Metadata, len(o.meta)+7)
|
||||
metadata = make(fs.Metadata, len(o.meta)+10)
|
||||
for k, v := range o.meta {
|
||||
switch k {
|
||||
case metaMtime:
|
||||
@@ -4845,6 +5214,15 @@ func (o *Object) Metadata(ctx context.Context) (metadata fs.Metadata, err error)
|
||||
setMetadata("content-disposition", o.contentDisposition)
|
||||
setMetadata("content-encoding", o.contentEncoding)
|
||||
setMetadata("content-language", o.contentLanguage)
|
||||
|
||||
// Set Object Lock metadata
|
||||
setMetadata("object-lock-mode", o.objectLockMode)
|
||||
if o.objectLockRetainUntilDate != nil {
|
||||
formatted := o.objectLockRetainUntilDate.Format(time.RFC3339)
|
||||
setMetadata("object-lock-retain-until-date", &formatted)
|
||||
}
|
||||
setMetadata("object-lock-legal-hold-status", o.objectLockLegalHoldStatus)
|
||||
|
||||
metadata["tier"] = o.GetTier()
|
||||
|
||||
return metadata, nil
|
||||
|
||||
@@ -498,10 +498,236 @@ func (f *Fs) InternalTestVersions(t *testing.T) {
|
||||
// Purge gets tested later
|
||||
}
|
||||
|
||||
func (f *Fs) InternalTestObjectLock(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
// Create a temporary bucket with Object Lock enabled to test on.
|
||||
// This exercises our BucketObjectLockEnabled option and isolates
|
||||
// the test from the main test bucket.
|
||||
lockBucket := f.rootBucket + "-object-lock-" + random.String(8)
|
||||
lockBucket = strings.ToLower(lockBucket)
|
||||
|
||||
// Try to create bucket with Object Lock enabled
|
||||
objectLockEnabled := true
|
||||
req := s3.CreateBucketInput{
|
||||
Bucket: &lockBucket,
|
||||
ACL: types.BucketCannedACL(f.opt.BucketACL),
|
||||
ObjectLockEnabledForBucket: &objectLockEnabled,
|
||||
}
|
||||
if f.opt.LocationConstraint != "" {
|
||||
req.CreateBucketConfiguration = &types.CreateBucketConfiguration{
|
||||
LocationConstraint: types.BucketLocationConstraint(f.opt.LocationConstraint),
|
||||
}
|
||||
}
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
_, err := f.c.CreateBucket(ctx, &req)
|
||||
return f.shouldRetry(ctx, err)
|
||||
})
|
||||
if err != nil {
|
||||
t.Skipf("Object Lock not supported by this provider: CreateBucket with Object Lock failed: %v", err)
|
||||
}
|
||||
|
||||
// Verify Object Lock is actually enabled on the new bucket.
|
||||
// Some S3-compatible servers (e.g. rclone serve s3) accept the
|
||||
// ObjectLockEnabledForBucket flag but don't actually implement Object Lock.
|
||||
var lockCfg *s3.GetObjectLockConfigurationOutput
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
var err error
|
||||
lockCfg, err = f.c.GetObjectLockConfiguration(ctx, &s3.GetObjectLockConfigurationInput{
|
||||
Bucket: &lockBucket,
|
||||
})
|
||||
return f.shouldRetry(ctx, err)
|
||||
})
|
||||
if err != nil || lockCfg.ObjectLockConfiguration == nil ||
|
||||
lockCfg.ObjectLockConfiguration.ObjectLockEnabled != types.ObjectLockEnabledEnabled {
|
||||
_ = f.pacer.Call(func() (bool, error) {
|
||||
_, err := f.c.DeleteBucket(ctx, &s3.DeleteBucketInput{Bucket: &lockBucket})
|
||||
return f.shouldRetry(ctx, err)
|
||||
})
|
||||
t.Skipf("Object Lock not functional on this provider (GetObjectLockConfiguration: %v)", err)
|
||||
}
|
||||
|
||||
// Switch f to use the Object Lock bucket for this test
|
||||
oldBucket := f.rootBucket
|
||||
oldRoot := f.root
|
||||
oldRootDir := f.rootDirectory
|
||||
f.rootBucket = lockBucket
|
||||
f.root = lockBucket
|
||||
f.rootDirectory = ""
|
||||
defer func() {
|
||||
f.rootBucket = oldBucket
|
||||
f.root = oldRoot
|
||||
f.rootDirectory = oldRootDir
|
||||
}()
|
||||
|
||||
// Helper to remove an object with Object Lock protection
|
||||
removeLocked := func(t *testing.T, obj fs.Object) {
|
||||
t.Helper()
|
||||
o := obj.(*Object)
|
||||
// Remove legal hold if present
|
||||
_ = o.setObjectLegalHold(ctx, types.ObjectLockLegalHoldStatusOff)
|
||||
// Enable bypass governance retention for deletion
|
||||
o.fs.opt.BypassGovernanceRetention = true
|
||||
err := obj.Remove(ctx)
|
||||
o.fs.opt.BypassGovernanceRetention = false
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
// Clean up the temporary bucket after all sub-tests
|
||||
defer func() {
|
||||
// List and remove all object versions
|
||||
var objectVersions []types.ObjectIdentifier
|
||||
listReq := &s3.ListObjectVersionsInput{Bucket: &lockBucket}
|
||||
for {
|
||||
var resp *s3.ListObjectVersionsOutput
|
||||
err := f.pacer.Call(func() (bool, error) {
|
||||
var err error
|
||||
resp, err = f.c.ListObjectVersions(ctx, listReq)
|
||||
return f.shouldRetry(ctx, err)
|
||||
})
|
||||
if err != nil {
|
||||
t.Logf("Failed to list object versions for cleanup: %v", err)
|
||||
break
|
||||
}
|
||||
for _, v := range resp.Versions {
|
||||
objectVersions = append(objectVersions, types.ObjectIdentifier{
|
||||
Key: v.Key,
|
||||
VersionId: v.VersionId,
|
||||
})
|
||||
}
|
||||
for _, m := range resp.DeleteMarkers {
|
||||
objectVersions = append(objectVersions, types.ObjectIdentifier{
|
||||
Key: m.Key,
|
||||
VersionId: m.VersionId,
|
||||
})
|
||||
}
|
||||
if !aws.ToBool(resp.IsTruncated) {
|
||||
break
|
||||
}
|
||||
listReq.KeyMarker = resp.NextKeyMarker
|
||||
listReq.VersionIdMarker = resp.NextVersionIdMarker
|
||||
}
|
||||
if len(objectVersions) > 0 {
|
||||
bypass := true
|
||||
_ = f.pacer.Call(func() (bool, error) {
|
||||
_, err := f.c.DeleteObjects(ctx, &s3.DeleteObjectsInput{
|
||||
Bucket: &lockBucket,
|
||||
BypassGovernanceRetention: &bypass,
|
||||
Delete: &types.Delete{
|
||||
Objects: objectVersions,
|
||||
Quiet: aws.Bool(true),
|
||||
},
|
||||
})
|
||||
return f.shouldRetry(ctx, err)
|
||||
})
|
||||
}
|
||||
_ = f.pacer.Call(func() (bool, error) {
|
||||
_, err := f.c.DeleteBucket(ctx, &s3.DeleteBucketInput{Bucket: &lockBucket})
|
||||
return f.shouldRetry(ctx, err)
|
||||
})
|
||||
}()
|
||||
|
||||
retainUntilDate := time.Now().UTC().Add(24 * time.Hour).Truncate(time.Second)
|
||||
|
||||
t.Run("Retention", func(t *testing.T) {
|
||||
// Set Object Lock options for this test
|
||||
f.opt.ObjectLockMode = "GOVERNANCE"
|
||||
f.opt.ObjectLockRetainUntilDate = retainUntilDate.Format(time.RFC3339)
|
||||
defer func() {
|
||||
f.opt.ObjectLockMode = ""
|
||||
f.opt.ObjectLockRetainUntilDate = ""
|
||||
}()
|
||||
|
||||
// Upload an object with Object Lock retention
|
||||
contents := random.String(100)
|
||||
item := fstest.NewItem("test-object-lock-retention", contents, fstest.Time("2001-05-06T04:05:06.499999999Z"))
|
||||
obj := fstests.PutTestContents(ctx, t, f, &item, contents, true)
|
||||
defer func() {
|
||||
removeLocked(t, obj)
|
||||
}()
|
||||
|
||||
// Read back metadata and verify Object Lock settings
|
||||
o := obj.(*Object)
|
||||
gotMetadata, err := o.Metadata(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "GOVERNANCE", gotMetadata["object-lock-mode"])
|
||||
gotRetainDate, err := time.Parse(time.RFC3339, gotMetadata["object-lock-retain-until-date"])
|
||||
require.NoError(t, err)
|
||||
assert.WithinDuration(t, retainUntilDate, gotRetainDate, time.Second)
|
||||
})
|
||||
|
||||
t.Run("LegalHold", func(t *testing.T) {
|
||||
// Set Object Lock legal hold option
|
||||
f.opt.ObjectLockLegalHoldStatus = "ON"
|
||||
defer func() {
|
||||
f.opt.ObjectLockLegalHoldStatus = ""
|
||||
}()
|
||||
|
||||
// Upload an object with legal hold
|
||||
contents := random.String(100)
|
||||
item := fstest.NewItem("test-object-lock-legal-hold", contents, fstest.Time("2001-05-06T04:05:06.499999999Z"))
|
||||
obj := fstests.PutTestContents(ctx, t, f, &item, contents, true)
|
||||
defer func() {
|
||||
removeLocked(t, obj)
|
||||
}()
|
||||
|
||||
// Verify legal hold is ON
|
||||
o := obj.(*Object)
|
||||
gotMetadata, err := o.Metadata(ctx)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "ON", gotMetadata["object-lock-legal-hold-status"])
|
||||
|
||||
// Set legal hold to OFF
|
||||
err = o.setObjectLegalHold(ctx, types.ObjectLockLegalHoldStatusOff)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Clear cached metadata and re-read
|
||||
o.meta = nil
|
||||
gotMetadata, err = o.Metadata(ctx)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "OFF", gotMetadata["object-lock-legal-hold-status"])
|
||||
})
|
||||
|
||||
t.Run("SetAfterUpload", func(t *testing.T) {
|
||||
// Test the post-upload API path (PutObjectRetention + PutObjectLegalHold)
|
||||
f.opt.ObjectLockSetAfterUpload = true
|
||||
f.opt.ObjectLockMode = "GOVERNANCE"
|
||||
f.opt.ObjectLockRetainUntilDate = retainUntilDate.Format(time.RFC3339)
|
||||
f.opt.ObjectLockLegalHoldStatus = "ON"
|
||||
defer func() {
|
||||
f.opt.ObjectLockSetAfterUpload = false
|
||||
f.opt.ObjectLockMode = ""
|
||||
f.opt.ObjectLockRetainUntilDate = ""
|
||||
f.opt.ObjectLockLegalHoldStatus = ""
|
||||
}()
|
||||
|
||||
// Upload an object - lock applied AFTER upload via separate API calls
|
||||
contents := random.String(100)
|
||||
item := fstest.NewItem("test-object-lock-after-upload", contents, fstest.Time("2001-05-06T04:05:06.499999999Z"))
|
||||
obj := fstests.PutTestContents(ctx, t, f, &item, contents, true)
|
||||
defer func() {
|
||||
removeLocked(t, obj)
|
||||
}()
|
||||
|
||||
// Verify all Object Lock settings were applied
|
||||
o := obj.(*Object)
|
||||
gotMetadata, err := o.Metadata(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "GOVERNANCE", gotMetadata["object-lock-mode"])
|
||||
gotRetainDate, err := time.Parse(time.RFC3339, gotMetadata["object-lock-retain-until-date"])
|
||||
require.NoError(t, err)
|
||||
assert.WithinDuration(t, retainUntilDate, gotRetainDate, time.Second)
|
||||
assert.Equal(t, "ON", gotMetadata["object-lock-legal-hold-status"])
|
||||
})
|
||||
}
|
||||
|
||||
func (f *Fs) InternalTest(t *testing.T) {
|
||||
t.Run("Metadata", f.InternalTestMetadata)
|
||||
t.Run("NoHead", f.InternalTestNoHead)
|
||||
t.Run("Versions", f.InternalTestVersions)
|
||||
t.Run("ObjectLock", f.InternalTestObjectLock)
|
||||
}
|
||||
|
||||
var _ fstests.InternalTester = (*Fs)(nil)
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/rclone/rclone/fs"
|
||||
@@ -92,3 +93,87 @@ var (
|
||||
_ fstests.SetUploadCutoffer = (*Fs)(nil)
|
||||
_ fstests.SetCopyCutoffer = (*Fs)(nil)
|
||||
)
|
||||
|
||||
func TestParseRetainUntilDate(t *testing.T) {
|
||||
now := time.Now()
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
wantErr bool
|
||||
checkFunc func(t *testing.T, result time.Time)
|
||||
}{
|
||||
{
|
||||
name: "RFC3339 date",
|
||||
input: "2030-01-15T10:30:00Z",
|
||||
wantErr: false,
|
||||
checkFunc: func(t *testing.T, result time.Time) {
|
||||
expected, _ := time.Parse(time.RFC3339, "2030-01-15T10:30:00Z")
|
||||
assert.Equal(t, expected, result)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "RFC3339 date with timezone",
|
||||
input: "2030-06-15T10:30:00+02:00",
|
||||
wantErr: false,
|
||||
checkFunc: func(t *testing.T, result time.Time) {
|
||||
expected, _ := time.Parse(time.RFC3339, "2030-06-15T10:30:00+02:00")
|
||||
assert.Equal(t, expected, result)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "duration days",
|
||||
input: "365d",
|
||||
wantErr: false,
|
||||
checkFunc: func(t *testing.T, result time.Time) {
|
||||
expected := now.Add(365 * 24 * time.Hour)
|
||||
diff := result.Sub(expected)
|
||||
assert.Less(t, diff.Abs(), 2*time.Second, "result should be ~365 days from now")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "duration hours",
|
||||
input: "24h",
|
||||
wantErr: false,
|
||||
checkFunc: func(t *testing.T, result time.Time) {
|
||||
expected := now.Add(24 * time.Hour)
|
||||
diff := result.Sub(expected)
|
||||
assert.Less(t, diff.Abs(), 2*time.Second, "result should be ~24 hours from now")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "duration minutes",
|
||||
input: "30m",
|
||||
wantErr: false,
|
||||
checkFunc: func(t *testing.T, result time.Time) {
|
||||
expected := now.Add(30 * time.Minute)
|
||||
diff := result.Sub(expected)
|
||||
assert.Less(t, diff.Abs(), 2*time.Second, "result should be ~30 minutes from now")
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "invalid input",
|
||||
input: "not-a-date",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "empty input",
|
||||
input: "",
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result, err := parseRetainUntilDate(tt.input)
|
||||
if tt.wantErr {
|
||||
require.Error(t, err)
|
||||
return
|
||||
}
|
||||
require.NoError(t, err)
|
||||
if tt.checkFunc != nil {
|
||||
tt.checkFunc(t, result)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ func (f *Fs) refreshJWTToken(ctx context.Context) (string, error) {
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("invalid token received from server")
|
||||
}
|
||||
var claims map[string]interface{}
|
||||
var claims map[string]any
|
||||
if err := json.Unmarshal(payload, &claims); err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -182,7 +182,7 @@ func (f *Fs) refreshJWTToken(ctx context.Context) (string, error) {
|
||||
return f.token, nil
|
||||
}
|
||||
|
||||
func (f *Fs) callAPI(ctx context.Context, method, path string, response interface{}) (*http.Response, error) {
|
||||
func (f *Fs) callAPI(ctx context.Context, method, path string, response any) (*http.Response, error) {
|
||||
token, err := f.refreshJWTToken(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path"
|
||||
@@ -203,9 +204,7 @@ func (s *shadeChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, read
|
||||
var uploadRes *http.Response
|
||||
if len(partURL.Headers) > 0 {
|
||||
opts.ExtraHeaders = make(map[string]string)
|
||||
for k, v := range partURL.Headers {
|
||||
opts.ExtraHeaders[k] = v
|
||||
}
|
||||
maps.Copy(opts.ExtraHeaders, partURL.Headers)
|
||||
}
|
||||
|
||||
err = s.f.pacer.Call(func() (bool, error) {
|
||||
|
||||
@@ -27,8 +27,8 @@ type Item struct {
|
||||
FileCount int32 `json:"FileCount,omitempty"`
|
||||
Name string `json:"Name,omitempty"`
|
||||
FileName string `json:"FileName,omitempty"`
|
||||
CreatedAt time.Time `json:"CreationDate,omitempty"`
|
||||
ModifiedAt time.Time `json:"ClientModifiedDate,omitempty"`
|
||||
CreatedAt time.Time `json:"CreationDate"`
|
||||
ModifiedAt time.Time `json:"ClientModifiedDate"`
|
||||
IsHidden bool `json:"IsHidden,omitempty"`
|
||||
Size int64 `json:"FileSizeBytes,omitempty"`
|
||||
Type string `json:"odata.type,omitempty"`
|
||||
|
||||
@@ -348,7 +348,7 @@ func (f *Fs) readMetaDataForPath(ctx context.Context, path string, depth string)
|
||||
ExtraHeaders: map[string]string{
|
||||
"Depth": depth,
|
||||
},
|
||||
NoRedirect: true,
|
||||
CheckRedirect: rest.PreserveMethodRedirectFn,
|
||||
}
|
||||
if f.hasOCMD5 || f.hasOCSHA1 {
|
||||
opts.Body = bytes.NewBuffer(owncloudProps)
|
||||
@@ -610,7 +610,7 @@ func (f *Fs) findHeader(headers fs.CommaSepList, find string) bool {
|
||||
|
||||
// fetch the bearer token and set it if successful
|
||||
func (f *Fs) fetchAndSetBearerToken() error {
|
||||
_, err, _ := f.authSingleflight.Do("bearerToken", func() (interface{}, error) {
|
||||
_, err, _ := f.authSingleflight.Do("bearerToken", func() (any, error) {
|
||||
if len(f.opt.BearerTokenCommand) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ type WriteMultiMetadataRequest struct {
|
||||
|
||||
// WriteMetadata is used to write item metadata
|
||||
type WriteMetadata struct {
|
||||
Attributes WriteAttributes `json:"attributes,omitempty"`
|
||||
Attributes WriteAttributes `json:"attributes"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
@@ -92,10 +92,10 @@ func TestCountWriterConcurrent(t *testing.T) {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(goroutines)
|
||||
for g := 0; g < goroutines; g++ {
|
||||
for range goroutines {
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for i := 0; i < loops; i++ {
|
||||
for range loops {
|
||||
n, err := cw.Write(data)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, chunkSize, n)
|
||||
|
||||
@@ -128,9 +128,7 @@ func (b *bisyncRun) startLockRenewal() func() {
|
||||
}
|
||||
stopLockRenewal := make(chan struct{})
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
ticker := time.NewTicker(time.Duration(b.opt.MaxLock) - time.Minute)
|
||||
for {
|
||||
select {
|
||||
@@ -141,7 +139,7 @@ func (b *bisyncRun) startLockRenewal() func() {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
return func() {
|
||||
close(stopLockRenewal)
|
||||
wg.Wait()
|
||||
|
||||
@@ -361,9 +361,7 @@ func StartStats() func() {
|
||||
}
|
||||
stopStats := make(chan struct{})
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
ticker := time.NewTicker(*statsInterval)
|
||||
for {
|
||||
select {
|
||||
@@ -374,7 +372,7 @@ func StartStats() func() {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
return func() {
|
||||
close(stopStats)
|
||||
wg.Wait()
|
||||
|
||||
@@ -108,7 +108,7 @@ func mountOptions(VFS *vfs.VFS, device string, mountpoint string, opt *mountlib.
|
||||
func waitFor(fn func() bool) (ok bool) {
|
||||
const totalWait = 10 * time.Second
|
||||
const individualWait = 10 * time.Millisecond
|
||||
for i := 0; i < int(totalWait/individualWait); i++ {
|
||||
for range int(totalWait / individualWait) {
|
||||
ok = fn()
|
||||
if ok {
|
||||
return ok
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
Rclone @ allows Linux, FreeBSD, macOS and Windows to
|
||||
mount any of Rclone's cloud storage systems as a file system with FUSE.
|
||||
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls`
|
||||
etc.
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls` etc.
|
||||
|
||||
On Linux and macOS, you can run mount in either foreground or background (aka
|
||||
daemon) mode. Mount runs in foreground mode by default. Use the `--daemon` flag
|
||||
@@ -30,8 +29,8 @@ The following examples will mount to an automatically assigned drive,
|
||||
to specific drive letter `X:`, to path `C:\path\parent\mount`
|
||||
(where parent directory or drive must exist, and mount must **not** exist,
|
||||
and is not supported when [mounting as a network drive](#mounting-modes-on-windows)),
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to
|
||||
an automatically assigned drive:
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to an
|
||||
automatically assigned drive:
|
||||
|
||||
```console
|
||||
rclone @ remote:path/to/files *
|
||||
@@ -137,8 +136,8 @@ rclone @ remote:path/to/files X: --volname \\server\share
|
||||
|
||||
You may also specify the network share UNC path as the mountpoint itself. Then rclone
|
||||
will automatically assign a drive letter, same as with `*` and use that as
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it
|
||||
were specified with the `--volname` option. This will also implicitly set
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it were
|
||||
specified with the `--volname` option. This will also implicitly set
|
||||
the `--network-mode` option. This means the following two examples have same result:
|
||||
|
||||
```console
|
||||
@@ -269,7 +268,7 @@ does not suffer from the same limitations.
|
||||
|
||||
Mounting on macOS can be done either via [built-in NFS server](/commands/rclone_serve_nfs/),
|
||||
[macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or
|
||||
[FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing
|
||||
[FUSE-T](https://www.fuse-t.org/).macFUSE is a traditional FUSE driver utilizing
|
||||
a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which
|
||||
"mounts" via an NFSv4 local server.
|
||||
|
||||
@@ -312,13 +311,13 @@ current as of FUSE-T version 1.0.14.
|
||||
|
||||
As per the [FUSE-T wiki](https://github.com/macos-fuse-t/fuse-t/wiki#caveats):
|
||||
|
||||
> File access and modification times cannot be set separately as it seems to be
|
||||
> an issue with the NFS client which always modifies both. Can be reproduced
|
||||
> with `touch -m` and `touch -a` commands
|
||||
> File access and modification times cannot be set separately as it seems to be an
|
||||
> issue with the NFS client which always modifies both. Can be reproduced with
|
||||
> 'touch -m' and 'touch -a' commands
|
||||
|
||||
This means that viewing files with various tools, notably macOS Finder, will
|
||||
cause rlcone to update the modification time of the file. This may make rclone
|
||||
upload a full new copy of the file.
|
||||
This means that viewing files with various tools, notably macOS Finder, will cause
|
||||
rlcone to update the modification time of the file. This may make rclone upload a
|
||||
full new copy of the file.
|
||||
|
||||
##### Read Only mounts
|
||||
|
||||
@@ -332,10 +331,9 @@ On newer versions of Ubuntu, you may encounter the following error when running
|
||||
|
||||
> NOTICE: mount helper error: fusermount3: mount failed: Permission denied
|
||||
> CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
|
||||
|
||||
This may be due to newer [Apparmor](https://wiki.ubuntu.com/AppArmor) restrictions,
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need
|
||||
to `sudo apt install apparmor-utils` beforehand).
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need to
|
||||
`sudo apt install apparmor-utils` beforehand).
|
||||
|
||||
### Limitations
|
||||
|
||||
|
||||
@@ -41,9 +41,7 @@ func startProgress() func() {
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
progressInterval := defaultProgressInterval
|
||||
if ShowStats() && *statsInterval > 0 {
|
||||
progressInterval = *statsInterval
|
||||
@@ -65,7 +63,7 @@ func startProgress() func() {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
return func() {
|
||||
close(stopStats)
|
||||
wg.Wait()
|
||||
|
||||
|
After Width: | Height: | Size: 704 B |
@@ -3,6 +3,7 @@ package http
|
||||
|
||||
import (
|
||||
"context"
|
||||
_ "embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -57,6 +58,9 @@ var DefaultOpt = Options{
|
||||
// Opt is options set by command line flags
|
||||
var Opt = DefaultOpt
|
||||
|
||||
//go:embed favicon.png
|
||||
var faviconData []byte
|
||||
|
||||
func init() {
|
||||
fs.RegisterGlobalOptions(fs.OptionsInfo{Name: "http", Opt: &Opt, Options: OptionsInfo})
|
||||
}
|
||||
@@ -198,9 +202,11 @@ func newServer(ctx context.Context, f fs.Fs, opt *Options, vfsOpt *vfscommon.Opt
|
||||
|
||||
router := s.server.Router()
|
||||
router.Use(
|
||||
middleware.Compress(5),
|
||||
middleware.SetHeader("Accept-Ranges", "bytes"),
|
||||
middleware.SetHeader("Server", "rclone/"+fs.Version),
|
||||
)
|
||||
router.Get("/favicon.ico", s.serveFavicon)
|
||||
router.Get("/*", s.handler)
|
||||
router.Head("/*", s.handler)
|
||||
|
||||
@@ -225,6 +231,27 @@ func (s *HTTP) Shutdown() error {
|
||||
return s.server.Shutdown()
|
||||
}
|
||||
|
||||
// serveFavicon serves the remote's favicon.ico if it exists, otherwise
|
||||
// the rclone favicon
|
||||
func (s *HTTP) serveFavicon(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
VFS, err := s.getVFS(ctx)
|
||||
if err == nil {
|
||||
node, err := VFS.Stat("favicon.ico")
|
||||
if err == nil && node.IsFile() {
|
||||
// Remote has favicon.ico, serve it as a regular file
|
||||
s.serveFile(w, r, "favicon.ico")
|
||||
return
|
||||
}
|
||||
}
|
||||
// Serve the embedded rclone favicon
|
||||
w.Header().Set("Content-Type", "image/png")
|
||||
w.Header().Set("Cache-Control", "max-age=86400")
|
||||
if _, err := w.Write(faviconData); err != nil {
|
||||
fs.Debugf(nil, "Failed to write favicon: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// handler reads incoming requests and dispatches them
|
||||
func (s *HTTP) handler(w http.ResponseWriter, r *http.Request) {
|
||||
isDir := strings.HasSuffix(r.URL.Path, "/")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"compress/gzip"
|
||||
"context"
|
||||
"flag"
|
||||
"io"
|
||||
@@ -297,6 +298,116 @@ func TestAuthProxy(t *testing.T) {
|
||||
testGET(t, true)
|
||||
}
|
||||
|
||||
func TestFavicon(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
doGet := func(testURL, path string) *http.Response {
|
||||
req, err := http.NewRequest("GET", testURL+path, nil)
|
||||
require.NoError(t, err)
|
||||
req.SetBasicAuth(testUser, testPass)
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
require.NoError(t, err)
|
||||
return resp
|
||||
}
|
||||
|
||||
t.Run("fallback", func(t *testing.T) {
|
||||
// testdata/files has no favicon.ico, so the embedded fallback is served
|
||||
f, err := fs.NewFs(ctx, "testdata/files")
|
||||
require.NoError(t, err)
|
||||
s, testURL := start(ctx, t, f)
|
||||
defer func() { assert.NoError(t, s.server.Shutdown()) }()
|
||||
|
||||
resp := doGet(testURL, "favicon.ico")
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
assert.Equal(t, "image/png", resp.Header.Get("Content-Type"))
|
||||
assert.Equal(t, "max-age=86400", resp.Header.Get("Cache-Control"))
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, faviconData, body)
|
||||
})
|
||||
|
||||
t.Run("remote override", func(t *testing.T) {
|
||||
// Start a server on a temp dir that already contains a custom favicon.ico,
|
||||
// so the VFS sees it at init time and serves it instead of the fallback.
|
||||
dir := t.TempDir()
|
||||
customFavicon := []byte("custom favicon data")
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dir, "favicon.ico"), customFavicon, 0666))
|
||||
|
||||
f, err := fs.NewFs(ctx, dir)
|
||||
require.NoError(t, err)
|
||||
s, testURL := start(ctx, t, f)
|
||||
defer func() { assert.NoError(t, s.server.Shutdown()) }()
|
||||
|
||||
resp := doGet(testURL, "favicon.ico")
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, customFavicon, body)
|
||||
})
|
||||
}
|
||||
|
||||
func TestCompressedDirectoryListing(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
require.NoError(t, setAllModTimes("testdata/files", expectedTime))
|
||||
f, err := fs.NewFs(ctx, "testdata/files")
|
||||
require.NoError(t, err)
|
||||
|
||||
s, testURL := start(ctx, t, f)
|
||||
defer func() { assert.NoError(t, s.server.Shutdown()) }()
|
||||
|
||||
req, err := http.NewRequest("GET", testURL, nil)
|
||||
require.NoError(t, err)
|
||||
req.SetBasicAuth(testUser, testPass)
|
||||
req.Header.Set("Accept-Encoding", "gzip")
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
require.NoError(t, err)
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
assert.Equal(t, "gzip", resp.Header.Get("Content-Encoding"))
|
||||
|
||||
gr, err := gzip.NewReader(resp.Body)
|
||||
require.NoError(t, err)
|
||||
defer func() { _ = gr.Close() }()
|
||||
|
||||
body, err := io.ReadAll(gr)
|
||||
require.NoError(t, err)
|
||||
assert.Contains(t, string(body), "Directory listing of /")
|
||||
}
|
||||
|
||||
func TestCompressedTextFile(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
require.NoError(t, setAllModTimes("testdata/files", expectedTime))
|
||||
f, err := fs.NewFs(ctx, "testdata/files")
|
||||
require.NoError(t, err)
|
||||
|
||||
s, testURL := start(ctx, t, f)
|
||||
defer func() { assert.NoError(t, s.server.Shutdown()) }()
|
||||
|
||||
req, err := http.NewRequest("GET", testURL+"two.txt", nil)
|
||||
require.NoError(t, err)
|
||||
req.SetBasicAuth(testUser, testPass)
|
||||
req.Header.Set("Accept-Encoding", "gzip")
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
require.NoError(t, err)
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
assert.Equal(t, "gzip", resp.Header.Get("Content-Encoding"))
|
||||
|
||||
gr, err := gzip.NewReader(resp.Body)
|
||||
require.NoError(t, err)
|
||||
defer func() { _ = gr.Close() }()
|
||||
|
||||
body, err := io.ReadAll(gr)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "0123456789\n", string(body))
|
||||
}
|
||||
|
||||
func TestRc(t *testing.T) {
|
||||
servetest.TestRc(t, rc.Params{
|
||||
"type": "http",
|
||||
|
||||
@@ -66,11 +66,9 @@ func testCacheCRUD(t *testing.T, h *Handler, c Cache, fileName string) {
|
||||
func testCacheThrashDifferent(t *testing.T, h *Handler, c Cache) {
|
||||
var wg sync.WaitGroup
|
||||
for i := range 100 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
testCacheCRUD(t, h, c, fmt.Sprintf("file-%d", i))
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
@@ -79,9 +77,7 @@ func testCacheThrashDifferent(t *testing.T, h *Handler, c Cache) {
|
||||
func testCacheThrashSame(t *testing.T, h *Handler, c Cache) {
|
||||
var wg sync.WaitGroup
|
||||
for range 100 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
|
||||
// Write a handle
|
||||
splitPath := []string{"file"}
|
||||
@@ -108,7 +104,7 @@ func testCacheThrashSame(t *testing.T, h *Handler, c Cache) {
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, errStaleHandle, err)
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
@@ -61,7 +61,11 @@ time instead of the current time. Times may be specified as one of:
|
||||
- 'YYYY-MM-DDTHH:MM:SS.SSS' - e.g. 2006-01-02T15:04:05.123456789
|
||||
|
||||
Note that value of ` + "`--timestamp`" + ` is in UTC. If you want local time
|
||||
then add the ` + "`--localtime`" + ` flag.`,
|
||||
then add the ` + "`--localtime`" + ` flag.
|
||||
|
||||
Metadata can be added when creating a new file with ` + "`--metadata-set`" + `.
|
||||
For example:
|
||||
rclone touch remote:path -M --metadata-set key=value`,
|
||||
Annotations: map[string]string{
|
||||
"versionIntroduced": "v1.39",
|
||||
"groups": "Filter,Listing,Important",
|
||||
@@ -123,10 +127,10 @@ func timeOfTouch() (time.Time, error) {
|
||||
}
|
||||
|
||||
// createEmptyObject creates an empty object (file) with specified timestamp
|
||||
func createEmptyObject(ctx context.Context, remote string, modTime time.Time, f fs.Fs) error {
|
||||
func createEmptyObject(ctx context.Context, remote string, modTime time.Time, f fs.Fs, options []fs.OpenOption) error {
|
||||
var buffer []byte
|
||||
src := object.NewStaticObjectInfo(remote, modTime, int64(len(buffer)), true, nil, f)
|
||||
_, err := f.Put(ctx, bytes.NewBuffer(buffer), src)
|
||||
_, err := f.Put(ctx, bytes.NewBuffer(buffer), src, options...)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -163,7 +167,8 @@ func Touch(ctx context.Context, f fs.Fs, remote string) error {
|
||||
return nil
|
||||
}
|
||||
fs.Debugf(f, "Touching (creating) %q", remote)
|
||||
if err = createEmptyObject(ctx, remote, t, f); err != nil {
|
||||
options := fs.MetadataAsOpenOptions(ctx)
|
||||
if err = createEmptyObject(ctx, remote, t, f, options); err != nil {
|
||||
return fmt.Errorf("failed to touch (create): %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,3 +150,32 @@ func TestRecursiveTouchDirWithFiles(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
fstest.CheckListingWithPrecision(t, r.Fremote, []fstest.Item{file1, file2, file3}, []string{"a", "a/b", "a/b/c"}, fs.ModTimeNotSupported)
|
||||
}
|
||||
|
||||
func TestTouchWithMetadata(t *testing.T) {
|
||||
r := fstest.NewRun(t)
|
||||
ctx := context.Background()
|
||||
features := r.Fremote.Features()
|
||||
if !features.UserMetadata {
|
||||
t.Skip("Skipping metadata test; backend does not support user metadata")
|
||||
}
|
||||
|
||||
ci := fs.GetConfig(ctx)
|
||||
origMetadata := ci.Metadata
|
||||
origMetadataSet := ci.MetadataSet
|
||||
t.Cleanup(func() {
|
||||
ci.Metadata = origMetadata
|
||||
ci.MetadataSet = origMetadataSet
|
||||
})
|
||||
|
||||
ci.Metadata = true
|
||||
ci.MetadataSet = fs.Metadata{
|
||||
"testkey": "testvalue",
|
||||
}
|
||||
|
||||
err := Touch(ctx, r.Fremote, "metaFile")
|
||||
require.NoError(t, err)
|
||||
|
||||
o, err := r.Fremote.NewObject(ctx, "metaFile")
|
||||
require.NoError(t, err)
|
||||
fstest.CheckEntryMetadata(ctx, t, r.Fremote, o, ci.MetadataSet)
|
||||
}
|
||||
@@ -133,6 +133,7 @@ WebDAV or S3, that work out of the box.)
|
||||
{{< provider name="Dropbox" home="https://www.dropbox.com/" config="/dropbox/" >}}
|
||||
{{< provider name="Enterprise File Fabric" home="https://storagemadeeasy.com/about/" config="/filefabric/" >}}
|
||||
{{< provider name="Exaba" home="https://exaba.com/" config="/s3/#exaba" >}}
|
||||
{{< provider name="Fastly Object Storage" home="https://www.fastly.com/products/storage" config="/s3/#fastly" >}}
|
||||
{{< provider name="Fastmail Files" home="https://www.fastmail.com/" config="/webdav/#fastmail-files" >}}
|
||||
{{< provider name="FileLu Cloud Storage" home="https://filelu.com/" config="/filelu/" >}}
|
||||
{{< provider name="FileLu S5 (S3-Compatible Object Storage)" home="https://s5lu.com/" config="/s3/#filelu-s5" >}}
|
||||
@@ -210,7 +211,6 @@ WebDAV or S3, that work out of the box.)
|
||||
{{< provider name="Sia" home="https://sia.tech/" config="/sia/" >}}
|
||||
{{< provider name="SMB / CIFS" home="https://en.wikipedia.org/wiki/Server_Message_Block" config="/smb/" >}}
|
||||
{{< provider name="Spectra Logic" home="https://spectralogic.com/blackpearl-nearline-object-gateway/" config="/s3/#spectralogic" >}}
|
||||
{{< provider name="StackPath" home="https://www.stackpath.com/products/object-storage/" config="/s3/#stackpath" >}}
|
||||
{{< provider name="Storj" home="https://storj.io/" config="/storj/" >}}
|
||||
{{< provider name="Synology" home="https://c2.synology.com/en-global/object-storage/overview" config="/s3/#synology-c2" >}}
|
||||
{{< provider name="SugarSync" home="https://sugarsync.com/" config="/sugarsync/" >}}
|
||||
@@ -219,6 +219,7 @@ WebDAV or S3, that work out of the box.)
|
||||
{{< provider name="Wasabi" home="https://wasabi.com/" config="/s3/#wasabi" >}}
|
||||
{{< provider name="WebDAV" home="https://en.wikipedia.org/wiki/WebDAV" config="/webdav/" >}}
|
||||
{{< provider name="Yandex Disk" home="https://disk.yandex.com/" config="/yandex/" >}}
|
||||
{{< provider name="Zadara Object Storage" home="https://www.zadara.com" config="/s3/#zadara" >}}
|
||||
{{< provider name="Zoho WorkDrive" home="https://www.zoho.com/workdrive/" config="/zoho/" >}}
|
||||
{{< provider name="Zata" home="https://zata.ai/" config="/s3/#Zata" end="true" >}}
|
||||
{{< provider name="The local filesystem" home="/local/" config="/local/" end="true">}}
|
||||
|
||||
@@ -978,7 +978,7 @@ put them back in again. -->
|
||||
- Nathanael Demacon <7271496+quantumsheep@users.noreply.github.com>
|
||||
- ahxxm <ahxxm@users.noreply.github.com>
|
||||
- Flora Thiebaut <johann.thiebaut@gmail.com>
|
||||
- kingston125 <support@filelu.com>
|
||||
- kingston125 <support@filelu.com> <kingston125@github.com>
|
||||
- Ser-Bul <30335009+Ser-Bul@users.noreply.github.com>
|
||||
- jinjingroad <jinjingroad@sina.com>
|
||||
- necaran <55765083+necaran@users.noreply.github.com>
|
||||
@@ -1073,3 +1073,24 @@ put them back in again. -->
|
||||
- jzunigax2 <125698953+jzunigax2@users.noreply.github.com>
|
||||
- lullius <lullius@users.noreply.github.com>
|
||||
- StarHack <StarHack@users.noreply.github.com>
|
||||
- Leon Brocard <acme@astray.com>
|
||||
- Cohinem <143964778+Cohinem@users.noreply.github.com>
|
||||
- Jack Kelly <jack@OpenClimateFix.org>
|
||||
- Prakhar Chhalotre <chhalotreprakhar00@gmail.com>
|
||||
- Varun Chawla <34209028+veeceey@users.noreply.github.com>
|
||||
- Jan-Philipp Reßler <75355263+TabError@users.noreply.github.com>
|
||||
- Shlomi Avihou <shlomi@zadarastorage.com>
|
||||
- Chris <238498929+chris081519-crypto@users.noreply.github.com>
|
||||
- Jan-Philipp Reßler <xodarap@xodarap.de>
|
||||
- Dark Dragon <darkdragon-001@web.de>
|
||||
- Leon Brocard <lbrocard@fastly.com>
|
||||
- a1pcm <a1pcm@users.noreply.github.com>
|
||||
- FTCHD <144691102+FTCHD@users.noreply.github.com>
|
||||
- Bjoern Franke <bjo+git@schafweide.org>
|
||||
- hxnd <callmehxnd@outlook.de>
|
||||
- Adam Kasztenny <adamkasztenny@gmail.com>
|
||||
- Romāns Potašovs <justgook@gmail.com>
|
||||
- Brian Bockelman <bbockelman@morgridge.org>
|
||||
- Bjoern Franke <bjo@schafweide.org>
|
||||
- razorloves <razorloves@gmail.com>
|
||||
- Duncan F <131309315+duncanaf@users.noreply.github.com>
|
||||
@@ -1049,9 +1049,11 @@ The following backends have known issues that need more investigation:
|
||||
<!--- start list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
|
||||
- `TestDropbox` (`dropbox`)
|
||||
- [`TestBisyncRemoteRemote/normalization`](https://pub.rclone.org/integration-tests/current/dropbox-cmd.bisync-TestDropbox-1.txt)
|
||||
- `TestSeafile` (`seafile`)
|
||||
- [`TestBisyncLocalRemote/volatile`](https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafile-1.txt)
|
||||
- `TestSeafileV6` (`seafile`)
|
||||
- [`TestBisyncLocalRemote/rmdirs`](https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafileV6-1.txt)
|
||||
- Updated: 2026-04-19-010011
|
||||
- [`TestBisyncLocalRemote/volatile`](https://pub.rclone.org/integration-tests/current/seafile-cmd.bisync-TestSeafileV6-1.txt)
|
||||
- Updated: 2026-01-30-010015
|
||||
<!--- end list_failures - DO NOT EDIT THIS SECTION - use make commanddocs --->
|
||||
|
||||
The following backends either have not been tested recently or have known issues
|
||||
|
||||
@@ -6,94 +6,6 @@ description: "Rclone Changelog"
|
||||
|
||||
# Changelog
|
||||
|
||||
## v1.73.5 - 2026-04-19
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.4...v1.73.5)
|
||||
|
||||
- Bug Fixes
|
||||
- operations: Add AuthRequired to operations/fsinfo to prevent backend creation CVE-2026-41179 (Nick Craig-Wood)
|
||||
- rc
|
||||
- Add AuthRequired to options/set to prevent auth bypass CVE-2026-41176 (Nick Craig-Wood)
|
||||
- Snapshot NoAuth at startup to prevent runtime auth bypass CVE-2026-41176 (Nick Craig-Wood)
|
||||
- filter: Fix debug logs that fire before logger is configured (Nick Craig-Wood)
|
||||
- Azureblob
|
||||
- Add Microsoft Partner Network User-Agent prefix (Nick Craig-Wood)
|
||||
- Drime
|
||||
- Fix User.EntryPermissions JSON unmarshalling (a1pcm)
|
||||
- Iclouddrive
|
||||
- Fix 'directory not found' error when the directory contains accent marks (Brais Couce)
|
||||
- S3
|
||||
- Fix TencentCOS CDN endpoint failing on bucket check (Mozi)
|
||||
- Fix empty delimiter parameter rejected by Archiware P5 server (Nick Craig-Wood)
|
||||
|
||||
## v1.73.4 - 2026-04-08
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.3...v1.73.4)
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to go 1.25.9 to fix multiple CVEs (Nick Craig-Wood)
|
||||
- CVE-2026-32282: os: Root.Chmod can follow symlinks out of the root on Linux
|
||||
- CVE-2026-32289: html/template: JS template literal context incorrectly tracked
|
||||
- CVE-2026-33810: crypto/x509: excluded DNS constraints not properly applied to wildcard domains
|
||||
- CVE-2026-27144: cmd/compile: no-op interface conversion bypasses overlap checking
|
||||
- CVE-2026-27143: cmd/compile: possible memory corruption after bound check elimination
|
||||
- CVE-2026-32288: archive/tar: unbounded allocation when parsing old format GNU sparse map
|
||||
- CVE-2026-32283: crypto/tls: multiple key update handshake messages can cause connection to deadlock
|
||||
- CVE-2026-27140: cmd/go: trust layer bypass when using cgo and SWIG
|
||||
- CVE-2026-32280: crypto/x509: unexpected work during chain building
|
||||
- CVE-2026-32281: crypto/x509: inefficient policy validation
|
||||
- Fix Denial of Service due to Panic in AWS SDK for Go v2 SDK EventStream Decoder (dependabot[bot])
|
||||
- Update golang.org/x/image to 0.38.0 to fix CVE-2026-33809 (dependabot[bot])
|
||||
- docs
|
||||
- Fix header level for metadata option (Clément Notin)
|
||||
- Fix markdown issues in mount docs (albertony)
|
||||
- Fix link to not be language specific (Ross Smith II)
|
||||
- Note macOS 10.15 (Catalina) support with version v1.70.3 (kapitainsky)
|
||||
- Filen
|
||||
- Update SDK version (Enduriel)
|
||||
|
||||
## v1.73.3 - 2026-03-23
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.2...v1.73.3)
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to google.golang.org/grpc 1.79.3 to fix CVE-2026-33186 (dependabot[bot])
|
||||
- Update to github.com/buger/jsonparser 1.1.2 to fix GHSA-6g7g-w4f8-9c9x (dependabot[bot])
|
||||
- doc fixes
|
||||
- Added text to the label showing version-introduced info (Jan-Philipp Reßler)
|
||||
- Clarify Filen password change requires updating both password and API key in rclone config (Jason)
|
||||
- s3: clarify multi tenant support for Cubbit (Marco Ferretti)
|
||||
- jottacloud: Fix broken link (albertony)
|
||||
- lib/rest: Fix URLPathEscapeAll breaking WebDAV servers (eg nzbdav) with strict path matching (Andrew Furman)
|
||||
- list: Fix nil pointer panic in Sorter when temp file creation fails (Nick Craig-Wood)
|
||||
|
||||
## v1.73.2 - 2026-03-06
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.1...v1.73.2)
|
||||
|
||||
- Bug Fixes
|
||||
- build
|
||||
- Update to go 1.25.8 to fix CVE-2026-27137 CVE-2026-27138 CVE-2026-25679 CVE-2026-27142 (Nick Craig-Wood)
|
||||
- Update github.com/cloudflare/circl to v1.6.3 to fix CVE-2026-1229 (Nick Craig-Wood)
|
||||
- Update to golang.org/x/net v0.51.0 to fix CVE-2026-27141 (Nick Craig-Wood)
|
||||
- docs fixes:
|
||||
- bisync: Add group Sync to the bisync command (Jan-Philipp Reßler)
|
||||
- Note that --use-server-modtime only works on some backends (Nick Craig-Wood)
|
||||
- Document unsupported S3 object keys with double slashes (Adam Kasztenny)
|
||||
- Fix headers hierarchy for mount.md (Dark Dragon)
|
||||
- Fix new drive flag typo in changelog (razorloves)
|
||||
- Archive
|
||||
- Extract: fix extraction with "./" prefix from tar entry paths (Varun Chawla)
|
||||
- Drime
|
||||
- Fix chunk-uploaded files ignoring workspace ID (a1pcm)
|
||||
- Internxt
|
||||
- Fix Entry doesn't belong in directory errors on windows (jzunigax2)
|
||||
- WebDAV
|
||||
- Escape reserved characters in URL path segments (Varun Chawla)
|
||||
- Add missing headers for CORS (Romāns Potašovs)
|
||||
|
||||
## v1.73.1 - 2026-02-17
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.73.0...v1.73.1)
|
||||
|
||||
@@ -329,11 +329,9 @@ rclone [flags]
|
||||
--filefabric-token-expiry string Token expiry time
|
||||
--filefabric-url string URL of the Enterprise File Fabric to connect to
|
||||
--filefabric-version string Version read from the file fabric
|
||||
--filelu-chunk-size SizeSuffix Chunk size to use for uploading. Used for multipart uploads (default 64Mi)
|
||||
--filelu-description string Description of the remote
|
||||
--filelu-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,Colon,Question,Asterisk,Pipe,Hash,Percent,BackSlash,CrLf,Del,Ctl,LeftSpace,LeftPeriod,LeftTilde,LeftCrLfHtVt,RightSpace,RightPeriod,RightCrLfHtVt,InvalidUtf8,Dot,SquareBracket,Semicolon,Exclamation)
|
||||
--filelu-key string Your FileLu Rclone key from My Account
|
||||
--filelu-upload-cutoff SizeSuffix Cutoff for switching to chunked upload. Any files larger than this will be uploaded in chunks of chunk_size (default 500Mi)
|
||||
--filen-api-key string API Key for your Filen account (obscured)
|
||||
--filen-auth-version string Authentication Version (internal use only)
|
||||
--filen-base-folder-uuid string UUID of Account Root Directory (internal use only)
|
||||
@@ -1065,7 +1063,7 @@ rclone [flags]
|
||||
--use-json-log Use json log format
|
||||
--use-mmap Use mmap allocator (see docs)
|
||||
--use-server-modtime Use server modified time instead of object metadata
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.73.5")
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.73.0")
|
||||
-v, --verbose count Print lots more stuff (repeat for more)
|
||||
-V, --version Print the version number
|
||||
--webdav-auth-redirect Preserve authentication on redirect
|
||||
|
||||
@@ -107,26 +107,6 @@ Flags for anything which can copy a file
|
||||
-u, --update Skip files that are newer on the destination
|
||||
```
|
||||
|
||||
### Sync Options
|
||||
|
||||
Flags used for sync commands
|
||||
|
||||
```text
|
||||
--backup-dir string Make backups into hierarchy based in DIR
|
||||
--delete-after When synchronizing, delete files on destination after transferring (default)
|
||||
--delete-before When synchronizing, delete files on destination before transferring
|
||||
--delete-during When synchronizing, delete files during transfer
|
||||
--fix-case Force rename of case insensitive dest to match source
|
||||
--ignore-errors Delete even if there are I/O errors
|
||||
--list-cutoff int To save memory, sort directory listings on disk above this threshold (default 1000000)
|
||||
--max-delete int When synchronizing, limit the number of deletes (default -1)
|
||||
--max-delete-size SizeSuffix When synchronizing, limit the total size of deletes (default off)
|
||||
--suffix string Suffix to add to changed files
|
||||
--suffix-keep-extension Preserve the extension when using --suffix
|
||||
--track-renames When synchronizing, track file renames and do a server-side move if possible
|
||||
--track-renames-strategy string Strategies to use when synchronizing using track-renames hash|modtime|leaf (default "hash")
|
||||
```
|
||||
|
||||
### Important Options
|
||||
|
||||
Important flags useful for most commands
|
||||
|
||||
@@ -231,12 +231,12 @@ rclone convmv "stories/The Quick Brown Fox!.txt" --name-transform "all,command=e
|
||||
|
||||
```console
|
||||
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{YYYYMMDD}"
|
||||
// Output: stories/The Quick Brown Fox!-20260419
|
||||
// Output: stories/The Quick Brown Fox!-20260130
|
||||
```
|
||||
|
||||
```console
|
||||
rclone convmv "stories/The Quick Brown Fox!" --name-transform "date=-{macfriendlytime}"
|
||||
// Output: stories/The Quick Brown Fox!-2026-04-19 1137AM
|
||||
// Output: stories/The Quick Brown Fox!-2026-01-30 0825PM
|
||||
```
|
||||
|
||||
```console
|
||||
|
||||
@@ -39,15 +39,6 @@ Note that `--stdout` and `--print-filename` are incompatible with `--urls`.
|
||||
This will do `--transfers` copies in parallel. Note that if `--auto-filename`
|
||||
is desired for all URLs then a file with only URLs and no filename can be used.
|
||||
|
||||
Each FILENAME in the CSV file can start with a relative path which will be appended
|
||||
to the destination path provided at the command line. For example, running the command
|
||||
shown above with the following CSV file will write two files to the destination:
|
||||
`remote:dir/local/path/bar.json` and `remote:dir/another/local/directory/qux.json`
|
||||
```csv
|
||||
https://example.org/foo/bar.json,local/path/bar.json
|
||||
https://example.org/qux/baz.json,another/local/directory/qux.json
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you can't get `rclone copyurl` to work then here are some things you can try:
|
||||
|
||||
@@ -13,8 +13,7 @@ Mount the remote as file system on a mountpoint.
|
||||
Rclone mount allows Linux, FreeBSD, macOS and Windows to
|
||||
mount any of Rclone's cloud storage systems as a file system with FUSE.
|
||||
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls`
|
||||
etc.
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls` etc.
|
||||
|
||||
On Linux and macOS, you can run mount in either foreground or background (aka
|
||||
daemon) mode. Mount runs in foreground mode by default. Use the `--daemon` flag
|
||||
@@ -42,8 +41,8 @@ The following examples will mount to an automatically assigned drive,
|
||||
to specific drive letter `X:`, to path `C:\path\parent\mount`
|
||||
(where parent directory or drive must exist, and mount must **not** exist,
|
||||
and is not supported when [mounting as a network drive](#mounting-modes-on-windows)),
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to
|
||||
an automatically assigned drive:
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to an
|
||||
automatically assigned drive:
|
||||
|
||||
```console
|
||||
rclone mount remote:path/to/files *
|
||||
@@ -149,8 +148,8 @@ rclone mount remote:path/to/files X: --volname \\server\share
|
||||
|
||||
You may also specify the network share UNC path as the mountpoint itself. Then rclone
|
||||
will automatically assign a drive letter, same as with `*` and use that as
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it
|
||||
were specified with the `--volname` option. This will also implicitly set
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it were
|
||||
specified with the `--volname` option. This will also implicitly set
|
||||
the `--network-mode` option. This means the following two examples have same result:
|
||||
|
||||
```console
|
||||
@@ -281,7 +280,7 @@ does not suffer from the same limitations.
|
||||
|
||||
Mounting on macOS can be done either via [built-in NFS server](/commands/rclone_serve_nfs/),
|
||||
[macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or
|
||||
[FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing
|
||||
[FUSE-T](https://www.fuse-t.org/).macFUSE is a traditional FUSE driver utilizing
|
||||
a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which
|
||||
"mounts" via an NFSv4 local server.
|
||||
|
||||
@@ -324,30 +323,29 @@ current as of FUSE-T version 1.0.14.
|
||||
|
||||
As per the [FUSE-T wiki](https://github.com/macos-fuse-t/fuse-t/wiki#caveats):
|
||||
|
||||
> File access and modification times cannot be set separately as it seems to be
|
||||
> an issue with the NFS client which always modifies both. Can be reproduced
|
||||
> with `touch -m` and `touch -a` commands
|
||||
> File access and modification times cannot be set separately as it seems to be an
|
||||
> issue with the NFS client which always modifies both. Can be reproduced with
|
||||
> 'touch -m' and 'touch -a' commands
|
||||
|
||||
This means that viewing files with various tools, notably macOS Finder, will
|
||||
cause rlcone to update the modification time of the file. This may make rclone
|
||||
upload a full new copy of the file.
|
||||
This means that viewing files with various tools, notably macOS Finder, will cause
|
||||
rlcone to update the modification time of the file. This may make rclone upload a
|
||||
full new copy of the file.
|
||||
|
||||
#### Read Only mounts
|
||||
|
||||
When mounting with `--read-only`, attempts to write to files will fail *silently*
|
||||
as opposed to with a clear warning as in macFUSE.
|
||||
|
||||
## Mounting on Linux
|
||||
# Mounting on Linux
|
||||
|
||||
On newer versions of Ubuntu, you may encounter the following error when running
|
||||
`rclone mount`:
|
||||
|
||||
> NOTICE: mount helper error: fusermount3: mount failed: Permission denied
|
||||
> CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
|
||||
|
||||
This may be due to newer [Apparmor](https://wiki.ubuntu.com/AppArmor) restrictions,
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need
|
||||
to `sudo apt install apparmor-utils` beforehand).
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need to
|
||||
`sudo apt install apparmor-utils` beforehand).
|
||||
|
||||
## Limitations
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ Mount the remote as file system on a mountpoint.
|
||||
Rclone nfsmount allows Linux, FreeBSD, macOS and Windows to
|
||||
mount any of Rclone's cloud storage systems as a file system with FUSE.
|
||||
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls`
|
||||
etc.
|
||||
First set up your remote using `rclone config`. Check it works with `rclone ls` etc.
|
||||
|
||||
On Linux and macOS, you can run mount in either foreground or background (aka
|
||||
daemon) mode. Mount runs in foreground mode by default. Use the `--daemon` flag
|
||||
@@ -43,8 +42,8 @@ The following examples will mount to an automatically assigned drive,
|
||||
to specific drive letter `X:`, to path `C:\path\parent\mount`
|
||||
(where parent directory or drive must exist, and mount must **not** exist,
|
||||
and is not supported when [mounting as a network drive](#mounting-modes-on-windows)),
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to
|
||||
an automatically assigned drive:
|
||||
and the last example will mount as network share `\\cloud\remote` and map it to an
|
||||
automatically assigned drive:
|
||||
|
||||
```console
|
||||
rclone nfsmount remote:path/to/files *
|
||||
@@ -150,8 +149,8 @@ rclone nfsmount remote:path/to/files X: --volname \\server\share
|
||||
|
||||
You may also specify the network share UNC path as the mountpoint itself. Then rclone
|
||||
will automatically assign a drive letter, same as with `*` and use that as
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it
|
||||
were specified with the `--volname` option. This will also implicitly set
|
||||
mountpoint, and instead use the UNC path specified as the volume name, as if it were
|
||||
specified with the `--volname` option. This will also implicitly set
|
||||
the `--network-mode` option. This means the following two examples have same result:
|
||||
|
||||
```console
|
||||
@@ -282,7 +281,7 @@ does not suffer from the same limitations.
|
||||
|
||||
Mounting on macOS can be done either via [built-in NFS server](/commands/rclone_serve_nfs/),
|
||||
[macFUSE](https://osxfuse.github.io/) (also known as osxfuse) or
|
||||
[FUSE-T](https://www.fuse-t.org/). macFUSE is a traditional FUSE driver utilizing
|
||||
[FUSE-T](https://www.fuse-t.org/).macFUSE is a traditional FUSE driver utilizing
|
||||
a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which
|
||||
"mounts" via an NFSv4 local server.
|
||||
|
||||
@@ -325,30 +324,29 @@ current as of FUSE-T version 1.0.14.
|
||||
|
||||
As per the [FUSE-T wiki](https://github.com/macos-fuse-t/fuse-t/wiki#caveats):
|
||||
|
||||
> File access and modification times cannot be set separately as it seems to be
|
||||
> an issue with the NFS client which always modifies both. Can be reproduced
|
||||
> with `touch -m` and `touch -a` commands
|
||||
> File access and modification times cannot be set separately as it seems to be an
|
||||
> issue with the NFS client which always modifies both. Can be reproduced with
|
||||
> 'touch -m' and 'touch -a' commands
|
||||
|
||||
This means that viewing files with various tools, notably macOS Finder, will
|
||||
cause rlcone to update the modification time of the file. This may make rclone
|
||||
upload a full new copy of the file.
|
||||
This means that viewing files with various tools, notably macOS Finder, will cause
|
||||
rlcone to update the modification time of the file. This may make rclone upload a
|
||||
full new copy of the file.
|
||||
|
||||
#### Read Only mounts
|
||||
|
||||
When mounting with `--read-only`, attempts to write to files will fail *silently*
|
||||
as opposed to with a clear warning as in macFUSE.
|
||||
|
||||
## Mounting on Linux
|
||||
# Mounting on Linux
|
||||
|
||||
On newer versions of Ubuntu, you may encounter the following error when running
|
||||
`rclone mount`:
|
||||
|
||||
> NOTICE: mount helper error: fusermount3: mount failed: Permission denied
|
||||
> CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
|
||||
|
||||
This may be due to newer [Apparmor](https://wiki.ubuntu.com/AppArmor) restrictions,
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need
|
||||
to `sudo apt install apparmor-utils` beforehand).
|
||||
which can be disabled with `sudo aa-disable /usr/bin/fusermount3` (you may need to
|
||||
`sudo apt install apparmor-utils` beforehand).
|
||||
|
||||
## Limitations
|
||||
|
||||
|
||||
@@ -2059,7 +2059,7 @@ This is the default.
|
||||
`CAUTIOUS` will try to prevent rclone from reaching the limit. Only applicable
|
||||
for `--max-transfer`.
|
||||
|
||||
### -M, --metadata
|
||||
## -M, --metadata
|
||||
|
||||
Setting this flag enables rclone to copy the metadata from the source
|
||||
to the destination. For local backends this is ownership, permissions,
|
||||
|
||||
@@ -143,7 +143,6 @@ The latest `rclone` version working for:
|
||||
| Windows Server 2012 | v1.63.1 |
|
||||
| Windows XP | v1.42 |
|
||||
| Windows Vista | v1.42 |
|
||||
| macOS 10.15 (Catalina) | v1.70.3 |
|
||||
| macOS 10.14 (Mojave) | v1.63.1 |
|
||||
| macOS 10.13 (High Sierra) | v1.63.1 |
|
||||
| macOS 10.12 (Sierra) | v1.56.0 |
|
||||
|
||||
@@ -219,28 +219,6 @@ Properties:
|
||||
|
||||
Here are the Advanced options specific to filelu (FileLu Cloud Storage).
|
||||
|
||||
#### --filelu-upload-cutoff
|
||||
|
||||
Cutoff for switching to chunked upload. Any files larger than this will be uploaded in chunks of chunk_size.
|
||||
|
||||
Properties:
|
||||
|
||||
- Config: upload_cutoff
|
||||
- Env Var: RCLONE_FILELU_UPLOAD_CUTOFF
|
||||
- Type: SizeSuffix
|
||||
- Default: 500Mi
|
||||
|
||||
#### --filelu-chunk-size
|
||||
|
||||
Chunk size to use for uploading. Used for multipart uploads.
|
||||
|
||||
Properties:
|
||||
|
||||
- Config: chunk_size
|
||||
- Env Var: RCLONE_FILELU_CHUNK_SIZE
|
||||
- Type: SizeSuffix
|
||||
- Default: 64Mi
|
||||
|
||||
#### --filelu-encoding
|
||||
|
||||
The encoding for the backend.
|
||||
|
||||
@@ -10,8 +10,6 @@ The initial setup for Filen requires that you get an API key for your account,
|
||||
currently this is only possible using the [Filen CLI](https://github.com/FilenCloudDienste/filen-cli).
|
||||
This means you must first download the CLI, login, and then run the `export-api-key` command.
|
||||
|
||||
**Note:** If you change your Filen account password, you will need to update your rclone configuration with the new password and a re-exported API key (via `export-api-key`).
|
||||
|
||||
Here is an example of how to make a remote called `FilenRemote`. First run:
|
||||
|
||||
rclone config
|
||||
|
||||
@@ -121,7 +121,7 @@ Flags for general networking and HTTP stuff.
|
||||
--tpslimit float Limit HTTP transactions per second to this
|
||||
--tpslimit-burst int Max burst of transactions for --tpslimit (default 1)
|
||||
--use-cookies Enable session cookiejar
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.73.5")
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.73.0")
|
||||
```
|
||||
|
||||
|
||||
@@ -605,11 +605,9 @@ Backend-only flags (these can be set in the config file also).
|
||||
--filefabric-token-expiry string Token expiry time
|
||||
--filefabric-url string URL of the Enterprise File Fabric to connect to
|
||||
--filefabric-version string Version read from the file fabric
|
||||
--filelu-chunk-size SizeSuffix Chunk size to use for uploading. Used for multipart uploads (default 64Mi)
|
||||
--filelu-description string Description of the remote
|
||||
--filelu-encoding Encoding The encoding for the backend (default Slash,LtGt,DoubleQuote,SingleQuote,BackQuote,Dollar,Colon,Question,Asterisk,Pipe,Hash,Percent,BackSlash,CrLf,Del,Ctl,LeftSpace,LeftPeriod,LeftTilde,LeftCrLfHtVt,RightSpace,RightPeriod,RightCrLfHtVt,InvalidUtf8,Dot,SquareBracket,Semicolon,Exclamation)
|
||||
--filelu-key string Your FileLu Rclone key from My Account
|
||||
--filelu-upload-cutoff SizeSuffix Cutoff for switching to chunked upload. Any files larger than this will be uploaded in chunks of chunk_size (default 500Mi)
|
||||
--filen-api-key string API Key for your Filen account (obscured)
|
||||
--filen-auth-version string Authentication Version (internal use only)
|
||||
--filen-base-folder-uuid string UUID of Account Root Directory (internal use only)
|
||||
|
||||
@@ -380,7 +380,7 @@ not the rclone developers so it may be out of date. Its current version is as be
|
||||
## Source installation {#source}
|
||||
|
||||
Make sure you have git and [Go](https://golang.org/) installed.
|
||||
Go version 1.24 or newer is required, the latest release is recommended.
|
||||
Go version 1.25 or newer is required, the latest release is recommended.
|
||||
You can get it from your package manager, or download it from
|
||||
[golang.org/dl](https://golang.org/dl/). Then you can run the following:
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ its own datacenters in Norway.
|
||||
In addition to the official service at [jottacloud.com](https://www.jottacloud.com/),
|
||||
it also provides white-label solutions to different companies. The following
|
||||
are currently supported by this backend, using a different authentication setup
|
||||
as described [below](#traditional):
|
||||
as described [below](#whitelabel-authentication):
|
||||
|
||||
- Elkjøp (with subsidiaries):
|
||||
- Elkjøp Cloud (cloud.elkjop.no)
|
||||
|
||||
@@ -62,7 +62,7 @@ handling file names.
|
||||
| / | 0x2F | / |
|
||||
|
||||
When running on Windows the following characters are replaced. This
|
||||
list is based on the [Windows file naming conventions](https://docs.microsoft.com/windows/desktop/FileIO/naming-a-file#naming-conventions).
|
||||
list is based on the [Windows file naming conventions](https://docs.microsoft.com/de-de/windows/desktop/FileIO/naming-a-file#naming-conventions).
|
||||
|
||||
| Character | Value | Replacement |
|
||||
| --------- |:-----:|:-----------:|
|
||||
|
||||
@@ -1659,8 +1659,6 @@ This command does not have a command line equivalent so use this instead:
|
||||
|
||||
rclone rc --loopback operations/fsinfo fs=remote:
|
||||
|
||||
**Authentication is required for this call.**
|
||||
|
||||
### operations/hashsum: Produces a hashsum file for all the objects in the path. {#operations-hashsum}
|
||||
|
||||
Produces a hash file for all the objects in the path using the hash
|
||||
@@ -1982,8 +1980,6 @@ And this sets NOTICE level logs (normal without -v)
|
||||
|
||||
rclone rc options/set --json '{"main": {"LogLevel": "NOTICE"}}'
|
||||
|
||||
**Authentication is required for this call.**
|
||||
|
||||
### pluginsctl/addPlugin: Add a plugin using url {#pluginsctl-addPlugin}
|
||||
|
||||
Used for adding a plugin to the webgui.
|
||||
|
||||
@@ -23,6 +23,7 @@ The S3 backend can be used with a number of different providers:
|
||||
{{< provider name="DigitalOcean Spaces" home="https://www.digitalocean.com/products/object-storage/" config="/s3/#digitalocean-spaces" >}}
|
||||
{{< provider name="Dreamhost" home="https://www.dreamhost.com/cloud/storage/" config="/s3/#dreamhost" >}}
|
||||
{{< provider name="Exaba" home="https://exaba.com/" config="/s3/#exaba" >}}
|
||||
{{< provider name="Fastly Object Storage" home="https://www.fastly.com/products/storage" config="/s3/#fastly" >}}
|
||||
{{< provider name="FileLu S5 (S3-Compatible Object Storage)" home="https://s5lu.com/" config="/s3/#filelu-s5" >}}
|
||||
{{< provider name="GCS" home="https://cloud.google.com/storage/docs" config="/s3/#google-cloud-storage" >}}
|
||||
{{< provider name="Hetzner" home="https://www.hetzner.com/storage/object-storage/" config="/s3/#hetzner" >}}
|
||||
@@ -51,11 +52,11 @@ The S3 backend can be used with a number of different providers:
|
||||
{{< provider name="Selectel" home="https://selectel.ru/services/cloud/storage/" config="/s3/#selectel" >}}
|
||||
{{< provider name="Servercore Object Storage" home="https://servercore.com/services/object-storage/" config="/s3/#servercore" >}}
|
||||
{{< provider name="Spectra Logic" home="https://spectralogic.com/blackpearl-nearline-object-gateway" config="/s3/#spectralogic" >}}
|
||||
{{< provider name="StackPath" home="https://www.stackpath.com/products/object-storage/" config="/s3/#stackpath" >}}
|
||||
{{< provider name="Storj" home="https://storj.io/" config="/s3/#storj" >}}
|
||||
{{< provider name="Synology C2 Object Storage" home="https://c2.synology.com/en-global/object-storage/overview" config="/s3/#synology-c2" >}}
|
||||
{{< provider name="Tencent Cloud Object Storage (COS)" home="https://intl.cloud.tencent.com/product/cos" config="/s3/#tencent-cos" >}}
|
||||
{{< provider name="Wasabi" home="https://wasabi.com/" config="/s3/#wasabi" end="true" >}}
|
||||
{{< provider name="Wasabi" home="https://wasabi.com/" config="/s3/#wasabi" >}}
|
||||
{{< provider name="Zadara Object Storage" home="https://www.zadara.com" config="/s3/#zadara" >}}
|
||||
{{< provider name="Zata" home="https://zata.ai/" config="/s3/#Zata" end="true" >}}
|
||||
{{< /provider_list >}}
|
||||
|
||||
@@ -917,10 +918,52 @@ section, small files that are not uploaded as multipart, use a different tag, ca
|
||||
the upload to fail. A simple solution is to set the `--s3-upload-cutoff 0` and force
|
||||
all the files to be uploaded as multipart.
|
||||
|
||||
#### Setting Object Lock retention
|
||||
|
||||
Rclone supports setting Object Lock retention on uploaded objects with
|
||||
the following options:
|
||||
|
||||
- `--s3-object-lock-mode` - Set the Object Lock mode (GOVERNANCE or COMPLIANCE)
|
||||
- `--s3-object-lock-retain-until-date` - Set the retention date (RFC3339 format or duration like `365d`, `24h`)
|
||||
- `--s3-object-lock-legal-hold-status` - Set legal hold (ON or OFF)
|
||||
|
||||
Example - upload files with 1 year GOVERNANCE retention:
|
||||
|
||||
rclone copy local:/data remote:bucket \
|
||||
--s3-object-lock-mode GOVERNANCE \
|
||||
--s3-object-lock-retain-until-date 365d
|
||||
|
||||
#### Copying Object Lock settings from source
|
||||
|
||||
When using `--metadata`, you can use the special value `copy` to preserve
|
||||
the source object's Object Lock settings:
|
||||
|
||||
rclone copy source:bucket dest:bucket \
|
||||
--metadata \
|
||||
--s3-object-lock-mode copy \
|
||||
--s3-object-lock-retain-until-date copy
|
||||
|
||||
You can also mix copied and explicit values. For example, to change the
|
||||
mode from COMPLIANCE to GOVERNANCE while preserving the original retention date:
|
||||
|
||||
rclone copy source:bucket dest:bucket \
|
||||
--metadata \
|
||||
--s3-object-lock-mode GOVERNANCE \
|
||||
--s3-object-lock-retain-until-date copy
|
||||
|
||||
#### Additional Object Lock options
|
||||
|
||||
- `--s3-bypass-governance-retention` - Required to delete or overwrite objects
|
||||
with GOVERNANCE mode retention before the retention date expires
|
||||
- `--s3-bucket-object-lock-enabled` - Enable Object Lock when creating a new
|
||||
bucket with `rclone mkdir`
|
||||
- `--s3-object-lock-set-after-upload` - Set Object Lock via separate API calls
|
||||
after upload (for providers that don't support Object Lock headers during PUT)
|
||||
|
||||
<!-- autogenerated options start - DO NOT EDIT - instead edit fs.RegInfo in backend/s3/s3.go and run make backenddocs to verify --> <!-- markdownlint-disable-line line-length -->
|
||||
### Standard options
|
||||
|
||||
Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, BizflyCloud, Ceph, ChinaMobile, Cloudflare, Cubbit, DigitalOcean, Dreamhost, Exaba, FileLu, FlashBlade, GCS, Hetzner, HuaweiOBS, IBMCOS, IDrive, Intercolo, IONOS, Leviia, Liara, Linode, LyveCloud, Magalu, Mega, Minio, Netease, Outscale, OVHcloud, Petabox, Qiniu, Rabata, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, Servercore, SpectraLogic, StackPath, Storj, Synology, TencentCOS, Wasabi, Zata, Other).
|
||||
Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, BizflyCloud, Ceph, ChinaMobile, Cloudflare, Cubbit, DigitalOcean, Dreamhost, Exaba, FileLu, FlashBlade, GCS, Hetzner, HuaweiOBS, IBMCOS, IDrive, Intercolo, IONOS, Leviia, Liara, Linode, LyveCloud, Magalu, Mega, Minio, Netease, Outscale, OVHcloud, Petabox, Qiniu, Rabata, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, Servercore, SpectraLogic, Storj, Synology, TencentCOS, Wasabi, Zata, Other).
|
||||
|
||||
#### --s3-provider
|
||||
|
||||
@@ -1013,8 +1056,6 @@ Properties:
|
||||
- Servercore Object Storage
|
||||
- "SpectraLogic"
|
||||
- Spectra Logic Black Pearl
|
||||
- "StackPath"
|
||||
- StackPath Object Storage
|
||||
- "Storj"
|
||||
- Storj (S3 Compatible Gateway)
|
||||
- "Synology"
|
||||
@@ -1082,7 +1123,7 @@ Properties:
|
||||
|
||||
- Config: region
|
||||
- Env Var: RCLONE_S3_REGION
|
||||
- Provider: AWS,BizflyCloud,Ceph,Cloudflare,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IBMCOS,Intercolo,IONOS,Leviia,LyveCloud,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,Rabata,RackCorp,Scaleway,SeaweedFS,Selectel,Servercore,StackPath,Synology,Wasabi,Zata,Other
|
||||
- Provider: AWS,BizflyCloud,Ceph,Cloudflare,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IBMCOS,Intercolo,IONOS,Leviia,LyveCloud,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,Rabata,RackCorp,Scaleway,SeaweedFS,Selectel,Servercore,Synology,Wasabi,Zata,Other
|
||||
- Type: string
|
||||
- Required: false
|
||||
- Examples:
|
||||
@@ -1200,11 +1241,11 @@ Properties:
|
||||
- ""
|
||||
- Use this if unsure.
|
||||
- Will use v4 signatures and an empty region.
|
||||
- Provider: Ceph,DigitalOcean,Dreamhost,Exaba,GCS,IBMCOS,Leviia,LyveCloud,Minio,Netease,SeaweedFS,StackPath,Wasabi,Other
|
||||
- Provider: Ceph,DigitalOcean,Dreamhost,Exaba,GCS,IBMCOS,Leviia,LyveCloud,Minio,Netease,SeaweedFS,Wasabi,Other
|
||||
- "other-v2-signature"
|
||||
- Use this only if v4 signatures don't work.
|
||||
- E.g. pre Jewel/v10 CEPH.
|
||||
- Provider: Ceph,DigitalOcean,Dreamhost,Exaba,GCS,IBMCOS,Leviia,LyveCloud,Minio,Netease,SeaweedFS,StackPath,Wasabi,Other
|
||||
- Provider: Ceph,DigitalOcean,Dreamhost,Exaba,GCS,IBMCOS,Leviia,LyveCloud,Minio,Netease,SeaweedFS,Wasabi,Other
|
||||
- "auto"
|
||||
- R2 buckets are automatically distributed across Cloudflare's data centers for low latency.
|
||||
- Provider: Cloudflare
|
||||
@@ -1518,7 +1559,7 @@ Properties:
|
||||
|
||||
- Config: endpoint
|
||||
- Env Var: RCLONE_S3_ENDPOINT
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cloudflare,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,FlashBlade,GCS,Hetzner,HuaweiOBS,IBMCOS,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Mega,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,Rabata,RackCorp,Rclone,Scaleway,SeaweedFS,Selectel,Servercore,SpectraLogic,StackPath,Storj,Synology,TencentCOS,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cloudflare,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,FlashBlade,GCS,Hetzner,HuaweiOBS,IBMCOS,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Mega,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,Rabata,RackCorp,Rclone,Scaleway,SeaweedFS,Selectel,Servercore,SpectraLogic,Storj,Synology,TencentCOS,Wasabi,Zata,Other
|
||||
- Type: string
|
||||
- Required: false
|
||||
- Examples:
|
||||
@@ -1704,9 +1745,6 @@ Properties:
|
||||
- "s3.cubbit.eu"
|
||||
- Cubbit DS3 Object Storage endpoint
|
||||
- Provider: Cubbit
|
||||
- "s3.{tenant_name}.cubbit.eu"
|
||||
- Multi-tenant endpoint - replace {tenant_name} with your actual tenant name. Do not select this directly
|
||||
- Provider: Cubbit
|
||||
- "syd1.digitaloceanspaces.com"
|
||||
- DigitalOcean Spaces Sydney 1
|
||||
- Provider: DigitalOcean
|
||||
@@ -2309,15 +2347,6 @@ Properties:
|
||||
- "s3.kz-1.srvstorage.kz"
|
||||
- Almaty, Kazakhstan
|
||||
- Provider: Servercore
|
||||
- "s3.us-east-2.stackpathstorage.com"
|
||||
- US East Endpoint
|
||||
- Provider: StackPath
|
||||
- "s3.us-west-1.stackpathstorage.com"
|
||||
- US West Endpoint
|
||||
- Provider: StackPath
|
||||
- "s3.eu-central-1.stackpathstorage.com"
|
||||
- EU Endpoint
|
||||
- Provider: StackPath
|
||||
- "gateway.storjshare.io"
|
||||
- Global Hosted Gateway
|
||||
- Provider: Storj
|
||||
@@ -2827,36 +2856,36 @@ Properties:
|
||||
|
||||
- Config: acl
|
||||
- Env Var: RCLONE_S3_ACL
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IBMCOS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,StackPath,TencentCOS,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IBMCOS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,TencentCOS,Wasabi,Zata,Other
|
||||
- Type: string
|
||||
- Required: false
|
||||
- Examples:
|
||||
- "private"
|
||||
- Owner gets FULL_CONTROL.
|
||||
- No one else has access rights (default).
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,StackPath,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,Wasabi,Zata,Other
|
||||
- "public-read"
|
||||
- Owner gets FULL_CONTROL.
|
||||
- The AllUsers group gets READ access.
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,StackPath,TencentCOS,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,TencentCOS,Wasabi,Zata,Other
|
||||
- "public-read-write"
|
||||
- Owner gets FULL_CONTROL.
|
||||
- The AllUsers group gets READ and WRITE access.
|
||||
- Granting this on a bucket is generally not recommended.
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,StackPath,TencentCOS,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,TencentCOS,Wasabi,Zata,Other
|
||||
- "authenticated-read"
|
||||
- Owner gets FULL_CONTROL.
|
||||
- The AuthenticatedUsers group gets READ access.
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,StackPath,TencentCOS,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,TencentCOS,Wasabi,Zata,Other
|
||||
- "bucket-owner-read"
|
||||
- Object owner gets FULL_CONTROL.
|
||||
- Bucket owner gets READ access.
|
||||
- If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,StackPath,TencentCOS,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,TencentCOS,Wasabi,Zata,Other
|
||||
- "bucket-owner-full-control"
|
||||
- Both the object owner and the bucket owner get FULL_CONTROL over the object.
|
||||
- If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,StackPath,TencentCOS,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,TencentCOS,Wasabi,Zata,Other
|
||||
- "private"
|
||||
- Owner gets FULL_CONTROL.
|
||||
- No one else has access rights (default).
|
||||
@@ -3021,7 +3050,7 @@ Properties:
|
||||
|
||||
### Advanced options
|
||||
|
||||
Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, BizflyCloud, Ceph, ChinaMobile, Cloudflare, Cubbit, DigitalOcean, Dreamhost, Exaba, FileLu, FlashBlade, GCS, Hetzner, HuaweiOBS, IBMCOS, IDrive, Intercolo, IONOS, Leviia, Liara, Linode, LyveCloud, Magalu, Mega, Minio, Netease, Outscale, OVHcloud, Petabox, Qiniu, Rabata, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, Servercore, SpectraLogic, StackPath, Storj, Synology, TencentCOS, Wasabi, Zata, Other).
|
||||
Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, BizflyCloud, Ceph, ChinaMobile, Cloudflare, Cubbit, DigitalOcean, Dreamhost, Exaba, FileLu, FlashBlade, GCS, Hetzner, HuaweiOBS, IBMCOS, IDrive, Intercolo, IONOS, Leviia, Liara, Linode, LyveCloud, Magalu, Mega, Minio, Netease, Outscale, OVHcloud, Petabox, Qiniu, Rabata, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, Servercore, SpectraLogic, Storj, Synology, TencentCOS, Wasabi, Zata, Other).
|
||||
|
||||
#### --s3-bucket-acl
|
||||
|
||||
@@ -3040,7 +3069,7 @@ Properties:
|
||||
|
||||
- Config: bucket_acl
|
||||
- Env Var: RCLONE_S3_BUCKET_ACL
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IBMCOS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Mega,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,Servercore,StackPath,TencentCOS,Wasabi,Zata,Other
|
||||
- Provider: AWS,Alibaba,ArvanCloud,BizflyCloud,Ceph,ChinaMobile,Cubbit,DigitalOcean,Dreamhost,Exaba,FileLu,GCS,Hetzner,HuaweiOBS,IBMCOS,IDrive,Intercolo,IONOS,Leviia,Liara,Linode,LyveCloud,Magalu,Mega,Minio,Netease,Outscale,OVHcloud,Petabox,Qiniu,RackCorp,Scaleway,SeaweedFS,Servercore,TencentCOS,Wasabi,Zata,Other
|
||||
- Type: string
|
||||
- Required: false
|
||||
- Examples:
|
||||
@@ -5009,7 +5038,7 @@ Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
...
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Magalu, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Magalu, Netease, RackCorp, Scaleway, SeaweedFS, Storj, Synology, Tencent COS and Wasabi
|
||||
\ (s3)
|
||||
...
|
||||
Storage> s3
|
||||
@@ -5103,9 +5132,7 @@ can follow this [guide](https://docs.cubbit.io/getting-started/quickstart#api-ke
|
||||
to retrieve these keys. They will be needed when prompted by `rclone config`.
|
||||
|
||||
Default region will correspond to `eu-west-1` and the endpoint has to be specified
|
||||
as `s3.cubbit.eu`. If you set a custom tenant endpoint, you must use
|
||||
`s3.{tenant_name}.cubbit.eu`, because the generic `s3.cubbit.eu` endpoint will not
|
||||
work in this case.
|
||||
as `s3.cubbit.eu`.
|
||||
|
||||
Going through the whole process of creating a new remote by running `rclone config`,
|
||||
each prompt should be answered as shown below:
|
||||
@@ -5118,7 +5145,7 @@ env_auth> false
|
||||
access_key_id> YOUR_ACCESS_KEY
|
||||
secret_access_key> YOUR_SECRET_KEY
|
||||
region> eu-west-1 (or leave empty)
|
||||
endpoint> s3.cubbit.eu (or s3.{tenant_name}.cubbit.eu)
|
||||
endpoint> s3.cubbit.eu
|
||||
acl>
|
||||
```
|
||||
|
||||
@@ -5298,6 +5325,92 @@ secret_access_key = XXX
|
||||
endpoint = http://127.0.0.1:9000/
|
||||
```
|
||||
|
||||
### Fastly Object Storage {#fastly}
|
||||
|
||||
[Fastly Object Storage](https://www.fastly.com/products/storage) is an
|
||||
S3-compatible object storage service from Fastly. It provides three
|
||||
regions (US East, US West, and EU Central) with mandatory server-side
|
||||
encryption.
|
||||
|
||||
Here is an example of making a configuration. First run:
|
||||
|
||||
```console
|
||||
rclone config
|
||||
```
|
||||
|
||||
This will guide you through an interactive setup process.
|
||||
|
||||
```text
|
||||
No remotes found, make a new one?
|
||||
n) New remote
|
||||
s) Set configuration password
|
||||
q) Quit config
|
||||
n/s/q> n
|
||||
|
||||
Enter name for new remote.
|
||||
name> fastly
|
||||
|
||||
Option Storage.
|
||||
Type of storage to configure.
|
||||
Storage> s3
|
||||
|
||||
Option provider.
|
||||
Choose your S3 provider.
|
||||
provider> Fastly
|
||||
|
||||
Option env_auth.
|
||||
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
|
||||
Only applies if access_key_id and secret_access_key is blank.
|
||||
env_auth> false
|
||||
|
||||
Option access_key_id.
|
||||
AWS Access Key ID.
|
||||
access_key_id> YOUR_ACCESS_KEY
|
||||
|
||||
Option secret_access_key.
|
||||
AWS Secret Access Key (password).
|
||||
secret_access_key> YOUR_SECRET_KEY
|
||||
|
||||
Option region.
|
||||
Region where your bucket will be created and your data stored.
|
||||
region> us-east
|
||||
|
||||
Option endpoint.
|
||||
Endpoint for S3 API.
|
||||
endpoint> us-east.object.fastlystorage.app
|
||||
|
||||
Edit advanced config?
|
||||
y) Yes
|
||||
n) No (default)
|
||||
y/n> n
|
||||
|
||||
Configuration complete.
|
||||
Options:
|
||||
- type: s3
|
||||
- provider: Fastly
|
||||
- access_key_id: YOUR_ACCESS_KEY
|
||||
- secret_access_key: YOUR_SECRET_KEY
|
||||
- region: us-east
|
||||
- endpoint: us-east.object.fastlystorage.app
|
||||
Keep this "fastly" remote?
|
||||
y) Yes this is OK (default)
|
||||
e) Edit this remote
|
||||
d) Delete this remote
|
||||
y/e/d> y
|
||||
```
|
||||
|
||||
The resulting configuration file should look like:
|
||||
|
||||
```ini
|
||||
[fastly]
|
||||
type = s3
|
||||
provider = Fastly
|
||||
access_key_id = YOUR_ACCESS_KEY
|
||||
secret_access_key = YOUR_SECRET_KEY
|
||||
region = us-east
|
||||
endpoint = us-east.object.fastlystorage.app
|
||||
```
|
||||
|
||||
### Google Cloud Storage
|
||||
|
||||
[GoogleCloudStorage](https://cloud.google.com/storage/docs) is an
|
||||
@@ -5349,7 +5462,7 @@ Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
[snip]
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, Hetzner, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Outscale, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, Hetzner, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Outscale, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
|
||||
\ (s3)
|
||||
[snip]
|
||||
Storage> s3
|
||||
@@ -7131,7 +7244,7 @@ Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
[...]
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Outscale, OVHcloud, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Outscale, OVHcloud, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
|
||||
\ (s3)
|
||||
[...]
|
||||
Storage> s3
|
||||
@@ -7505,7 +7618,7 @@ Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
[snip]
|
||||
4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, FlashBlade, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Outscale, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
|
||||
4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, FlashBlade, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Outscale, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, Selectel, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
|
||||
\ (s3)
|
||||
[snip]
|
||||
Storage> s3
|
||||
@@ -9005,15 +9118,6 @@ To configure access to Tencent COS, follow the steps below:
|
||||
cos s3
|
||||
```
|
||||
|
||||
#### Tencent COS Global Acceleration Endpoint
|
||||
|
||||
When using the Global Acceleration Endpoint (`cos.accelerate.myqcloud.com`),
|
||||
rclone automatically sets `no_check_bucket = true` because this acceleration
|
||||
endpoint does not support the `CreateBucket` call which is used for ensuring
|
||||
a bucket's existence by rclone. Global Acceleration is a per-bucket feature,
|
||||
so you should first create the bucket in one physical region, then enable it
|
||||
in the Tencent Cloud console.
|
||||
|
||||
### Wasabi
|
||||
|
||||
[Wasabi](https://wasabi.com) is a cloud-based object storage service for a
|
||||
@@ -9127,6 +9231,125 @@ server_side_encryption =
|
||||
storage_class =
|
||||
```
|
||||
|
||||
### Zadara Object Storage {#zadara}
|
||||
|
||||
[Zadara Object Storage](https://www.zadara.com) is a fully-managed,
|
||||
enterprise-grade, S3-compatible storage solution that provides scalable,
|
||||
multi-tenant object storage with flexible deployment options (on-prem,
|
||||
hybrid, or cloud).
|
||||
|
||||
Zadara Object Storage can be configured using `rclone config` with `s3` as
|
||||
the type and `Zadara` as the provider name. Here is an example
|
||||
run of the configurator.
|
||||
|
||||
Authentication and endpoint information, including the region field,
|
||||
should be fetched from Zadara’s Object Storage management interface
|
||||
|
||||
To configure access to Zadara Object Storage, first run:
|
||||
|
||||
```console
|
||||
rclone config
|
||||
```
|
||||
|
||||
```text
|
||||
This will guide you through an interactive setup process:
|
||||
|
||||
No remotes found, make a new one\?
|
||||
n) New remote
|
||||
s) Set configuration password
|
||||
n/s> n
|
||||
|
||||
Enter name for new remote.
|
||||
name> Zadara-Object-Storage
|
||||
|
||||
Option Storage.
|
||||
Type of storage to configure.
|
||||
Choose a number from below, or type in your own value.
|
||||
|
||||
XX / Amazon S3 Compliant Storage Providers including AWS ...
|
||||
\ (s3)
|
||||
|
||||
Storage> s3
|
||||
|
||||
Option provider.
|
||||
Choose your S3 provider.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
|
||||
XX / Zadara Object Storage
|
||||
\ (Zadara)
|
||||
|
||||
provider> Zadara
|
||||
|
||||
Option env_auth.
|
||||
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
|
||||
Only applies if access_key_id and secret_access_key is blank.
|
||||
Choose a number from below, or type in your own boolean value (true or false).
|
||||
Press Enter for the default (false).
|
||||
1 / Enter AWS credentials in the next step.
|
||||
\ (false)
|
||||
2 / Get AWS credentials from the environment (env vars or IAM).
|
||||
\ (true)
|
||||
env_auth>
|
||||
|
||||
Option access_key_id.
|
||||
AWS Access Key ID.
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
access_key_id> S3_ACCESS_KEY
|
||||
|
||||
Option secret_access_key.
|
||||
AWS Secret Access Key (password).
|
||||
Leave blank for anonymous access or runtime credentials.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
secret_access_key> S3_SECRET_KEY
|
||||
|
||||
Option region.
|
||||
Region to connect to.
|
||||
Leave blank if you are using an S3 clone and you don't have a region.
|
||||
Choose a number from below, or type in your own value.
|
||||
Press Enter to leave empty.
|
||||
/ The default region.
|
||||
1 | Leave location constraint empty.
|
||||
\ (us-east-1)
|
||||
region>
|
||||
|
||||
Option endpoint.
|
||||
Endpoint for S3 API.
|
||||
Required when using an S3 clone.
|
||||
Enter a value. Press Enter to leave empty.
|
||||
endpoint> https://vsa-00000001-public-zadara-cloud-01.zadarazios.com
|
||||
|
||||
Edit advanced config?
|
||||
y) Yes
|
||||
n) No (default)
|
||||
y/n>
|
||||
|
||||
Configuration complete.
|
||||
Options:
|
||||
- type: s3
|
||||
- provider: Zadara
|
||||
- access_key_id: S3_ACCESS_KEY
|
||||
- secret_access_key: S3_SECRET_KEY
|
||||
- endpoint: https://vsa-00000001-public-zadara-cloud-01.zadarazios.com
|
||||
Keep this "Zadara-Object-Storage" remote?
|
||||
y) Yes this is OK (default)
|
||||
e) Edit this remote
|
||||
d) Delete this remote
|
||||
y/e/d> y
|
||||
```
|
||||
|
||||
This will leave the config file looking like this.
|
||||
|
||||
```ini
|
||||
[Zadara-Object-Storage]
|
||||
type = s3
|
||||
provider = Zadara
|
||||
access_key_id = S3_ACCESS_KEY
|
||||
secret_access_key = S3_SECRET_KEY
|
||||
endpoint = https://vsa-00000001-public-zadara-cloud-01.zadarazios.com
|
||||
```
|
||||
|
||||
### Zata Object Storage {#Zata}
|
||||
|
||||
[Zata Object Storage](https://zata.ai/) provides a secure, S3-compatible cloud
|
||||
|
||||
@@ -12,6 +12,7 @@ security: High
|
||||
virtual: false
|
||||
remote: 'TestDrime:'
|
||||
features:
|
||||
- About
|
||||
- CanHaveEmptyDirectories
|
||||
- Copy
|
||||
- DirCacheFlush
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"beta" "This feature is currently in beta must be used with care."
|
||||
}}
|
||||
|
||||
{{ if .Params.versionIntroduced }}<span class="badge badge-pill badge-secondary float-right" style="margin-top: 30px; font-size: 100%" title="This feature needs Rclone {{ .Params.versionIntroduced }} or later.">added in {{ .Params.versionIntroduced }}</span>{{ end }}
|
||||
{{ if .Params.versionIntroduced }}<span class="badge badge-pill badge-secondary float-right" style="margin-top: 30px; font-size: 100%" title="This feature needs Rclone {{ .Params.versionIntroduced }} or later.">{{ .Params.versionIntroduced }}</span>{{ end }}
|
||||
|
||||
{{ with .Params.status | lower }}
|
||||
{{ $statusCode := . }}
|
||||
|
||||
@@ -1 +1 @@
|
||||
v1.73.5
|
||||
v1.74.0
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 404 B |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 704 B |
@@ -11,6 +11,7 @@ import (
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/rclone/rclone/fs/rc"
|
||||
"github.com/rclone/rclone/lib/transferaccounter"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/asyncreader"
|
||||
@@ -312,6 +313,15 @@ func (acc *Account) serverSideEnd(n int64) {
|
||||
}
|
||||
}
|
||||
|
||||
// NewServerSideCopyAccounter returns a TransferAccounter for a server
|
||||
// side copy and a new ctx with it embedded
|
||||
func (acc *Account) NewServerSideCopyAccounter(ctx context.Context) (context.Context, *transferaccounter.TransferAccounter) {
|
||||
return transferaccounter.New(ctx, func(n int64) {
|
||||
acc.stats.AddServerSideCopyBytes(n)
|
||||
acc.accountReadNoNetwork(n)
|
||||
})
|
||||
}
|
||||
|
||||
// ServerSideCopyEnd accounts for a read of n bytes in a server-side copy
|
||||
func (acc *Account) ServerSideCopyEnd(n int64) {
|
||||
acc.stats.AddServerSideCopy(n)
|
||||
@@ -363,6 +373,17 @@ func (acc *Account) accountRead(n int) {
|
||||
acc.limitPerFileBandwidth(n)
|
||||
}
|
||||
|
||||
// Account the read if not using network (eg for server side copies)
|
||||
func (acc *Account) accountReadNoNetwork(n int64) {
|
||||
// Update Stats
|
||||
acc.values.mu.Lock()
|
||||
acc.values.lpBytes += n
|
||||
acc.values.bytes += n
|
||||
acc.values.mu.Unlock()
|
||||
|
||||
acc.stats.BytesNoNetwork(n)
|
||||
}
|
||||
|
||||
// read bytes from the io.Reader passed in and account them
|
||||
func (acc *Account) read(in io.Reader, p []byte) (n int, err error) {
|
||||
bytesUntilLimit, err := acc.checkReadBefore()
|
||||
@@ -575,8 +596,11 @@ func (acc *Account) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
var displaySpeedString string
|
||||
if acc.ci.DataRateUnit == "bits" {
|
||||
cur *= 8
|
||||
displaySpeedString = fs.SizeSuffix(cur * 8).BitRateUnit()
|
||||
} else {
|
||||
displaySpeedString = fs.SizeSuffix(cur).ByteRateUnit()
|
||||
}
|
||||
|
||||
percentageDone := 0
|
||||
@@ -584,12 +608,12 @@ func (acc *Account) String() string {
|
||||
percentageDone = int(100 * float64(a) / float64(b))
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%*s:%3d%% /%s, %s/s, %s",
|
||||
return fmt.Sprintf("%*s:%3d%% / %s, %s, %s",
|
||||
acc.ci.StatsFileNameLength,
|
||||
shortenName(acc.name, acc.ci.StatsFileNameLength),
|
||||
percentageDone,
|
||||
fs.SizeSuffix(b),
|
||||
fs.SizeSuffix(cur),
|
||||
fs.SizeSuffix(b).ByteUnit(),
|
||||
displaySpeedString,
|
||||
etas,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -183,14 +183,14 @@ func TestAccountString(t *testing.T) {
|
||||
|
||||
// FIXME not an exhaustive test!
|
||||
|
||||
assert.Equal(t, "test: 0% /3, 0/s, -", strings.TrimSpace(acc.String()))
|
||||
assert.Equal(t, "test: 0% / 3 B, 0 B/s, -", strings.TrimSpace(acc.String()))
|
||||
|
||||
var buf = make([]byte, 2)
|
||||
n, err := acc.Read(buf)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 2, n)
|
||||
|
||||
assert.Equal(t, "test: 66% /3, 0/s, -", strings.TrimSpace(acc.String()))
|
||||
assert.Equal(t, "test: 66% / 3 B, 0 B/s, -", strings.TrimSpace(acc.String()))
|
||||
|
||||
assert.NoError(t, acc.Close())
|
||||
}
|
||||
|
||||
@@ -960,6 +960,13 @@ func (s *StatsInfo) AddServerSideMove(n int64) {
|
||||
s.mu.Unlock()
|
||||
}
|
||||
|
||||
// AddServerSideCopyBytes adds bytes for a server side copy
|
||||
func (s *StatsInfo) AddServerSideCopyBytes(n int64) {
|
||||
s.mu.Lock()
|
||||
s.serverSideCopyBytes += n
|
||||
s.mu.Unlock()
|
||||
}
|
||||
|
||||
// AddServerSideCopy counts a server side copy
|
||||
func (s *StatsInfo) AddServerSideCopy(n int64) {
|
||||
s.mu.Lock()
|
||||
|
||||
@@ -19,7 +19,7 @@ type TransferSnapshot struct {
|
||||
Checked bool `json:"checked"`
|
||||
What string `json:"what"`
|
||||
StartedAt time.Time `json:"started_at"`
|
||||
CompletedAt time.Time `json:"completed_at,omitempty"`
|
||||
CompletedAt time.Time `json:"completed_at"`
|
||||
Error error `json:"-"`
|
||||
Group string `json:"group"`
|
||||
SrcFs string `json:"srcFs,omitempty"`
|
||||
|
||||
@@ -265,9 +265,7 @@ func testAsyncReaderClose(t *testing.T, writeto bool) {
|
||||
var copyErr error
|
||||
var wg sync.WaitGroup
|
||||
started := make(chan struct{})
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
close(started)
|
||||
if writeto {
|
||||
// exercise the WriteTo path
|
||||
@@ -284,7 +282,7 @@ func testAsyncReaderClose(t *testing.T, writeto bool) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
// Do some copying
|
||||
<-started
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
@@ -163,7 +163,7 @@ type Item struct {
|
||||
// struct, otherwise they will be embedded as they are.
|
||||
func Items(opt any) (items []Item, err error) {
|
||||
def := reflect.ValueOf(opt)
|
||||
if def.Kind() != reflect.Ptr {
|
||||
if def.Kind() != reflect.Pointer {
|
||||
return nil, errors.New("argument must be a pointer")
|
||||
}
|
||||
def = def.Elem() // indirect the pointer
|
||||
|
||||
@@ -198,18 +198,21 @@ func NewFilter(opt *Options) (f *Filter, err error) {
|
||||
// Filter flags
|
||||
if f.Opt.MinAge.IsSet() {
|
||||
f.ModTimeTo = time.Now().Add(-time.Duration(f.Opt.MinAge))
|
||||
fs.Debugf(nil, "--min-age %v to %v", f.Opt.MinAge, f.ModTimeTo)
|
||||
}
|
||||
if f.Opt.MaxAge.IsSet() {
|
||||
f.ModTimeFrom = time.Now().Add(-time.Duration(f.Opt.MaxAge))
|
||||
if !f.ModTimeTo.IsZero() && f.ModTimeTo.Before(f.ModTimeFrom) {
|
||||
return nil, fmt.Errorf("filter: --min-age %q can't be larger than --max-age %q", opt.MinAge, opt.MaxAge)
|
||||
}
|
||||
fs.Debugf(nil, "--max-age %v to %v", f.Opt.MaxAge, f.ModTimeFrom)
|
||||
}
|
||||
if f.Opt.HashFilter != "" {
|
||||
f.hashFilterK, f.hashFilterN, err = parseHashFilter(f.Opt.HashFilter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fs.Debugf(nil, "Using --hash-filter %d/%d", f.hashFilterK, f.hashFilterN)
|
||||
}
|
||||
|
||||
err = parseRules(&f.Opt.RulesOpt, f.Add, f.Clear)
|
||||
|
||||
@@ -50,7 +50,6 @@ type Sorter struct {
|
||||
errChan <-chan error // for getting errors from the ext sort
|
||||
sorter *extsort.StringSorter // external string sort
|
||||
errs *errcount.ErrCount // accumulate errors
|
||||
tempDir string // directory for temp files (empty for default)
|
||||
}
|
||||
|
||||
// KeyFn turns an entry into a sort key
|
||||
@@ -145,7 +144,6 @@ func (ls *Sorter) startExtSort() (err error) {
|
||||
ChanBuffSize: 1024, // small effect
|
||||
SortedChanBuffSize: 1024, // makes a lot of difference
|
||||
ChunkSize: 32 * 1024, // tuned for 50 char records (UUID sized)
|
||||
TempFilesDir: ls.tempDir,
|
||||
// Defaults
|
||||
// ChunkSize: int(1e6), // amount of records to store in each chunk which will be written to disk
|
||||
// NumWorkers: 2, // maximum number of workers to use for parallel sorting
|
||||
@@ -154,17 +152,6 @@ func (ls *Sorter) startExtSort() (err error) {
|
||||
// TempFilesDir: "", // empty for use OS default ex: /tmp
|
||||
}
|
||||
ls.sorter, ls.outputChan, ls.errChan = extsort.Strings(ls.inputChan, &opt)
|
||||
if ls.sorter == nil {
|
||||
// extsort.Strings returns nil when it can't create temp
|
||||
// files (e.g. due to permissions or apparmor restrictions).
|
||||
// The error will be on errChan.
|
||||
select {
|
||||
case err = <-ls.errChan:
|
||||
default:
|
||||
err = errors.New("failed to initialise on-disk sort")
|
||||
}
|
||||
return fmt.Errorf("sorter: %w", err)
|
||||
}
|
||||
go ls.sorter.Sort(ls.ctx)
|
||||
|
||||
// Show we are extsorting now
|
||||
|
||||
@@ -4,9 +4,6 @@ import (
|
||||
"cmp"
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -234,51 +231,6 @@ func TestSorterExt(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test that startExtSort returns an error instead of panicking when
|
||||
// temp file creation fails (e.g. due to permissions or apparmor).
|
||||
// See: https://github.com/rclone/rclone/issues/9244
|
||||
func TestSorterExtTempFileError(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ctx, ci := fs.AddConfig(ctx)
|
||||
ci.ListCutoff = 1 // force ext sort on first Add
|
||||
|
||||
callback := func(entries fs.DirEntries) error {
|
||||
return nil
|
||||
}
|
||||
ls, err := NewSorter(ctx, nil, callback, nil)
|
||||
require.NoError(t, err)
|
||||
defer ls.CleanUp()
|
||||
|
||||
// Override tempDir to a path where os.MkdirAll will fail,
|
||||
// simulating apparmor or permission denial. This makes
|
||||
// extsort.Strings return a nil sorter.
|
||||
if runtime.GOOS == "windows" {
|
||||
// On Windows, create a regular file and use a child path.
|
||||
// os.MkdirAll fails because an intermediate component is a file.
|
||||
// Windows stat returns ERROR_PATH_NOT_FOUND (treated as
|
||||
// IsNotExist) so the extsort library won't fall back to a
|
||||
// default directory.
|
||||
blocker := filepath.Join(t.TempDir(), "notadir")
|
||||
require.NoError(t, os.WriteFile(blocker, []byte("x"), 0644))
|
||||
ls.tempDir = filepath.Join(blocker, "sub")
|
||||
} else {
|
||||
// On Unix, create a read-only parent directory. stat on the
|
||||
// child returns ENOENT so the extsort library won't fall
|
||||
// back, but os.MkdirAll fails with EACCES.
|
||||
parent := filepath.Join(t.TempDir(), "roparent")
|
||||
require.NoError(t, os.Mkdir(parent, 0o755))
|
||||
require.NoError(t, os.Chmod(parent, 0o555))
|
||||
t.Cleanup(func() { _ = os.Chmod(parent, 0o755) })
|
||||
ls.tempDir = filepath.Join(parent, "child")
|
||||
}
|
||||
|
||||
// Add enough entries to trigger ext sort. Before the fix this
|
||||
// would panic with nil pointer dereference.
|
||||
err = ls.Add(fs.DirEntries{mockobject.Object("a"), mockobject.Object("b")})
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "sorter:")
|
||||
}
|
||||
|
||||
// benchFs implements enough of the fs.Fs interface for Sorter
|
||||
type benchFs struct{}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ func Trace(o any, format string, a ...any) func(string, ...any) {
|
||||
for i := range a {
|
||||
// read the values of the pointed to items
|
||||
typ := reflect.TypeOf(a[i])
|
||||
if typ.Kind() == reflect.Ptr {
|
||||
if typ.Kind() == reflect.Pointer {
|
||||
value := reflect.ValueOf(a[i])
|
||||
if value.IsNil() {
|
||||
a[i] = nil
|
||||
|
||||
@@ -205,9 +205,7 @@ func (m *March) Run(ctx context.Context) error {
|
||||
checkers := ci.Checkers
|
||||
in := make(chan listDirJob, checkers)
|
||||
for range checkers {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for {
|
||||
select {
|
||||
case <-m.Ctx.Done():
|
||||
@@ -244,7 +242,7 @@ func (m *March) Run(ctx context.Context) error {
|
||||
traversing.Done()
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
// Start the process
|
||||
@@ -393,9 +391,7 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
||||
// List the src and dst directories
|
||||
if !job.noSrc {
|
||||
srcChan := srcChan // duplicate this as we may override it later
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
srcListErr = m.srcListDir(job.srcRemote, func(entries fs.DirEntries) error {
|
||||
for _, entry := range entries {
|
||||
srcChan <- entry
|
||||
@@ -403,16 +399,14 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
||||
return nil
|
||||
})
|
||||
close(srcChan)
|
||||
}()
|
||||
})
|
||||
} else {
|
||||
close(srcChan)
|
||||
}
|
||||
startedDst := false
|
||||
if !m.NoTraverse && !job.noDst {
|
||||
startedDst = true
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
dstListErr = m.dstListDir(job.dstRemote, func(entries fs.DirEntries) error {
|
||||
for _, entry := range entries {
|
||||
dstChan <- entry
|
||||
@@ -420,7 +414,7 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
||||
return nil
|
||||
})
|
||||
close(dstChan)
|
||||
}()
|
||||
})
|
||||
}
|
||||
// If NoTraverse is set, then try to find a matching object
|
||||
// for each item in the srcList to head dst object
|
||||
@@ -455,9 +449,7 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
||||
// Get the tasks from the queue and find a matching object.
|
||||
var workerWg sync.WaitGroup
|
||||
for range workers {
|
||||
workerWg.Add(1)
|
||||
go func() {
|
||||
defer workerWg.Done()
|
||||
workerWg.Go(func() {
|
||||
for t := range matchTasks {
|
||||
// Can't match directories with NewObject
|
||||
if _, ok := t.src.(fs.Object); !ok {
|
||||
@@ -476,7 +468,7 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
||||
}
|
||||
t.dstMatch <- dst
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
// Close dstResults when all the workers have finished
|
||||
@@ -486,9 +478,7 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
||||
}()
|
||||
|
||||
// Read the matches in order and send them to dstChan if found.
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for dstMatch := range dstMatches {
|
||||
dst := <-dstMatch
|
||||
// Note that dst may be nil here
|
||||
@@ -497,7 +487,7 @@ func (m *March) processJob(job listDirJob) ([]listDirJob, error) {
|
||||
}
|
||||
close(srcChan)
|
||||
close(dstChan)
|
||||
}()
|
||||
})
|
||||
}
|
||||
if !startedDst {
|
||||
close(dstChan)
|
||||
|
||||
@@ -508,9 +508,7 @@ func TestMatchListings(t *testing.T) {
|
||||
}
|
||||
ls, err := list.NewSorter(ctx, nil, list.SortToChan(out), key)
|
||||
require.NoError(t, err)
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for i := 0; i < len(test.input); i += 2 {
|
||||
entry := test.input[i+offset]
|
||||
if entry != nil {
|
||||
@@ -520,7 +518,7 @@ func TestMatchListings(t *testing.T) {
|
||||
require.NoError(t, ls.Send())
|
||||
ls.CleanUp()
|
||||
close(out)
|
||||
}()
|
||||
})
|
||||
return out
|
||||
}
|
||||
|
||||
|
||||
@@ -151,9 +151,17 @@ func (c *copy) serverSideCopy(ctx context.Context) (actionTaken string, newDst f
|
||||
}
|
||||
in := c.tr.Account(ctx, nil) // account the transfer
|
||||
in.ServerSideTransferStart()
|
||||
newDst, err = doCopy(ctx, c.src, c.remoteForCopy)
|
||||
newCtx, ta := in.NewServerSideCopyAccounter(ctx)
|
||||
newDst, err = doCopy(newCtx, c.src, c.remoteForCopy)
|
||||
if err == nil {
|
||||
in.ServerSideCopyEnd(newDst.Size()) // account the bytes for the server-side transfer
|
||||
var n int64
|
||||
if !ta.Started() {
|
||||
n = newDst.Size()
|
||||
}
|
||||
in.ServerSideCopyEnd(n) // account the bytes for the server-side transfer
|
||||
} else {
|
||||
// Rewind any stats counted on error
|
||||
ta.Reset()
|
||||
}
|
||||
_ = in.Close()
|
||||
if errors.Is(err, fs.ErrorCantCopy) {
|
||||
|
||||
@@ -64,25 +64,15 @@ type multiThreadCopyState struct {
|
||||
}
|
||||
|
||||
// Copy a single chunk into place
|
||||
func (mc *multiThreadCopyState) copyChunk(ctx context.Context, chunk int, writer fs.ChunkWriter) (err error) {
|
||||
func (mc *multiThreadCopyState) copyChunk(ctx context.Context, chunk int, writer fs.ChunkWriter, start, end, size int64, rw *pool.RW) (err error) {
|
||||
defer func() {
|
||||
if !mc.noBuffering {
|
||||
fs.CheckClose(rw, &err)
|
||||
}
|
||||
if err != nil {
|
||||
fs.Debugf(mc.src, "multi-thread copy: chunk %d/%d failed: %v", chunk+1, mc.numChunks, err)
|
||||
}
|
||||
}()
|
||||
start := int64(chunk) * mc.partSize
|
||||
if start >= mc.size {
|
||||
return nil
|
||||
}
|
||||
end := min(start+mc.partSize, mc.size)
|
||||
size := end - start
|
||||
|
||||
// Reserve the memory first so we don't open the source and wait for memory buffers for ages
|
||||
var rw *pool.RW
|
||||
if !mc.noBuffering {
|
||||
rw = multipart.NewRW().Reserve(size)
|
||||
defer fs.CheckClose(rw, &err)
|
||||
}
|
||||
|
||||
fs.Debugf(mc.src, "multi-thread copy: chunk %d/%d (%d-%d) size %v starting", chunk+1, mc.numChunks, start, end, fs.SizeSuffix(size))
|
||||
|
||||
@@ -226,9 +216,24 @@ func multiThreadCopy(ctx context.Context, f fs.Fs, remote string, src fs.Object,
|
||||
if gCtx.Err() != nil {
|
||||
break
|
||||
}
|
||||
chunk := chunk
|
||||
|
||||
// Work out how big and where the chunk is
|
||||
start := int64(chunk) * mc.partSize
|
||||
if start >= mc.size {
|
||||
continue
|
||||
}
|
||||
end := min(start+mc.partSize, mc.size)
|
||||
size := end - start
|
||||
|
||||
// Reserve the memory first so we don't open the source and wait for memory buffers for ages
|
||||
// This also avoids creating an excess of goroutines all waiting on memory.
|
||||
var rw *pool.RW
|
||||
if !mc.noBuffering {
|
||||
rw = multipart.NewRW().Reserve(size)
|
||||
}
|
||||
|
||||
g.Go(func() error {
|
||||
return mc.copyChunk(gCtx, chunk, chunkWriter)
|
||||
return mc.copyChunk(gCtx, chunk, chunkWriter, start, end, size, rw)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -430,10 +430,9 @@ func rcPublicLink(ctx context.Context, in rc.Params) (out rc.Params, err error)
|
||||
|
||||
func init() {
|
||||
rc.Add(rc.Call{
|
||||
Path: "operations/fsinfo",
|
||||
AuthRequired: true,
|
||||
Fn: rcFsInfo,
|
||||
Title: "Return information about the remote",
|
||||
Path: "operations/fsinfo",
|
||||
Fn: rcFsInfo,
|
||||
Title: "Return information about the remote",
|
||||
Help: `This takes the following parameters:
|
||||
|
||||
- fs - a remote name string e.g. "drive:"
|
||||
|
||||
@@ -146,10 +146,9 @@ func rcOptionsLocal(ctx context.Context, in Params) (out Params, err error) {
|
||||
|
||||
func init() {
|
||||
Add(Call{
|
||||
Path: "options/set",
|
||||
AuthRequired: true,
|
||||
Fn: rcOptionsSet,
|
||||
Title: "Set an option",
|
||||
Path: "options/set",
|
||||
Fn: rcOptionsSet,
|
||||
Title: "Set an option",
|
||||
Help: `Parameters:
|
||||
|
||||
- option block name containing an object with
|
||||
|
||||
@@ -53,7 +53,6 @@ type Server struct {
|
||||
files http.Handler
|
||||
pluginsHandler http.Handler
|
||||
opt *rc.Options
|
||||
noAuth bool // snapshot of opt.NoAuth at startup to prevent runtime mutation
|
||||
}
|
||||
|
||||
func newServer(ctx context.Context, opt *rc.Options, mux *http.ServeMux) (*Server, error) {
|
||||
@@ -105,7 +104,6 @@ func newServer(ctx context.Context, opt *rc.Options, mux *http.ServeMux) (*Serve
|
||||
opt: opt,
|
||||
files: fileHandler,
|
||||
pluginsHandler: pluginsHandler,
|
||||
noAuth: opt.NoAuth,
|
||||
}
|
||||
|
||||
var err error
|
||||
@@ -265,7 +263,7 @@ func (s *Server) handlePost(w http.ResponseWriter, r *http.Request, path string)
|
||||
}
|
||||
|
||||
// Check to see if it requires authorisation
|
||||
if !s.noAuth && call.AuthRequired && !s.server.UsingAuth() {
|
||||
if !s.opt.NoAuth && call.AuthRequired && !s.server.UsingAuth() {
|
||||
writeError(path, in, w, fmt.Errorf("authentication must be set up on the rc server to use %q or the --rc-no-auth flag must be in use", path), http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||