VRFS-719 Added code to force downloads through cloudfront

This commit is contained in:
Chris Doughty 2013-12-12 20:47:20 -06:00
parent 6b4e42dfc5
commit fa8df410da
2 changed files with 6 additions and 1 deletions

View File

@ -51,11 +51,12 @@ class ArtifactsController < ApiController
end
def determine_url(artifact)
if SampleApp::Application.config.storage_type == :file
# this is basically a dev-time only path of code; we store real artifacts in s3
url = SampleApp::Application.config.jam_admin_root_url + artifact.uri.url
else
url = artifact.uri.url
url = artifact.uri.url.gsub(SampleApp::Application.config.aws_fullhost,SampleApp::Application.config.cloudfront_host)
end
return url

View File

@ -122,6 +122,10 @@ if defined?(Bundler)
config.aws_bucket = 'jamkazam-dev'
config.aws_bucket_public = 'jamkazam-dev-public'
config.aws_cache = '315576000'
config.aws_fullhost = "#{config.aws_bucket_public}.s3.amazonaws.com"
# cloudfront host
config.cloudfront_host = "d34f55ppvvtgi3.cloudfront.net"
# facebook keys
config.facebook_key = '468555793186398'