Yep sorry that was a typo just in my previous post. DISCOURSE_S3_BACKUP_BUCKET doesn’t set s3_bucket in GlobalSetting for me. I’m not sure how you’re running that rake task without setting DISCOURSE_S3_BUCKET.
I really appreciate your help btw and realise this isn’t your problem to solve, so thanks.
unless GlobalSetting.use_s3? || use_db_s3_config
STDERR.puts "ERROR: Ensure S3 is configured in config/discourse.conf or environment vars"
use_db_s3_config is saving you from having to set that extra variable. That must be a bug in global_setting.rb because I should be able to just set DISCOURSE_S3_UPLOAD_BUCKET unless there is a difference between that and DISCOURSE_S3_BUCKET, but I think you’re right that the latter is supposed to be deprecated.
Irrespective of a bug in global_setting.rb I’m still seeing an issue where Discourse is looking for assets in their usual place and not on my S3 CDN, even though I’ve declared all my variables and DISCOURSE_ENABLE_S3_UPLOADS is set to true.
There’s a task for this bundle exec rake uploads:migrate_to_s3 . Once you have configured your buckets you should run that task to move uploads to s3. S3/CDN has changed in the recent few months and documentation is not up to date, so make sure you backup and prepare in case something goes wrong.
When I was enabling this for the first time we had some downtime while we figure everything out/
Yep I saw that. I’ve set DISCOURSE_CDN_URL but I still get the same issue. However I’m tired so maybe I missed something with all the messing around. Will pick this back up tomorrow. Thanks for the help.
By setting the data in admin panels to S3 everything works properly and everything loads to S3. I do not have any settings in ENV. Is that bad ? Is it necessary if everything works ?
The second example is different because I can’t migrate the old data to S3 (only new ones work) But here entering this data in app.yml (DISCOURSE_S3_ACCESS_KEY_ID: ‘key’ etc) file doesn’t change anything and it still doesn’t work (i.e.