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

mirror/dir-generator.php: parse README links
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 13 18:50:05 2014 +0100 (2014-12-13)
parents 5e1012801aa2
children f3da7ce92a08
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="/static/favicon.ico" />
11 <link rel="stylesheet" type="text/css" href="/static/slitaz.css" />
12 <style type="text/css">
13 h2 img { padding-right: 4px; }
14 </style>
15 </head>
16 <body>
18 <!-- Header -->
19 <div id="header">
20 <div id="logo"></div>
21 <div id="network">
22 <a href="http://www.slitaz.org/">
23 <img src="/static/home.png" alt=" [ Home ] " /></a>
24 <a href="http://scn.slitaz.org/">Community</a>
25 <a href="http://doc.slitaz.org/">Doc</a>
26 <a href="http://forum.slitaz.org/">Forum</a>
27 <a href="http://slitaz.pro/">Pro</a>
28 <a href="http://slitaz.spreadshirt.net/">Shop</a>
29 <a href="http://bugs.slitaz.org">Bugs</a>
30 <a href="http://hg.slitaz.org/?sort=lastchange">Hg</a>
31 <a href="http://cook.slitaz.org/">Cook</a>
32 </div>
33 <h1><a href="http://<?php echo $_SERVER["HTTP_HOST"]; ?>/">SliTaz
34 <?php $host=preg_replace('/(\w+).*/i','$1',$_SERVER["HTTP_HOST"]); echo $host; ?></a></h1>
35 </div>
37 <!-- Block -->
38 <div id="block">
39 <!-- Navigation -->
40 <div id="block_nav">
41 <h4><img src="images/server.png" alt="[ Server ]" />Project servers</h4>
42 <ul>
43 <li><a href="http://tank.slitaz.org/">Tank server</a></li>
44 <li><a href="http://pangolin.slitaz.org/">Pangolin server</a></li>
45 <li><a href="http://chub.slitaz.org/">Chub server</a></li>
46 </ul>
47 </div>
48 <!-- Information/image -->
49 <div id="block_info">
50 <h4>Codename: <?php echo $host; ?></h4>
51 <p>
52 This is the SliTaz GNU/Linux main mirror. The server runs naturally SliTaz
53 (stable) in an UML virtual machine provided by
54 <a href="http://www.ads-lu.com/">Allied Data Sys. (ADS)</a>.
55 </p>
56 <p>
57 Mirror CPU is a <?php system("( sed '/cpuinfo=/!d;" .
58 "s/.*cpuinfo=\\([^ ]*\).*/: \\1/;s/_/ /g' /proc/cmdline ; grep '^model name' /proc/cpuinfo) | sed -e 's/.*Intel(R) //;" .
59 "s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //;q' |" .
60 " awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
61 "if (n == 4) printf \"quad \"; print s }' ")?> -
62 <?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
63 "n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
64 "printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?> - Located in France next to
65 Roubaix. This page has real time statistics provided by PHP
66 <code>system()</code> Mirror is also monitored by RRDtool which provides
67 <a href="graphs.php">graphical stats</a>.
68 </p>
69 </div>
70 </div>
72 <!-- Content -->
73 <div id="content">
75 <h2><a href="graphs.php"><img
76 title="Mirror RRDtool graphs" alt="graphs"
77 src="images/monitor.png" /></a>System stats</h2>
79 <h4>Uptime</h4>
81 <pre class="box">
82 <?php
83 system("uptime | sed 's/^\s*//'");
84 ?>
85 </pre>
87 <h4>Disk usage</h4>
89 <pre class="box">
90 <?php
91 system("[ -d /sys/block ] && [ -x /usr/sbin/smartctl ] && { cd /sys/block ; for i in [hs]d? ; do echo -n \$i ; /usr/sbin/smartctl -a /dev/\$i 2> /dev/null | sed '/Power_On_Hours/{s/.*Pow/: Pow/;s/ours.*-/ours/;p};/offline/!d;q'; echo; done; }");
92 system("df -h | sed '/^rootfs/d' | grep '\(^/dev\|Filesystem\)'");
93 ?>
94 </pre>
96 <h4>Network</h4>
97 <pre class="box">
98 <?php
99 system("ifconfig eth0 | awk '{ if (/X packet/ || /X byte/) print }' | sed 's/^\s*//'");
100 ?>
101 </pre>
104 <?php if (isset($_GET["all"])) { ?>
105 <h4>Logins</h4>
106 <pre class="box">
107 <?php
108 system("last");
109 ?>
110 </pre>
112 <h4>Processes</h4>
113 <pre class="box">
114 <?php
115 system("top -n1 -b");
116 ?>
117 </pre>
118 <?php } ?>
120 <a name="vhosts"></a>
121 <h2><img title="Mirror Virtual hosts" alt="vhosts"
122 src="/static/network.png" />Virtual hosts</h2>
124 <ul>
125 <li><a href="http://mirror1.slitaz.org/">mirror1.slitaz.org</a> - SliTaz Mirror.
126 (<a href="http://mirror1.slitaz.org/stats">stats</a>)</li>
127 <li><a href="http://scn.slitaz.org/">scn.slitaz.org</a> - SliTaz Community Network.
128 (<a href="http://mirror1.slitaz.org/awstats.pl?config=scn.slitaz.org">stats</a>)</li>
129 <li><a href="http://pizza.slitaz.org/">pizza.slitaz.org</a> - SliTaz Flavor builder.
130 (<a href="http://mirror1.slitaz.org/awstats.pl?config=pizza.mirror1.slitaz.org">stats</a>)</li>
131 <li><a href="http://tiny.slitaz.org/">tiny.slitaz.org</a> - Tiny SliTaz builder.
132 (<a href="http://mirror1.slitaz.org/awstats.pl?config=tiny.slitaz.org">stats</a>)</li>
133 <li><a href="https://ajaxterm.slitaz.org/">ajaxterm.slitaz.org</a> - Slitaz Web Console.
134 (<a href="http://mirror1.slitaz.org/awstats.pl?config=ajaxterm.slitaz.org">stats</a>)</li>
135 </ul>
137 <a name="replicas"></a>
138 <h2><a href="http://mirror1.slitaz.org/awstats.pl?config=replicas.mirror1.slitaz.org">
139 <img title="Tank replicas" alt="replicas"
140 src="/static/network.png" /></a>Tank replicas</h2>
142 <ul>
143 <li><a href="http://mirror1.slitaz.org/www/">www.slitaz.org</a> - SliTaz Website.
144 (<a href="http://www.slitaz.org/">main</a>)</li>
145 <li><a href="http://mirror1.slitaz.org/doc/">doc.slitaz.org</a> - Documentation.
146 (<a href="http://doc.slitaz.org/">main</a>)</li>
147 <li><a href="http://mirror1.slitaz.org/pkgs/">pkgs.slitaz.org</a> - Packages Web interface.
148 (<a href="http://pkgs.slitaz.org/">main</a>)</li>
149 <li><a href="http://mirror1.slitaz.org/hg/?sort=lastchange">hg.slitaz.org</a> - Mercurial repositories (read only).
150 (<a href="http://hg.slitaz.org/?sort=lastchange">main</a>
151 <a href="http://hg.tuxfamily.org/mercurialroot/slitaz/">tuxfamily</a>)</li>
152 <li><a href="http://mirror1.slitaz.org/webboot/">boot.slitaz.org</a> - gPXE Web boot.
153 (<a href="http://boot.slitaz.org/">main</a>)</li>
154 </ul>
156 <a name="boot"></a>
157 <h2><a href="http://doc.slitaz.org/en:guides:pxe#web-booting">
158 <img title="Web boot" src="/static/network.png"
159 alt="web boot" /></a>Web boot services</h2>
160 The SliTaz mirror provides a <b>tftp</b> access and a
161 <a href="/pxe">pxe</a> tree. Simply add to your DHCP server configuration file:
162 <ul>
163 <li>for <b>udhcpd</b><!-- siaddr? sname? tftp? -->
164 <pre>
165 siaddr mirror.slitaz.org
166 boot_file gpxe.pxe</pre>
167 </li>
168 <li>for <b>dhcpd</b>
169 <pre>
170 next-server "mirror.slitaz.org"
171 filemane "gpxe.pxe"</pre>
172 </li>
173 <li>for <b>dnsmasq</b>
174 <pre>
175 dhcp-boot=gpxe.pxe,mirror.slitaz.org</pre>
176 </li>
177 </ul>
179 <a name="mirrors"></a>
180 <h2><a href="http://mirror1.slitaz.org/awstats.pl?config=rsync">
181 <img title="Secondary mirrors" src="/static/network.png"
182 alt="mirrors" /></a>Mirrors</h2>
183 Most mirrors are updated using the url: <b>rsync://mirror1.slitaz.org/slitaz/</b>
184 (<a href="http://mirror1.slitaz.org/awstats.pl?config=rsync">stats</a>)
185 <pre>
186 rsync -azH --delete rsync://mirror1.slitaz.org/slitaz/ /local/slitaz/mirror/ </pre>
187 New mirrors should be announced on the
188 <a href="http://www.slitaz.org/en/mailing-list.html">mailing list</a>.
189 <ul>
190 <?php
191 $output_url_file="";
192 $output_url_handler;
193 $mirrors_url_file="/tmp/mirrors";
195 function test_url($link, $proto)
196 {
197 global $output_url_file;
198 global $mirrors_url_file;
199 global $output_url_handler;
201 if ($output_url_file != "") {
202 switch($proto) {
203 case "http" :
204 case "ftp" :
205 $cmd = "busybox wget -s $link/README" ;
206 break;
207 case "rsync" :
208 $cmd = "rsync $link > /dev/null 2>&1" ;
209 break;
210 default :
211 return FALSE;
212 }
213 if (shell_exec("$cmd && echo -n OK") == "OK") {
214 fwrite($output_url_handler,$link."\n");
215 return TRUE;
216 }
217 return FALSE;
218 }
219 return shell_exec("grep -qs ^$link$ $mirrors_url_file && echo -n OK") == "OK";
220 }
222 if (! file_exists($mirrors_url_file)) {
223 $output_url_file = tempnam('/tmp','mkmirrors');
224 $output_url_handler = fopen($output_url_file, "w");
225 fwrite($output_url_handler,"http://mirror1.slitaz.org/\n");
226 fwrite($output_url_handler,"rsync://mirror1.slitaz.org/\n");
227 }
229 # Flags icons from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip
230 foreach (array(
231 array( "flag" => "ch",
232 "http" => "http://mirror.switch.ch/ftp/mirror/slitaz/",
233 "ftp" => "ftp://mirror.switch.ch/mirror/slitaz/"),
234 array( "flag" => "us",
235 "http" => "http://www.gtlib.gatech.edu/pub/slitaz/",
236 "ftp" => "ftp://ftp.gtlib.gatech.edu/pub/slitaz/",
237 "rsync" => "rsync://www.gtlib.gatech.edu/slitaz/"),
238 array( "flag" => "fr",
239 "http" => "http://download.tuxfamily.org/slitaz/",
240 "ftp" => "ftp://download.tuxfamily.org/slitaz/",
241 "rsync" => "rsync://download.tuxfamily.org/pub/slitaz/"),
242 array( "flag" => "fr",
243 "http" => "http://www.linuxembarque.com/slitaz/mirror/"),
244 // array( "flag" => "cn",
245 // "http" => "http://mirror.lupaworld.com/slitaz/"),
246 array( "flag" => "cn",
247 "http" => "http://ks.lupaworld.com/slitaz/"),
248 array( "flag" => "br",
249 "http" => "http://slitaz.c3sl.ufpr.br/",
250 "ftp" => "ftp://slitaz.c3sl.ufpr.br/slitaz/",
251 "rsync" => "rsync://slitaz.c3sl.ufpr.br/slitaz/"),
252 array( "flag" => "it",
253 "http" => "http://slitaz.mirror.garr.it/mirrors/slitaz/",
254 "ftp" => "ftp://slitaz.mirror.garr.it/mirrors/slitaz/",
255 "rsync" => "rsync://slitaz.mirror.garr.it/mirrors/slitaz/"),
256 array( "flag" => "si",
257 "http" => "http://mirror.drustvo-dns.si/slitaz/"),
258 // array( "flag" => "si",
259 // "ftp" => "ftp://ftp.pina.si/slitaz/"),
260 array( "flag" => "us",
261 "http" => "http://distro.ibiblio.org/pub/linux/distributions/slitaz/",
262 "ftp" => "ftp://distro.ibiblio.org/pub/linux/distributions/slitaz/"),
263 array( "flag" => "nl",
264 "http" => "http://ftp.vim.org/ftp/os/Linux/distr/slitaz/",
265 "ftp" => "ftp://ftp.vim.org/mirror/os/Linux/distr/slitaz/"),
266 array( "flag" => "nl",
267 "http" => "http://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/",
268 "ftp" => "ftp://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/"),
269 array( "flag" => "ch",
270 "http" => "http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/",
271 "ftp" => "ftp://ftp.ch.xemacs.org//pool/2/mirror/slitaz/"),
272 array( "flag" => "de",
273 "http" => "http://ftp.uni-stuttgart.de/slitaz/",
274 "ftp" => "ftp://ftp.uni-stuttgart.de/slitaz/"),
275 array( "flag" => "au",
276 "http" => "http://mirror.iprimus.com/slitaz/"),
277 array( "flag" => "au",
278 "http" => "http://mirror01.ipgn.com.au/slitaz/"),
279 array( "flag" => "us",
280 "http" => "http://mirror.clarkson.edu/slitaz/",
281 "rsync" => "rsync://mirror.clarkson.edu/slitaz/")) as $mirror) {
282 $flag = "images/flags/".$mirror["flag"].".png";
283 $head = TRUE;
284 foreach(array("http", "ftp", "rsync") as $proto) {
285 if (!isset($mirror[$proto])) continue;
286 $link = $mirror[$proto];
287 if (!test_url($link, $proto)) continue;
288 $serveur = parse_url($link, PHP_URL_HOST);
289 if ($head) echo <<<EOT
290 <li><a href="http://en.utrace.de/?query=$serveur">
291 <img title="map" src="$flag" alt="map" /></a>
292 <a href="$link">$link</a>
293 EOT;
294 else echo <<<EOT
295 or <a href="$link">$proto</a>
296 EOT;
297 $head = FALSE;
298 }
299 if ($head) continue;
300 echo " </li>\n";
301 }
303 if ($output_url_file != "") {
304 fclose($output_url_handler);
305 rename($output_url_file, $mirrors_url_file);
306 chmod($mirrors_url_file, 0644);
307 }
309 ?>
310 </ul>
312 <a name="builds"></a>
313 <h3><img title="Daily builds" src="images/iso.png" alt="builds"
314 width="25" height="25" />
315 Daily builds</h3>
317 <?php
318 function display_log($file,$anchor,$url)
319 {
320 echo '<a name="'.$anchor.'"></a>';
321 echo "<h4><a href=\"$url\">";
322 system("stat -c '%y %n' ".$file." | sed 's/.000000000//;s|/var/log/\(.*\).log|\\1.iso|'");
323 echo "</a></h4>";
324 echo "<pre>";
325 $sed_script="s/.\[[0-9][^mG]*.//g";
326 $sed_script.=";:a;s/^\(.\{1,68\}\)\(\[ [A-Za-z]* \]\)/\\1 \\2/;ta";
327 $sed_script.=";s#\[ OK \]#[ <span style=\"color:green\">OK</span> ]#";
328 $sed_script.=";s#\[ Failed \]#[ <span style=\"color:red\">Failed</span> ]#";
329 system("sed '".$sed_script."' < $file");
330 echo "</pre>";
331 }
333 display_log("/var/log/packages-stable.log", "buildstable", "/iso/stable/packages-4.0.iso");
334 display_log("/var/log/packages-cooking.log","buildcooking","/iso/cooking/packages-cooking.iso");
335 ?>
337 <!-- End of content -->
338 </div>
340 <!-- Footer -->
342 <script type="text/javascript">
343 function QRCodePNG(str, obj) {
344 try {
345 obj.height = obj.width += 300;
346 return QRCode.generatePNG(str, {ecclevel: 'H'});
347 }
348 catch (any) {
349 var element = document.createElement("script");
350 element.src = "/static/qrcode.js";
351 element.type ="text/javascript";
352 element.onload = function() {
353 obj.src = QRCode.generatePNG(str, {ecclevel: 'H'});
354 };
355 document.body.appendChild(element);
356 }
357 }
358 </script>
360 <div id="footer">
361 Copyright &copy; <span class="year"></span>
362 <a href="http://www.slitaz.org/">SliTaz</a> - Network:
363 <a href="http://scn.slitaz.org/">Community</a>
364 <a href="http://doc.slitaz.org/">Doc</a>
365 <a href="http://forum.slitaz.org/">Forum</a>
366 <a href="http://pkgs.slitaz.org/">Packages</a>
367 <a href="http://boot.slitaz.org/">Boot</a>
368 <a href="http://bugs.slitaz.org">Bugs</a>
369 <a href="http://hg.slitaz.org/?sort=lastchange">Hg</a>
370 <p>
371 <img src="/static/qr.png" alt="SliTaz @" onmouseover="this.title = location.href"
372 onclick="this.src = QRCodePNG(location.href, this)" />
373 <a href="http://twitter.com/slitaz">Twitter</a>
374 <a href="http://www.facebook.com/slitaz">Facebook</a>
375 <a href="http://distrowatch.com/slitaz">Distrowatch</a>
376 <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a>
377 <a href="http://flattr.com/profile/slitaz">Flattr</a>
378 </p>
379 <p>
380 <a href="http://validator.w3.org/check?uri=referer">
381 <img src="/static/xhtml10.png"
382 alt="Valid XHTML 1.0" title="Code valid. XHTML 1.0"
383 style="width: 80px; height: 15px;" /></a>
384 </p>
385 </div>
387 </body>
388 </html>