So, I also wanted to put my uploads behind CloudfFlare, using Wasabi instead of S3, so no CloudFront available.
I ended up directly modifying the DB, and restarting discourse and it worked. Also, does https between CDN and S3 really matter if the bucket is public read only?
UPDATE site_settings SET value = 'uploads.domain.tld' WHERE name = 's3_upload_bucket';
I can set the CDN URL just fine, and point it directly to wasabi. But the only way to get it to go through cloudflare first is to have a CNAME on my domain pointing to s3.wasabisys.com, where the bucket name needs to be subdomain.your.domain.
Eg, I can’t have a bucket called xyz-uploads and use that behind cloudflare with a CNAME to s3.wasabisys.com