penguin/s3-arch-utils

bash scripts for s3

commit 2649d1f0348d44f565e96a0e6b674599e6c5a86f

author斟酌 鵬兄 <tgckpg@gmail.com>
date2022-03-30T06:05:37Z
subjectFixed for backblaze b2 not working
commit 2649d1f0348d44f565e96a0e6b674599e6c5a86f
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2022-03-30T06:05:37Z

    Fixed for backblaze b2 not working
---
 arch_delete_aws4.sh   | 3 ++-
 arch_download_aws4.sh | 3 ++-
 arch_getacl_aws4.sh   | 3 ++-
 arch_list_aws4.sh     | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch_delete_aws4.sh b/arch_delete_aws4.sh
index 621d0c8..3508f46 100755
--- a/arch_delete_aws4.sh
+++ b/arch_delete_aws4.sh
@@ -38,7 +38,7 @@ BUCKET_URL=$ARCH_S3_BUCKET_URL
 
 _DATE=$( date -u +"%Y%m%d" )
 _DTIME=$( date -u +"%Y%m%dT%H%M%SZ" )
-_HEADERS="host;x-amz-date"
+_HEADERS="host;x-amz-content-sha256;x-amz-date"
 _SHA=$( echo -n "" | sha256sum | cut -d' ' -f1 )
 
 # Canon Request
@@ -46,6 +46,7 @@ _C="DELETE"
 _C="$_C\n/$_PATH"
 _C="$_C\n" # no query strings here
 _C="$_C\nhost:$BUCKET_URL"
+_C="$_C\nx-amz-content-sha256:$_SHA"
 _C="$_C\nx-amz-date:$_DTIME"
 _C="$_C\n"
 _C="$_C\n$_HEADERS"
diff --git a/arch_download_aws4.sh b/arch_download_aws4.sh
index c86cbc5..2c39004 100755
--- a/arch_download_aws4.sh
+++ b/arch_download_aws4.sh
@@ -37,7 +37,7 @@ BUCKET_URL=$ARCH_S3_BUCKET_URL
 
 _DATE=$( date -u +"%Y%m%d" )
 _DTIME=$( date -u +"%Y%m%dT%H%M%SZ" )
-_HEADERS="host;x-amz-date"
+_HEADERS="host;x-amz-content-sha256;x-amz-date"
 _SHA=$( echo -n "" | sha256sum | cut -d' ' -f1 )
 
 # Canon Request
@@ -45,6 +45,7 @@ _C="GET"
 _C="$_C\n/$_PATH"
 _C="$_C\n" # no query strings here
 _C="$_C\nhost:$BUCKET_URL"
+_C="$_C\nx-amz-content-sha256:$_SHA"
 _C="$_C\nx-amz-date:$_DTIME"
 _C="$_C\n"
 _C="$_C\n$_HEADERS"
diff --git a/arch_getacl_aws4.sh b/arch_getacl_aws4.sh
index 7bc4e94..2e2068e 100755
--- a/arch_getacl_aws4.sh
+++ b/arch_getacl_aws4.sh
@@ -37,7 +37,7 @@ BUCKET_URL=$ARCH_S3_BUCKET_URL
 
 _DATE=$( date -u +"%Y%m%d" )
 _DTIME=$( date -u +"%Y%m%dT%H%M%SZ" )
-_HEADERS="host;x-amz-date"
+_HEADERS="host;x-amz-content-sha256;x-amz-date"
 _SHA=$( echo -n "" | sha256sum | cut -d' ' -f1 )
 
 # Keys should be sorted
@@ -68,6 +68,7 @@ _C="GET"
 _C="$_C\n/$_PATH"
 _C="$_C\n$QSTR"
 _C="$_C\nhost:$BUCKET_URL"
+_C="$_C\nx-amz-content-sha256:$_SHA"
 _C="$_C\nx-amz-date:$_DTIME"
 _C="$_C\n"
 _C="$_C\n$_HEADERS"
diff --git a/arch_list_aws4.sh b/arch_list_aws4.sh
index cdd3062..edb832d 100755
--- a/arch_list_aws4.sh
+++ b/arch_list_aws4.sh
@@ -34,7 +34,7 @@ BUCKET_URL=$ARCH_S3_BUCKET_URL
 
 _DATE=$( date -u +"%Y%m%d" )
 _DTIME=$( date -u +"%Y%m%dT%H%M%SZ" )
-_HEADERS="host;x-amz-date"
+_HEADERS="host;x-amz-content-sha256;x-amz-date"
 _SHA=$( echo -n "" | sha256sum | cut -d' ' -f1 )
 _PATH=""
 
@@ -78,6 +78,7 @@ _C="GET"
 _C="$_C\n/$_PATH"
 _C="$_C\n$QSTR"
 _C="$_C\nhost:$BUCKET_URL"
+_C="$_C\nx-amz-content-sha256:$_SHA"
 _C="$_C\nx-amz-date:$_DTIME"
 _C="$_C\n"
 _C="$_C\n$_HEADERS"