Setup guide · Step 3

Video hosting on Cloudflare R2

This takes about 15 minutes. Your church’s videos live in your own Cloudflare account. Rock Your Screens never sees or stores them.

What you’ll end up with:

  • an R2 bucket that holds the videos (and, optionally, large images)
  • a small Cloudflare Worker that does two jobs: the Load Screens page in Rock uploads to it, and the Apple TVs play videos from it

Your domain does not need to be on Cloudflare. If your DNS is at GoDaddy or anywhere else, that’s fine.

1 Create a Cloudflare account

Go to dash.cloudflare.com/sign-up and use a shared church email (for example a tech@ or media@ address) so the account isn’t tied to one person.

2 Turn on R2

  1. In the left menu, choose R2 Object Storage.
  2. Click Purchase R2 Plan / Enable R2. Cloudflare asks for a card even on the free tier.
    • Free each month: 10 GB of storage, 1 million uploads and 10 million reads. Downloads (egress) are always free.
    • After the free 10 GB, storage costs about $0.015 per GB per month. For example, 30 GB costs about $0.30 a month.

3 Create the bucket

  1. Click R2 → Create bucket.
  2. Name: rys-media (lowercase).
  3. Location: Automatic. Storage class: Standard.
  4. Click Create bucket. Leave public access off; the Worker serves the files.

4 Create the Worker

  1. Click Workers & Pages → Create → Create Worker.
  2. Name: rys-media (this becomes part of the address, e.g. rys-media.yourchurch.workers.dev), then click Deploy.
  3. Click Edit code, delete the sample code, paste in the entire contents of r2-upload-worker.js, then click Deploy.
  4. Go to the Worker’s Settings → Bindings → Add → R2 bucket:
    • Variable name: BUCKET
    • Bucket: rys-media
  5. Go to Settings → Variables and Secrets and add:
Type Name Value
Text ALLOWED_ORIGIN https://rock.yourchurch.org (your Rock address, no trailing slash)
Text PUBLIC_BASE https://rys-media.<your-subdomain>.workers.dev/media/ (copy the Worker’s address from its overview page and add /media/)
Secret UPLOAD_TOKEN a long random string, e.g. from a password generator (40+ characters)
  1. Click Deploy again so the settings take effect.

5 Check it

Open https://rys-media.<your-subdomain>.workers.dev/ping in a browser. It should say Not authorized. That’s correct: it means the Worker is running and refusing requests without the token.

6 Tell Rock about it

Put the Worker address and the UPLOAD_TOKEN into the Load Screens block in Rock. The Load Screens guide shows exactly where.

Notes

  • Costs: the Workers free plan allows 100,000 requests a day. An Apple TV playing a video makes a few dozen requests, so a church would need hundreds of screens to come close.
  • Optional custom domain: if your domain’s DNS ever moves to Cloudflare, you can connect media.yourchurch.org to the bucket and change PUBLIC_BASE to it. Existing slides keep working only if their links stay the same, so decide this early.
  • Security: the token only allows uploads. Anyone with a video’s link can watch it, the same as Rock’s own public files, and links are hard to guess.