238fea854c54d032e19e30fd4a778a7b556a2c91
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

1) #!/usr/bin/perl -w
2) use warnings;
3) use strict;
4) use LWP::Simple;
5) use LWP;
6) use Date::Parse;
Jacob Appelbaum Removed dupe mirror entry,...

Jacob Appelbaum authored 15 years ago

7) use Date::Format;
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

8) 
Jacob Appelbaum Add credit and some idea of...

Jacob Appelbaum authored 15 years ago

9) #
10) # A quick hack by Jacob Appelbaum <jacob@appelbaum.net>
11) # LWP suggestions by Leigh Honeywell 
12) # This is Free Software (GPLv3)
13) # http://www.gnu.org/licenses/gpl-3.0.txt
14) #
15) 
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

16) print "Creating LWP agent ($LWP::VERSION)...\n";
17) my $lua = LWP::UserAgent->new(
18)     keep_alive => 1,
19)     timeout => 15, 
20)     agent => "Tor MirrorCheck Agent"
21) );
22) 
23) sub sanitize {
24)     my $taintedData = shift;
25)     my $cleanedData;
26)     my $whitelist = '-a-zA-Z0-9: +';
27) 
28)     # clean the data, return cleaned data
29)     $taintedData =~ s/[^$whitelist]//go;
30)     $cleanedData = $taintedData;
31) 
32)     return $cleanedData;
33) }
34) 
35) sub FetchDate {
36)     my $url = shift; # Base url for mirror
37)     my $trace = "project/trace/www.torproject.org"; # Location of recent update info
38)     $url = "$url$trace";
39) 
40)     print "Fetching possible date from: $url\n";
41) 
42)     my $request = new HTTP::Request GET => "$url";
43)     my $result = $lua->request($request);
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

44)     my $code = $result->code();
45)     print "Result code $code\n";
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

46) 
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

47)     if ($result->is_success && $code eq "200"){
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

48)        my $taint = $result->content;
49)        my $content = sanitize($taint);
50)        if ($content) {
51)             
52)             my $date = str2time($content);
53) 
54)             if ($date) {
55)                 print "We've fetched a date $date.\n";
56)                 return $date;
57)             } else {
58)                 print "We've haven't fetched a date.\n";
59)                 return "Unknown";
60)             }
61) 
62)         } else {
63)             print "Unable to fetch date, empty content returned.\n";
64)             return "Unknown";
65)         }
66)             
67)     } else {
68)        print "Our request failed, we had no result.\n";
69)        return "Unknown";
70)     }
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

71) 
72)     return "Unknown";
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

73) }
74) 
75) # This is the list of all known Tor mirrors
76) # Add new mirrors to the bottom!
77) my %m = ( 
78)        mirror000 => {
79)             orgName => "cypherpunks.at",
80)             isoCC => "AT",
81)             subRegion => "",
82)             region => "Europe",
83)             ipv4 => "True",
84)             ipv6 => "False",
85)             loadBalanced => "Unknown",
86)             httpWebsiteMirror => "http://tor.cypherpunks.at/",
87)             rsyncWebsiteMirror => "rsync://tor.cypherpunks.at/tor",
88)             httpDistMirror => "http://tor.cypherpunks.at/dist/",
Jacob Appelbaum Normalize rsync urls.

Jacob Appelbaum authored 15 years ago

89)             rsyncDistMirror => "rsync://tor.cypherpunks.at::tor/dist/",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

90)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

91)         },
92) 
93)        mirror001 => {
94)             orgName => "depthstrike.com",
95)             isoCC => "CA",
96)             subRegion => "NS",
97)             region => "North America",
98)             ipv4 => "True",
99)             ipv6 => "False",
100)             loadBalanced => "Unknown",
101)             httpWebsiteMirror => "http://tor.depthstrike.com/",
102)             ftpWebsiteMirror => "",
103)             rsyncWebsiteMirror => "",
104)             httpDistMirror => "http://tor.depthstrike.com/dist/",
105)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

106)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

