Anyone used SeaweedFS? With the uncertainty over MinIO, I’ve been looking at this option and will try it out to see if there are any compatibility issues with Discourse.
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.
Right. You really don’t want to use DISCOURSE_INCLUDE_S3_UPLOADS_IN_BACKUPS unless you’re moving away from S3. It doesn’t make sense to download all the images from S3 to include them in a backup stored . . . on S3. I once left that enabled on an AWS bucket and had a big bill from downloading every single image every single day.
This is supposed to be a separate CDN that points to your Discourse server, not the S3 bucket. Some stuff, like avatars, and I’m not sure what else, is served from your server. The reason it didn’t work is you included your S3 CDN not the site CDN.
You mean if you use 2 different companies? One for bucket and one for CDN? I’m not well versed on this so I need the info like I’m a 3rd grader…
I know that when you create a “custom domain” in the R2 interface it acts as a CDN so that’s why I initially tried adding that line.
Anyway, it’s been working perfect for my test site and unless there’s something else that it’s supposed to be doing that it’s not I’d recommend the original post be updated to show that Cloudflare now works with Discourse.
No. You can’t do that. There’s only one S3 key/secret. I was trying to contrive a reason to use include s3 uploads, but there is none.
That’s for the S3 Bucket not for your site. There are two different variables DISCOURSE_S3_CDN_URL and DISCOURSE_CDN_URL. You are treating them as if they are the same. You can not use a CDN for the site, but the reason it didn’t work when you set that variable is that you gave it the wrong CDN.
Okay, I thought I had a slight grasp of what I was doing, but now I think I’m completely lost.
So what is the difference between S3 CDN and CDN?
Would it still work if I reversed which of those 2 I’ve commented out?
I noticed an odd issue with the background image of my welcome banner too, is that related at all to any of this?