mirror of
https://github.com/moebooru/moebooru
synced 2025-08-31 14:05:14 +00:00
Remove geoip
It's never been used in any meaningful way.
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -17,7 +17,6 @@ gem "diff-lcs", require: ['diff-lcs', 'diff/lcs/array']
|
|||||||
gem "dalli"
|
gem "dalli"
|
||||||
gem "connection_pool"
|
gem "connection_pool"
|
||||||
gem "acts_as_versioned_rails3"
|
gem "acts_as_versioned_rails3"
|
||||||
gem "geoip"
|
|
||||||
gem "exception_notification"
|
gem "exception_notification"
|
||||||
gem "will_paginate"
|
gem "will_paginate"
|
||||||
gem "will-paginate-i18n"
|
gem "will-paginate-i18n"
|
||||||
|
@@ -88,7 +88,6 @@ GEM
|
|||||||
ffi (1.13.1)
|
ffi (1.13.1)
|
||||||
ffi (1.13.1-java)
|
ffi (1.13.1-java)
|
||||||
ffi (1.13.1-x86-mingw32)
|
ffi (1.13.1-x86-mingw32)
|
||||||
geoip (1.6.4)
|
|
||||||
get_process_mem (0.2.7)
|
get_process_mem (0.2.7)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
globalid (0.4.2)
|
globalid (0.4.2)
|
||||||
@@ -246,7 +245,6 @@ DEPENDENCIES
|
|||||||
dalli
|
dalli
|
||||||
diff-lcs
|
diff-lcs
|
||||||
exception_notification
|
exception_notification
|
||||||
geoip
|
|
||||||
i18n-js (>= 3.0.0.rc7)
|
i18n-js (>= 3.0.0.rc7)
|
||||||
image_size
|
image_size
|
||||||
jbuilder (~> 2.5)
|
jbuilder (~> 2.5)
|
||||||
|
@@ -82,16 +82,6 @@ class ApplicationController < ActionController::Base
|
|||||||
@current_user.log(request.remote_ip) unless @current_user.is_anonymous?
|
@current_user.log(request.remote_ip) unless @current_user.is_anonymous?
|
||||||
end
|
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|
|
CONFIG["user_levels"].each do |name, _value|
|
||||||
normalized_name = name.downcase.gsub(/ /, "_")
|
normalized_name = name.downcase.gsub(/ /, "_")
|
||||||
|
|
||||||
@@ -190,7 +180,6 @@ class ApplicationController < ActionController::Base
|
|||||||
before_action :set_current_user
|
before_action :set_current_user
|
||||||
before_action :mini_profiler_check if Rails.env.development?
|
before_action :mini_profiler_check if Rails.env.development?
|
||||||
before_action :limit_api
|
before_action :limit_api
|
||||||
before_action :set_country
|
|
||||||
before_action :check_ip_ban
|
before_action :check_ip_ban
|
||||||
after_action :init_cookies
|
after_action :init_cookies
|
||||||
|
|
||||||
@@ -261,8 +250,6 @@ class ApplicationController < ActionController::Base
|
|||||||
@current_user.last_forum_topic_read_at || Time.at(0)
|
@current_user.last_forum_topic_read_at || Time.at(0)
|
||||||
end.to_json
|
end.to_json
|
||||||
|
|
||||||
cookies["country"] = @current_user_country
|
|
||||||
|
|
||||||
if @current_user.is_anonymous?
|
if @current_user.is_anonymous?
|
||||||
cookies.delete :user_info
|
cookies.delete :user_info
|
||||||
else
|
else
|
||||||
|
BIN
db/GeoIP.dat
BIN
db/GeoIP.dat
Binary file not shown.
Reference in New Issue
Block a user