2016-05-13 16:08:51 +02:00
|
|
|
require_relative 'features'
|
|
|
|
|
2016-05-20 16:27:32 +02:00
|
|
|
if Rails.env.test?
|
|
|
|
Fog.credentials_path = Rails.root.join('config/fog_credentials.test.yml')
|
|
|
|
else
|
|
|
|
Fog.credentials_path = Rails.root.join('config/fog_credentials.yml')
|
|
|
|
end
|
2016-05-13 16:08:51 +02:00
|
|
|
|
|
|
|
CarrierWave.configure do |config|
|
|
|
|
# These permissions will make dir and files available only to the user running
|
|
|
|
# the servers
|
2016-05-24 14:25:40 +02:00
|
|
|
config.permissions = 0664
|
|
|
|
config.directory_permissions = 0775
|
2016-05-13 16:08:51 +02:00
|
|
|
|
|
|
|
if Features.remote_storage and not Rails.env.test?
|
|
|
|
config.fog_credentials = { provider: 'OpenStack' }
|
|
|
|
end
|
|
|
|
|
|
|
|
# This avoids uploaded files from saving to public/ and so
|
|
|
|
# they will not be available for public (non-authenticated) downloading
|
|
|
|
config.root = Rails.root
|
|
|
|
|
|
|
|
config.cache_dir = "#{Rails.root}/uploads"
|
|
|
|
|
|
|
|
config.fog_public = true
|
|
|
|
|
|
|
|
if Rails.env.production?
|
|
|
|
config.fog_directory = "tps"
|
|
|
|
else
|
|
|
|
config.fog_directory = "tps_dev"
|
|
|
|
end
|
|
|
|
end
|