slitaz-forge view mirror/info/index.php @ rev 157

mirror: Add mirror info files
author Christophe Lincoln <pankso@slitaz.org>
date Tue Mar 20 13:13:22 2012 +0100 (2012-03-20)
parents
children 076ab51e4997
line source
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <title>SliTaz Mirror</title>
6 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
7 <meta name="description" content="slitaz mirror server" />
8 <meta name="robots" content="index, nofollow" />
9 <meta name="author" content="SliTaz Contributors" />
10 <link rel="shortcut icon" href="/css/favicon.ico" />
11 <link rel="stylesheet" type="text/css" href="/css/slitaz.css" />
12 <style type="text/css">
13 #copy {
14 text-align: center;
15 }
17 #bottom {
18 text-align: center;
19 }
20 </style>
21 </head>
22 <body>
24 <!-- Header -->
25 <div id="header">
26 <div id="logo"></div>
27 <div id="network">
28 <a href="http://www.slitaz.org/">
29 <img src="/css/pics/network.png" alt="network.png" /></a>
30 <a href="http://scn.slitaz.org/">Community</a>
31 <a href="http://doc.slitaz.org/" title="SliTaz Community Documentation">Doc</a>
32 <a href="http://forum.slitaz.org/" title="Slitaz Forum">Forum</a>
33 <a href="http://bugs.slitaz.org/" title="Bug Tracking System">Bugs</a>
34 <a href="http://hg.slitaz.org/" title="SliTaz repositories">Hg</a>
35 </div>
36 <h1><a href="http://<?php echo $_SERVER["HTTP_HOST"]; ?>/">SliTaz
37 <?php $host=preg_replace('/(\w+).*/i','$1',$_SERVER["HTTP_HOST"]); echo $host; ?></a></h1>
38 </div>
40 <!-- Block -->
41 <div id="block">
42 <!-- Navigation -->
43 <div id="block_nav">
44 <h4><img src="/css/pics/development.png" alt="development.png" />Developers Corner</h4>
45 <ul>
46 <li><a href="http://www.slitaz.org/en/devel/">Website devel</a></li>
47 <li><a href="http://scn.slitaz.org/">Community</a></li>
48 <li><a href="http://cook.slitaz.org/">Build Bot</a></li>
49 <li><a href="http://tank.slitaz.org/">Tank Server</a></li>
50 <li><a href="http://mirror.slitaz.org/info/">Mirror Server</a> -
51 <a href="http://mirror.slitaz.org/console/">Console</a>
52 </li>
53 </ul>
54 </div>
55 <!-- Information/image -->
56 <div id="block_info">
57 <h4>Codename: <?php echo $host; ?></h4>
58 <p>
59 This is the SliTaz GNU/Linux main mirror. The server runs naturally SliTaz
60 (stable) in an lguest virtual machine provided by
61 <a href="http://www.ads-lu.com/">Allied Data Sys. (ADS)</a>.
62 </p>
63 <p>
64 Mirror CPU is a <?php system("sed -e '/^model name/!d;s/.*Intel(R) //;" .
65 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </proc/cpuinfo |" .
66 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
67 "if (n == 4) printf \"quad \"; print s }' ")?> -
68 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
69 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
70 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?> - Located in France next to
71 Roubaix. This page has real time statistics provided by PHP
72 <code>system()</code> Mirror is also monitored by RRDtool which provides
73 <a href="graphs.php">graphical stats</a>.
74 </p>
75 </div>
76 </div>
78 <!-- Content -->
79 <div id="content">
81 <h2><a href="graphs.php"><img
82 style="vertical-align: middle; padding: 0 4px 0 0;"
83 title="Mirror RRDtool graphs" alt="graphs"
84 src="pics/website/monitor.png" /></a>System stats</h2>
86 <h4>Uptime</h4>
88 <pre class="package">
89 <?php
90 system("uptime | sed 's/^\s*//'");
91 ?>
92 </pre>
94 <h4>Disk usage</h4>
96 <pre class="package">
97 <?php
98 system("df -h | sed '/^rootfs/d' | grep '\(^/dev\|Filesystem\)'");
99 ?>
100 </pre>
102 <h4>Network</h4>
103 <pre class="package">
104 <?php
105 system("ifconfig eth0 | awk '{ if (/X packet/ || /X byte/) print }' | sed 's/^\s*//'");
106 ?>
107 </pre>
110 <?php if (isset($_GET["all"])) { ?>
111 <h4>Logins</h4>
112 <pre class="package">
113 <?php
114 system("last");
115 ?>
116 </pre>
118 <h4>Processes</h4>
119 <pre class="package">
120 <?php
121 system("top -n1 -b");
122 ?>
123 </pre>
124 <?php } ?>
126 <a name="vhosts"></a>
127 <h3><a href="http://mirror.slitaz.org/awstats.pl?config=info.mirror.slitaz.org" target="_blank">
128 <img title="Mirror Virtual hosts" alt="vhosts"
129 src="pics/website/vhosts.png" /></a>Virtual hosts</h3>
131 <ul>
132 <li><a href="http://mirror.slitaz.org/">mirror.slitaz.org</a> - SliTaz Mirror.
133 (<a href="http://mirror.slitaz.org/stats" target="_blank">stats</a>)</li>
134 <li><a href="http://scn.slitaz.org/">scn.slitaz.org</a> - SliTaz Community Network.
135 (<a href="http://mirror.slitaz.org/awstats.pl?config=scn.slitaz.org" target="_blank">stats</a>)</li>
136 <li><a href="http://pizza.slitaz.org/">pizza.slitaz.org</a> - SliTaz Flavor builder.
137 (<a href="http://mirror.slitaz.org/awstats.pl?config=pizza.mirror.slitaz.org" target="_blank">stats</a>)</li>
138 <li><a href="http://tiny.slitaz.org/">tiny.slitaz.org</a> - Tiny SliTaz builder.
139 (<a href="http://mirror.slitaz.org/awstats.pl?config=tiny.slitaz.org" target="_blank">stats</a>)</li>
140 <li><a href="https://ajaxterm.slitaz.org/">ajaxterm.slitaz.org</a> - Slitaz Web Console.
141 (<a href="http://mirror.slitaz.org/awstats.pl?config=ajaxterm.slitaz.org" target="_blank">stats</a>)</li>
142 </ul>
144 <a name="replicas"></a>
145 <h3><a href="http://mirror.slitaz.org/awstats.pl?config=replicas.mirror.slitaz.org" target="_blank">
146 <img title="Tank replicas" alt="replicas"
147 src="pics/website/vhosts.png" /></a>Tank replicas</h3>
149 <ul>
150 <li><a href="http://mirror.slitaz.org/www/">www.slitaz.org</a> - SliTaz Website.
151 (<a href="http://www.slitaz.org/" target="_blank">main</a>)</li>
152 <li><a href="http://mirror.slitaz.org/doc/">doc.slitaz.org</a> - Documentation.
153 (<a href="http://doc.slitaz.org/" target="_blank">main</a>)</li>
154 <li><a href="http://mirror.slitaz.org/pkgs/">pkgs.slitaz.org</a> - Packages Web interface.
155 (<a href="http://pkgs.slitaz.org/" target="_blank">main</a>)</li>
156 <li><a href="http://mirror.slitaz.org/hg/">hg.slitaz.org</a> - Mercurial repositories (read only).
157 (<a href="http://hg.slitaz.org/" target="_blank">main</a>
158 <a href="http://hg.tuxfamily.org/mercurialroot/slitaz/" target="_blank">tuxfamily</a>)</li>
159 <li><a href="http://mirror.slitaz.org/webboot/">boot.slitaz.org</a> - gPXE Web boot.
160 (<a href="http://boot.slitaz.org/" target="_blank">main</a>)</li>
161 </ul>
163 <a name="boot"></a>
164 <h3><a href="http://doc.slitaz.org/en:guides:pxe#web-booting" target="_blank">
165 <img title="Web boot" src="pics/website/vhosts.png"
166 alt="web boot" /></a>Web boot services</h3>
167 The SliTaz mirror provides a <b>tftp</b> access and a
168 <a href="/pxe">pxe</a> tree. Simply add to your DHCP server configuration file:
169 <ul>
170 <li>for <b>udhcpd</b><!-- siaddr? sname? tftp? -->
171 <pre>
172 siaddr mirror.slitaz.org
173 boot_file gpxe.pxe</pre>
174 </li>
175 <li>for <b>dhcpd</b>
176 <pre>
177 next-server "mirror.slitaz.org"
178 filemane "gpxe.pxe"</pre>
179 </li>
180 <li>for <b>dnsmasq</b>
181 <pre>
182 dhcp-boot=gpxe.pxe,mirror.slitaz.org</pre>
183 </li>
184 </ul>
186 <a name="mirrors"></a>
187 <h3><a href="http://mirror.slitaz.org/awstats.pl?config=rsync" target="_blank">
188 <img title="Secondary mirrors" src="pics/website/vhosts.png"
189 alt="mirrors" /></a>Mirrors</h3>
190 Most mirrors are updated using the url: <b>rsync://mirror.slitaz.org/slitaz/</b>
191 (<a href="http://mirror.slitaz.org/awstats.pl?config=rsync">stats</a>)
192 <pre>
193 rsync -azH --delete rsync://mirror.slitaz.org/slitaz/ /local/slitaz/mirror/ </pre>
194 New mirrors should be announced on the
195 <a href="http://www.slitaz.org/en/mailing-list.html">mailing list</a>.
196 <ul>
197 <?php
198 $output_url_file="";
199 $output_url_handler;
200 $mirrors_url_file="/tmp/mirrors";
202 function test_url($link, $proto)
203 {
204 global $output_url_file;
205 global $mirrors_url_file;
206 global $output_url_handler;
208 if ($output_url_file != "") {
209 switch($proto) {
210 case "http" :
211 case "ftp" :
212 $cmd = "busybox wget -s $link/README" ;
213 break;
214 case "rsync" :
215 $cmd = "rsync $link > /dev/null 2>&1" ;
216 break;
217 default :
218 return FALSE;
219 }
220 if (shell_exec("$cmd && echo -n OK") == "OK") {
221 fwrite($output_url_handler,$link."\n");
222 return TRUE;
223 }
224 return FALSE;
225 }
226 return shell_exec("grep -qs ^$link$ $mirrors_url_file && echo -n OK") == "OK";
227 }
229 if (! file_exists($mirrors_url_file)) {
230 $output_url_file = tempnam('/tmp','mkmirrors');
231 $output_url_handler = fopen($output_url_file, "w");
232 fwrite($output_url_handler,"http://mirror.slitaz.org/\n");
233 fwrite($output_url_handler,"rsync://mirror.slitaz.org/\n");
234 }
236 # Flags icons from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip
237 foreach (array(
238 array( "flag" => "ch",
239 "http" => "http://mirror.switch.ch/ftp/mirror/slitaz/",
240 "ftp" => "ftp://mirror.switch.ch/mirror/slitaz/"),
241 array( "flag" => "us",
242 "http" => "http://www.gtlib.gatech.edu/pub/slitaz/",
243 "ftp" => "ftp://ftp.gtlib.gatech.edu/pub/slitaz/",
244 "rsync" => "rsync://www.gtlib.gatech.edu/slitaz/"),
245 array( "flag" => "fr",
246 "http" => "http://download.tuxfamily.org/slitaz/",
247 "ftp" => "ftp://download.tuxfamily.org/slitaz/",
248 "rsync" => "rsync://download.tuxfamily.org/pub/slitaz/"),
249 array( "flag" => "fr",
250 "http" => "http://www.linuxembarque.com/slitaz/mirror/"),
251 array( "flag" => "cn",
252 "http" => "http://mirror.lupaworld.com/slitaz/"),
253 array( "flag" => "cn",
254 "http" => "http://ks.lupaworld.com/slitaz/"),
255 array( "flag" => "br",
256 "http" => "http://slitaz.c3sl.ufpr.br/",
257 "ftp" => "ftp://slitaz.c3sl.ufpr.br/slitaz/",
258 "rsync" => "rsync://slitaz.c3sl.ufpr.br/slitaz/"),
259 array( "flag" => "it",
260 "http" => "http://slitaz.mirror.garr.it/mirrors/slitaz/",
261 "ftp" => "ftp://slitaz.mirror.garr.it/mirrors/slitaz/",
262 "rsync" => "rsync://slitaz.mirror.garr.it/mirrors/slitaz/"),
263 array( "flag" => "si",
264 "http" => "http://mirror.drustvo-dns.si/slitaz/"),
265 array( "flag" => "si",
266 "ftp" => "ftp://ftp.pina.si/slitaz/"),
267 array( "flag" => "us",
268 "http" => "http://distro.ibiblio.org/pub/linux/distributions/slitaz/",
269 "ftp" => "ftp://distro.ibiblio.org/pub/linux/distributions/slitaz/"),
270 array( "flag" => "nl",
271 "http" => "http://ftp.vim.org/ftp/os/Linux/distr/slitaz/",
272 "ftp" => "ftp://ftp.vim.org/mirror/os/Linux/distr/slitaz/"),
273 array( "flag" => "nl",
274 "http" => "http://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/",
275 "ftp" => "ftp://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/"),
276 array( "flag" => "ch",
277 "http" => "http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/",
278 "ftp" => "ftp://ftp.ch.xemacs.org//pool/2/mirror/slitaz/"),
279 array( "flag" => "de",
280 "http" => "http://ftp.uni-stuttgart.de/slitaz/",
281 "ftp" => "ftp://ftp.uni-stuttgart.de/slitaz/"),
282 array( "flag" => "au",
283 "http" => "http://mirror.iprimus.com/slitaz/"),
284 array( "flag" => "au",
285 "http" => "http://mirror01.ipgn.com.au/slitaz/"),
286 array( "flag" => "us",
287 "http" => "http://mirror.clarkson.edu/slitaz/",
288 "rsync" => "rsync://mirror.clarkson.edu/slitaz/")) as $mirror) {
289 $flag = "pics/website/".$mirror["flag"].".png";
290 $head = TRUE;
291 foreach(array("http", "ftp", "rsync") as $proto) {
292 if (!isset($mirror[$proto])) continue;
293 $link = $mirror[$proto];
294 if (!test_url($link, $proto)) continue;
295 $serveur = parse_url($link, PHP_URL_HOST);
296 if ($head) echo <<<EOT
297 <li><a href="http://en.utrace.de/?query=$serveur">
298 <img title="map" src="$flag" alt="map" /></a>
299 <a href="$link">$link</a>
300 EOT;
301 else echo <<<EOT
302 or <a href="$link">$proto</a>
303 EOT;
304 $head = FALSE;
305 }
306 if ($head) continue;
307 echo " </li>\n";
308 }
310 if ($output_url_file != "") {
311 fclose($output_url_handler);
312 rename($output_url_file, $mirrors_url_file);
313 chmod($mirrors_url_file, 0644);
314 }
316 ?>
317 </ul>
319 <a name="builds"></a>
320 <h3><img title="Daily builds" src="pics/website/cdrom.png" alt="builds"
321 width="25" height="25" />
322 Daily builds</h3>
324 <?php
325 function display_log($file,$anchor,$url)
326 {
327 echo '<a name="'.$anchor.'"></a>';
328 echo "<h4><a href=\"$url\">";
329 system("stat -c '%y %n' ".$file." | sed 's/.000000000//;s|/var/log/\(.*\).log|\\1.iso|'");
330 echo "</a></h4>";
331 echo "<pre>";
332 $sed_script="s/.\[[0-9][^mG]*.//g";
333 $sed_script.=";:a;s/^\(.\{1,68\}\)\(\[ [A-Za-z]* \]\)/\\1 \\2/;ta";
334 $sed_script.=";s#\[ OK \]#[ <span style=\"color:green\">OK</span> ]#";
335 $sed_script.=";s#\[ Failed \]#[ <span style=\"color:red\">Failed</span> ]#";
336 system("sed '".$sed_script."' < $file");
337 echo "</pre>";
338 }
340 display_log("/var/log/packages-stable.log", "buildstable", "/iso/stable/packages-3.0.iso");
341 display_log("/var/log/packages-cooking.log","buildcooking","/iso/cooking/packages-cooking.iso");
342 ?>
344 <!-- End of content -->
345 </div>
347 <div id="content_bottom">
348 <div class="bottom_left"></div>
349 <div class="bottom_right"></div>
350 </div>
352 <!-- Start of footer and copy notice -->
353 <div id="copy">
354 <p>
355 Last update : <?php echo date('r'); ?>
356 </p>
357 <p>
358 Copyright &copy; <?php echo date('Y'); ?> <a href="http://www.slitaz.org/">SliTaz</a> -
359 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>
360 </p>
361 <!-- End of copy -->
362 </div>
364 <!-- Bottom and logo's -->
365 <div id="bottom">
366 <p>
367 <a href="http://validator.w3.org/check?uri=referer"><img
368 src="/css/pics/website/xhtml10.png" alt="Valid XHTML 1.0"
369 title="Code validé XHTML 1.0"
370 style="width: 80px; height: 15px;" /></a>
371 </p>
372 </div>
374 </body>
375 </html>