I am trying to run my static files on S3 and everything works great. Files are available, rendered and uploaded without any problem. But everything that is pushed to blogs via ckeditor is not pointing to amazon host, but application url instead.
this is the configuration
config/initializers/fog.rb
CarrierWave.configure do |config|
config.cache_dir = "#{Rails.root}/tmp/uploads"
config.storage = :fog
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: Rails.application.secrets.app_s3_username,
aws_secret_access_key: Rails.application.secrets.app_s3_password,
region: Rails.application.secrets.app_s3_region
}
config.fog_directory = Rails.application.secrets.app_s3_bucket
config.fog_public = false
config.fog_attributes = { 'Cache-Control' => "max-age=#{365.day.to_i}" }
end
models/ckeditor/picture.rb
class Ckeditor::Picture < Ckeditor::Asset
mount_uploader :data, CkeditorPictureUploader, :mount_on => :data_file_name
def url_content
url(:content)
end
end
uploaders/ckeditor_picture_uploader.rb
# encoding: utf-8
class CkeditorPictureUploader < CarrierWave::Uploader::Base
include Ckeditor::Backend::CarrierWave
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
include CarrierWave::MiniMagick
# include CarrierWave::ImageScience
# Choose what kind of storage to use for this uploader:
storage :fog
.
.
.
installed gems
* carrierwave (0.11.2)
* ckeditor (4.1.6)
* fog (1.37.0)
anyway the url of other uploaders images is https://bucket.s3-eu-west-1.amazonaws.com/uploads/... the url of ckeditor images http://example.com/uploads/...
any suggestion and help would be appreciated as i tried and searched the internet and wasn't able to find anyone having similar issue. Some mentioned a problem with public / private images, but that is not my issue as the URL is incorrect