From dd7e6f6ba9bc559fcfd38da7741714f7fde11dab Mon Sep 17 00:00:00 2001 From: Lars Yencken Date: Tue, 13 Feb 2024 10:45:30 +0000 Subject: [PATCH 1/2] :honeybee: set the dev tools to use a profile for s3 credentials Previously, our dev tool used the default s3 credentials when syncing to DigitalOcean Spaces. This is a little problematic, since we are now using multiple object stores. This change suggests setting up a profile for OWID and explicitly using that. In this way, it's compatible with using multiple object stores, and in fact having multiple sets of S3 credentials on your machine. --- devTools/docker/sync-s3-images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devTools/docker/sync-s3-images.sh b/devTools/docker/sync-s3-images.sh index b2a8a06987a..bfa5c6e7b35 100755 --- a/devTools/docker/sync-s3-images.sh +++ b/devTools/docker/sync-s3-images.sh @@ -13,4 +13,4 @@ fi # for local development, it should be owid-image-upload/local-yourname # at least until we decide to instead host images locally, if ever -aws --endpoint=https://nyc3.digitaloceanspaces.com s3 sync s3://owid-image-upload/production/ s3://$IMAGE_HOSTING_BUCKET_PATH/ --acl public-read \ No newline at end of file +aws --profile=owid-spaces --endpoint=https://nyc3.digitaloceanspaces.com s3 sync s3://owid-image-upload/production/ s3://$IMAGE_HOSTING_BUCKET_PATH/ --acl public-read \ No newline at end of file From 9c414a44a58803b10eaa59a773c1fdf4c82b2c3d Mon Sep 17 00:00:00 2001 From: Lars Yencken Date: Wed, 14 Feb 2024 15:13:51 +0000 Subject: [PATCH 2/2] :honeybee: give a helpful usage message to set up s3 credentials --- devTools/docker/sync-s3-images.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devTools/docker/sync-s3-images.sh b/devTools/docker/sync-s3-images.sh index bfa5c6e7b35..d15f1e2399b 100755 --- a/devTools/docker/sync-s3-images.sh +++ b/devTools/docker/sync-s3-images.sh @@ -13,4 +13,12 @@ fi # for local development, it should be owid-image-upload/local-yourname # at least until we decide to instead host images locally, if ever +if ! grep -q 'profile owid-spaces' ~/.aws/config; then + echo 'Please configure your S3 credentials for profile owid-spaces:' + echo + echo ' aws configure --profile=owid-spaces' + echo + exit 1 +fi + aws --profile=owid-spaces --endpoint=https://nyc3.digitaloceanspaces.com s3 sync s3://owid-image-upload/production/ s3://$IMAGE_HOSTING_BUCKET_PATH/ --acl public-read \ No newline at end of file