881171b795eecffdd6f64b72220da61a7746c216
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 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 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 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 16 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 16 years ago

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

Jacob Appelbaum authored 16 years ago

46) 
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 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 16 years ago

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

Jacob Appelbaum authored 16 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 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

79)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

80)             orgName => "cypherpunks.at",
81)             isoCC => "AT",
82)             subRegion => "",
83)             region => "Europe",
84)             ipv4 => "True",
85)             ipv6 => "False",
86)             loadBalanced => "Unknown",
87)             httpWebsiteMirror => "http://tor.cypherpunks.at/",
88)             rsyncWebsiteMirror => "rsync://tor.cypherpunks.at/tor",
89)             httpDistMirror => "http://tor.cypherpunks.at/dist/",
Jacob Appelbaum Normalize rsync urls.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

92)         },
93) 
94)        mirror001 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

95)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

109)         },
110) 
111)        mirror002 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

112)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

113)             orgName => "hermetix.org",
114)             isoCC => "CA",
115)             subRegion => "QC",
116)             region => "North America",
117)             ipv4 => "True",
118)             ipv6 => "False",
119)             loadBalanced => "Unknown",
120)             httpWebsiteMirror => "http://tor.hermetix.org/",
121)             rsyncWebsiteMirror => "",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

125)         },
126) 
127)        mirror003 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

128)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

129)             orgName => "Boinc.ch",
130)             isoCC => "CH",
131)             subRegion => "",
132)             region => "Europe",
133)             ipv4 => "True",
134)             ipv6 => "False",
135)             loadBalanced => "Unknown",
136)             httpWebsiteMirror => "http://tor.boinc.ch/",
137)             ftpWebsiteMirror => "",
138)             rsyncWebsiteMirror => "",
139)             httpDistMirror => "http://tor.boinc.ch/dist/",
140)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

142)         },
143) 
144)        mirror004 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

145)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

146)             orgName => "anonymity.cn",
147)             isoCC => "CN",
148)             subRegion => "",
149)             region => "Asia",
150)             ipv4 => "True",
151)             ipv6 => "False",
152)             loadBalanced => "Unknown",
153)             httpWebsiteMirror => "http://tor.anonymity.cn/",
154)             ftpWebsiteMirror => "",
155)             rsyncWebsiteMirror => "",
156)             httpDistMirror => "http://tor.anonymity.cn/dist/",
157)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

159)         },
160) 
Jacob Appelbaum Fix numbering of mirror, up...

Jacob Appelbaum authored 16 years ago

161)        mirror005 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

162)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

163)             orgName => "bbs",
164)             isoCC => "DE",
165)             subRegion => "",
166)             region => "Europe",
167)             ipv4 => "True",
168)             ipv6 => "False",
169)             loadBalanced => "Unknown",
170)             httpWebsiteMirror => "http://tor.blingblingsquad.net/",
171)             ftpWebsiteMirror => "",
172)             rsyncWebsiteMirror => "",
173)             httpDistMirror => "http://tor.blingblingsquad.net/dist/",
174)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

176)         },
177) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

193) 
194)        mirror006 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

195)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

196)             orgName => "cybermirror",
197)             isoCC => "DE",
198)             subRegion => "",
199)             region => "Europe",
200)             ipv4 => "True",
201)             ipv6 => "False",
202)             loadBalanced => "Unknown",
203)             httpWebsiteMirror => "http://tor.cybermirror.org/",
204)             ftpWebsiteMirror => "",
205)             rsyncWebsiteMirror => "",
206)             httpDistMirror => "http://tor.cybermirror.org/dist/",
207)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

209)         },
210) 
211)        mirror007 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

213)             orgName => "Spline",
214)             isoCC => "DE",
215)             subRegion => "FU",
216)             region => "Europe",
217)             ipv4 => "True",
218)             ipv6 => "False",
219)             loadBalanced => "Unknown",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

226)         },
227) 
228)        mirror008 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

229)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

230)             orgName => "mirror.bsdhost.eu",
231)             isoCC => "DE",
232)             subRegion => "",
233)             region => "Europe",
234)             ipv4 => "True",
235)             ipv6 => "False",
236)             loadBalanced => "Unknown",
237)             httpWebsiteMirror => "http://mirror.bsdhost.eu/www.torproject.org/",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

243)         },
244) 
245)        mirror009 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

246)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

