2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-22 01:47:48 +00:00

Remove geoip

It's never been used in any meaningful way.
This commit is contained in:
nanaya 2020-12-20 18:51:13 +09:00
parent 1e00bd7565
commit f4a1ac0ad4
4 changed files with 0 additions and 16 deletions

View File

@ -17,7 +17,6 @@ gem "diff-lcs", require: ['diff-lcs', 'diff/lcs/array']
gem "dalli"
gem "connection_pool"
gem "acts_as_versioned_rails3"
gem "geoip"
gem "exception_notification"
gem "will_paginate"
gem "will-paginate-i18n"

View File

@ -88,7 +88,6 @@ GEM
ffi (1.13.1)
ffi (1.13.1-java)
ffi (1.13.1-x86-mingw32)
geoip (1.6.4)
get_process_mem (0.2.7)
ffi (~> 1.0)
globalid (0.4.2)
@ -246,7 +245,6 @@ DEPENDENCIES
dalli
diff-lcs
exception_notification
geoip
i18n-js (>= 3.0.0.rc7)
image_size
jbuilder (~> 2.5)

View File

@ -82,16 +82,6 @@ class ApplicationController < ActionController::Base
@current_user.log(request.remote_ip) unless @current_user.is_anonymous?
end
def set_country
@current_user_country = Rails.cache.fetch({ :type => :geoip, :ip => request.remote_ip }, :expires_in => 1.month) do
begin
GeoIP.new(Rails.root.join("db", "GeoIP.dat").to_s).country(request.remote_ip).country_code2
rescue
"--"
end
end
end
CONFIG["user_levels"].each do |name, _value|
normalized_name = name.downcase.gsub(/ /, "_")
@ -190,7 +180,6 @@ class ApplicationController < ActionController::Base
before_action :set_current_user
before_action :mini_profiler_check if Rails.env.development?
before_action :limit_api
before_action :set_country
before_action :check_ip_ban
after_action :init_cookies
@ -261,8 +250,6 @@ class ApplicationController < ActionController::Base
@current_user.last_forum_topic_read_at || Time.at(0)
end.to_json
cookies["country"] = @current_user_country
if @current_user.is_anonymous?
cookies.delete :user_info
else

Binary file not shown.