diff --git a/.env b/.env deleted file mode 100644 index f4e2a1b..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -PG_HOST=localhost \ No newline at end of file diff --git a/app/models/medium.rb b/app/models/medium.rb index b5fc598..bede857 100644 --- a/app/models/medium.rb +++ b/app/models/medium.rb @@ -5,8 +5,7 @@ class Medium < ApplicationRecord has_attached_file :attachment, storage: :s3, styles: { medium: "300x300>", thumb: "100x100>" }, - default_url: "/images/:style/missing.png", - :s3_credentials => S3_CREDENTIALS + default_url: "/images/:style/missing.png" validates_attachment :attachment, content_type: { content_type: ["image/jpeg", "image/gif", "image/png"] } diff --git a/config/aws.yml b/config/aws.yml index eca01c5..c820a56 100644 --- a/config/aws.yml +++ b/config/aws.yml @@ -1,3 +1,3 @@ -access_key_id: ENV['S3_ACCESS_KEY_ID'] -secret_access_key: ENV['S3_SECRET_ACCESS_KEY'] +access_key_id: <%= ENV['S3_ACCESS_KEY_ID'] %> +secret_access_key: <%= ENV['S3_SECRET_ACCESS_KEY'] %> diff --git a/config/environments/development.rb b/config/environments/development.rb index 1ee427f..a2bd866 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -44,8 +44,9 @@ :storage => :s3, :s3_region => "us-east-1", :url => ":s3_domain_url", - :bucket => 'stuyspec-media-testing', - :s3_protocol => "http" + :s3_endpoint => 's3-us-east-1.amazonaws.com', + :bucket => 'stuyspec-images', + :s3_protocol => "https" } # Raises error for missing translations # config.action_view.raise_on_missing_translations = true diff --git a/config/environments/production.rb b/config/environments/production.rb index 8ed667b..6f0e834 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -62,10 +62,11 @@ config.paperclip_defaults = { :storage => :s3, - :s3_region => "us-east-2", + :s3_region => "us-east-1", :url => ":s3_domain_url", - :bucket => 'stuyspec-media', - :s3_protocol => "http" + :s3_endpoint => 's3-us-east-1.amazonaws.com', + :bucket => 'stuyspec-images', + :s3_protocol => "https" } # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found).