Skip to content

Configure R2 Keys

Store your Cloudflare R2 API token here. Add a credential before you can use anything else.

Open it from: Cloudflare R2 → Credential


The credential page

Cloudflare R2 Credential page

The page is one form with two columns:

  • Left — Credentials, Bucket Settings, Cache Control Rules.
  • Right — Connector Status (toggles) and Sync Actions.

A General tab and a History tab sit at the top. Save is in the top-right corner.


Get an R2 API token

  1. Sign in to the Cloudflare dashboard.
  2. Go to R2 → Manage R2 API Tokens.
  3. Create a token with Edit permission for your bucket.
  4. Copy the Account ID, Access Key ID, and Secret Access Key.

Make sure your bucket's CORS policy allows requests from your UnoPim domain — otherwise images won't render in the admin.


Fill in the form

Credentials

FieldWhat it is
Cloudflare Account IDYour account ID. The endpoint is auto-derived from this when Endpoint is empty.
R2 Access Key IDThe token's access key. Required on first save; leave blank later to keep the saved one.
R2 Secret Access KeyThe token's secret. Hidden after saving — leave blank to keep the saved one.
RegionDefaults to auto for R2.
EndpointRequired. Auto-filled to https://<account_id>.r2.cloudflarestorage.com if you leave it blank but provide an Account ID.

Bucket Settings

FieldWhat it is
Bucket NameThe bucket you created. Required.
Bucket URLPublic CDN URL or custom domain. Required for public buckets.
Environment Update TimeOptional YYYY-MM-DD HH:MM:SS — bumps the cache key when you swap buckets.

Connector Status (right column)

Connector Status toggles

ToggleWhat it does
Enable Cloudflare R2Master switch. New uploads go to R2 only when this is on.
Re-Synchronize Without UploadingSkip the upload step on Synchronize Media — only verifies the file exists on R2 and writes the mapping row. Use this when files are already on R2.
Default File VisibilityOn = Public (CDN URL). Off = Private (short-lived presigned URLs).

Cache Control Rules

Per-extension max-age for newly uploaded objects. With no rules, a default 7-day cache is used.

ExtensionMax age (seconds)Effect
jpg259200030 days
png259200030 days
pdf864001 day

Click Add Rule to add one, fill the extension and seconds, click Save. Rules apply to new uploads — change a rule and re-sync to apply it to old files.


Save = test + save

Click Save. The form runs a live ListObjects against your bucket first. If the credentials work, the form is saved. If not, you see the error and nothing is stored.

TIP

No separate Test Connection step exists — Save is the test. Bad keys never reach the database.


Edit later

The next time you open the page:

  • Access Key shows masked (580a************).
  • Secret Key shows fully masked (********************).

Leave both blank to keep the stored values. Type a new value to replace one.


Change history

Click the History tab to see every change made to the credential — toggles flipped, fields edited, rules added.

Access keys and secret keys are never written to history.

Released under the MIT License.