247)             orgName => "onionland",
248)             isoCC => "DE",
249)             subRegion => "",
250)             region => "Europe",
251)             ipv4 => "True",
252)             ipv6 => "False",
253)             loadBalanced => "Unknown",
254)             httpWebsiteMirror => "http://mirror.onionland.org/",
255)             ftpWebsiteMirror => "",
256)             rsyncWebsiteMirror => "rsync: mirror.onionland.org::tor/",
257)             httpDistMirror => "http://mirror.onionland.org/dist/",
Jacob Appelbaum Normalize rsync urls.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

260)         },
261) 
262)        mirror010 => {
Mfr change contact address on p...

Mfr authored 16 years ago

263) 												adminContact => "contact\@plentyfact.org",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

264)             orgName => "plentyfact",
265)             isoCC => "DE",
266)             subRegion => "",
267)             region => "Europe",
268)             ipv4 => "True",
269)             ipv6 => "False",
270)             loadBalanced => "Unknown",
271)             httpWebsiteMirror => "http://tor.plentyfact.net/",
272)             ftpWebsiteMirror => "",
273)             httpsWebsiteMirror => "https://tor.plentyfact.net/",
274)             rsyncWebsiteMirror => "",
275)             httpDistMirror => "http://tor.plentyfact.net/dist/",
Mfr Update table to correct mis...

Mfr authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

279)         },
280) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

281)        # mirror011 => {
282)             # orgName => "loxal.net",
283)             # isoCC => "DE",
284)             # subRegion => "",
285)             # region => "Europe",
286)             # ipv4 => "True",
287)             # ipv6 => "False",
288)             # loadBalanced => "Unknown",
289)             # httpWebsiteMirror => "http://tor-anonymizer.mirror.loxal.net/",
290)             # ftpWebsiteMirror => "",
291)             # rsyncWebsiteMirror => "",
292)             # httpDistMirror => "http://tor-anonymizer.mirror.loxal.net/dist/",
293)             # rsyncDistMirror => "",
294)             # updateDate => "Unknown",
295)         # },
296) 
297)        # mirror012 => {
298)             # orgName => "centervenus.com",
299)             # isoCC => "DE",
300)             # subRegion => "",
301)             # region => "Europe",
302)             # ipv4 => "True",
303)             # ipv6 => "False",
304)             # loadBalanced => "Unknown",
305)             # httpWebsiteMirror => "",
306)             # ftpWebsiteMirror => "",
307)             # rsyncWebsiteMirror => "",
308)             # httpDistMirror => "http://www.centervenus.com/mirrors/tor/dist/",
309)             # rsyncDistMirror => "",
310)             # updateDate => "Unknown",
311)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

312) 
313)        mirror013 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

314)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

315)             orgName => "zdg-gmbh.eu",
316)             isoCC => "DK",
317)             subRegion => "",
318)             region => "Europe",
319)             ipv4 => "True",
320)             ipv6 => "False",
321)             loadBalanced => "Unknown",
322)             httpWebsiteMirror => "http://tor.zdg-gmbh.eu/", 
323)             ftpWebsiteMirror => "",
324)             rsyncWebsiteMirror => "", 
325)             httpDistMirror => "http://tor.zdg-gmbh.eu/dist/",
326)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

328)         },
329) 
330)        mirror014 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

332)             orgName => "CRAN",
333)             isoCC => "FR",
334)             subRegion => "",
335)             region => "Europe",
336)             ipv4 => "True",
337)             ipv6 => "False",
338)             loadBalanced => "Unknown",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

345)         },
346) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

347)        # mirror015 => {
348)             # orgName => "tor.newworldorder.com.es",
349)             # isoCC => "HU",
350)             # subRegion => "",
351)             # region => "Europe",
352)             # ipv4 => "True",
353)             # ipv6 => "False",
354)             # loadBalanced => "Unknown",
355)             # httpWebsiteMirror => "http://tor.newworldorder.com.es/",
356)             # rsyncWebsiteMirror => "", 
357)             # ftpWebsiteMirror => "",
358)             # httpDistMirror => "",
359)             # rsyncDistMirror => "",
360)             # updateDate => "Unknown",
361)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

362) 
363)        mirror016 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

364)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

365)             orgName => "amorphis.eu",
366)             isoCC => "NL",
367)             subRegion => "",
368)             region => "Europe",
369)             ipv4 => "True",
370)             ipv6 => "False",
371)             loadBalanced => "Unknown",
372)             httpWebsiteMirror => "http://tor.amorphis.eu/",
373)             rsyncWebsiteMirror => "", 
374)             ftpWebsiteMirror => "",
375)             httpDistMirror => "http://tor.amorphis.eu/dist/",
376)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

378)         },
379) 
380)        mirror017 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

381)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

382)             orgName => "BIT BV",
383)             isoCC => "NL",
384)             subRegion => "",
385)             region => "Europe",
386)             ipv4 => "True",
387)             ipv6 => "False",
388)             loadBalanced => "Unknown",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

395)         },
396) 
397)        mirror018 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

398)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

399)             orgName => "CCC",
400)             isoCC => "NL",
401)             subRegion => "",
402)             region => "Europe",
403)             ipv4 => "True",
404)             ipv6 => "False",
405)             loadBalanced => "Unknown",
406)             httpWebsiteMirror => "http://tor.ccc.de/",
407)             rsyncWebsiteMirror => "", 
408)             ftpWebsiteMirror => "",
409)             httpDistMirror => "http://tor.ccc.de/dist/",
410)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

412)         },
413) 
414)        mirror018 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

415)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

416)             orgName => "kamagurka.org",
417)             isoCC => "NL",
418)             subRegion => "Haarlem",
419)             region => "Europe",
420)             ipv4 => "True",
421)             ipv6 => "False",
422)             loadBalanced => "Unknown",
423)             httpWebsiteMirror => "http://tor.kamagurka.org/",
424)             rsyncWebsiteMirror => "", 
425)             ftpWebsiteMirror => "",
426)             httpDistMirror => "http://tor.kamagurka.org/dist/",
427)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

429)         },
430) 
431)        mirror019 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

432)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

433)             orgName => "OS Mirror",
434)             isoCC => "NL",
435)             subRegion => "",
436)             region => "Europe",
437)             ipv4 => "True",
438)             ipv6 => "False",
439)             loadBalanced => "Unknown",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

446)         },
447) 
448) 
449)        mirror020 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

450)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

451)             orgName => "Meulie.net",
452)             isoCC => "NO",
453)             subRegion => "",
454)             region => "Europe",
455)             ipv4 => "True",
456)             ipv6 => "False",
457)             loadBalanced => "Unknown",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

464)         },
465) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

466)        # mirror021 => {
467)             # orgName => "Swedish Linux Society",
468)             # isoCC => "SE",
469)             # subRegion => "",
470)             # region => "Europe",
471)             # ipv4 => "True",
472)             # ipv6 => "False",
473)             # loadBalanced => "Unknown",
474)             # httpWebsiteMirror => "http://ftp.se.linux.org/crypto/tor/",
475)             # rsyncWebsiteMirror => "", 
476)             # ftpWebsiteMirror => "ftp://ftp.se.linux.org/pub/crypto/tor/",
477)             # httpDistMirror => "",
478)             # rsyncDistMirror => "",
479)             # updateDate => "Unknown",
480)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

481) 
482)        mirror022 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

483)             adminContact => "",							
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

484)             orgName => "Ghirai.com",
485)             isoCC => "UK",
486)             subRegion => "London",
487)             region => "Europe",
488)             ipv4 => "True",
489)             ipv6 => "False",
490)             loadBalanced => "Unknown",
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

497)         },
498) 
499)        mirror023 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

500) 							     adminContact => "",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

501)             orgName => "BJWOnline.com",
502)             isoCC => "US",
503)             subRegion => "California",
504)             region => "North America",
505)             ipv4 => "True",
506)             ipv6 => "False",
507)             loadBalanced => "Unknown",
508)             httpWebsiteMirror => "http://mirror.bjwonline.com/tor/",
509)             rsyncWebsiteMirror => "", 
510)             ftpWebsiteMirror => "",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

514)         },
515) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

516)        # mirror024 => {
517)             # orgName => "Libertarian Action Network",
518)             # isoCC => "US",
519)             # subRegion => "",
520)             # region => "North America",
521)             # ipv4 => "True",
522)             # ipv6 => "False",
523)             # loadBalanced => "Unknown",
524)             # httpWebsiteMirror => "",
525)             # rsyncWebsiteMirror => "", 
526)             # ftpWebsiteMirror => "ftp://libertarianactivism.com/tor.eff.org/dist/",
527)             # httpDistMirror => "",
528)             # rsyncDistMirror => "",
529)             # updateDate => "Unknown",
530)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

531) 
532)        mirror025 => {
Mfr Add a new french mirror

Mfr authored 16 years ago

533) 							     adminContact => "",
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

534)             orgName => "TheOnionRouter.com",
535)             isoCC => "US",
536)             subRegion => "Texas",
537)             region => "North America",
538)             ipv4 => "True",
539)             ipv6 => "False",
540)             loadBalanced => "Unknown",
541)             httpWebsiteMirror => "http://www.theonionrouter.com/",
542)             rsyncWebsiteMirror => "", 
543)             ftpWebsiteMirror => "",
544)             httpDistMirror => "http://www.theonionrouter.com/dist/",
545)             rsyncDistMirror => "",
Jacob Appelbaum Fix a date bug.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

547)         },
548) 
Jacob Appelbaum Updated the mirrors-table t...

Jacob Appelbaum authored 16 years ago

549)        # mirror026 => {
550)             # orgName => "Site2nd.org",
551)             # isoCC => "USA",
552)             # subRegion => "Texas",
553)             # region => "North America",
554)             # ipv4 => "True",
555)             # ipv6 => "False",
556)             # loadBalanced => "Unknown",
557)             # httpWebsiteMirror => "http://tor.site2nd.org",
558)             # rsyncWebsiteMirror => "", 
559)             # ftpWebsiteMirror => "",
560)             # httpDistMirror => "",
561)             # rsyncDistMirror => "",
562)             # updateDate => "Unknown",
563)         # },
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

564) 
565)        mirror027 => {
566)             adminContact => "jeroen\@unfix.org",
567)             orgName => "unfix",
568)             isoCC => "CH",
569)             subRegion => "",
570)             region => "Europe",
571)             ipv4 => "True",
572)             ipv6 => "True",
573)             loadBalanced => "Unknown",
574)             httpWebsiteMirror => "http://tor.unfix.org/",
575)             rsyncWebsiteMirror => "", 
576)             ftpWebsiteMirror => "",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

580)         },
581) 
582)        mirror028 => {
583)             adminContact => "jeroen\@unfix.org",
584)             orgName => "sixx",
Jacob Appelbaum Removed dupe mirror entry,...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

586)             subRegion => "",
587)             region => "Europe",
588)             ipv4 => "True",
589)             ipv6 => "True",
590)             loadBalanced => "Unknown",
591)             httpWebsiteMirror => "http://tor.sixxs.net/",
592)             rsyncWebsiteMirror => "", 
593)             ftpWebsiteMirror => "",
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

598) 
599)        mirror029 => {
600)             adminContact => "",
601)             orgName => "crypto.nsa.org",
602)             isoCC => "US",
603)             subRegion => "",
604)             region => "North America",
605)             ipv4 => "True",
606)             ipv6 => "False",
607)             loadBalanced => "Unknown",
608)             httpWebsiteMirror => "http://crypto.nsa.org/tor/",
609)             rsyncWebsiteMirror => "", 
610)             ftpWebsiteMirror => "",
611)             httpDistMirror => "http://crypto.nsa.org/tor/dist/",
612)             rsyncDistMirror => "",
613)             updateDate => "Unknown",
614)         },
Jacob Appelbaum New mirror, update mirror t...

Jacob Appelbaum authored 16 years ago

615) 
Jacob Appelbaum Update of mirrors from M Fr.

Jacob Appelbaum authored 16 years ago

616)        mirror030 => {
617)             adminContact => "web2005a\@year2005a.wiretapped.net",
618)             orgName => "Wiretapped",
619)             isoCC => "AU",
620)             subRegion => "Sydney",
621)             region => "Oceania",
622)             ipv4 => "True",
623)             ipv6 => "False",
624)             loadBalanced => "Unknown",
625)             httpWebsiteMirror => "",
626)             rsyncWebsiteMirror => "", 
627)             ftpWebsiteMirror => "ftp://ftp.mirrors.wiretapped.net/pub/security/cryptography/network/tor/",
628)             httpDistMirror => "http://www.mirrors.wiretapped.net/security/cryptography/network/tor/",
629)             rsyncDistMirror => "",
630)             updateDate => "Unknown",
631)         },								
Jacob Appelbaum Add a new mirror, change th...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

633)         mirror031 => {
634)             adminContact => "tormaster\@xpdm.us",
635)             orgName => "xpdm",
636)             isoCC => "US",
637)             subRegion => "",
638)             region => "North America",
639)             ipv4 => "True",
640)             ipv6 => "False",
641)             loadBalanced => "Unknown",
642)             httpWebsiteMirror => "http://torproj.xpdm.us/",
Jacob Appelbaum Update table to include htt...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

644)             rsyncWebsiteMirror => "", 
645)             ftpWebsiteMirror => "",
Jacob Appelbaum Update table to include htt...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

648)             rsyncDistMirror => "",
649)             hiddenServiceMirror => "http://h3prhz46uktgm4tt.onion/",
650)             updateDate => "Unknown",
651)         },								
652) 
Mfr Add a new french mirror

Mfr authored 16 years ago

653)         mirror032 => {
654)             adminContact => "abuse\@misericordia.be",
655)             orgName => "misericordia",
656)             isoCC => "FR",
657)             subRegion => "France",
658)             region => "Europe",
659)             ipv4 => "True",
660)             ipv6 => "False",
661)             loadBalanced => "No",
662)             httpWebsiteMirror => "http://mirror.misericordia.be/",
663)             httpsWebsiteMirror => "",
664)             rsyncWebsiteMirror => "", 
665)             ftpWebsiteMirror => "",
666)             httpDistMirror => "http://mirror.misericordia.be/dist/",
667)             httpsDistMirror => "",
668)             rsyncDistMirror => "",
669)             hiddenServiceMirror => "",
670)             updateDate => "Unknown",
671)         },		
Jacob Appelbaum New mirror, update mirror t...

Jacob Appelbaum authored 16 years ago

672) 
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

673) );
674) 
675) my $count = values %m;
676) print "We have a total of $count mirrors\n";
677) print "Fetching the last updated date for each mirror.\n";
678) 
679) foreach my $server ( keys %m ) {
680) 
681)     print "Attempting to fetch from $m{$server}{'orgName'}\n";
682) 
683)     if ($m{$server}{'httpWebsiteMirror'}) {
684)         print "Attempt to fetch via HTTP.\n";
685)         $m{$server}{"updateDate"} = FetchDate("$m{$server}{'httpWebsiteMirror'}");
686)     } elsif ($m{$server}{'httpsWebsiteMirror'}) {
687)         print "Attempt to fetch via HTTPS.\n";
688)         $m{$server}{"updateDate"} = FetchDate("$m{$server}{'httpsWebsiteMirror'}");
689)     } elsif ($m{$server}{'ftpWebsiteMirror'}) {
690)         print "Attempt to fetch via FTP.\n";
691)         $m{$server}{"updateDate"} = FetchDate("$m{$server}{'ftpWebsiteMirror'}");
692)     } else {
693)         print "We were unable to fetch or store anything. We still have the following: $m{$server}{'updateDate'}\n";
694)     }
695) 
696)     print "We fetched and stored the following: $m{$server}{'updateDate'}\n";
697) 
698)  }
699) 
700) 
701) print "We sorted the following mirrors by their date of last update: \n";
702) foreach my $server ( sort { $m{$b}{'updateDate'} <=> $m{$a}{'updateDate'}} keys %m ) {
703) 
704)      print "\n";
705)      print "Mirror $m{$server}{'orgName'}: \n";
706) 
707)      foreach my $attrib ( sort keys %{$m{$server}} ) {
708)         print "$attrib = $m{$server}{$attrib}";
709)         print "\n";
710)      };
711) }
712) 
713) my $outFile = "include/mirrors-table.wmi";
714) my $html;
715) open(OUT, "> $outFile") or die "Can't open $outFile: $!";
716) 
717) # Here's where we open a file and print some wml include goodness 
718) # This is storted from last known recent update to unknown update times
719) foreach my $server ( sort { $m{$b}{'updateDate'} <=> $m{$a}{'updateDate'}} keys %m ) {
720) 
Jacob Appelbaum ensure the date is either p...

Jacob Appelbaum authored 16 years ago

721)      my $time;
722)      if( "$m{$server}{'updateDate'}" ne "Unknown") {
723)         $time = ctime($m{$server}{'updateDate'});
724)         chomp($time);
725)      } else { $time = "Unknown"; }
726) 
Jacob Appelbaum Removed dupe mirror entry,...

Jacob Appelbaum authored 16 years ago

727) print OUT <<"END";
728)      \n<tr>\n
729)          <td>$m{$server}{'isoCC'}</td>\n
730)          <td>$m{$server}{'orgName'}</td>\n
731)          <td>$time</td>\n
732) END
733) 
734)      my %prettyNames = (
735)                         httpWebsiteMirror => "http",
736)                         httpsWebsiteMirror => "https",
737)                         ftpWebsiteMirror => "ftp",
738)                         rsyncWebsiteMirror => "rsync",
739)                         httpDistMirror => "http",
740)                         httpsDistMirror => "https",
741)                         rsyncDistMirrors => "rsync", );
742) 
743)      foreach my $precious ( sort keys %prettyNames )
Jacob Appelbaum Add a perl script that auto...

Jacob Appelbaum authored 16 years ago

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

Jacob Appelbaum authored 16 years ago

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