Skip to content

Commit

Permalink
debug: disable Locomotive & Dragonfly
Browse files Browse the repository at this point in the history
  • Loading branch information
did committed Aug 31, 2024
1 parent 18f8a4c commit 7202bc8
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 109 deletions.
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gem 'remote_syslog_logger', '1.0.4'

# gem 'locomotivecms_search', path: '../../search'

gem 'locomotivecms', github: 'locomotivecms/engine', ref: 'e6fb512c'
gem 'locomotivecms', github: 'locomotivecms/engine', ref: 'e6fb512c', require: false
gem 'locomotivecms_steam', github: 'locomotivecms/steam', ref: '4386db6', require: false
gem 'locomotivecms_common', github: 'locomotivecms/common', ref: 'c78da158', require: false
# gem 'locomotivecms_search', github: 'locomotivecms/search', ref: '35e5813'
Expand Down Expand Up @@ -65,9 +65,11 @@ gem "bootsnap", require: false
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'dotenv'

group :development, :test do
gem "debug", ">= 1.0.0"
gem 'dotenv'

end

group :development do
Expand Down
56 changes: 28 additions & 28 deletions config/initializers/dragonfly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,41 @@
TRANSFORMED_IMAGES_SERVICE_URL = ENV['DRAGONFLYAPP_HOST'] || ENV['DRAGONFLYAPP_URL'] || Rails.application.config.action_controller.asset_host

# Configure
Dragonfly.app(:engine).configure do
plugin :imagemagick,
convert_command: `which convert`.strip.presence || '/usr/local/bin/convert',
identify_command: `which identify`.strip.presence || '/usr/local/bin/identify'
# Dragonfly.app(:engine).configure do
# plugin :imagemagick,
# convert_command: `which convert`.strip.presence || '/usr/local/bin/convert',
# identify_command: `which identify`.strip.presence || '/usr/local/bin/identify'

processor :thumb, Locomotive::Dragonfly::Processors::SmartThumb.new
# processor :thumb, Locomotive::Dragonfly::Processors::SmartThumb.new

if Rails.env.production?
verify_urls true
# if Rails.env.production?
# verify_urls true

secret ENV['DRAGONFLY_SECRET_KEY']
else
verify_urls false
end
# secret ENV['DRAGONFLY_SECRET_KEY']
# else
# verify_urls false
# end

url_format '/images/dynamic/:job/:sha/:basename.:ext'
# url_format '/images/dynamic/:job/:sha/:basename.:ext'

fetch_file_whitelist /public/
# fetch_file_whitelist /public/

fetch_url_whitelist /.+/
# fetch_url_whitelist /.+/

# we don't care if this is the Heroku app converting the image
url_host (case Rails.env.to_sym
when :production then TRANSFORMED_IMAGES_SERVICE_URL
else nil; end)
end
# # we don't care if this is the Heroku app converting the image
# url_host (case Rails.env.to_sym
# when :production then TRANSFORMED_IMAGES_SERVICE_URL
# else nil; end)
# end

Dragonfly.app(:steam).configure do
url_host (case Rails.env.to_sym
when :production then TRANSFORMED_IMAGES_SERVICE_URL
else nil; end)
end
# Dragonfly.app(:steam).configure do
# url_host (case Rails.env.to_sym
# when :production then TRANSFORMED_IMAGES_SERVICE_URL
# else nil; end)
# end

# Logger
Dragonfly.logger = Rails.logger
# # Logger
# Dragonfly.logger = Rails.logger

# Mount as middleware
Rails.application.middleware.use Dragonfly::Middleware, :engine
# # Mount as middleware
# Rails.application.middleware.use Dragonfly::Middleware, :engine
152 changes: 76 additions & 76 deletions config/initializers/locomotive.rb
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
Locomotive.configure do |config|

# enable it if you want Locomotive to render the site of the Rails application embedding the engine
if Rails.env.production?
config.host = 'beta.locomotive.works'
end

# list of forbidden handles for a site because there are in conflicts with internal resources.
# config.reserved_site_handles = %w(sites my_account password sign_in sign_out)

# list of domains which can't be used by any Locomotive sites
# config.reserved_domains = []

# configure how many items we display in sub menu in the "Models" section.
config.ui = {
per_page: 10
}

# default locale (for now, only en, de, fr, pl, pt, pt-BR, it, nl, nb, ja, cs, bg, sk, sv and uk are supported)
config.default_locale = :en

# locales allowed for the back-office UI
config.locales = [:en, :fr, :de, :"zh-CN", :cs, :el, :lt, :"pt-BR", :nl, :ru]

# available locales suggested to "localize" a site. You will have to pick up at least one among that list.
config.site_locales = %w{en de fr es} # pl pt pt-BR it nl nb es ru ja cs bg sk uk}

# tell if logs of the Engine (back-office) are enabled. Useful for debug purpose.
config.enable_logs = true

# setup the logger for Steam (rendering)
# config.steam_log_file = ENV['LOCOMOTIVE_STEAM_LOG'] || Rails.root.join('log', 'steam.log')
config.steam_log_level = ::Logger::INFO
# config.steam_log_level = ::Logger::INFO

# the API authentication requires to developer to pass 2 params in the header
# of the request: X-Locomotive-Account-Email and X-Locomotive-Token.
# However, to keep backward compatability with v2.x versions, you can use
# the "token" request param instead although it is considered unsafe.
config.unsafe_token_authentication = true

# Uncomment this line to force Locomotive to redirect all requests in the
# back-office to https in production.
config.enable_admin_ssl = Rails.env.production?

# Configure the e-mail address which will be shown in the DeviseMailer, NotificationMailer, ...etc
# if you do not put the domain name in the email, Locomotive will take the default domain name depending
# on your deployment target (server, Heroku, Bushido, ...etc)
#
# Ex:
# config.mailer_sender = 'support'
config.mailer_sender = '[email protected]'

# Add the checksum of a theme asset at the end of its path to allow public caching.
# By default, it's disabled.
#
# config.theme_assets_checksum = true

# Rack-cache settings, mainly used for the inline resizing image module. Default options:
# config.rack_cache = {
# verbose: true,
# metastore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), # URI encoded in case of spaces
# entitystore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/body")
# }
# If you do want to disable it for good, just use the following syntax
# config.rack_cache = false
#
# Note: by default, rack/cache is disabled in the Heroku platform

# Dragonfly within Steam uses it to generate the protective SHA
config.steam_image_resizer_secret = ENV['DRAGONFLY_SECRET_KEY']

# Indicate whether you want to allow users to register with the site. If set
# to false the registration page will not be shown. (Default: true)
config.enable_registration = false
end
# Locomotive.configure do |config|

# # enable it if you want Locomotive to render the site of the Rails application embedding the engine
# if Rails.env.production?
# config.host = 'beta.locomotive.works'
# end

# # list of forbidden handles for a site because there are in conflicts with internal resources.
# # config.reserved_site_handles = %w(sites my_account password sign_in sign_out)

# # list of domains which can't be used by any Locomotive sites
# # config.reserved_domains = []

# # configure how many items we display in sub menu in the "Models" section.
# config.ui = {
# per_page: 10
# }

# # default locale (for now, only en, de, fr, pl, pt, pt-BR, it, nl, nb, ja, cs, bg, sk, sv and uk are supported)
# config.default_locale = :en

# # locales allowed for the back-office UI
# config.locales = [:en, :fr, :de, :"zh-CN", :cs, :el, :lt, :"pt-BR", :nl, :ru]

# # available locales suggested to "localize" a site. You will have to pick up at least one among that list.
# config.site_locales = %w{en de fr es} # pl pt pt-BR it nl nb es ru ja cs bg sk uk}

# # tell if logs of the Engine (back-office) are enabled. Useful for debug purpose.
# config.enable_logs = true

# # setup the logger for Steam (rendering)
# # config.steam_log_file = ENV['LOCOMOTIVE_STEAM_LOG'] || Rails.root.join('log', 'steam.log')
# config.steam_log_level = ::Logger::INFO
# # config.steam_log_level = ::Logger::INFO

# # the API authentication requires to developer to pass 2 params in the header
# # of the request: X-Locomotive-Account-Email and X-Locomotive-Token.
# # However, to keep backward compatability with v2.x versions, you can use
# # the "token" request param instead although it is considered unsafe.
# config.unsafe_token_authentication = true

# # Uncomment this line to force Locomotive to redirect all requests in the
# # back-office to https in production.
# config.enable_admin_ssl = Rails.env.production?

# # Configure the e-mail address which will be shown in the DeviseMailer, NotificationMailer, ...etc
# # if you do not put the domain name in the email, Locomotive will take the default domain name depending
# # on your deployment target (server, Heroku, Bushido, ...etc)
# #
# # Ex:
# # config.mailer_sender = 'support'
# config.mailer_sender = '[email protected]'

# # Add the checksum of a theme asset at the end of its path to allow public caching.
# # By default, it's disabled.
# #
# # config.theme_assets_checksum = true

# # Rack-cache settings, mainly used for the inline resizing image module. Default options:
# # config.rack_cache = {
# # verbose: true,
# # metastore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), # URI encoded in case of spaces
# # entitystore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/body")
# # }
# # If you do want to disable it for good, just use the following syntax
# # config.rack_cache = false
# #
# # Note: by default, rack/cache is disabled in the Heroku platform

# # Dragonfly within Steam uses it to generate the protective SHA
# config.steam_image_resizer_secret = ENV['DRAGONFLY_SECRET_KEY']

# # Indicate whether you want to allow users to register with the site. If set
# # to false the registration page will not be shown. (Default: true)
# config.enable_registration = false
# end
6 changes: 3 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
get '/locomotive/demo', to: 'demo#show'

# Locomotive Back-office
mount Locomotive::Engine => '/locomotive', as: 'locomotive' # you can change the value of the path, by default set to "/locomotive"
# mount Locomotive::Engine => '/locomotive', as: 'locomotive' # you can change the value of the path, by default set to "/locomotive"

# Locomotive API
mount Locomotive::API.to_app => '/locomotive(/:site_handle)/api'
# mount Locomotive::API.to_app => '/locomotive(/:site_handle)/api'

# Render site
mount Locomotive::Steam.to_app => '/', anchor: false
# mount Locomotive::Steam.to_app => '/', anchor: false
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end

0 comments on commit 7202bc8

Please sign in to comment.