107)         },
108) 
109)        mirror002 => {
110)             orgName => "hermetix.org",
111)             isoCC => "CA",
112)             subRegion => "QC",
113)             region => "North America",
114)             ipv4 => "True",
115)             ipv6 => "False",
116)             loadBalanced => "Unknown",
117)             httpWebsiteMirror => "http://tor.hermetix.org/",
118)             rsyncWebsiteMirror => "",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

119)             httpDistMirror => "",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

120)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

121)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

122)         },
123) 
124)        mirror003 => {
125)             orgName => "Boinc.ch",
126)             isoCC => "CH",
127)             subRegion => "",
128)             region => "Europe",
129)             ipv4 => "True",
130)             ipv6 => "False",
131)             loadBalanced => "Unknown",
132)             httpWebsiteMirror => "http://tor.boinc.ch/",
133)             ftpWebsiteMirror => "",
134)             rsyncWebsiteMirror => "",
135)             httpDistMirror => "http://tor.boinc.ch/dist/",
136)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

137)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

138)         },
139) 
140)        mirror004 => {
141)             orgName => "anonymity.cn",
142)             isoCC => "CN",
143)             subRegion => "",
144)             region => "Asia",
145)             ipv4 => "True",
146)             ipv6 => "False",
147)             loadBalanced => "Unknown",
148)             httpWebsiteMirror => "http://tor.anonymity.cn/",
149)             ftpWebsiteMirror => "",
150)             rsyncWebsiteMirror => "",
151)             httpDistMirror => "http://tor.anonymity.cn/dist/",
152)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

153)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

154)         },
155) 
Jacob Appelbaum Fix numbering of mirror, up...

Jacob Appelbaum authored 15 years ago

156)        mirror005 => {
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

157)             orgName => "bbs",
158)             isoCC => "DE",
159)             subRegion => "",
160)             region => "Europe",
161)             ipv4 => "True",
162)             ipv6 => "False",
163)             loadBalanced => "Unknown",
164)             httpWebsiteMirror => "http://tor.blingblingsquad.net/",
165)             ftpWebsiteMirror => "",
166)             rsyncWebsiteMirror => "",
167)             httpDistMirror => "http://tor.blingblingsquad.net/dist/",
168)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

169)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

170)         },
171) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

172)        # mirror005 => {
173)             # orgName => "Berapla",
174)             # isoCC => "DE",
175)             # subRegion => "",
176)             # region => "Europe",
177)             # ipv4 => "True",
178)             # ipv6 => "False",
179)             # loadBalanced => "Unknown",
180)             # httpWebsiteMirror => "http://download.berapla.de/mirrors/tor/",
181)             # ftpWebsiteMirror => "",
182)             # rsyncWebsiteMirror => "",
183)             # httpDistMirror => "",
184)             # rsyncDistMirror => "",
185)             # updateDate => "Unknown",
186)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

187) 
188)        mirror006 => {
189)             orgName => "cybermirror",
190)             isoCC => "DE",
191)             subRegion => "",
192)             region => "Europe",
193)             ipv4 => "True",
194)             ipv6 => "False",
195)             loadBalanced => "Unknown",
196)             httpWebsiteMirror => "http://tor.cybermirror.org/",
197)             ftpWebsiteMirror => "",
198)             rsyncWebsiteMirror => "",
199)             httpDistMirror => "http://tor.cybermirror.org/dist/",
200)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

201)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

202)         },
203) 
204)        mirror007 => {
205)             orgName => "Spline",
206)             isoCC => "DE",
207)             subRegion => "FU",
208)             region => "Europe",
209)             ipv4 => "True",
210)             ipv6 => "False",
211)             loadBalanced => "Unknown",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

212)             httpWebsiteMirror => "",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

213)             ftpWebsiteMirror => "",
214)             rsyncWebsiteMirror => "",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

215)             httpDistMirror => "http://rem.spline.de/tor/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

216)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

217)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

218)         },
219) 
220)        mirror008 => {
221)             orgName => "mirror.bsdhost.eu",
222)             isoCC => "DE",
223)             subRegion => "",
224)             region => "Europe",
225)             ipv4 => "True",
226)             ipv6 => "False",
227)             loadBalanced => "Unknown",
228)             httpWebsiteMirror => "http://mirror.bsdhost.eu/www.torproject.org/",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

