discourse/lib/backup_restore
Martin Brennan 9a72a0945f
FIX: Ensure CORS rules exist for S3 using rake task (#14802)
This commit introduces a new s3:ensure_cors_rules rake task
that is run as a prerequisite to s3:upload_assets. This rake
task calls out to the S3CorsRulesets class to ensure that
the 3 relevant sets of CORS rules are applied, depending on
site settings:

* assets
* direct S3 backups
* direct S3 uploads

This works for both Global S3 settings and Database S3 settings
(the latter set directly via SiteSetting).

As it is, only one rule can be applied, which is generally
the assets rule as it is called first. This commit changes
the ensure_cors! method to be able to apply new rules as
well as the existing ones.

This commit also slightly changes the existing rules to cover
direct S3 uploads via uppy, especially multipart, which requires
some more headers.
2021-11-08 09:16:38 +10:00
..
backup_file_handler.rb FIX: Restoring could fail due to missing path 2021-02-09 17:28:03 +01:00
backup_store.rb FEATURE: Allow overriding the backup location when restoring via CLI (#12015) 2021-02-09 16:02:44 +01:00
backuper.rb FEATURE: Attach backup log as upload (#13849) 2021-08-03 20:06:50 +03:00
database_restorer.rb FIX: Check all migrations for dropped columns/tables during restore 2021-06-23 17:43:38 +01:00
factory.rb FIX: Restoring could fail due to missing path 2021-02-09 17:28:03 +01:00
local_backup_store.rb DEV: Upgrading Discourse to Zeitwerk (#8098) 2019-10-02 14:01:53 +10:00
logger.rb FIX: Remap old S3 endpoints during backup restore (#12276) 2021-03-03 21:10:09 +01:00
meta_data_handler.rb REFACTOR: Simplify backup version check 2020-01-15 23:37:40 +01:00
restorer.rb FEATURE: Attach backup log as upload (#13849) 2021-08-03 20:06:50 +03:00
s3_backup_store.rb FIX: Ensure CORS rules exist for S3 using rake task (#14802) 2021-11-08 09:16:38 +10:00
system_interface.rb PERF: Disable Sidekiq only during database restore (#10857) 2020-10-16 15:19:02 +02:00
uploads_restorer.rb FIX: Remap old S3 endpoints during backup restore (#12276) 2021-03-03 21:10:09 +01:00