wok-current rev 7324
mirror-tools: add /etc/lighttpd/vhosts.conf
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Nov 18 10:21:49 2010 +0100 (2010-11-18) |
parents | a6137e640e01 |
children | fd94327b5714 |
files | mirror-tools/stuff/etc/lighttpd/vhosts.conf mirror-tools/stuff/home/backups/mirror/backup.sh mirror-tools/stuff/usr/bin/mkpkgiso mirror-tools/stuff/var/www/mirror-info/index.php |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mirror-tools/stuff/etc/lighttpd/vhosts.conf Thu Nov 18 10:21:49 2010 +0100 1.3 @@ -0,0 +1,171 @@ 1.4 +# /etc/lighttpd/vhosts.conf : Virtual hosts configuration file. 1.5 +# 1.6 + 1.7 +# Example.org 1.8 +# 1.9 +#$HTTP["host"] =~ "(^|\.)example\.org$" { 1.10 + #server.document-root = "/var/www/vhost/exemple.com/html" 1.11 + #server.errorlog = "/var/log/lighttpd/example.org-error.log" 1.12 + #accesslog.filename = "/var/log/lighttpd/example.org-access.log" 1.13 +#} 1.14 + 1.15 +# mirror.slitaz.org (Server canonical hostname) 1.16 +# 1.17 +$HTTP["host"] =~ "^mirror\.slitaz\.org$" { 1.18 + server.document-root = "/var/www/slitaz/mirror" 1.19 + server.errorlog = "/var/log/lighttpd/mirror.slitaz.org-error.log" 1.20 + accesslog.filename = "/var/log/lighttpd/mirror.slitaz.org-access.log" 1.21 + 1.22 + include "awstats.conf" 1.23 + 1.24 + alias.url += ( "/info" => "/var/www/mirror-info/" ) 1.25 + 1.26 + alias.url += ( "/pizza" => "/var/www/pizza/" ) 1.27 + 1.28 + alias.url += ( "/doc" => "/var/www/doc/" ) 1.29 + var.dokudir = "/doc" 1.30 + # Rewrites for dokuwiki 1.31 + url.rewrite = ( 1.32 + "^" + var.dokudir + "/lib/.*$" => "$0", 1.33 + "^" + var.dokudir + "/_media/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1&$2", 1.34 + "^" + var.dokudir + "/_media/(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1", 1.35 + "^" + var.dokudir + "/_detail/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/detail.php?media=$1&$2", 1.36 + "^" + var.dokudir + "/_detail/(.*)?$" => var.dokudir + "/lib/exe/detail.php?media=$1", 1.37 + "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3", 1.38 + "^" + var.dokudir + "/_export/([^/]+)/(.*)" => var.dokudir + "/doku.php?do=export_$1&id=$2", 1.39 + "^" + var.dokudir + "/doku.php.*" => "$0", 1.40 + "^" + var.dokudir + "/feed.php.*" => "$0", 1.41 + "^" + var.dokudir + "/(.*)\?(.*)" => var.dokudir + "/doku.php?id=$1&$2", 1.42 + "^" + var.dokudir + "/(.*)" => var.dokudir + "/doku.php?id=$1" 1.43 + ) 1.44 + 1.45 + alias.url += ( "/webboot" => "/var/www/boot/" ) 1.46 + 1.47 + alias.url += ( "/pkgs" => "/var/www/pkgs/" ) 1.48 + index-file.names += ( "search.sh" ) 1.49 + cgi.assign += ( 1.50 + ".sh" => "/bin/sh" 1.51 + ) 1.52 + 1.53 + alias.url += ( "/hg" => "/var/www/hg/" ) 1.54 +### url.rewrite-once = ( "/hg(.*)" => "/hg/hgwebdir.py$1" ) 1.55 + index-file.names += ( "hgwebdir.py" ) 1.56 + cgi.assign += ( 1.57 + ".py" => "/usr/bin/python" 1.58 + ) 1.59 + 1.60 + alias.url += ( "/www" => "/home/slitaz/website" ) 1.61 + 1.62 +# alias.url += ( "/tiny" => "/var/www/pizza/tiny/demos/192.168.0.6/var/www" ) 1.63 +# index-file.names += ( "index.sh" ) 1.64 + 1.65 + index-file.names += ( "index.html" ) 1.66 + index-file.names += ( "index.php" ) 1.67 + # Last but not least... 1.68 + index-file.names += ( "/dir-generator.php" ) 1.69 +} 1.70 + 1.71 +## info.mirror.slitaz.org 1.72 +## 1.73 +#$HTTP["host"] =~ "^info\.mirror\.slitaz\.org$" { 1.74 +# server.document-root = "/var/www/mirror-info/" 1.75 +# server.errorlog = "/var/log/lighttpd/info.mirror.slitaz.org-error.log" 1.76 +# accesslog.filename = "/var/log/lighttpd/info.mirror.slitaz.org-access.log" 1.77 +# include "awstats.conf" 1.78 +#} 1.79 + 1.80 +$HTTP["host"] =~ "ajaxterm\.slitaz\.org$" { 1.81 + proxy.server = ( "/" => 1.82 + ( ( "host" => "127.0.0.1", "port" => 8022 ) ) 1.83 + ) 1.84 +} 1.85 + 1.86 +# pizza.slitaz.org (Server canonical hostname) 1.87 +# 1.88 +$HTTP["host"] =~ "^pizza\.slitaz\.org$" { 1.89 + server.document-root = "/var/www/pizza" 1.90 + server.errorlog = "/var/log/lighttpd/pizza.slitaz.org-error.log" 1.91 + accesslog.filename = "/var/log/lighttpd/pizza.slitaz.org-access.log" 1.92 + include "awstats.conf" 1.93 + index-file.names += ( "index.php" ) 1.94 +} 1.95 + 1.96 +# slitaz.org 1.97 +# 1.98 +#$HTTP["host"] =~ "(^|www\.)slitaz\.org$" { 1.99 +$HTTP["host"] =~ "www\.slitaz\.org$" { 1.100 + server.document-root = "/home/slitaz/website" 1.101 + server.errorlog = "/var/log/lighttpd/slitaz.org-error.log" 1.102 + accesslog.filename = "/var/log/lighttpd/slitaz.org-access.log" 1.103 + include "awstats.conf" 1.104 + 1.105 +### index-file.names = ( "index.html" ) 1.106 + index-file.names += ( "start.html" ) 1.107 + 1.108 + 1.109 +### url.rewrite-once = ( 1.110 +### "^/about" => "/fr/about", 1.111 +### "^/artwork" => "/fr/artwork", 1.112 +### "^/devel" => "/fr/devel", 1.113 +### "^/doc" => "/fr/doc", 1.114 +### "^/get" => "/fr/get", 1.115 +### "^/packages" => "/fr/packages" 1.116 +### ) 1.117 + 1.118 +} 1.119 + 1.120 +# doc.slitaz.org 1.121 +# 1.122 +$HTTP["host"] =~ "doc\.slitaz\.org$" { 1.123 + server.document-root = "/var/www/doc" 1.124 + server.errorlog = "/var/log/lighttpd/doc.slitaz.org-error.log" 1.125 + accesslog.filename = "/var/log/lighttpd/doc.slitaz.org-access.log" 1.126 + index-file.names = ("doku.php") 1.127 + var.dokudir = "" 1.128 + # Rewrites for dokuwiki 1.129 + url.rewrite = ( 1.130 + "^" + var.dokudir + "/lib/.*$" => "$0", 1.131 + "^" + var.dokudir + "/_media/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1&$2", 1.132 + "^" + var.dokudir + "/_media/(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1", 1.133 + "^" + var.dokudir + "/_detail/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/detail.php?media=$1&$2", 1.134 + "^" + var.dokudir + "/_detail/(.*)?$" => var.dokudir + "/lib/exe/detail.php?media=$1", 1.135 + "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3", 1.136 + "^" + var.dokudir + "/_export/([^/]+)/(.*)" => var.dokudir + "/doku.php?do=export_$1&id=$2", 1.137 + "^" + var.dokudir + "/doku.php.*" => "$0", 1.138 + "^" + var.dokudir + "/feed.php.*" => "$0", 1.139 + "^" + var.dokudir + "/(.*)\?(.*)" => var.dokudir + "/doku.php?id=$1&$2", 1.140 + "^" + var.dokudir + "/(.*)" => var.dokudir + "/doku.php?id=$1" 1.141 + ) 1.142 +} 1.143 + 1.144 +# boot.slitaz.org 1.145 +# 1.146 +$HTTP["host"] =~ "boot\.slitaz\.org$" { 1.147 + server.document-root = "/var/www/boot" 1.148 + server.errorlog = "/var/log/lighttpd/boot.slitaz.org-error.log" 1.149 + accesslog.filename = "/var/log/lighttpd/boot.slitaz.org-access.log" 1.150 +} 1.151 + 1.152 +# pkgs.slitaz.org 1.153 +# 1.154 +$HTTP["host"] =~ "pkgs\.slitaz\.org$" { 1.155 + server.document-root = "/var/www/pkgs" 1.156 + server.errorlog = "/var/log/lighttpd/pkgs.slitaz.org-error.log" 1.157 + accesslog.filename = "/var/log/lighttpd/pkgs.slitaz.org-access.log" 1.158 + index-file.names += ( "search.sh" ) 1.159 + cgi.assign = ( 1.160 + ".sh" => "/bin/sh" 1.161 + ) 1.162 +} 1.163 + 1.164 +# hg.slitaz.org (Mercurial repos) 1.165 +# 1.166 +$HTTP["host"] =~ "hg\.slitaz\.org" { 1.167 + cgi.assign = ( 1.168 + ".py" => "/usr/bin/python" 1.169 + ) 1.170 + server.document-root = "/var/www/hg" 1.171 +# url.rewrite-once = ( "(.*)" => "/hgwebdir.py$1" ) 1.172 + index-file.names += ( "hgwebdir.py" ) 1.173 +} 1.174 +
2.1 --- a/mirror-tools/stuff/home/backups/mirror/backup.sh Thu Nov 18 09:56:09 2010 +0100 2.2 +++ b/mirror-tools/stuff/home/backups/mirror/backup.sh Thu Nov 18 10:21:49 2010 +0100 2.3 @@ -7,12 +7,19 @@ 2.4 2.5 backup_data() 2.6 { 2.7 +GZIP=rgzip 2.8 +which $GZIP > /dev/null || GZIP=gzip 2.9 +echo "Sync doc.slitaz.org ..." 2.10 +rsync -aH -e "$SSH" --bwlimit=50 \ 2.11 + $REMOTE_USER@tank.slitaz.org:/home/slitaz/www/doc/data/. /var/www/doc/data/. 2.12 while read file dirs; do 2.13 + echo "Create $file.cpio.gz ..." 2.14 ( cd / ; find $dirs | cpio -o -H newc ) | \ 2.15 - rgzip -9 > $file.cpio.gz 2> /dev/null 2.16 + $GZIP -9 > $file.cpio.gz 2> /dev/null 2.17 done <<EOT 2.18 etc etc home/$BACKUP_USER/.ssh 2.19 www var/www/mirror-info var/www/pizza 2.20 +www2 var/www/boot /var/www/hg /var/www/pkgs /var/www/doc 2.21 packages var/lib/tazpkg/installed 2.22 rrd var/spool/rrd 2.23 crontabs var/spool/cron/crontabs 2.24 @@ -24,11 +31,12 @@ 2.25 # The following should be kept untouched. 2.26 # 2.27 2.28 -SSH="ssh -i /home/$BACKUP_USER/.ssh/id_rsa" 2.29 +SSH="ssh -i /home/$BACKUP_USER/.ssh/id_rsa -o PasswordAuthentication=no" 2.30 2.31 cd $(dirname $0) 2.32 [ $(id -u) == 0 ] || exit 1 2.33 -[ $(hostname) == $(basename $PWD) ] || exit 1 2.34 +[ $(hostname) == $(basename $PWD) -o \ 2.35 + $(hostname) == $(basename $PWD).slitaz.org ] || exit 1 2.36 2.37 rotate() 2.38 { 2.39 @@ -62,12 +70,14 @@ 2.40 done 2.41 fi 2.42 2.43 +echo "Local backup for $(hostname) ..." 2.44 backup_data 2.45 2.46 chown $BACKUP_USER * 2.47 chmod 700 * 2.48 2.49 [ -n "$REMOTE_USER" ] && for i in $(cd .. ; ls); do 2.50 - [ $i == $(hostname) ] && continue 2.51 + [ $i == $(hostname) -o $i.slitaz.org == $(hostname) ] && continue 2.52 + echo "Get backups from $i ..." 2.53 rsync -aH -e "$SSH" --bwlimit=50 $REMOTE_USER@$i.slitaz.org:/home/backups/$i/. ../$i/. 2.54 done
3.1 --- a/mirror-tools/stuff/usr/bin/mkpkgiso Thu Nov 18 09:56:09 2010 +0100 3.2 +++ b/mirror-tools/stuff/usr/bin/mkpkgiso Thu Nov 18 10:21:49 2010 +0100 3.3 @@ -52,7 +52,7 @@ 3.4 # Update hg repos 3.5 if [ "$PKG_VER" == "update-hg" ]; then 3.6 for i in $1/* ; do 3.7 - [ -s $i/.hg/hgrc ] || continue 3.8 + grep -qs '\[paths]' $i/.hg/hgrc || continue 3.9 cd $i 3.10 hg pull 3.11 hg update 3.12 @@ -256,6 +256,9 @@ 3.13 EOF 3.14 fi;; 3.15 --sources) 3.16 + echo -n "Removing previous ISO..." 3.17 + rm -f $OUTPUT 3.18 + status 3.19 cat >>$TEMP_DIR/install.sh<<EOF 3.20 mkdir -p /home/slitaz 3.21 ln -s \$DIR/src /home/slitaz
4.1 --- a/mirror-tools/stuff/var/www/mirror-info/index.php Thu Nov 18 09:56:09 2010 +0100 4.2 +++ b/mirror-tools/stuff/var/www/mirror-info/index.php Thu Nov 18 10:21:49 2010 +0100 4.3 @@ -38,6 +38,7 @@ 4.4 <h4>SliTaz Network</h4> 4.5 <ul> 4.6 <li><a href="http://www.slitaz.org/">Main Website</a></li> 4.7 + <li><a href="http://doc.slitaz.org/">Documentation</a></li> 4.8 <li><a href="http://forum.slitaz.org/">Community Forum</a></li> 4.9 <li><a href="http://community.slitaz.org/">Community Platform</a></li> 4.10 <li><a href="http://labs.slitaz.org/">SliTaz Laboratories</a></li> 4.11 @@ -143,6 +144,8 @@ 4.12 <ul> 4.13 <li><a href="http://mirror.slitaz.org/www/">www.slitaz.org</a> - SliTaz Website. 4.14 (<a href="http://www.slitaz.org/" target="_blank">main</a>)</li> 4.15 + <li><a href="http://mirror.slitaz.org/doc/">doc.slitaz.org</a> - Documentation. 4.16 + (<a href="http://doc.slitaz.org/" target="_blank">main</a>)</li> 4.17 <li><a href="http://mirror.slitaz.org/pkgs/">pkgs.slitaz.org</a> - Packages Web interface. 4.18 (<a href="http://pkgs.slitaz.org/" target="_blank">main</a>)</li> 4.19 <li><a href="http://mirror.slitaz.org/hg/">hg.slitaz.org</a> - Mercurial repositories (read only). 4.20 @@ -156,26 +159,29 @@ 4.21 <h3><a href="http://mirror.slitaz.org/awstats.pl?config=rsync" target="_blank"> 4.22 <img title="Secondary mirrors" src="pics/website/vhosts.png" 4.23 alt="mirrors" /></a>Mirrors</h3> 4.24 - These mirrors are updated using the url: <b>rsync://mirror.slitaz.org/slitaz/</b> 4.25 + Most mirrors are updated using the url: <b>rsync://mirror.slitaz.org/slitaz/</b> 4.26 (<a href="http://mirror.slitaz.org/awstats.pl?config=rsync">stats</a>) 4.27 <ul> 4.28 <li><a href="http://en.utrace.de/?query=mirror.switch.ch"> 4.29 <img title="map" src="pics/website/ch.png" alt="map" /></a> 4.30 <a href="http://mirror.switch.ch/ftp/mirror/slitaz/"> 4.31 http://mirror.switch.ch/ftp/mirror/slitaz/</a> or 4.32 - <a href="ftp://mirror.switch.ch/mirror/slitaz/"> 4.33 - ftp://mirror.switch.ch/mirror/slitaz/</a></li> 4.34 + <a href="ftp://mirror.switch.ch/mirror/slitaz/">ftp</a></li> 4.35 <li><a href="http://en.utrace.de/?query=www.gtlib.gatech.edu"> 4.36 <img title="map" src="pics/website/us.png" alt="map" /></a> 4.37 <a href="http://www.gtlib.gatech.edu/pub/slitaz/"> 4.38 http://www.gtlib.gatech.edu/pub/slitaz/</a> or 4.39 - <a href="ftp://ftp.gtlib.gatech.edu/pub/slitaz/"> 4.40 - ftp://ftp.gtlib.gatech.edu/pub/slitaz/</a></li> 4.41 + <a href="ftp://ftp.gtlib.gatech.edu/pub/slitaz/">ftp</a> or 4.42 + <a href="rsync://www.gtlib.gatech.edu/slitaz/">rsync</a></li> 4.43 <li><a href="http://en.utrace.de/?query=download.tuxfamily.org"> 4.44 <img title="map" src="pics/website/fr.png" alt="map" /></a> 4.45 <a href="http://download.tuxfamily.org/slitaz/"> 4.46 - http://download.tuxfamily.org/slitaz/</a></li> 4.47 + http://download.tuxfamily.org/slitaz/</a> or 4.48 + <a href="ftp://download.tuxfamily.org/slitaz/">ftp</a> or 4.49 + <a href="rsync://download.tuxfamily.org/pub/slitaz/">rsync</a></li> 4.50 <!-- li><a href="http://www.linuxembarque.com/slitaz/mirror/"> 4.51 + <img title="map" src="pics/website/fr.png" alt="map" /></a> 4.52 + <a href="http://www.linuxembarque.com/slitaz/mirror/"> 4.53 http://www.linuxembarque.com/slitaz/mirror/</a></li --> 4.54 <li><a href="http://en.utrace.de/?query=mirror.lupaworld.com"> 4.55 <img title="map" src="pics/website/cn.png" alt="map" /></a> 4.56 @@ -185,12 +191,14 @@ 4.57 <img title="map" src="pics/website/br.png" alt="map" /></a> 4.58 <a href="http://slitaz.c3sl.ufpr.br/"> 4.59 http://slitaz.c3sl.ufpr.br/</a> or 4.60 - <a href="ftp://slitaz.c3sl.ufpr.br/slitaz/"> 4.61 - ftp://slitaz.c3sl.ufpr.br/slitaz/</a></li> 4.62 + <a href="ftp://slitaz.c3sl.ufpr.br/slitaz/">ftp</a> or 4.63 + <a href="rsync://slitaz.c3sl.ufpr.br/slitaz/">rsync</a></li> 4.64 <li><a href="http://en.utrace.de/?query=slitaz.mirror.garr.it"> 4.65 <img title="map" src="pics/website/it.png" alt="map" /></a> 4.66 <a href="http://slitaz.mirror.garr.it/mirrors/slitaz/"> 4.67 - http://slitaz.mirror.garr.it/mirrors/slitaz/</a></li> 4.68 + http://slitaz.mirror.garr.it/mirrors/slitaz/</a> or 4.69 + <a href="ftp://slitaz.mirror.garr.it/mirrors/slitaz/">ftp</a> or 4.70 + <a href="rsync://slitaz.mirror.garr.it/mirrors/slitaz/">rsync</a></li> 4.71 <!-- li><a href="http://mirror.drustvo-dns.si/slitaz/"> 4.72 http://mirror.drustvo-dns.si/slitaz/</a></li --> 4.73 <li><a href="http://en.utrace.de/?query=ftp.pina.si"> 4.74 @@ -200,11 +208,26 @@ 4.75 <li><a href="http://en.utrace.de/?query=distro.ibiblio.org"> 4.76 <img title="map" src="pics/website/us.png" alt="map" /></a> 4.77 <a href="http://distro.ibiblio.org/pub/linux/distributions/slitaz/"> 4.78 - http://distro.ibiblio.org/pub/linux/distributions/slitaz/</a></li> 4.79 + http://distro.ibiblio.org/pub/linux/distributions/slitaz/</a> or 4.80 + <a href="ftp://distro.ibiblio.org/pub/linux/distributions/slitaz/">ftp</a></li> 4.81 <li><a href="http://en.utrace.de/?query=ftp.vim.org"> 4.82 <img title="map" src="pics/website/nl.png" alt="map" /></a> 4.83 <a href="http://ftp.vim.org/ftp/os/Linux/distr/slitaz/"> 4.84 - http://ftp.vim.org/ftp/os/Linux/distr/slitaz/</a></li> 4.85 + http://ftp.vim.org/ftp/os/Linux/distr/slitaz/</a> or 4.86 + <a href="ftp://ftp.vim.org/mirror/os/Linux/distr/slitaz/"> 4.87 + ftp</a></li> 4.88 + <li><a href="http://en.utrace.de/?query=ftp.nedit.org"> 4.89 + <img title="map" src="pics/website/nl.png" alt="map" /></a> 4.90 + <a href="http://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/"> 4.91 + http://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/</a> or 4.92 + <a href="ftp://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/"> 4.93 + ftp</a></li> 4.94 + <li><a href="http://en.utrace.de/?query=ftp.ch.xemacs.org"> 4.95 + <img title="map" src="pics/website/ch.png" alt="map" /></a> 4.96 + <a href="http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/" /> 4.97 + http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/</a> or 4.98 + <a href="ftp://ftp.ch.xemacs.org//pool/2/mirror/slitaz/" /> 4.99 + ftp</a></li> 4.100 </ul> 4.101 4.102 <a name="builds"></a> 4.103 @@ -212,10 +235,12 @@ 4.104 Daily builds</h3> 4.105 4.106 <?php 4.107 -function display_log($file,$anchor) 4.108 +function display_log($file,$anchor,$url) 4.109 { 4.110 echo '<a name="'.$anchor.'"></a>'; 4.111 +echo "<a href=\"$url\">"; 4.112 system("stat -c '<h4>%y %n</h4>' ".$file." | sed -e 's/.000000000//' -e 's|/var/log/\(.*\).log|\\1.iso|'"); 4.113 +echo "</a>"; 4.114 echo "<pre>"; 4.115 system("cat ".$file." | sed -e 's/.\[[0-9][^mG]*.//g' | awk '". 4.116 '{ if (/\[/) { n=index($0,"["); printf("%s%s%s\n",substr($0,1,n-1),'. 4.117 @@ -223,9 +248,8 @@ 4.118 echo "</pre>"; 4.119 } 4.120 4.121 -display_log("/var/log/packages-stable.log", "buildstable" ); 4.122 -display_log("/var/log/packages-cooking.log","buildcooking"); 4.123 -display_log("/var/log/sources-cooking.log", "buildsources"); 4.124 +display_log("/var/log/packages-stable.log", "buildstable", "/iso/stable/packages-3.0.iso"); 4.125 +display_log("/var/log/packages-cooking.log","buildcooking","/iso/cooking/packages-cooking.iso"); 4.126 ?> 4.127 <!-- End of content with round corner --> 4.128 </div>