From b4e24376f55f089741bd8bf3e0055fde54d536cb Mon Sep 17 00:00:00 2001 From: Jayash Date: Sun, 4 Jun 2023 19:58:09 +0530 Subject: [PATCH 1/7] Updated gosdk --- cmd.sh | 1 + cmd/root.go | 16 ++++++++++++++-- dstorage/dstorage.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 cmd.sh diff --git a/cmd.sh b/cmd.sh new file mode 100644 index 0000000..5fa72e2 --- /dev/null +++ b/cmd.sh @@ -0,0 +1 @@ +/usr/local/bin/s3mgrt migrate --access-key AKIA4MPQDEZ4ODBRWUOU --secret-key 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 --allocation $alloc --bucket cloud-mig --skip 1 --resume true \ No newline at end of file diff --git a/cmd/root.go b/cmd/root.go index 3c8639d..1fe2299 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -31,8 +31,20 @@ var ( bSilent bool rootCmd = &cobra.Command{ - Use: "s3migration", - Short: "S3-Migration to migrate s3 buckets to dStorage allocation", + Use: "s3migration", + Short: "S3-Migration to " + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "migrate s3 buckets to dStorage allocation", Long: `S3-Migration uses 0chain-gosdk to communicate with 0chain network. It uses AWS SDK for Go program to communicate with s3.`, } diff --git a/dstorage/dstorage.go b/dstorage/dstorage.go index 84168e8..d4e3604 100644 --- a/dstorage/dstorage.go +++ b/dstorage/dstorage.go @@ -92,7 +92,7 @@ func (d *DStorageService) Upload(ctx context.Context, remotePath string, r io.Re fileMeta := sdk.FileMeta{ RemotePath: filepath.Clean(remotePath), - ActualSize: size, + ActualSize: size,f MimeType: contentType, RemoteName: filepath.Base(remotePath), } diff --git a/go.mod b/go.mod index a870fdc..dee7fee 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.8.17-0.20230601002348-0ca1e8ca3445 + github.com/0chain/gosdk v1.8.17-0.20230603052641-d16cb2fc4a3c github.com/aws/aws-sdk-go-v2 v1.17.1 github.com/aws/aws-sdk-go-v2/config v1.17.10 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.37 diff --git a/go.sum b/go.sum index 5838c98..1599e31 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.8.17-0.20230601002348-0ca1e8ca3445 h1:B8YojfxAGcgU9iEe8Tet/9k/oyvJ4xGtBosJz2BapcA= -github.com/0chain/gosdk v1.8.17-0.20230601002348-0ca1e8ca3445/go.mod h1:IN4Tejoe8O4ktC6bJWVvPhj3r0frMYviShjGINo41KY= +github.com/0chain/gosdk v1.8.17-0.20230603052641-d16cb2fc4a3c h1:JWNbSwuFoTF+ofqExNU8um5AkkvN4gTxxcZWzoa6IpE= +github.com/0chain/gosdk v1.8.17-0.20230603052641-d16cb2fc4a3c/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw= From e083107fbe12466fb23d11f4079df194ef49e38c Mon Sep 17 00:00:00 2001 From: Jayash Date: Sun, 4 Jun 2023 22:12:06 +0530 Subject: [PATCH 2/7] Fix typo --- dstorage/dstorage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dstorage/dstorage.go b/dstorage/dstorage.go index d4e3604..84168e8 100644 --- a/dstorage/dstorage.go +++ b/dstorage/dstorage.go @@ -92,7 +92,7 @@ func (d *DStorageService) Upload(ctx context.Context, remotePath string, r io.Re fileMeta := sdk.FileMeta{ RemotePath: filepath.Clean(remotePath), - ActualSize: size,f + ActualSize: size, MimeType: contentType, RemoteName: filepath.Base(remotePath), } From ef5b45257480cd296cc0ee952818f50299dee107 Mon Sep 17 00:00:00 2001 From: Jayash Date: Tue, 6 Jun 2023 23:45:44 +0530 Subject: [PATCH 3/7] Updated gosdk --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dee7fee..2fb6a2a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.8.17-0.20230603052641-d16cb2fc4a3c + github.com/0chain/gosdk v1.8.17-0.20230606181026-0ce33e0461bb github.com/aws/aws-sdk-go-v2 v1.17.1 github.com/aws/aws-sdk-go-v2/config v1.17.10 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.37 diff --git a/go.sum b/go.sum index 1599e31..cab8ad1 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.8.17-0.20230603052641-d16cb2fc4a3c h1:JWNbSwuFoTF+ofqExNU8um5AkkvN4gTxxcZWzoa6IpE= -github.com/0chain/gosdk v1.8.17-0.20230603052641-d16cb2fc4a3c/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= +github.com/0chain/gosdk v1.8.17-0.20230606181026-0ce33e0461bb h1:AKntuYTeFZKhu58oXiP9vVucTGJDQTINz9wXn/NwEeI= +github.com/0chain/gosdk v1.8.17-0.20230606181026-0ce33e0461bb/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw= From 0441f253dcf558fe94a58fa7904b2501dc4923cd Mon Sep 17 00:00:00 2001 From: Jayash Date: Thu, 8 Jun 2023 10:32:35 +0530 Subject: [PATCH 4/7] Updated gosdk --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2fb6a2a..2d6bd10 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.8.17-0.20230606181026-0ce33e0461bb + github.com/0chain/gosdk v1.8.17-0.20230608045223-74640c80c0a3 github.com/aws/aws-sdk-go-v2 v1.17.1 github.com/aws/aws-sdk-go-v2/config v1.17.10 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.37 diff --git a/go.sum b/go.sum index cab8ad1..089fc8a 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.8.17-0.20230606181026-0ce33e0461bb h1:AKntuYTeFZKhu58oXiP9vVucTGJDQTINz9wXn/NwEeI= -github.com/0chain/gosdk v1.8.17-0.20230606181026-0ce33e0461bb/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= +github.com/0chain/gosdk v1.8.17-0.20230608045223-74640c80c0a3 h1:jH3ePqtqPa9dogdPUlnPQxMZe3mEFQxL9duXk8n84Tk= +github.com/0chain/gosdk v1.8.17-0.20230608045223-74640c80c0a3/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw= From 6a7dd76bf8730575c14c0f630bb1175e293eea81 Mon Sep 17 00:00:00 2001 From: Jayash Date: Sat, 10 Jun 2023 14:32:25 +0530 Subject: [PATCH 5/7] Updated gosdk --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2d6bd10..756bf22 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.8.17-0.20230608045223-74640c80c0a3 + github.com/0chain/gosdk v1.8.17-0.20230610085329-4d7e8c669c08 github.com/aws/aws-sdk-go-v2 v1.17.1 github.com/aws/aws-sdk-go-v2/config v1.17.10 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.37 diff --git a/go.sum b/go.sum index 089fc8a..506d72e 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.8.17-0.20230608045223-74640c80c0a3 h1:jH3ePqtqPa9dogdPUlnPQxMZe3mEFQxL9duXk8n84Tk= -github.com/0chain/gosdk v1.8.17-0.20230608045223-74640c80c0a3/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= +github.com/0chain/gosdk v1.8.17-0.20230610085329-4d7e8c669c08 h1:5KmToPa3i2i6PMC7EeEZvpRRH8HUNCtSCMti1KEHoaQ= +github.com/0chain/gosdk v1.8.17-0.20230610085329-4d7e8c669c08/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw= From ee021c273c4b4235bdb77ea167b9e34f4ba4f798 Mon Sep 17 00:00:00 2001 From: Jayash Date: Tue, 13 Jun 2023 00:11:03 +0530 Subject: [PATCH 6/7] Updated gosdk --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 756bf22..0c5d611 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.8.17-0.20230610085329-4d7e8c669c08 + github.com/0chain/gosdk v1.8.17-0.20230612181834-a31d2d7190fe github.com/aws/aws-sdk-go-v2 v1.17.1 github.com/aws/aws-sdk-go-v2/config v1.17.10 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.37 diff --git a/go.sum b/go.sum index 506d72e..48ffa88 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.8.17-0.20230610085329-4d7e8c669c08 h1:5KmToPa3i2i6PMC7EeEZvpRRH8HUNCtSCMti1KEHoaQ= -github.com/0chain/gosdk v1.8.17-0.20230610085329-4d7e8c669c08/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= +github.com/0chain/gosdk v1.8.17-0.20230612181834-a31d2d7190fe h1:EAhukg8stOHzUpG+OiGfBb5G8QKxllaeXea3bNOMf7Q= +github.com/0chain/gosdk v1.8.17-0.20230612181834-a31d2d7190fe/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw= From 8d8954178eb7a16a831eb13cc495ba17beaf6484 Mon Sep 17 00:00:00 2001 From: Jayash Date: Tue, 13 Jun 2023 23:30:50 +0530 Subject: [PATCH 7/7] Update --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0c5d611..25e7114 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.8.17-0.20230612181834-a31d2d7190fe + github.com/0chain/gosdk v1.8.17-0.20230613172735-1ed7418612be github.com/aws/aws-sdk-go-v2 v1.17.1 github.com/aws/aws-sdk-go-v2/config v1.17.10 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.37 diff --git a/go.sum b/go.sum index 48ffa88..e8755f4 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.8.17-0.20230612181834-a31d2d7190fe h1:EAhukg8stOHzUpG+OiGfBb5G8QKxllaeXea3bNOMf7Q= -github.com/0chain/gosdk v1.8.17-0.20230612181834-a31d2d7190fe/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= +github.com/0chain/gosdk v1.8.17-0.20230613172735-1ed7418612be h1:BkJPrh+HgMoDRtNrOrbRxn6b23TZkAci2APPxhnb9Do= +github.com/0chain/gosdk v1.8.17-0.20230613172735-1ed7418612be/go.mod h1:YWr9ZGV76N9LWEO3AIys5ao3GI9kVDcrVHDIlV3RJKU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw=