-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
8,875 additions
and
7,753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
db/migrate/20240703124751_add_banned_users_table.decidim_spam_signal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_spam_signal (originally 20220726153218) | ||
|
||
class AddBannedUsersTable < ActiveRecord::Migration[5.2] | ||
def change | ||
create_table :decidim_banned_users do |t| | ||
t.references :banned_user, foreign_key: { to_table: :decidim_users, on_delete: :nullify } | ||
t.references :admin_reporter, foreign_key: { to_table: :decidim_users } | ||
t.datetime :notified_at | ||
t.datetime :removed_at | ||
t.string :banned_email, index: true | ||
t.timestamps | ||
end | ||
end | ||
end |
23 changes: 23 additions & 0 deletions
23
db/migrate/20240703124752_create_spam_signal_config_table.decidim_spam_signal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_spam_signal (originally 20220728004242) | ||
|
||
class CreateSpamSignalConfigTable < ActiveRecord::Migration[5.2] | ||
def change | ||
create_table :spam_signal_config_tables do |t| | ||
t.integer :decidim_organization_id, | ||
foreign_key: true, | ||
index: { name: "index_decidim_spam_signal_on_decidim_organization_id" } | ||
t.string :profile_scan | ||
t.string :comment_scan | ||
|
||
t.string :profile_obvious_cop | ||
t.string :profile_suspicious_cop | ||
t.string :comment_obvious_cop | ||
t.string :comment_suspicious_cop | ||
|
||
t.jsonb :cops_settings | ||
t.jsonb :scan_settings | ||
t.timestamps | ||
end | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
db/migrate/20240703124753_add_justification_to_banned_users.decidim_spam_signal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_spam_signal (originally 20220728095052) | ||
|
||
class AddJustificationToBannedUsers < ActiveRecord::Migration[5.2] | ||
def change | ||
add_column :decidim_banned_users, :justification, :text | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
db/migrate/20240703124754_unified_config.decidim_spam_signal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_spam_signal (originally 20221010141918) | ||
|
||
class UnifiedConfig < ActiveRecord::Migration[5.2] | ||
def change | ||
drop_table :spam_signal_config_tables | ||
create_table :spam_signal_config_tables do |t| | ||
t.integer :decidim_organization_id, | ||
foreign_key: true, | ||
index: { name: "index_decidim_spam_signal_on_decidim_organization_id" } | ||
t.jsonb :comment_settings | ||
t.jsonb :profile_settings | ||
t.timestamps | ||
end | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
db/migrate/20240703124755_drop_quarantine.decidim_spam_signal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_spam_signal (originally 20221010141920) | ||
|
||
class DropQuarantine < ActiveRecord::Migration[5.2] | ||
def change | ||
drop_table :decidim_banned_users | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
db/migrate/20240703124756_copbot_email.decidim_spam_signal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
# This migration comes from decidim_spam_signal (originally 20230920151920) | ||
|
||
class CopbotEmail < ActiveRecord::Migration[5.2] | ||
def change | ||
# bot email should never be bot@decidim.org | ||
cop = Decidim::User.where(nickname: "bot").first | ||
if cop | ||
cop.email = ENV.fetch("USER_BOT_EMAIL", "bot@example.org") | ||
cop.skip_confirmation! | ||
cop.save | ||
end | ||
Decidim::User.where(email: "bot@decidim.org").each do |legacy_bot| | ||
Decidim::UserReport.where(user: legacy_bot).update(user: cop) | ||
legacy_bot.destroy | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.