mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:03:22 +08:00
FIX: Restore to S3 didn't work without env variables
The `uplaods:migrate_to_s3` rake task should always use the environment variables, because you usually don't want to break your site's uploads during the migration. But restoring a backup should work with site settings as well as environment variables, otherwise you can't restore uploads to S3 from the web interface.
This commit is contained in:
parent
baae0e7446
commit
c6b411f6c1
|
@ -198,7 +198,7 @@ module FileStore
|
|||
FileUtils.symlink(source_path, public_upload_path)
|
||||
|
||||
FileStore::ToS3Migration.new(
|
||||
s3_options: FileStore::ToS3Migration.s3_options_from_env,
|
||||
s3_options: FileStore::ToS3Migration.s3_options_from_site_settings,
|
||||
migrate_to_multisite: Rails.configuration.multisite,
|
||||
).migrate
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ module FileStore
|
|||
def self.s3_options_from_site_settings
|
||||
{
|
||||
client_options: S3Helper.s3_options(SiteSetting),
|
||||
bucket: SiteSetting.s3_upload_bucket
|
||||
bucket: SiteSetting.Upload.s3_upload_bucket
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user