229)             ftpWebsiteMirror => "ftp://mirror.bsdhost.eu/www.torproject.org/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

230)             rsyncWebsiteMirror => "",
231)             httpDistMirror => "http://mirror.bsdhost.eu/www.torproject.org/dist/",
232)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

233)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

234)         },
235) 
236)        mirror009 => {
237)             orgName => "onionland",
238)             isoCC => "DE",
239)             subRegion => "",
240)             region => "Europe",
241)             ipv4 => "True",
242)             ipv6 => "False",
243)             loadBalanced => "Unknown",
244)             httpWebsiteMirror => "http://mirror.onionland.org/",
245)             ftpWebsiteMirror => "",
246)             rsyncWebsiteMirror => "rsync: mirror.onionland.org::tor/",
247)             httpDistMirror => "http://mirror.onionland.org/dist/",
Jacob Appelbaum Normalize rsync urls.

Jacob Appelbaum authored 15 years ago

248)             rsyncDistMirror => "rsync://mirror.onionland.org::tor/dist/",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

249)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

250)         },
251) 
252)        mirror010 => {
253)             orgName => "plentyfact",
254)             isoCC => "DE",
255)             subRegion => "",
256)             region => "Europe",
257)             ipv4 => "True",
258)             ipv6 => "False",
259)             loadBalanced => "Unknown",
260)             httpWebsiteMirror => "http://tor.plentyfact.net/",
261)             ftpWebsiteMirror => "",
262)             httpsWebsiteMirror => "https://tor.plentyfact.net/",
263)             rsyncWebsiteMirror => "",
264)             httpDistMirror => "http://tor.plentyfact.net/dist/",
Mfr Update table to correct mis...

Mfr authored 15 years ago

265)             httpsDistMirror => "https://tor.plentyfact.net/dist/",												
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

266)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

267)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

268)         },
269) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

270)        # mirror011 => {
271)             # orgName => "loxal.net",
272)             # isoCC => "DE",
273)             # subRegion => "",
274)             # region => "Europe",
275)             # ipv4 => "True",
276)             # ipv6 => "False",
277)             # loadBalanced => "Unknown",
278)             # httpWebsiteMirror => "http://tor-anonymizer.mirror.loxal.net/",
279)             # ftpWebsiteMirror => "",
280)             # rsyncWebsiteMirror => "",
281)             # httpDistMirror => "http://tor-anonymizer.mirror.loxal.net/dist/",
282)             # rsyncDistMirror => "",
283)             # updateDate => "Unknown",
284)         # },
285) 
286)        # mirror012 => {
287)             # orgName => "centervenus.com",
288)             # isoCC => "DE",
289)             # subRegion => "",
290)             # region => "Europe",
291)             # ipv4 => "True",
292)             # ipv6 => "False",
293)             # loadBalanced => "Unknown",
294)             # httpWebsiteMirror => "",
295)             # ftpWebsiteMirror => "",
296)             # rsyncWebsiteMirror => "",
297)             # httpDistMirror => "http://www.centervenus.com/mirrors/tor/dist/",
298)             # rsyncDistMirror => "",
299)             # updateDate => "Unknown",
300)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

301) 
302)        mirror013 => {
303)             orgName => "zdg-gmbh.eu",
304)             isoCC => "DK",
305)             subRegion => "",
306)             region => "Europe",
307)             ipv4 => "True",
308)             ipv6 => "False",
309)             loadBalanced => "Unknown",
310)             httpWebsiteMirror => "http://tor.zdg-gmbh.eu/", 
311)             ftpWebsiteMirror => "",
312)             rsyncWebsiteMirror => "", 
313)             httpDistMirror => "http://tor.zdg-gmbh.eu/dist/",
314)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

315)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

316)         },
317) 
318)        mirror014 => {
319)             orgName => "CRAN",
320)             isoCC => "FR",
321)             subRegion => "",
322)             region => "Europe",
323)             ipv4 => "True",
324)             ipv6 => "False",
325)             loadBalanced => "Unknown",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

