mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 18:11:11 +08:00
FEATURE: Support backup uploads/downloads directly to/from S3.
This commit is contained in:

committed by
Guo Xiang Tan

parent
5039a6c3f1
commit
c29a4dddc1
@ -210,9 +210,9 @@ describe AdminDashboardData do
|
||||
end
|
||||
|
||||
context 'when setting is enabled' do
|
||||
let(:setting_enabled) { true }
|
||||
before do
|
||||
SiteSetting.public_send("#{setting_key}=", setting_enabled)
|
||||
all_setting_keys.each { |key| SiteSetting.public_send("#{key}=", 'foo') }
|
||||
SiteSetting.public_send("#{setting[:key]}=", setting[:enabled_value])
|
||||
SiteSetting.public_send("#{bucket_key}=", bucket_value)
|
||||
end
|
||||
|
||||
@ -229,7 +229,7 @@ describe AdminDashboardData do
|
||||
context 'when bucket is filled in' do
|
||||
let(:bucket_value) { 'a' }
|
||||
before do
|
||||
SiteSetting.public_send("s3_use_iam_profile=", use_iam_profile)
|
||||
SiteSetting.s3_use_iam_profile = use_iam_profile
|
||||
end
|
||||
|
||||
context 'when using iam profile' do
|
||||
@ -260,7 +260,7 @@ describe AdminDashboardData do
|
||||
|
||||
context 'when setting is not enabled' do
|
||||
before do
|
||||
SiteSetting.public_send("#{setting_key}=", false)
|
||||
SiteSetting.public_send("#{setting[:key]}=", setting[:disabled_value])
|
||||
end
|
||||
|
||||
it "always returns nil" do
|
||||
@ -272,13 +272,25 @@ describe AdminDashboardData do
|
||||
end
|
||||
|
||||
describe 'uploads' do
|
||||
let(:setting_key) { :enable_s3_uploads }
|
||||
let(:setting) do
|
||||
{
|
||||
key: :enable_s3_uploads,
|
||||
enabled_value: true,
|
||||
disabled_value: false
|
||||
}
|
||||
end
|
||||
let(:bucket_key) { :s3_upload_bucket }
|
||||
include_examples 'problem detection for s3-dependent setting'
|
||||
end
|
||||
|
||||
describe 'backups' do
|
||||
let(:setting_key) { :enable_s3_backups }
|
||||
let(:setting) do
|
||||
{
|
||||
key: :backup_location,
|
||||
enabled_value: BackupLocationSiteSetting::S3,
|
||||
disabled_value: BackupLocationSiteSetting::LOCAL
|
||||
}
|
||||
end
|
||||
let(:bucket_key) { :s3_backup_bucket }
|
||||
include_examples 'problem detection for s3-dependent setting'
|
||||
end
|
||||
|
Reference in New Issue
Block a user