diff --git a/Gemfile b/Gemfile index 458f324..0684676 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,8 @@ gem 'shoulda' gem 'paperclip' +gem 'aws-sdk' + gem 'devise' gem 'travis' diff --git a/Gemfile.lock b/Gemfile.lock index 62039fc..0c3db3b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,6 +41,14 @@ GEM acts_as_votable (0.10.0) addressable (2.4.0) arel (7.1.4) + aws-sdk (2.6.20) + aws-sdk-resources (= 2.6.20) + aws-sdk-core (2.6.20) + aws-sigv4 (~> 1.0) + jmespath (~> 1.0) + aws-sdk-resources (2.6.20) + aws-sdk-core (= 2.6.20) + aws-sigv4 (1.0.0) backports (3.6.8) bcrypt (3.1.11) builder (3.2.2) @@ -107,6 +115,7 @@ GEM jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) + jmespath (1.3.1) jquery-rails (4.2.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -288,6 +297,7 @@ PLATFORMS DEPENDENCIES acts_as_votable (~> 0.10.0) + aws-sdk byebug capybara coffee-rails (~> 4.2) diff --git a/config/environments/development.rb b/config/environments/development.rb index 611f592..6667cd7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -7,6 +7,17 @@ Paperclip.options[:command_path] = "/usr/local/bin/convert/" + config.paperclip_defaults = { + storage: :s3, + s3_host_name: "s3-eu-west-1.amazonaws.com", + s3_credentials: { + bucket: ENV.fetch('S3_BUCKET_NAME'), + access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'), + secret_access_key: ENV.fetch('AWS_SECRET_KEY'), + s3_region: ENV.fetch('AWS_REGION'), + } +} + config.cache_classes = false # Do not eager load code on boot. diff --git a/config/environments/production.rb b/config/environments/production.rb index 839d384..3c90d60 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -4,6 +4,17 @@ # Code is not reloaded between requests. config.cache_classes = true + config.paperclip_defaults = { + storage: :s3, + s3_host_name: "s3-eu-west-1.amazonaws.com", + s3_credentials: { + bucket: ENV.fetch('S3_BUCKET_NAME'), + access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'), + secret_access_key: ENV.fetch('AWS_SECRET_KEY'), + s3_region: ENV.fetch('AWS_REGION'), + } +} + # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers # and those relying on copy on write to perform better. diff --git a/config/environments/test.rb b/config/environments/test.rb index 30587ef..59e9836 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -7,6 +7,17 @@ # and recreated between test runs. Don't rely on the data there! config.cache_classes = true + config.paperclip_defaults = { + storage: :s3, + s3_host_name: "s3-eu-west-1.amazonaws.com", + s3_credentials: { + bucket: ENV["S3_BUCKET_NAME"], + access_key_id: ENV["AWS_ACCESS_KEY_ID"], + secret_access_key: ENV["AWS_SECRET_KEY"], + s3_region: ENV["AWS_REGION"], + } +} + # Do not eager load code on boot. This avoids loading your whole application # just for the purpose of running a single test. If you are using a tool that # preloads Rails for running tests, you may have to set it to true. diff --git a/public/system/photos/avatars/000/000/007/medium/2bce38_bcc0feefbd7c76208d4163ae860e7b8b.jpg b/public/system/photos/avatars/000/000/007/medium/2bce38_bcc0feefbd7c76208d4163ae860e7b8b.jpg new file mode 100644 index 0000000..e07b987 Binary files /dev/null and b/public/system/photos/avatars/000/000/007/medium/2bce38_bcc0feefbd7c76208d4163ae860e7b8b.jpg differ diff --git a/public/system/photos/avatars/000/000/007/original/2bce38_bcc0feefbd7c76208d4163ae860e7b8b.jpg b/public/system/photos/avatars/000/000/007/original/2bce38_bcc0feefbd7c76208d4163ae860e7b8b.jpg new file mode 100644 index 0000000..da9a681 Binary files /dev/null and b/public/system/photos/avatars/000/000/007/original/2bce38_bcc0feefbd7c76208d4163ae860e7b8b.jpg differ