I can download backups, I’ve never had any problems with this.
With S3 uploads included?
Thanks very use full, just when I upload in copy the image from clipboard is not working, do you face this problem?, in the end was uploaded to R2 but not visible in post:
Did you look at the image URL, what does it look like?
So we still can’t configure r2 through app. yml?Only through website setting,that is DB_S3_CONFIG?
Use this method,can you upload the old local uploads to R2, via rake uploads : migrate to s3 ?
Hey, thank you all for this.
If I understand this correctly, “DISCOURSE_CDN_URL” can be the same as “DISCOURSE_S3_CDN_URL”, which is the custom public domain linked to the bucket on Cloudflare? Or is some other configuration needed for this?
Yes, you must add the same domain name to the discourse container.yml. Here is an example of usage:
## The HTTP or HTTPS CDN address for this Discourse instance (configured to pull)
## See https://meta.discourse.org/t/14857 for details
#DISCOURSE_CDN_URL: https://discourse-cdn.example.com
#DISCOURSE_USE_S3: true
DISCOURSE_S3_REGION: 'auto'
DISCOURSE_S3_ENDPOINT: 'https://45dv544v56x****************************564564.eu.r2.cloudflarestorage.com'
DISCOURSE_S3_ACCESS_KEY_ID: '564dfds4f54sdfs********65564545'
DISCOURSE_S3_SECRET_ACCESS_KEY: 'sddfsdf564564**********6545sd4f54sd56f4s6d5'
DISCOURSE_S3_CDN_URL: 'https://cdn.discourse.com.br'
##DISCOURSE_CDN_URL: 'https://cdn.discourse.com.br'
#DISCOURSE_S3_BUCKET: 'cloudflarebucketname'
#DISCOURSE_S3_BACKUP_BUCKET: 'cloudflarebackupbucketname/backups'
#DISCOURSE_BACKUP_LOCATION: 's3'
DISCOURSE_INCLUDE_S3_UPLOADS_IN_BACKUPS: true
DISCOURSE_S3_INSTALL_CORS_RULE: false
The settings disabled with this character should be configured via the admin panel; examples are provided in the code. If you prefer, you can also enable these settings within the configuration section, it is up to you.
This option will break the site when set on app.yml, as not all static files like JavaScript are hosted on R2 for some reason.
Dit is geweldig. Ik heb net de gids in bericht #39 gevolgd en alles werkte. Ik heb slechts één suggestie en 2 vragen.
Suggestie:
Voor zover ik heb gelezen, zou je de CDN-bestanden bucket publiekelijk beschikbaar moeten maken en de back-up bucket privé. Dus ik heb 2 buckets aangemaakt en de back-up bucket privé gelaten, terwijl ik de bestanden bucket publiek heb gemaakt met een aangepaste domeinnaam. Het betekende alleen dat ik 2 verschillende paden in de 2 vakken onder admin moest invoeren.
Ik heb veel mensen hun back-ups laten maken als een pad van hun top-level bucket, denk ik hier verkeerd over na? Of is dit gewoon een eigenaardigheid van CF R2?
V1:
Ik heb ‘DISCOURSE_INCLUDE_S3_UPLOADS_IN_BACKUPS: true’ toegevoegd aan mijn app.yml en opnieuw opgebouwd, maar als ik naar back-ups ga en op de back-upknop klik, krijg ik nog steeds de pop-up die me vertelt dat uploads niet zullen worden opgenomen. Is dat gewoon omdat de pop-up er geen logica onder heeft of klopt er iets niet?
V2:
Als ik de huidige uploads naar R2 wil verplaatsen, wat zijn dan de beknopte commando’s?
Ik heb rondgekeken en geprobeerd:
./launcher enter app
rake uploads:migrate_to_s3
rake posts:rebake_uncooked_posts
Maar het lijkt erop dat het eerste rake commando alleen werkt als ik de S3-opties in het app.yml-bestand instel. Klopt dat?
Als ik dat doe, zal R2 dan blijven werken?
Oké, getest en tekortkomingen gevonden.
Het lijkt erop dat het eerste rake-commando alleen werkt voor AWS.
rake aborted!
Seahorse::Client::NetworkingError: Failed to open TCP connection to exotics-unlimited.s3.auto.amazonaws.com:443 (getaddrinfo: Name or service not known) (Seahorse::Client::NetworkingError)
Is er een ander commando dat hetzelfde doet met andere S3-leveranciers?
Have you done any follow up to see if we can get R2 as a fully working solution?
R2 works fine; just don’t use or set this option: DISCOURSE_CDN_URL
R2 works fine; just don’t use or set this option:
DISCOURSE_CDN_URL
Right, which means it’s not fully working because some static files are not being pushed/hosted correctly.
I’m just looking to make everything work instead of just some of it working.
Ik kan DC er niet van weerhouden te denken dat het AWS is, terwijl het CF R2 is, de back-ups worden gewoon niet geüpload. Ik wil het alleen gebruiken voor back-up zip-bestanden, in plaats van AWS. Ik geloof dat ik alle instellingen correct heb ingevuld en mijn toegangstoken heeft de scope “object read & write” voor deze specifieke bucket. Ik heb ook het CORS-beleid uit de thread toegevoegd.
[2025-09-06 13:56:44] Archief zippen, dit kan even duren...
[2025-09-06 13:56:49] Archief uploaden...
[2025-09-06 13:56:49] UITZONDERING: Aws::S3::Errors::Forbidden
[2025-09-06 13:56:49] /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.182.0/lib/aws-sdk-s3/object.rb:559:in `rescue in exists?'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.182.0/lib/aws-sdk-s3/object.rb:554:in `exists?'
/var/www/discourse/lib/backup_restore/s3_backup_store.rb:46:in `upload_file'
/var/www/discourse/lib/backup_restore/backuper.rb:351:in `upload_archive'
/var/www/discourse/lib/backup_restore/backuper.rb:41:in `run'
/var/www/discourse/script/spawn_backup_restore.rb:9:in `backup'
/var/www/discourse/script/spawn_backup_restore.rb:31:in `block in <main>'
/var/www/discourse/script/spawn_backup_restore.rb:4:in `fork'
/var/www/discourse/script/spawn_backup_restore.rb:4:in `<main>'
[2025-09-06 13:56:49] Oude back-ups verwijderen...
[2025-09-06 13:56:49] Rommel opruimen...
[2025-09-06 13:56:49] Archief verwijderen uit lokale opslag...
[2025-09-06 13:56:49] '.tar' restanten verwijderen...
[2025-09-06 13:56:49] Back-up markeren als voltooid...
[2025-09-06 13:56:49] 'Firsh' op de hoogte stellen van het einde van de back-up...
[2025-09-06 13:56:54] Klaar!
This seems to be working fine for me too! (remember to set the cdn url, otherwise uploads will work but gets won’t)

