From cd9cce0fce13f38218c2fff7863bdd4340542c59 Mon Sep 17 00:00:00 2001 From: zaziemo Date: Mon, 6 May 2024 20:34:48 +0200 Subject: [PATCH] Remove gem crawler detect [#1352] --- Gemfile | 1 - Gemfile.lock | 4 ---- app/controllers/application_controller.rb | 8 -------- config/application.rb | 1 - 4 files changed, 14 deletions(-) diff --git a/Gemfile b/Gemfile index 87ad98f69..0ea76dcdf 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 35190194f..3b2a75059 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 @@ -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) @@ -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 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 412b33ba0..8b3e2006d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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? @@ -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) diff --git a/config/application.rb b/config/application.rb index 372ed19c2..7a2c55662 100644 --- a/config/application.rb +++ b/config/application.rb @@ -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