Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

pcloud: only use SHA1 hashes in EU region

Nick Craig-Woodf43a9ac17e96
diff --git a/backend/pcloud/api/types.go b/backend/pcloud/api/types.go
index 8c0300b72..974d9f5f3 100644
--- a/backend/pcloud/api/types.go
+++ b/backend/pcloud/api/types.go
@@ -104,8 +104,9 @@ type ItemResult struct {
// Hashes contains the supported hashes
type Hashes struct {
- SHA1 string `json:"sha1"`
- MD5 string `json:"md5"`
+ SHA1 string `json:"sha1"`
+ MD5 string `json:"md5"`
+ SHA256 string `json:"sha256"`
}
// UploadFileResponse is the response from /uploadfile
diff --git a/backend/pcloud/pcloud.go b/backend/pcloud/pcloud.go
index d8c533036..7ffec4853 100644
--- a/backend/pcloud/pcloud.go
+++ b/backend/pcloud/pcloud.go
@@ -884,6 +884,13 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) {
// Hashes returns the supported hash sets.
func (f *Fs) Hashes() hash.Set {
+ // EU region supports SHA1 and SHA256 (but rclone doesn't
+ // support SHA256 yet).
+ //
+ // https://forum.rclone.org/t/pcloud-to-local-no-hashes-in-common/19440
+ if f.opt.Hostname == "eapi.pcloud.com" {
+ return hash.Set(hash.SHA1)
+ }
return hash.Set(hash.MD5 | hash.SHA1)
}
diff --git a/docs/content/overview.md b/docs/content/overview.md
index cc235c733..10f6867c2 100644
--- a/docs/content/overview.md
+++ b/docs/content/overview.md
@@ -22,7 +22,7 @@ Here is an overview of the major features of each cloud storage system.
| Backblaze B2 | SHA1 | Yes | No | No | R/W |
| Box | SHA1 | Yes | Yes | No | - |
| Citrix ShareFile | MD5 | Yes | Yes | No | - |
-| Dropbox | DBHASH † | Yes | Yes | No | - |
+| Dropbox | DBHASH ¹ | Yes | Yes | No | - |
| FTP | - | No | No | No | - |
| Google Cloud Storage | MD5 | Yes | No | No | R/W |
| Google Drive | MD5 | Yes | No | Yes | R/W |
@@ -31,51 +31,61 @@ Here is an overview of the major features of each cloud storage system.
| Hubic | MD5 | Yes | No | No | R/W |
| Jottacloud | MD5 | Yes | Yes | No | R/W |
| Koofr | MD5 | No | Yes | No | - |
-| Mail.ru Cloud | Mailru ‡‡‡ | Yes | Yes | No | - |
+| Mail.ru Cloud | Mailru ⁶ | Yes | Yes | No | - |
| Mega | - | No | No | Yes | - |
| Memory | MD5 | Yes | No | No | - |
| Microsoft Azure Blob Storage | MD5 | Yes | No | No | R/W |
-| Microsoft OneDrive | SHA1 ‡‡ | Yes | Yes | No | R |
-| OpenDrive | MD5 | Yes | Yes | Partial \* | - |
+| Microsoft OneDrive | SHA1 ⁵ | Yes | Yes | No | R |
+| OpenDrive | MD5 | Yes | Yes | Partial ⁸ | - |
| OpenStack Swift | MD5 | Yes | No | No | R/W |
-| pCloud | MD5, SHA1 | Yes | No | No | W |
+| pCloud | MD5, SHA1 ⁷ | Yes | No | No | W |
| premiumize.me | - | No | Yes | No | R |
| put.io | CRC-32 | Yes | No | Yes | R |
| QingStor | MD5 | No | No | No | R/W |
| Seafile | - | No | No | No | - |
-| SFTP | MD5, SHA1 ‡ | Yes | Depends | No | - |
+| SFTP | MD5, SHA1 ² | Yes | Depends | No | - |
| SugarSync | - | No | No | No | - |
| Tardigrade | - | Yes | No | No | - |
-| WebDAV | MD5, SHA1 ††| Yes ††† | Depends | No | - |
+| WebDAV | MD5, SHA1 ³ | Yes ⁴ | Depends | No | - |
| Yandex Disk | MD5 | Yes | No | No | R/W |
| The local filesystem | All | Yes | Depends | No | - |
-### Hash ###
-
-The cloud storage system supports various hash types of the objects.
-The hashes are used when transferring data as an integrity check and
-can be specifically used with the `--checksum` flag in syncs and in
-the `check` command.
+### Notes
-To use the verify checksums when transferring between cloud storage
-systems they must support a common hash type.
-
-† Note that Dropbox supports [its own custom
+¹ Dropbox supports [its own custom
hash](https://www.dropbox.com/developers/reference/content-hash).
This is an SHA256 sum of all the 4MB block SHA256s.
-‡ SFTP supports checksums if the same login has shell access and `md5sum`
-or `sha1sum` as well as `echo` are in the remote's PATH.
+² SFTP supports checksums if the same login has shell access and
+`md5sum` or `sha1sum` as well as `echo` are in the remote's PATH.
-†† WebDAV supports hashes when used with Owncloud and Nextcloud only.
+³ WebDAV supports hashes when used with Owncloud and Nextcloud only.
-††† WebDAV supports modtimes when used with Owncloud and Nextcloud only.
+⁴ WebDAV supports modtimes when used with Owncloud and Nextcloud only.
-‡‡ Microsoft OneDrive Personal supports SHA1 hashes, whereas OneDrive
+⁵ Microsoft OneDrive Personal supports SHA1 hashes, whereas OneDrive
for business and SharePoint server support Microsoft's own
[QuickXorHash](https://docs.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash).
-‡‡‡ Mail.ru uses its own modified SHA1 hash
+⁶ Mail.ru uses its own modified SHA1 hash
+
+⁷ pCloud only supports SHA1 (not MD5) in its EU region
+
+⁸ Opendrive does not support creation of duplicate files using
+their web client interface or other stock clients, but the underlying
+storage platform has been determined to allow duplicate files, and it
+is possible to create them with `rclone`. It may be that this is a
+mistake or an unsupported feature.
+
+### Hash ###
+
+The cloud storage system supports various hash types of the objects.
+The hashes are used when transferring data as an integrity check and
+can be specifically used with the `--checksum` flag in syncs and in
+the `check` command.
+
+To use the verify checksums when transferring between cloud storage
+systems they must support a common hash type.
### ModTime ###
@@ -117,12 +127,6 @@ objects with the same name.
This confuses rclone greatly when syncing - use the `rclone dedupe`
command to rename or remove duplicates.
-\* Opendrive does not support creation of duplicate files using
-their web client interface or other stock clients, but the underlying
-storage platform has been determined to allow duplicate files, and it
-is possible to create them with `rclone`. It may be that this is a
-mistake or an unsupported feature.
-
### Restricted filenames ###
Some cloud storage systems might have restrictions on the characters
diff --git a/docs/content/pcloud.md b/docs/content/pcloud.md
index 682e0f3ad..adac14e39 100644
--- a/docs/content/pcloud.md
+++ b/docs/content/pcloud.md
@@ -90,8 +90,11 @@ second. These will be used to detect whether objects need syncing or
not. In order to set a Modification time pCloud requires the object
be re-uploaded.
-pCloud supports MD5 and SHA1 type hashes, so you can use the
-`--checksum` flag.
+pCloud supports MD5 and SHA1 type hashes in the US region but and SHA1
+only in the EU region, so you can use the `--checksum` flag.
+
+(Note that pCloud also support SHA256 in the EU region, but rclone
+does not have support for that yet.)
#### Restricted filename characters