From f1a8420814961bd43119c605f53e76f44a619961 Mon Sep 17 00:00:00 2001 From: BakaWang Date: Thu, 6 Jul 2023 17:54:07 +0800 Subject: [PATCH] s3: add synology to s3 provider list --- README.md | 1 + backend/s3/s3.go | 53 +++++++++++- docs/content/_index.md | 1 + docs/content/s3.md | 178 ++++++++++++++++++++++++++++++++++++++--- 4 files changed, 220 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d38a131eb..221041854 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ Rclone *("rsync for cloud storage")* is a command-line program to sync files and * 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) * Tencent Cloud Object Storage (COS) [:page_facing_up:](https://rclone.org/s3/#tencent-cos) * Wasabi [:page_facing_up:](https://rclone.org/s3/#wasabi) * WebDAV [:page_facing_up:](https://rclone.org/webdav/) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index f9ca3d3ff..ae7a5f05b 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -66,7 +66,7 @@ import ( func init() { fs.Register(&fs.RegInfo{ Name: "s3", - Description: "Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi", + Description: "Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi", NewFs: NewFs, CommandHelp: commandHelp, Config: func(ctx context.Context, name string, m configmap.Mapper, config fs.ConfigIn) (*fs.ConfigOut, error) { @@ -154,6 +154,9 @@ func init() { }, { Value: "Storj", Help: "Storj (S3 Compatible Gateway)", + }, { + Value: "Synology", + Help: "Synology C2 Object Storage", }, { Value: "TencentCOS", Help: "Tencent Cloud Object Storage (COS)", @@ -463,10 +466,30 @@ func init() { Value: "sa-east-1", Help: "South America (São Paulo)", }}, + }, { + Name: "region", + Help: "Region where your data stored.\n", + Provider: "Synology", + Examples: []fs.OptionExample{{ + Value: "eu-001", + Help: "Europe Region 1", + }, { + Value: "eu-002", + Help: "Europe Region 2", + }, { + Value: "us-001", + Help: "US Region 1", + }, { + Value: "us-002", + Help: "US Region 2", + }, { + Value: "tw-001", + Help: "Asia (Taiwan)", + }}, }, { Name: "region", Help: "Region to connect to.\n\nLeave blank if you are using an S3 clone and you don't have a region.", - Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,TencentCOS,HuaweiOBS,IDrive", + Provider: "!AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,Synology,TencentCOS,HuaweiOBS,IDrive", Examples: []fs.OptionExample{{ Value: "", Help: "Use this if unsure.\nWill use v4 signatures and an empty region.", @@ -1000,6 +1023,26 @@ func init() { Value: "gateway.storjshare.io", Help: "Global Hosted Gateway", }}, + }, { + Name: "endpoint", + Help: "Endpoint for Synology C2 Object Storage API.", + Provider: "Synology", + Examples: []fs.OptionExample{{ + Value: "eu-001.s3.synologyc2.net", + Help: "EU Endpoint 1", + }, { + Value: "eu-002.s3.synologyc2.net", + Help: "EU Endpoint 2", + }, { + Value: "us-001.s3.synologyc2.net", + Help: "US Endpoint 1", + }, { + Value: "us-002.s3.synologyc2.net", + Help: "US Endpoint 2", + }, { + Value: "tw-001.s3.synologyc2.net", + Help: "TW Endpoint 1", + }}, }, { // cos endpoints: https://intl.cloud.tencent.com/document/product/436/6224 Name: "endpoint", @@ -1156,7 +1199,7 @@ func init() { }, { Name: "endpoint", Help: "Endpoint for S3 API.\n\nRequired when using an S3 clone.", - Provider: "!AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,RackCorp,Qiniu,Petabox", + Provider: "!AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,Synology,RackCorp,Qiniu,Petabox", Examples: []fs.OptionExample{{ Value: "objects-us-east-1.dream.io", Help: "Dream Objects endpoint", @@ -1659,7 +1702,7 @@ doesn't copy the ACL from the source but rather writes a fresh one. If the acl is an empty string then no X-Amz-Acl: header is added and the default (private) will be used. `, - Provider: "!Storj,Cloudflare", + Provider: "!Storj,Synology,Cloudflare", Examples: []fs.OptionExample{{ Value: "default", Help: "Owner gets Full_CONTROL.\nNo one else has access rights (default).", @@ -2969,6 +3012,8 @@ func setQuirks(opt *Options) { if opt.ChunkSize < 64*fs.Mebi { opt.ChunkSize = 64 * fs.Mebi } + case "Synology": + useMultipartEtag = false case "TencentCOS": listObjectsV2 = false // untested useMultipartEtag = false // untested diff --git a/docs/content/_index.md b/docs/content/_index.md index ba4611855..88972625e 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -170,6 +170,7 @@ WebDAV or S3, that work out of the box.) {{< provider name="SMB / CIFS" home="https://en.wikipedia.org/wiki/Server_Message_Block" config="/smb/" >}} {{< 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/" >}} {{< provider name="Tencent Cloud Object Storage (COS)" home="https://intl.cloud.tencent.com/product/cos" config="/s3/#tencent-cos" >}} {{< provider name="Uptobox" home="https://uptobox.com" config="/uptobox/" >}} diff --git a/docs/content/s3.md b/docs/content/s3.md index bbaaff602..e379f7f34 100644 --- a/docs/content/s3.md +++ b/docs/content/s3.md @@ -32,6 +32,7 @@ The S3 backend can be used with a number of different providers: {{< provider name="SeaweedFS" home="https://github.com/chrislusf/seaweedfs/" config="/s3/#seaweedfs" >}} {{< 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_list >}} @@ -649,7 +650,7 @@ A simple solution is to set the `--s3-upload-cutoff 0` and force all the files t {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/s3/s3.go then run make backenddocs" >}} ### Standard options -Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi). +Here are the Standard options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi). #### --s3-provider @@ -708,6 +709,8 @@ Properties: - StackPath Object Storage - "Storj" - Storj (S3 Compatible Gateway) + - "Synology" + - Synology C2 Object Storage - "TencentCOS" - Tencent Cloud Object Storage (COS) - "Wasabi" @@ -1069,7 +1072,7 @@ Properties: - Config: region - Env Var: RCLONE_S3_REGION -- Provider: !AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,TencentCOS,HuaweiOBS,IDrive +- Provider: !AWS,Alibaba,ArvanCloud,ChinaMobile,Cloudflare,IONOS,Petabox,Liara,Qiniu,RackCorp,Scaleway,Storj,Synology,TencentCOS,HuaweiOBS,IDrive - Type: string - Required: false - Examples: @@ -1565,6 +1568,29 @@ Properties: #### --s3-endpoint +Endpoint for Synology C2 Object Storage API. + +Properties: + +- Config: endpoint +- Env Var: RCLONE_S3_ENDPOINT +- Provider: Synology +- Type: string +- Required: false +- Examples: + - "eu-001.s3.synologyc2.net" + - Europe Region 1 + - "eu-002.s3.synologyc2.net" + - Europe Region 2 + - "us-001.s3.synologyc2.net" + - US Region 1 + - "us-002.s3.synologyc2.net" + - US Region 2 + - "tw-001.s3.synologyc2.net" + - Asia Region (Taiwan) + +#### --s3-endpoint + Endpoint for Tencent COS API. Properties: @@ -1702,7 +1728,7 @@ Properties: - Config: endpoint - Env Var: RCLONE_S3_ENDPOINT -- Provider: !AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,RackCorp,Qiniu,Petabox +- Provider: !AWS,ArvanCloud,IBMCOS,IDrive,IONOS,TencentCOS,HuaweiOBS,Alibaba,ChinaMobile,GCS,Liara,Scaleway,StackPath,Storj,Synology,RackCorp,Qiniu,Petabox - Type: string - Required: false - Examples: @@ -2368,7 +2394,7 @@ Properties: ### Advanced options -Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi). +Here are the Advanced options specific to s3 (Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, China Mobile, Cloudflare, GCS, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi). #### --s3-bucket-acl @@ -3421,7 +3447,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, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, 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, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi \ (s3) ... Storage> s3 @@ -3605,7 +3631,7 @@ Option Storage. Type of storage to configure. Choose a number from below, or type in your own value. [snip] - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi \ (s3) [snip] Storage> 5 @@ -3900,7 +3926,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, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi \ (s3) [snip] Storage> s3 @@ -4006,7 +4032,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, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS and Wasabi +XX / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS and Wasabi \ (s3) [snip] Storage> s3 @@ -4252,7 +4278,7 @@ Choose a number from below, or type in your own value \ (alias) 4 / Amazon Drive \ (amazon cloud drive) - 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Liara, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi \ (s3) [snip] Storage> s3 @@ -5749,3 +5775,137 @@ use policy `mfs` (most free space) as a member of an rclone union remote. See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/) + + + +### Synology C2 Object Storage {#synology-c2} + +[Synology C2 Object Storage](https://c2.synology.com/en-global/object-storage/overview) provides a secure, S3-compatible, and cost-effective cloud storage solution without API request, download fees, and deletion penalty. + +The S3 compatible gateway is configured using `rclone config` with a +type of `s3` and with a provider name of `Synology`. Here is an example +run of the configurator. + +First run: + +``` +rclone config +``` + +This will guide you through an interactive setup process. + +``` +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.1 +name> syno + +Type of storage to configure. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + + 5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, GCS, ArvanCloud, DigitalOcean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Liara, Lyve Cloud, Minio, Netease, Petabox, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Synology, Tencent COS, Qiniu and Wasabi + \ "s3" + +Storage> s3 + +Choose your S3 provider. +Enter a string value. Press Enter for the default (""). +Choose a number from below, or type in your own value + 24 / Synology C2 Object Storage + \ (Synology) + +provider> Synology + +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. +Enter a boolean value (true or false). Press Enter for the default ("false"). +Choose a number from below, or type in your own value + 1 / Enter AWS credentials in the next step + \ "false" + 2 / Get AWS credentials from the environment (env vars or IAM) + \ "true" + +env_auth> 1 + +AWS Access Key ID. +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). + +access_key_id> accesskeyid + +AWS Secret Access Key (password) +Leave blank for anonymous access or runtime credentials. +Enter a string value. Press Enter for the default (""). + +secret_access_key> secretaccesskey + +Region where your data stored. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / Europe Region 1 + \ (eu-001) + 2 / Europe Region 2 + \ (eu-002) + 3 / US Region 1 + \ (us-001) + 4 / US Region 2 + \ (us-002) + 5 / Asia (Taiwan) + \ (tw-001) + +region > 1 + +Option endpoint. +Endpoint for Synology C2 Object Storage API. +Choose a number from below, or type in your own value. +Press Enter to leave empty. + 1 / EU Endpoint 1 + \ (eu-001.s3.synologyc2.net) + 2 / US Endpoint 1 + \ (us-001.s3.synologyc2.net) + 3 / TW Endpoint 1 + \ (tw-001.s3.synologyc2.net) + +endpoint> 1 + +Option location_constraint. +Location constraint - must be set to match the Region. +Leave blank if not sure. Used when creating buckets only. +Enter a value. Press Enter to leave empty. +location_constraint> + +Edit advanced config? (y/n) +y) Yes +n) No +y/n> y + +Option no_check_bucket. +If set, don't attempt to check the bucket exists or create it. +This can be useful when trying to minimise the number of transactions +rclone does if you know the bucket exists already. +It can also be needed if the user you are using does not have bucket +creation permissions. Before v1.52.0 this would have passed silently +due to a bug. +Enter a boolean value (true or false). Press Enter for the default (true). + +no_check_bucket> true + +Configuration complete. +Options: +- type: s3 +- provider: Synology +- region: eu-001 +- endpoint: eu-001.s3.synologyc2.net +- no_check_bucket: true +Keep this "syno" remote? +y) Yes this is OK (default) +e) Edit this remote +d) Delete this remote + +y/e/d> y