fp/services/uppy/apply-backblaze-cors-rules.sh

9 lines
442 B
Bash
Raw Normal View History

2024-01-20 16:16:14 +00:00
#/bin/bash
source ../../.env
echo "allowedOrigin ${NEXT_PUBLIC_SITE_URL} to bucket ${UPPY_B2_BUCKET}"
b2-linux \
update-bucket \
--corsRules "[{\"corsRuleName\":\"allowUploads\", \"allowedOrigins\": [\"${NEXT_PUBLIC_SITE_URL}\"], \"allowedHeaders\": [\"*\"], \"allowedOperations\": [\"s3_head\", \"s3_get\", \"s3_put\"], \"exposeHeaders\": [\"x-bz-content-sha1\", \"etag\"], \"maxAgeSeconds\": 3600}]" \
"${UPPY_B2_BUCKET}" allPrivate