Paperclip: add support for Azure blob storage (#23607)
This commit is contained in:
parent
4c18928a93
commit
b848ba3867
5 changed files with 40 additions and 1 deletions
|
@ -131,6 +131,26 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
|
|||
fog_host: ENV['SWIFT_OBJECT_URL'],
|
||||
fog_public: true
|
||||
)
|
||||
elsif ENV['AZURE_ENABLED'] == 'true'
|
||||
require 'paperclip-azure'
|
||||
|
||||
Paperclip::Attachment.default_options.merge!(
|
||||
storage: :azure,
|
||||
azure_options: {
|
||||
protocol: 'https',
|
||||
},
|
||||
azure_credentials: {
|
||||
storage_account_name: ENV['AZURE_STORAGE_ACCOUNT'],
|
||||
storage_access_key: ENV['AZURE_STORAGE_ACCESS_KEY'],
|
||||
container: ENV['AZURE_CONTAINER_NAME'],
|
||||
}
|
||||
)
|
||||
if ENV.has_key?('AZURE_ALIAS_HOST')
|
||||
Paperclip::Attachment.default_options.merge!(
|
||||
url: ':azure_alias_url',
|
||||
azure_host_alias: ENV['AZURE_ALIAS_HOST']
|
||||
)
|
||||
end
|
||||
else
|
||||
Paperclip::Attachment.default_options.merge!(
|
||||
storage: :filesystem,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue