Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove gem crawler detect #1358

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading