Skip to content

Commit

Permalink
Merge pull request #1358 from rubymonsters/1352-remove-crawler-detect
Browse files Browse the repository at this point in the history
Remove gem crawler detect
  • Loading branch information
zaziemo authored May 6, 2024
2 parents 62b3d6f + cd9cce0 commit 2ee930b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 14 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ gem 'image_processing', '~> 1.2'
gem 'rack-timeout'
gem 'pg_search'

gem 'crawler_detect'
gem 'rack-attack'

# downgrade gem to solve parsing error https://stackoverflow.com/questions/74725359/ruby-on-rails-legacy-application-update-generates-gem-psych-alias-error-psychb
Expand Down
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ GEM
country_select (8.0.1)
countries (~> 5.0)
crass (1.0.6)
crawler_detect (1.2.3)
qonfig (~> 0.24)
css_parser (1.2.6)
addressable
rdoc
Expand Down Expand Up @@ -329,7 +327,6 @@ GEM
method_source (~> 1.0)
psych (3.3.3)
public_suffix (5.0.1)
qonfig (0.28.0)
racc (1.7.1)
rack (2.2.6.4)
rack-attack (6.7.0)
Expand Down Expand Up @@ -484,7 +481,6 @@ DEPENDENCIES
capybara (~> 3.38)
coffee-rails (~> 5.0.0)
country_select
crawler_detect
database_cleaner (~> 1.7.0)
deadweight
derailed_benchmarks
Expand Down
8 changes: 0 additions & 8 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class ApplicationController < ActionController::Base
before_action :set_current_region
before_action :set_search_region
before_action :check_cookie_consent
before_action :log_bot_activity

def authenticate_admin!
return if current_profile&.admin?
Expand Down Expand Up @@ -58,13 +57,6 @@ def validate_region(region)
helper_method :search_region

private
def log_bot_activity
return if Rails.env.test?
return unless request.is_crawler?

logger.warn "Crawler #{request.crawler_name} was here!"
end

def build_missing_translations(object)
I18n.available_locales.each do |locale|
object.translations.build(locale: locale) unless object.translated_locales.include?(locale)
Expand Down
1 change: 0 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ class Application < Rails::Application
# the framework and any gems in your application.

config.exceptions_app = self.routes
config.middleware.use Rack::CrawlerDetect
end
end

0 comments on commit 2ee930b

Please sign in to comment.