From 92ab3eedfc03a6cd770e36745373ca188ed9ee20 Mon Sep 17 00:00:00 2001 From: Quentin Date: Sat, 21 Nov 2020 15:44:09 +0100 Subject: Use awscli instead of s3cmd --- script/dev-bucket.sh | 6 +++--- script/dev-env.sh | 13 +++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'script') diff --git a/script/dev-bucket.sh b/script/dev-bucket.sh index f07263f5..8c0ef4e4 100755 --- a/script/dev-bucket.sh +++ b/script/dev-bucket.sh @@ -6,11 +6,11 @@ GARAGE_DEBUG="${REPO_FOLDER}/target/debug/" GARAGE_RELEASE="${REPO_FOLDER}/target/release/" PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH" -garage bucket create éprouvette +garage bucket create eprouvette KEY_INFO=`garage key new --name opérateur` ACCESS_KEY=`echo $KEY_INFO|grep -Po 'GK[a-f0-9]+'` SECRET_KEY=`echo $KEY_INFO|grep -Po 'secret_key: "[a-f0-9]+'|grep -Po '[a-f0-9]+$'` -garage bucket allow éprouvette --read --write --key $ACCESS_KEY +garage bucket allow eprouvette --read --write --key $ACCESS_KEY echo "$ACCESS_KEY $SECRET_KEY" > /tmp/garage.s3 -echo "Bucket s3://éprouvette created. Credentials stored in /tmp/garage.s3." +echo "Bucket s3://eprouvette created. Credentials stored in /tmp/garage.s3." diff --git a/script/dev-env.sh b/script/dev-env.sh index 7e8ffc50..61c8618f 100755 --- a/script/dev-env.sh +++ b/script/dev-env.sh @@ -6,13 +6,10 @@ GARAGE_DEBUG="${REPO_FOLDER}/target/debug/" GARAGE_RELEASE="${REPO_FOLDER}/target/release/" PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH" -ACCESS_KEY=`cat /tmp/garage.s3 |cut -d' ' -f1` -SECRET_KEY=`cat /tmp/garage.s3 |cut -d' ' -f2` +export AWS_ACCESS_KEY_ID=`cat /tmp/garage.s3 |cut -d' ' -f1` +export AWS_SECRET_ACCESS_KEY=`cat /tmp/garage.s3 |cut -d' ' -f2` +export AWS_DEFAULT_REGION='garage' -alias s3grg="s3cmd \ - --host 127.0.0.1:3900 \ - --access_key=$ACCESS_KEY \ - --secret_key=$SECRET_KEY \ - --region=garage \ - --no-ssl" +alias s3grg="aws s3 \ + --endpoint-url http://127.0.0.1:3900" -- cgit v1.2.3 From 54c3a023f0febb68824be51a9b35a2457373ad07 Mon Sep 17 00:00:00 2001 From: Quentin Date: Sun, 29 Nov 2020 17:27:49 +0100 Subject: Use aws cli version 2 --- script/test-smoke.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/test-smoke.sh b/script/test-smoke.sh index 7b462b00..7faf2a07 100755 --- a/script/test-smoke.sh +++ b/script/test-smoke.sh @@ -15,8 +15,8 @@ source ${SCRIPT_FOLDER}/dev-env.sh dd if=/dev/urandom of=/tmp/garage.rnd bs=1M count=10 -s3grg put /tmp/garage.rnd s3://eprouvette/ +s3grg cp /tmp/garage.rnd s3://eprouvette/ s3grg ls s3://eprouvette -s3grg get s3://eprouvette/garage.rnd /tmp/garage.dl +s3grg cp s3://eprouvette/garage.rnd /tmp/garage.dl diff /tmp/garage.rnd /tmp/garage.dl -- cgit v1.2.3 From 8df0b322aba3360e7ff1fdca805f93e05cda963a Mon Sep 17 00:00:00 2001 From: Quentin Date: Sun, 29 Nov 2020 17:40:36 +0100 Subject: Fix merge error --- script/dev-env.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'script') diff --git a/script/dev-env.sh b/script/dev-env.sh index 71fbd208..15f08e2e 100755 --- a/script/dev-env.sh +++ b/script/dev-env.sh @@ -6,7 +6,6 @@ GARAGE_DEBUG="${REPO_FOLDER}/target/debug/" GARAGE_RELEASE="${REPO_FOLDER}/target/release/" PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH" -<<<<<<< HEAD export AWS_ACCESS_KEY_ID=`cat /tmp/garage.s3 |cut -d' ' -f1` export AWS_SECRET_ACCESS_KEY=`cat /tmp/garage.s3 |cut -d' ' -f2` export AWS_DEFAULT_REGION='garage' -- cgit v1.2.3 From 1119d466e762b6fe11eb939811c4f24b27a0404f Mon Sep 17 00:00:00 2001 From: Quentin Date: Thu, 10 Dec 2020 20:19:22 +0100 Subject: Fix S3 command --- script/dev-env-s3cmd.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'script') diff --git a/script/dev-env-s3cmd.sh b/script/dev-env-s3cmd.sh index 15f08e2e..88d2941f 100644 --- a/script/dev-env-s3cmd.sh +++ b/script/dev-env-s3cmd.sh @@ -6,9 +6,14 @@ GARAGE_DEBUG="${REPO_FOLDER}/target/debug/" GARAGE_RELEASE="${REPO_FOLDER}/target/release/" PATH="${GARAGE_DEBUG}:${GARAGE_RELEASE}:$PATH" -export AWS_ACCESS_KEY_ID=`cat /tmp/garage.s3 |cut -d' ' -f1` -export AWS_SECRET_ACCESS_KEY=`cat /tmp/garage.s3 |cut -d' ' -f2` -export AWS_DEFAULT_REGION='garage' +ACCESS_KEY=`cat /tmp/garage.s3 |cut -d' ' -f1` +SECRET_KEY=`cat /tmp/garage.s3 |cut -d' ' -f2` + +alias s3grg="s3cmd \ + --host 127.0.0.1:3911 \ + --host-bucket 127.0.0.1:3911 \ + --access_key=$ACCESS_KEY \ + --secret_key=$SECRET_KEY \ + --region=garage \ + --no-ssl" -alias s3grg="aws s3 \ - --endpoint-url http://127.0.0.1:3911" -- cgit v1.2.3 From 086e5be290b329b898206397ad95c82964fbf499 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 17 Dec 2020 21:04:59 +0100 Subject: Update testing script --- script/test-smoke.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'script') diff --git a/script/test-smoke.sh b/script/test-smoke.sh index 111afac9..a2ffcea1 100755 --- a/script/test-smoke.sh +++ b/script/test-smoke.sh @@ -6,6 +6,7 @@ shopt -s expand_aliases SCRIPT_FOLDER="`dirname \"$0\"`" REPO_FOLDER="${SCRIPT_FOLDER}/../" +echo "setup" cargo build ${SCRIPT_FOLDER}/dev-clean.sh ${SCRIPT_FOLDER}/dev-cluster.sh > /tmp/garage.log 2>&1 & @@ -22,6 +23,7 @@ dd if=/dev/urandom of=/tmp/garage.1.rnd bs=1k count=2 # < INLINE_THRESHOLD = 307 dd if=/dev/urandom of=/tmp/garage.2.rnd bs=1M count=5 dd if=/dev/urandom of=/tmp/garage.3.rnd bs=1M count=10 +echo "s3 api testing..." for idx in $(seq 1 3); do # AWS sends awsgrg cp /tmp/garage.$idx.rnd s3://eprouvette/garage.$idx.aws @@ -55,6 +57,18 @@ for idx in $(seq 1 3); do done rm /tmp/garage.{1,2,3}.rnd +echo "website testing" +echo "

hello world

" > /tmp/garage-index.html +awsgrg cp /tmp/garage-index.html s3://eprouvette/index.html +[ `curl -s -o /dev/null -w "%{http_code}" --header "Host: eprouvette.garage.tld" http://127.0.0.1:3923/ ` == 404 ] +garage bucket website --allow eprouvette +[ `curl -s -o /dev/null -w "%{http_code}" --header "Host: eprouvette.garage.tld" http://127.0.0.1:3923/ ` == 200 ] +garage bucket website --deny eprouvette +[ `curl -s -o /dev/null -w "%{http_code}" --header "Host: eprouvette.garage.tld" http://127.0.0.1:3923/ ` == 404 ] +awsgrg rm s3://eprouvette/index.html +rm /tmp/garage-index.html + +echo "teardown" garage bucket deny --read --write eprouvette --key $AWS_ACCESS_KEY_ID garage bucket delete --yes eprouvette garage key delete --yes $AWS_ACCESS_KEY_ID -- cgit v1.2.3