2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

FEATURE: allow specifying s3 config via globals

This refactors handling of s3 so it can be specified via GlobalSetting

This means that in a multisite environment you can configure s3 uploads
without actual sites knowing credentials in s3

It is a critical setting for situations where assets are mirrored to s3.
This commit is contained in:
Sam 2017-10-06 16:20:01 +11:00
parent 5881355006
commit 70bb2aa426
28 changed files with 354 additions and 131 deletions

View file

@ -9,6 +9,21 @@ end
describe GlobalSetting do
describe '.use_s3_assets?' do
it 'returns false by default' do
expect(GlobalSetting.use_s3?).to eq(false)
end
it 'returns true once set' do
global_setting :s3_bucket, 'test_bucket'
global_setting :s3_region, 'ap-australia'
global_setting :s3_access_key_id, '123'
global_setting :s3_secret_access_key, '123'
expect(GlobalSetting.use_s3?).to eq(true)
end
end
describe '.safe_secret_key_base' do
it 'sets redis token if it is somehow flushed after 30 seconds' do