db: drop IP addresses from certain tables.

Don't track IP addresses for post appeals, post flags, tag aliases, tag
implications, or user feedbacks. These things are already tightly
limited. We don't need IPs from them to detect sockpuppets.
This commit is contained in:
evazion
2019-11-17 02:28:19 -06:00
parent 72f17fd1de
commit a2ea2a65a1
9 changed files with 17 additions and 49 deletions

View File

@@ -28,10 +28,7 @@ module Moderator
add_row(sums, WikiPageVersion.where(updater_ip_addr: ip_addrs).group(:updater).count)
add_row(sums, Comment.where(creator_ip_addr: ip_addrs).group(:creator).count)
add_row(sums, Dmail.where(creator_ip_addr: ip_addrs).group(:from).count)
add_row(sums, PostAppeal.where(creator_ip_addr: ip_addrs).group(:creator).count)
add_row(sums, PostFlag.where(creator_ip_addr: ip_addrs).group(:creator).count)
add_row(sums, Upload.where(uploader_ip_addr: ip_addrs).group(:uploader).count)
add_row(sums, UserFeedback.where(creator_ip_addr: ip_addrs).group(:creator).count)
add_row(sums, Hash[User.where(last_ip_addr: ip_addrs).collect { |user| [user, 1] }])
add_row_id(sums, PoolArchive.where(updater_ip_addr: ip_addrs).group(:updater_id).count) if PoolArchive.enabled?
@@ -57,11 +54,8 @@ module Moderator
add_row(sums, WikiPageVersion.where(updater: users).group(:updater_ip_addr).count)
add_row(sums, Comment.where(creator: users).group(:creator_ip_addr).count)
add_row(sums, Dmail.where(from: users).group(:creator_ip_addr).count)
add_row(sums, PostAppeal.where(creator: users).where.not(creator_ip_addr: nil).group(:creator_ip_addr).count)
add_row(sums, PostFlag.where(creator: users).group(:creator_ip_addr).count)
add_row(sums, Upload.where(uploader: users).group(:uploader_ip_addr).count)
add_row(sums, User.where(id: users).where.not(last_ip_addr: nil).group(:last_ip_addr).count)
add_row(sums, UserFeedback.where(creator_id: users).where.not(creator_ip_addr: nil).group(:creator_ip_addr).count)
sums
end

View File

@@ -3,7 +3,7 @@ class PostAppeal < ApplicationRecord
belongs_to :creator, :class_name => "User"
belongs_to :post
validates_presence_of :reason, :creator_ip_addr
validates_presence_of :reason
validate :validate_post_is_inactive
validate :validate_creator_is_not_limited
before_validation :initialize_creator, :on => :create
@@ -60,7 +60,6 @@ class PostAppeal < ApplicationRecord
def initialize_creator
self.creator_id = CurrentUser.id
self.creator_ip_addr = CurrentUser.ip_addr
end
def appeal_count_for_creator

View File

@@ -35,7 +35,6 @@ class TagRelationship < ApplicationRecord
def initialize_creator
self.creator_id = CurrentUser.user.id
self.creator_ip_addr = CurrentUser.ip_addr
end
def normalize_names

View File

@@ -2,13 +2,7 @@
<% appeals.each do |appeal| %>
<li class="post-appeal-reason">
<span class="prose"><%= format_text(appeal.reason, inline: true) %></span>
- <%= link_to_user(appeal.creator) %>
<% if CurrentUser.is_moderator? %>
(<%= link_to_ip(appeal.creator_ip_addr) %>)
<% end %>
- <%= time_ago_in_words_tagged(appeal.created_at) %>
</li>
<% end %>

View File

@@ -5,10 +5,6 @@
<% if CurrentUser.can_view_flagger_on_post?(flag) %>
- <%= link_to_user(flag.creator) %>
<% if CurrentUser.is_moderator? %>
(<%= link_to_ip(flag.creator_ip_addr) %>)
<% end %>
<% end %>
- <%= time_ago_in_words_tagged(flag.created_at) %>