326)             httpWebsiteMirror => "",
Jacob Appelbaum Normalize rsync urls.

Jacob Appelbaum authored 15 years ago

327)             rsyncWebsiteMirror => "rsync://miroir-francais.fr::tor", 
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

328)             ftpWebsiteMirror => "ftp://miroir-francais.fr/pub/tor/",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

329)             httpDistMirror => "http://tor.miroir-francais.fr/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

330)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

331)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

332)         },
333) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

334)        # mirror015 => {
335)             # orgName => "tor.newworldorder.com.es",
336)             # isoCC => "HU",
337)             # subRegion => "",
338)             # region => "Europe",
339)             # ipv4 => "True",
340)             # ipv6 => "False",
341)             # loadBalanced => "Unknown",
342)             # httpWebsiteMirror => "http://tor.newworldorder.com.es/",
343)             # rsyncWebsiteMirror => "", 
344)             # ftpWebsiteMirror => "",
345)             # httpDistMirror => "",
346)             # rsyncDistMirror => "",
347)             # updateDate => "Unknown",
348)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

349) 
350)        mirror016 => {
351)             orgName => "amorphis.eu",
352)             isoCC => "NL",
353)             subRegion => "",
354)             region => "Europe",
355)             ipv4 => "True",
356)             ipv6 => "False",
357)             loadBalanced => "Unknown",
358)             httpWebsiteMirror => "http://tor.amorphis.eu/",
359)             rsyncWebsiteMirror => "", 
360)             ftpWebsiteMirror => "",
361)             httpDistMirror => "http://tor.amorphis.eu/dist/",
362)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

363)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

364)         },
365) 
366)        mirror017 => {
367)             orgName => "BIT BV",
368)             isoCC => "NL",
369)             subRegion => "",
370)             region => "Europe",
371)             ipv4 => "True",
372)             ipv6 => "False",
373)             loadBalanced => "Unknown",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

374)             httpWebsiteMirror => "",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

375)             rsyncWebsiteMirror => "", 
376)             ftpWebsiteMirror => "ftp://ftp.bit.nl/mirror/tor/",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

377)             httpDistMirror => "http://ftp.bit.nl/mirror/tor/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

378)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

379)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

380)         },
381) 
382)        mirror018 => {
383)             orgName => "CCC",
384)             isoCC => "NL",
385)             subRegion => "",
386)             region => "Europe",
387)             ipv4 => "True",
388)             ipv6 => "False",
389)             loadBalanced => "Unknown",
390)             httpWebsiteMirror => "http://tor.ccc.de/",
391)             rsyncWebsiteMirror => "", 
392)             ftpWebsiteMirror => "",
393)             httpDistMirror => "http://tor.ccc.de/dist/",
394)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

395)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

396)         },
397) 
398)        mirror018 => {
399)             orgName => "kamagurka.org",
400)             isoCC => "NL",
401)             subRegion => "Haarlem",
402)             region => "Europe",
403)             ipv4 => "True",
404)             ipv6 => "False",
405)             loadBalanced => "Unknown",
406)             httpWebsiteMirror => "http://tor.kamagurka.org/",
407)             rsyncWebsiteMirror => "", 
408)             ftpWebsiteMirror => "",
409)             httpDistMirror => "http://tor.kamagurka.org/dist/",
410)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

411)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

412)         },
413) 
414)        mirror019 => {
415)             orgName => "OS Mirror",
416)             isoCC => "NL",
417)             subRegion => "",
418)             region => "Europe",
419)             ipv4 => "True",
420)             ipv6 => "False",
421)             loadBalanced => "Unknown",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

422)             httpWebsiteMirror => "",
Jacob Appelbaum Normalize rsync urls.

Jacob Appelbaum authored 15 years ago

423)             rsyncWebsiteMirror => "rsync://rsync.osmirror.nl::tor/", 
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

424)             ftpWebsiteMirror => "ftp://ftp.osmirror.nl/pub/tor/",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

425)             httpDistMirror => "http://tor.osmirror.nl/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

426)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

427)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

