diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 739c15ee..d219c4e2 100755 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -46,8 +46,6 @@ class ProfilesController < ApplicationController else @profile = current_user.profile end - puts "______________awsbucketaddress: #{Settings.image.host}" - puts "______________awsbucketaddress: #{Settings.image&.host}" @profile.update_attributes(params[:profile]) json_saved @profile, 'Profile updated' end diff --git a/config/environment.rb b/config/environment.rb index 74e95206..b8401d16 100755 --- a/config/environment.rb +++ b/config/environment.rb @@ -63,7 +63,7 @@ Config.schema do required(:aws).schema do # the region your AWS bucket is in - required(:region).filled(:str?) + # required(:region).filled(:str?) # the name of your aws bucket required(:bucket).filled(:str?) @@ -295,4 +295,3 @@ Settings.reload! # Initialize the rails application Commitchange::Application.initialize! - diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 0542a856..59b7bfc0 100755 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -4,8 +4,7 @@ CarrierWave.configure do |config| config.storage = :aws config.aws_bucket = Settings.aws.bucket config.aws_acl = :public_read - # config.asset_host = Settings.image&.host || "https://s3-#{Settings.aws.region}.amazonaws.com/#{Settings.aws.bucket}" - config.asset_host = "https://s3.amazonaws.com/#{Settings.aws.bucket}" + config.asset_host = Settings.image&.host || "https://s3-#{Settings.aws.region}.amazonaws.com/#{Settings.aws.bucket}" config.aws_authenticated_url_expiration = 60 * 60 * 24 * 365 config.aws_credentials = { access_key_id: Settings.aws.access_key_id, diff --git a/config/settings.yml b/config/settings.yml index f657c967..f6a5c812 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -20,9 +20,11 @@ default: aws: access_key_id: <%= ENV['AWS_ACCESS_KEY'] %> secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %> - region: <%= ENV['AWS_REGION'] %> bucket: <%= ENV['S3_BUCKET_NAME'] %> +image: + host: "https://#{Settings.aws.bucket}.s3.amazonaws.com" + mailer: delivery_method: "sendmail" address: "localhost"