Skip to content

Setup R2 Public Access #2

Setup R2 Public Access

Setup R2 Public Access #2

Workflow file for this run

name: Setup R2 Public Access
on:
workflow_dispatch:
permissions:
contents: read
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Enable R2 Public Access
env:
CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
set -x
AID="6a46b418508c26278ae2d3373f41da81"
# Try to enable public access on the bucket
echo "=== Enable public access on acreetionos-isos ==="
curl -s -X POST \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
"https://api.cloudflare.com/client/v4/accounts/$AID/r2/buckets/acreetionos-isos/public-access" \
-d '{"enabled":true}' | jq .
# List the existing acreetionos-32bit bucket to see if there are ISOs
echo "=== Check existing 32bit bucket objects ==="
curl -s -H "Authorization: Bearer $CF_API_TOKEN" \
"https://api.cloudflare.com/client/v4/accounts/$AID/r2/buckets/acreetionos-32bit/objects" | jq '.result.objects[:5] | .[]? | {key, size, uploaded}' 2>/dev/null || echo "No access"
echo "=== Done ==="