428)         },
429) 
430) 
431)        mirror020 => {
432)             orgName => "Meulie.net",
433)             isoCC => "NO",
434)             subRegion => "",
435)             region => "Europe",
436)             ipv4 => "True",
437)             ipv6 => "False",
438)             loadBalanced => "Unknown",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

439)             httpWebsiteMirror => "",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

440)             rsyncWebsiteMirror => "", 
441)             ftpWebsiteMirror => "",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

442)             httpDistMirror => "http://tor.meulie.net/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

443)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

444)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

445)         },
446) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

447)        # mirror021 => {
448)             # orgName => "Swedish Linux Society",
449)             # isoCC => "SE",
450)             # subRegion => "",
451)             # region => "Europe",
452)             # ipv4 => "True",
453)             # ipv6 => "False",
454)             # loadBalanced => "Unknown",
455)             # httpWebsiteMirror => "http://ftp.se.linux.org/crypto/tor/",
456)             # rsyncWebsiteMirror => "", 
457)             # ftpWebsiteMirror => "ftp://ftp.se.linux.org/pub/crypto/tor/",
458)             # httpDistMirror => "",
459)             # rsyncDistMirror => "",
460)             # updateDate => "Unknown",
461)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

462) 
463)        mirror022 => {
464)             orgName => "Ghirai.com",
465)             isoCC => "UK",
466)             subRegion => "London",
467)             region => "Europe",
468)             ipv4 => "True",
469)             ipv6 => "False",
470)             loadBalanced => "Unknown",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

471)             httpWebsiteMirror => "",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

472)             rsyncWebsiteMirror => "", 
473)             ftpWebsiteMirror => "",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

474)             httpDistMirror => "http://www.ghirai.com/tor/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

475)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

476)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

477)         },
478) 
479)        mirror023 => {
480)             orgName => "BJWOnline.com",
481)             isoCC => "US",
482)             subRegion => "California",
483)             region => "North America",
484)             ipv4 => "True",
485)             ipv6 => "False",
486)             loadBalanced => "Unknown",
487)             httpWebsiteMirror => "http://mirror.bjwonline.com/tor/",
488)             rsyncWebsiteMirror => "", 
489)             ftpWebsiteMirror => "",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

490)             httpDistMirror => "http://mirror.bjwonline.com/tor/dist/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

491)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

492)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

493)         },
494) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

495)        # mirror024 => {
496)             # orgName => "Libertarian Action Network",
497)             # isoCC => "US",
498)             # subRegion => "",
499)             # region => "North America",
500)             # ipv4 => "True",
501)             # ipv6 => "False",
502)             # loadBalanced => "Unknown",
503)             # httpWebsiteMirror => "",
504)             # rsyncWebsiteMirror => "", 
505)             # ftpWebsiteMirror => "ftp://libertarianactivism.com/tor.eff.org/dist/",
506)             # httpDistMirror => "",
507)             # rsyncDistMirror => "",
508)             # updateDate => "Unknown",
509)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

510) 
511)        mirror025 => {
512)             orgName => "TheOnionRouter.com",
513)             isoCC => "US",
514)             subRegion => "Texas",
515)             region => "North America",
516)             ipv4 => "True",
517)             ipv6 => "False",
518)             loadBalanced => "Unknown",
519)             httpWebsiteMirror => "http://www.theonionrouter.com/",
520)             rsyncWebsiteMirror => "", 
521)             ftpWebsiteMirror => "",
522)             httpDistMirror => "http://www.theonionrouter.com/dist/",
523)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

524)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

525)         },
526) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 15 years ago

527)        # mirror026 => {
528)             # orgName => "Site2nd.org",
529)             # isoCC => "USA",
530)             # subRegion => "Texas",
531)             # region => "North America",
532)             # ipv4 => "True",
533)             # ipv6 => "False",
534)             # loadBalanced => "Unknown",
535)             # httpWebsiteMirror => "http://tor.site2nd.org",
536)             # rsyncWebsiteMirror => "", 
537)             # ftpWebsiteMirror => "",
538)             # httpDistMirror => "",
539)             # rsyncDistMirror => "",
540)             # updateDate => "Unknown",
541)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

