2016-05-20 16:27:32 +02:00
|
|
|
if Rails.env.test?
|
2018-03-06 13:44:29 +01:00
|
|
|
Fog.credentials_path = Rails.root.join('config', 'fog_credentials.test.yml')
|
2016-05-20 16:27:32 +02:00
|
|
|
else
|
2018-03-06 13:44:29 +01:00
|
|
|
Fog.credentials_path = Rails.root.join('config', 'fog_credentials.yml')
|
2016-05-20 16:27:32 +02:00
|
|
|
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
|
|
|
|
2018-04-18 12:24:37 +02:00
|
|
|
if Rails.env.production? || Rails.env.staging?
|
2016-05-13 16:08:51 +02:00
|
|
|
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
|
|
|
|
|
2018-03-06 13:44:29 +01:00
|
|
|
config.cache_dir = Rails.root.join("uploads")
|
2016-05-13 16:08:51 +02:00
|
|
|
|
|
|
|
config.fog_public = true
|
|
|
|
|
|
|
|
if Rails.env.production?
|
|
|
|
config.fog_directory = "tps"
|
2016-07-18 09:37:22 +02:00
|
|
|
elsif Rails.env.development?
|
2017-08-28 10:56:37 +02:00
|
|
|
config.fog_directory = "test_local"
|
2016-05-13 16:08:51 +02:00
|
|
|
else
|
|
|
|
config.fog_directory = "tps_dev"
|
|
|
|
end
|
|
|
|
end
|