Set fog_provider and load carrierwave/storage/fog if S3 is enabled

Fixes #7563

closes #7566
This commit is contained in:
Benjamin Neff 2017-08-22 01:00:48 +02:00
parent 398235ee6f
commit 5ea7b8ee13
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
2 changed files with 4 additions and 1 deletions

View file

@ -5,7 +5,8 @@
* Remove Internet Explorer workarounds [#7557](https://github.com/diaspora/diaspora/pull/7557) * Remove Internet Explorer workarounds [#7557](https://github.com/diaspora/diaspora/pull/7557)
## Bug fixes ## Bug fixes
* Fix displaying posts with long labels [#7579](https://github.com/diaspora/diaspora/pull/7579) * Fix displaying polls with long answers [#7579](https://github.com/diaspora/diaspora/pull/7579)
* Fix S3 support [#7566](https://github.com/diaspora/diaspora/pull/7566)
## Features ## Features
* Ask for confirmation when leaving a submittable comment field [#7530](https://github.com/diaspora/diaspora/pull/7530) * Ask for confirmation when leaving a submittable comment field [#7530](https://github.com/diaspora/diaspora/pull/7530)

View file

@ -6,6 +6,8 @@
ENV['SSL_CERT_FILE'] = AppConfig.environment.certificate_authorities.get ENV['SSL_CERT_FILE'] = AppConfig.environment.certificate_authorities.get
CarrierWave.configure do |config| CarrierWave.configure do |config|
if !Rails.env.test? && AppConfig.environment.s3.enable? if !Rails.env.test? && AppConfig.environment.s3.enable?
config.fog_provider = "fog/aws"
require "carrierwave/storage/fog"
config.storage = :fog config.storage = :fog
config.cache_dir = Rails.root.join('tmp', 'uploads').to_s config.cache_dir = Rails.root.join('tmp', 'uploads').to_s
config.fog_credentials = { config.fog_credentials = {