mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Code to parse out tode exit nodes I might do something with later
This commit is contained in:
parent
76cb669659
commit
4b6001b6ef
1 changed files with 11 additions and 0 deletions
11
Rakefile
11
Rakefile
|
@ -72,6 +72,17 @@ task :update_blocked_ips => [:environment] do
|
|||
end
|
||||
end
|
||||
|
||||
desc 'parse tor exits'
|
||||
task :parse_tor_exits => [:environment] do
|
||||
exit_ips = Net::HTTP.get(URI.parse('https://check.torproject.org/exit-addresses'))
|
||||
|
||||
exit_ips.split("\n").collect {|line|
|
||||
line.match(/ExitAddress (\d+\.\d+\.\d+\.\d+)/)&.captures&.first
|
||||
}.compact
|
||||
|
||||
# ^^ Array of ip addresses of known exit nodes
|
||||
end
|
||||
|
||||
desc 'Compile nginx mapfiles'
|
||||
task :compile_nginx_mapfiles => [:environment] do
|
||||
File.open('./files/map.txt', 'w') do |file|
|
||||
|
|
Loading…
Add table
Reference in a new issue