diff --git a/Gemfile b/Gemfile index 917b3d2941..fc5dce72b7 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,7 @@ gem 'font-awesome-rails' gem 'paperclip', '~> 4.3' gem 'paperclip-av-transcoder' +gem 'aws-sdk', '~> 2.3' gem 'http' gem 'httplog' diff --git a/Gemfile.lock b/Gemfile.lock index ae163a1b24..f3ec10c0ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -44,6 +44,12 @@ GEM ast (2.3.0) av (0.9.0) cocaine (~> 0.5.3) + aws-sdk (2.6.18) + aws-sdk-resources (= 2.6.18) + aws-sdk-core (2.6.18) + jmespath (~> 1.0) + aws-sdk-resources (2.6.18) + aws-sdk-core (= 2.6.18) babel-source (5.8.35) babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) @@ -139,6 +145,7 @@ GEM jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) + jmespath (1.3.1) jquery-rails (4.1.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -374,6 +381,7 @@ PLATFORMS DEPENDENCIES active_record_query_trace addressable + aws-sdk (~> 2.3) better_errors binding_of_caller browserify-rails diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb new file mode 100644 index 0000000000..73eb3356bc --- /dev/null +++ b/config/initializers/paperclip.rb @@ -0,0 +1,10 @@ +if ENV['S3_ENABLED'] == 'true' + Paperclip::Attachment.default_options[:storage] = :s3 + + Paperclip::Attachment.default_options[:s3_credentials] = { + bucket: ENV.fetch('S3_BUCKET'), + access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'), + secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'), + s3_region: ENV.fetch('S3_REGION') + } +end diff --git a/public/500.html b/public/500.html index af46b8a5a1..aa18fc722e 100644 --- a/public/500.html +++ b/public/500.html @@ -2,66 +2,41 @@
-If you are the application owner check the logs for more information.