Configure an S3 compatible object storage provider for uploads

I got R2 working correctly by using this set of rules:

  ## This set of lines allows R2 S3 hosted files to be uploaded and downloaded..
  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: auto
  DISCOURSE_S3_ACCESS_KEY_ID: access-key-id
  DISCOURSE_S3_SECRET_ACCESS_KEY: access-key
  DISCOURSE_S3_CDN_URL: https://eufiles.technospider.com
  DISCOURSE_S3_BUCKET: exotics-unlimited
  DISCOURSE_S3_BACKUP_BUCKET: exotics-unlimited-backups
  DISCOURSE_BACKUP_LOCATION: s3
#  DISCOURSE_CDN_URL: https://eufiles.technospider.com
  DISCOURSE_S3_ENDPOINT: https://71*****5d4976.r2.cloudflarestorage.com
#  DISCOURSE_INCLUDE_S3_UPLOADS_IN_BACKUPS: true
  DISCOURSE_S3_INSTALL_CORS_RULE: false

Once I commented out the CDN_URL line things worked. I guess by the nature of the fact that R2 auto creates the CDN you don’t need that line and in fact adding it breaks stuff.
I commented out the include images line just to keep my backup sizes down. I’m using the free tier at R2 and don’t want to go over my limit.