janitor can now write suspended domains to whatever JANITOR_BLOCKLIST_OUTPUT is set to so they can be imported elsewhere (e.g., `nginx`)
parent
39a58f4061
commit
2ff40d3788
|
@ -22,6 +22,7 @@ class Scheduler::JanitorScheduler
|
||||||
suspend_spammers!
|
suspend_spammers!
|
||||||
silence_markov!
|
silence_markov!
|
||||||
import_blocklists!
|
import_blocklists!
|
||||||
|
export_suspensions!
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -62,6 +63,15 @@ class Scheduler::JanitorScheduler
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def export_suspensions!
|
||||||
|
outfile = ENV.fetch('JANITOR_BLOCKLIST_OUTPUT', '')
|
||||||
|
return if outfile.blank?
|
||||||
|
return unless File.file?(outfile)
|
||||||
|
File.open(outfile, 'w:UTF-8') do |file|
|
||||||
|
file.puts(DomainBlock.suspend.pluck(:domain))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def spammer_accounts
|
def spammer_accounts
|
||||||
spammer_ids = spammer_account_ids
|
spammer_ids = spammer_account_ids
|
||||||
|
|
Loading…
Reference in New Issue