542) 
543)        mirror027 => {
544)             adminContact => "jeroen\@unfix.org",
545)             orgName => "unfix",
546)             isoCC => "CH",
547)             subRegion => "",
548)             region => "Europe",
549)             ipv4 => "True",
550)             ipv6 => "True",
551)             loadBalanced => "Unknown",
552)             httpWebsiteMirror => "http://tor.unfix.org/",
553)             rsyncWebsiteMirror => "", 
554)             ftpWebsiteMirror => "",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

555)             httpDistMirror => "http://tor.unfix.org/dist/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

556)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

557)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

558)         },
559) 
560)        mirror028 => {
561)             adminContact => "jeroen\@unfix.org",
562)             orgName => "sixx",
Jacob Appelbaum Removed dupe mirror entry,...

Jacob Appelbaum authored 15 years ago

563)             isoCC => "CH",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

564)             subRegion => "",
565)             region => "Europe",
566)             ipv4 => "True",
567)             ipv6 => "True",
568)             loadBalanced => "Unknown",
569)             httpWebsiteMirror => "http://tor.sixxs.net/",
570)             rsyncWebsiteMirror => "", 
571)             ftpWebsiteMirror => "",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

572)             httpDistMirror => "http://tor.sixxs.net/dist/",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

573)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 15 years ago

574)             updateDate => "Unknown",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

575)         },
Jacob Appelbaum Add a new mirror, change th...

Jacob Appelbaum authored 15 years ago

576) 
577)        mirror029 => {
578)             adminContact => "",
579)             orgName => "crypto.nsa.org",
580)             isoCC => "US",
581)             subRegion => "",
582)             region => "North America",
583)             ipv4 => "True",
584)             ipv6 => "False",
585)             loadBalanced => "Unknown",
586)             httpWebsiteMirror => "http://crypto.nsa.org/tor/",
587)             rsyncWebsiteMirror => "", 
588)             ftpWebsiteMirror => "",
589)             httpDistMirror => "http://crypto.nsa.org/tor/dist/",
590)             rsyncDistMirror => "",
591)             updateDate => "Unknown",
592)         },
Jacob Appelbaum New mirror, update mirror t...

Jacob Appelbaum authored 15 years ago

593) 
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 15 years ago

594)        mirror030 => {
595)             adminContact => "web2005a\@year2005a.wiretapped.net",
596)             orgName => "Wiretapped",
597)             isoCC => "AU",
598)             subRegion => "Sydney",
599)             region => "Oceania",
600)             ipv4 => "True",
601)             ipv6 => "False",
602)             loadBalanced => "Unknown",
603)             httpWebsiteMirror => "",
604)             rsyncWebsiteMirror => "", 
605)             ftpWebsiteMirror => "ftp://ftp.mirrors.wiretapped.net/pub/security/cryptography/network/tor/",
606)             httpDistMirror => "http://www.mirrors.wiretapped.net/security/cryptography/network/tor/",
607)             rsyncDistMirror => "",
608)             updateDate => "Unknown",
609)         },								
Jacob Appelbaum Add a new mirror, change th...

Jacob Appelbaum authored 15 years ago

610) 
Jacob Appelbaum New mirror, update mirror t...

Jacob Appelbaum authored 15 years ago

611)         mirror031 => {
612)             adminContact => "tormaster\@xpdm.us",
613)             orgName => "xpdm",
614)             isoCC => "US",
615)             subRegion => "",
616)             region => "North America",
617)             ipv4 => "True",
618)             ipv6 => "False",
619)             loadBalanced => "Unknown",
620)             httpWebsiteMirror => "http://torproj.xpdm.us/",
Jacob Appelbaum Update table to include htt...

Jacob Appelbaum authored 15 years ago

621)             httpsWebsiteMirror => "https://torproj.xpdm.us/",
Jacob Appelbaum New mirror, update mirror t...

Jacob Appelbaum authored 15 years ago

622)             rsyncWebsiteMirror => "", 
623)             ftpWebsiteMirror => "",
Jacob Appelbaum Update table to include htt...

Jacob Appelbaum authored 15 years ago

