mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Fix for blocked ip update script
This commit is contained in:
parent
ee3516829f
commit
a733a3b742
1 changed files with 5 additions and 9 deletions
14
Rakefile
14
Rakefile
|
@ -47,17 +47,13 @@ end
|
|||
|
||||
desc 'Update banned IPs list'
|
||||
task :update_blocked_ips => [:environment] do
|
||||
uri = URI.parse('http://www.stopforumspam.com/downloads/listed_ip_90.zip')
|
||||
blocked_ips_zip = Tempfile.new('blockedipszip', Dir.tmpdir)
|
||||
blocked_ips_zip.binmode
|
||||
|
||||
Net::HTTP.start(uri.host, uri.port) do |http|
|
||||
resp = http.get(uri.path)
|
||||
blocked_ips_zip.write(resp.body)
|
||||
blocked_ips_zip.flush
|
||||
end
|
||||
IO.copy_stream(
|
||||
open('http://www.stopforumspam.com/downloads/listed_ip_90.zip'),
|
||||
'/tmp/listed_ip_90.zip'
|
||||
)
|
||||
|
||||
Zip::Archive.open(blocked_ips_zip.path) do |ar|
|
||||
Zip::Archive.open('/tmp/listed_ip_90.zip') do |ar|
|
||||
ar.fopen('listed_ip_90.txt') do |f|
|
||||
ips = f.read
|
||||
insert_hashes = []
|
||||
|
|
Loading…
Add table
Reference in a new issue