mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:03:35 +08:00
Merge pull request #5838 from discourse/fix-for-s3-subfolders
FIX for bucket name in GlobalSetting with folder
This commit is contained in:
commit
f6becd6a4e
|
@ -85,6 +85,10 @@ class GlobalSetting
|
|||
end) == :true
|
||||
end
|
||||
|
||||
def self.s3_bucket_name
|
||||
@s3_bucket_name ||= s3_bucket.downcase.split("/")[0]
|
||||
end
|
||||
|
||||
# for testing
|
||||
def self.reset_s3_cache!
|
||||
@use_s3 = nil
|
||||
|
|
|
@ -133,7 +133,7 @@ class SiteSetting < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.absolute_base_url
|
||||
bucket = SiteSetting.enable_s3_uploads ? Discourse.store.s3_bucket_name : GlobalSetting.s3_bucket
|
||||
bucket = SiteSetting.enable_s3_uploads ? Discourse.store.s3_bucket_name : GlobalSetting.s3_bucket_name
|
||||
|
||||
# cf. http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
|
||||
if SiteSetting.Upload.s3_region == "us-east-1"
|
||||
|
|
Loading…
Reference in New Issue
Block a user