624)             httpDistMirror => "http://torproj.xpdm.us/dist/",
625)             httpsDistMirror => "https://torproj.xpdm.us/dist/",
Jacob Appelbaum New mirror, update mirror t...

Jacob Appelbaum authored 15 years ago

626)             rsyncDistMirror => "",
627)             hiddenServiceMirror => "http://h3prhz46uktgm4tt.onion/",
628)             updateDate => "Unknown",
629)         },								
630) 
631) 
632) 
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

633) );
634) 
635) my $count = values %m;
636) print "We have a total of $count mirrors\n";
637) print "Fetching the last updated date for each mirror.\n";
638) 
639) foreach my $server ( keys %m ) {
640) 
641)     print "Attempting to fetch from $m{$server}{'orgName'}\n";
642) 
643)     if ($m{$server}{'httpWebsiteMirror'}) {
644)         print "Attempt to fetch via HTTP.\n";
645)         $m{$server}{"updateDate"} = FetchDate("$m{$server}{'httpWebsiteMirror'}");
646)     } elsif ($m{$server}{'httpsWebsiteMirror'}) {
647)         print "Attempt to fetch via HTTPS.\n";
648)         $m{$server}{"updateDate"} = FetchDate("$m{$server}{'httpsWebsiteMirror'}");
649)     } elsif ($m{$server}{'ftpWebsiteMirror'}) {
650)         print "Attempt to fetch via FTP.\n";
651)         $m{$server}{"updateDate"} = FetchDate("$m{$server}{'ftpWebsiteMirror'}");
652)     } else {
653)         print "We were unable to fetch or store anything. We still have the following: $m{$server}{'updateDate'}\n";
654)     }
655) 
656)     print "We fetched and stored the following: $m{$server}{'updateDate'}\n";
657) 
658)  }
659) 
660) 
661) print "We sorted the following mirrors by their date of last update: \n";
662) foreach my $server ( sort { $m{$b}{'updateDate'} <=> $m{$a}{'updateDate'}} keys %m ) {
663) 
664)      print "\n";
665)      print "Mirror $m{$server}{'orgName'}: \n";
666) 
667)      foreach my $attrib ( sort keys %{$m{$server}} ) {
668)         print "$attrib = $m{$server}{$attrib}";
669)         print "\n";
670)      };
671) }
672) 
673) my $outFile = "include/mirrors-table.wmi";
674) my $html;
675) open(OUT, "> $outFile") or die "Can't open $outFile: $!";
676) 
677) # Here's where we open a file and print some wml include goodness 
678) # This is storted from last known recent update to unknown update times
679) foreach my $server ( sort { $m{$b}{'updateDate'} <=> $m{$a}{'updateDate'}} keys %m ) {
680) 
Jacob Appelbaum ensure the date is either p...

Jacob Appelbaum authored 15 years ago

681)      my $time;
682)      if( "$m{$server}{'updateDate'}" ne "Unknown") {
683)         $time = ctime($m{$server}{'updateDate'});
684)         chomp($time);
685)      } else { $time = "Unknown"; }
686) 
Jacob Appelbaum Removed dupe mirror entry,...

Jacob Appelbaum authored 15 years ago

687) print OUT <<"END";
688)      \n<tr>\n
689)          <td>$m{$server}{'isoCC'}</td>\n
690)          <td>$m{$server}{'orgName'}</td>\n
691)          <td>$time</td>\n
692) END
693) 
694)      my %prettyNames = (
695)                         httpWebsiteMirror => "http",
696)                         httpsWebsiteMirror => "https",
697)                         ftpWebsiteMirror => "ftp",
698)                         rsyncWebsiteMirror => "rsync",
699)                         httpDistMirror => "http",
700)                         httpsDistMirror => "https",
701)                         rsyncDistMirrors => "rsync", );
702) 
703)      foreach my $precious ( sort keys %prettyNames )
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 15 years ago

704)      {
705)         if ($m{$server}{"$precious"}) {
706)             print OUT "    <td><a href=\"" . $m{$server}{$precious} . "\">" .
Jacob Appelbaum Removed dupe mirror entry,...

Jacob Appelbaum authored 15 years ago

707)                       "$prettyNames{$precious}</a></td>\n";