From c3986a7964dcd30705b94a2c2db45a1504616ce6 Mon Sep 17 00:00:00 2001 From: Chris Hager Date: Thu, 2 Nov 2023 14:40:22 +0000 Subject: [PATCH] fix upload --- cmd/website/main.go | 4 ++-- scripts/s3/upload-file-to-r2.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/website/main.go b/cmd/website/main.go index aa50dbf..eb3c0f4 100644 --- a/cmd/website/main.go +++ b/cmd/website/main.go @@ -86,7 +86,7 @@ func buildWebsite() { if err != nil { log.Fatal(err) } - fmt.Println(months) + fmt.Println("Months:", months) // build root page log.Infof("Building root page ...") @@ -185,7 +185,7 @@ func buildWebsite() { for _, file := range toUpload { app := "./scripts/s3/upload-file-to-r2.sh" - cmd := exec.Command(app, file.from, strings.TrimPrefix(file.to, "/")) //nolint:gosec + cmd := exec.Command(app, file.from, file.to) //nolint:gosec stdout, err := cmd.Output() if err != nil { log.Fatal(err) diff --git a/scripts/s3/upload-file-to-r2.sh b/scripts/s3/upload-file-to-r2.sh index 58725c5..adefceb 100755 --- a/scripts/s3/upload-file-to-r2.sh +++ b/scripts/s3/upload-file-to-r2.sh @@ -9,8 +9,8 @@ fi # auto-fill target if not given if [ -z "$target" ]; then # remove "/mnt/data/mempool-dumpster/" prefix from src and make it the S3 prefix - target="ethereum/mainnet/${src#"/mnt/data/mempool-dumpster/"}" + target="/ethereum/mainnet/${src#"/mnt/data/mempool-dumpster/"}" fi echo "uploading $src to S3 $target ..." -aws s3 cp $src s3://flashbots-mempool-dumpster/$target --endpoint-url "https://${CLOUDFLARE_R2_ACCOUNT_ID}.r2.cloudflarestorage.com" +aws s3 cp $src s3://flashbots-mempool-dumpster$target --endpoint-url "https://${CLOUDFLARE_R2_ACCOUNT_ID}.r2.cloudflarestorage.com"