Cloudflare R2: Navigating Setup and Handling Configuration Errors

Or maybe I sort-of owe you and apology. I do seem to have made it work, though I don’t have time to promise that I can write instructions that will allow you to make it work.

  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: 'auto'
  DISCOURSE_S3_ENDPOINT: https://=ACCOUNT_ID=.r2.cloudflarestorage.com
  DISCOURSE_S3_ACCESS_KEY_ID: '=ACCESS_KEY_ID='
  DISCOURSE_S3_SECRET_ACCESS_KEY: '=SECRET_ACCESS_KEY'
  DISCOURSE_S3_CDN_URL: '=S3_CDN_URL='
  DISCOURSE_CDN_URL: '=CDN_URL='
  DISCOURSE_S3_BUCKET: '=BUCKET='
  DISCOURSE_S3_BACKUP_BUCKET: '=BUCKET=/backups'
  DISCOURSE_BACKUP_LOCATION: 's3'

Don’t forget the stanza that does the rake task to push uploads to S3.

GIve this a try and see if it’ll work for you. A quick test shows that it works for uploads, assets, and backups. So, I guess the issue with gzip files no longer applies.

1 Like