slitaz-modular rev 36
Updated mkiso.sh script and local-mirror script. Removed variables in lighttpd configs files. Fixed seding local-mirror.conf file in mkiso.sh. Made two lighttpd configs. One for local tank and one for local mirror. Added support for tank-only or mirror-only option into local-mirror.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sat Mar 12 00:13:08 2011 +0000 (2011-03-12) |
parents | 6b712a8c338c |
children | 34f80bdc1ea9 |
files | initramfs/etc/lighttpd/vhosts-local-mirror.conf initramfs/etc/lighttpd/vhosts-local-tank.conf initramfs/etc/lighttpd/vhosts-local.conf initramfs/etc/local-mirror.conf initramfs/usr/bin/local-mirror mkiso.sh |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/initramfs/etc/lighttpd/vhosts-local-mirror.conf Sat Mar 12 00:13:08 2011 +0000 1.3 @@ -0,0 +1,56 @@ 1.4 + 1.5 +# mirror.slitaz.org (Server canonical hostname) 1.6 +# 1.7 +$HTTP["host"] =~ "^mirror([0-9]*)\.slitaz\.org$" { 1.8 + server.document-root = "/home/slitaz/www/slitaz/mirror" 1.9 + server.errorlog = "/var/log/lighttpd/mirror.slitaz.org-error.log" 1.10 + accesslog.filename = "/var/log/lighttpd/mirror.slitaz.org-access.log" 1.11 + 1.12 + include "awstats.conf" 1.13 + 1.14 + alias.url += ( "/info" => "/home/slitaz/www/mirror-info/" ) 1.15 + 1.16 + alias.url += ( "/pizza" => "/home/slitaz/www/pizza/" ) 1.17 + 1.18 + alias.url += ( "/doc" => "/home/slitaz/www/doc/" ) 1.19 + var.dokudir = "/doc" 1.20 + # Rewrites for dokuwiki 1.21 + url.rewrite = ( 1.22 + "^" + var.dokudir + "/lib/.*$" => "$0", 1.23 + "^" + var.dokudir + "/_media/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1&$2", 1.24 + "^" + var.dokudir + "/_media/(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1", 1.25 + "^" + var.dokudir + "/_detail/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/detail.php?media=$1&$2", 1.26 + "^" + var.dokudir + "/_detail/(.*)?$" => var.dokudir + "/lib/exe/detail.php?media=$1", 1.27 + "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3", 1.28 + "^" + var.dokudir + "/_export/([^/]+)/(.*)" => var.dokudir + "/doku.php?do=export_$1&id=$2", 1.29 + "^" + var.dokudir + "/doku.php.*" => "$0", 1.30 + "^" + var.dokudir + "/feed.php.*" => "$0", 1.31 + "^" + var.dokudir + "/(.*)\?(.*)" => var.dokudir + "/doku.php?id=$1&$2", 1.32 + "^" + var.dokudir + "/(.*)" => var.dokudir + "/doku.php?id=$1" 1.33 + ) 1.34 + 1.35 + alias.url += ( "/webboot" => "/home/slitaz/www/boot/" ) 1.36 + 1.37 + alias.url += ( "/pkgs" => "/home/slitaz/www/pkgs/" ) 1.38 + index-file.names += ( "search.cgi" ) 1.39 + cgi.assign += ( 1.40 + ".cgi" => "/bin/sh" 1.41 + ) 1.42 + 1.43 + alias.url += ( "/hg" => "/home/slitaz/www/hg/" ) 1.44 +### url.rewrite-once = ( "/hg(.*)" => "/hg/hgwebdir.py$1" ) 1.45 + index-file.names += ( "hgwebdir.py" ) 1.46 + cgi.assign += ( 1.47 + ".py" => "/usr/bin/python" 1.48 + ) 1.49 + 1.50 + alias.url += ( "/www" => "/home/slitaz/www/website" ) 1.51 + 1.52 +# alias.url += ( "/tiny" => "/var/www/pizza/tiny/demos/192.168.0.6/var/www" ) 1.53 +# index-file.names += ( "index.sh" ) 1.54 + 1.55 + index-file.names += ( "index.html" ) 1.56 + index-file.names += ( "index.php" ) 1.57 + # Last but not least... 1.58 + index-file.names += ( "/dir-generator.php" ) 1.59 +} 1.60 \ No newline at end of file
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/initramfs/etc/lighttpd/vhosts-local-tank.conf Sat Mar 12 00:13:08 2011 +0000 2.3 @@ -0,0 +1,147 @@ 2.4 +# /etc/lighttpd/vhosts.conf : Virtual hosts configuration file. 2.5 +# 2.6 + 2.7 +# Nice url's for Drupal 2.8 +# 2.9 +#url.rewrite-final = ( 2.10 +# "^/system/test/(.*)$" => "/index.php?q=system/test/$1", 2.11 +# "^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2", 2.12 +# "^/([^.?]*)$" => "/index.php?q=$1", 2.13 +# "^/rss.xml" => "/index.php?q=rss.xml" 2.14 +# ) 2.15 + 2.16 +# tank.slitaz.org (Server canonical hostname) 2.17 +# 2.18 +$HTTP["host"] =~ "tank\.slitaz\.org$" { 2.19 + server.document-root = "/home/slitaz/www/tank" 2.20 + server.errorlog = "/var/log/lighttpd/tank.slitaz.org-error.log" 2.21 + accesslog.filename = "/var/log/lighttpd/tank.slitaz.org-access.log" 2.22 + include "awstats.conf" 2.23 + index-file.names += ( "index.php" ) 2.24 +} 2.25 + 2.26 +# slitaz.org 2.27 +# 2.28 +$HTTP["host"] =~ "(^|www\.)slitaz\.org$" { 2.29 + server.document-root = "/home/slitaz/www/website" 2.30 + server.errorlog = "/var/log/lighttpd/slitaz.org-error.log" 2.31 + accesslog.filename = "/var/log/lighttpd/slitaz.org-access.log" 2.32 + 2.33 + include "awstats.conf" 2.34 + index-file.names += ( "index.php" ) 2.35 + index-file.names += ( "index.html" ) 2.36 + 2.37 + url.rewrite-once = ( 2.38 + "^/about" => "/fr/about", 2.39 + "^/artwork" => "/fr/artwork", 2.40 + "^/devel" => "/fr/devel", 2.41 + "^/doc" => "/fr/doc", 2.42 + "^/get" => "/fr/get", 2.43 + "^/packages" => "/fr/packages" 2.44 + ) 2.45 + 2.46 +} 2.47 + 2.48 +# pro.slitaz.org 2.49 +# 2.50 +$HTTP["host"] =~ "pro\.slitaz\.org$" { 2.51 + server.document-root = "/home/slitaz/www/pro" 2.52 + server.errorlog = "/var/log/lighttpd/pro.slitaz.org-error.log" 2.53 + accesslog.filename = "/var/log/lighttpd/pro.slitaz.org-access.log" 2.54 + url.rewrite-final = ( 2.55 + "^/system/test/(.*)$" => "/index.php?q=system/test/$1", 2.56 + "^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2", 2.57 + "^/([^.?]*)$" => "/index.php?q=$1", 2.58 + "^/rss.xml" => "/index.php?q=rss.xml" 2.59 + ) 2.60 +} 2.61 + 2.62 +# people.slitaz.org 2.63 +# 2.64 +$HTTP["host"] =~ "people\.slitaz\.org$" { 2.65 + userdir.path = "Public" 2.66 + userdir.exclude-user = ("root") 2.67 + server.document-root = "/home/slitaz/www/people" 2.68 + server.errorlog = "/var/log/lighttpd/people.slitaz.org-error.log" 2.69 + accesslog.filename = "/var/log/lighttpd/people.slitaz.org-access.log" 2.70 +} 2.71 + 2.72 +# boot.slitaz.org 2.73 +# 2.74 +$HTTP["host"] =~ "boot\.slitaz\.org$" { 2.75 + server.document-root = "/home/slitaz/www/boot" 2.76 + server.errorlog = "/var/log/lighttpd/boot.slitaz.org-error.log" 2.77 + accesslog.filename = "/var/log/lighttpd/boot.slitaz.org-access.log" 2.78 +} 2.79 + 2.80 +# pkgs.slitaz.org 2.81 +# 2.82 +$HTTP["host"] =~ "pkgs\.slitaz\.org$" { 2.83 + server.document-root = "/home/slitaz/www/pkgs" 2.84 + server.errorlog = "/var/log/lighttpd/pkgs.slitaz.org-error.log" 2.85 + accesslog.filename = "/var/log/lighttpd/pkgs.slitaz.org-access.log" 2.86 + cgi.assign = ( 2.87 + ".cgi" => "/bin/sh" 2.88 + ) 2.89 +} 2.90 + 2.91 +# bb.slitaz.org (Build Bot) 2.92 +# 2.93 +$HTTP["host"] =~ "bb\.slitaz\.org$" { 2.94 + server.document-root = "/home/slitaz/www/bb" 2.95 + server.errorlog = "/var/log/lighttpd/bb.slitaz.org-error.log" 2.96 + accesslog.filename = "/var/log/lighttpd/bb.slitaz.org-access.log" 2.97 +} 2.98 + 2.99 +# hg.slitaz.org (Mercurial repos) 2.100 +# 2.101 +$HTTP["host"] =~ "hg\.slitaz\.org" { 2.102 + cgi.assign = ( 2.103 + ".cgi" => "/usr/bin/python" 2.104 + ) 2.105 + server.document-root = "/home/slitaz/www/hg" 2.106 + url.rewrite-once = ( "(.*)" => "/hgwebdir.cgi$1" ) 2.107 +} 2.108 + 2.109 +# repos.slitaz.org (Mercurial repos with auth and write access) 2.110 +# 2.111 +$HTTP["host"] =~ "repos\.slitaz\.org" { 2.112 + cgi.assign = ( 2.113 + ".cgi" => "/usr/bin/python" 2.114 + ) 2.115 + server.document-root = "/home/slitaz/www/hg" 2.116 + url.rewrite-once = ( "(.*)" => "/hgwebdir.cgi$1" ) 2.117 + auth.backend = "plain" 2.118 + auth.backend.plain.userfile = "/etc/lighttpd/plain.passwd" 2.119 + auth.require = ( "/" => 2.120 + ( 2.121 + "method" => "basic", 2.122 + "realm" => "SliTaz Mercurial repositories protected area", 2.123 + "require" => "valid-user" 2.124 + ) 2.125 + ) 2.126 + 2.127 +} 2.128 + 2.129 +# doc.slitaz.org 2.130 +# 2.131 +$HTTP["host"] =~ "doc\.slitaz\.org" { 2.132 + server.document-root = "/home/slitaz/www/doc" 2.133 + index-file.names = ("doku.php") 2.134 + var.dokudir = "" 2.135 + # Rewrites for dokuwiki 2.136 + url.rewrite = ( 2.137 + "^" + var.dokudir + "/lib/.*$" => "$0", 2.138 + "^" + var.dokudir + "/_media/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1&$2", 2.139 + "^" + var.dokudir + "/_media/(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1", 2.140 + "^" + var.dokudir + "/_detail/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/detail.php?media=$1&$2", 2.141 + "^" + var.dokudir + "/_detail/(.*)?$" => var.dokudir + "/lib/exe/detail.php?media=$1", 2.142 + "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3", 2.143 + "^" + var.dokudir + "/_export/([^/]+)/(.*)" => var.dokudir + "/doku.php?do=export_$1&id=$2", 2.144 + "^" + var.dokudir + "/doku.php.*" => "$0", 2.145 + "^" + var.dokudir + "/feed.php.*" => "$0", 2.146 + "^" + var.dokudir + "/(.*)\?(.*)" => var.dokudir + "/doku.php?id=$1&$2", 2.147 + "^" + var.dokudir + "/(.*)" => var.dokudir + "/doku.php?id=$1" 2.148 + ) 2.149 +} 2.150 +
3.1 --- a/initramfs/etc/lighttpd/vhosts-local.conf Tue Mar 08 15:48:30 2011 +0000 3.2 +++ b/initramfs/etc/lighttpd/vhosts-local.conf Sat Mar 12 00:13:08 2011 +0000 3.3 @@ -1,224 +1,3 @@ 3.4 -# /etc/lighttpd/vhosts.conf : Virtual hosts configuration file. 3.5 -# 3.6 3.7 -# Nice url's for Drupal 3.8 -# 3.9 -#url.rewrite-final = ( 3.10 -# "^/system/test/(.*)$" => "/index.php?q=system/test/$1", 3.11 -# "^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2", 3.12 -# "^/([^.?]*)$" => "/index.php?q=$1", 3.13 -# "^/rss.xml" => "/index.php?q=rss.xml" 3.14 -# ) 3.15 - 3.16 -include "common.conf" 3.17 - 3.18 -# tank.slitaz.org (Server canonical hostname) 3.19 -# 3.20 -$HTTP["host"] =~ "tank\.slitaz\.org$" { 3.21 - server.name = "tank" 3.22 - server.document-root = basedir + server.name 3.23 - server.errorlog = logdir + "localhost-tank-error.log" 3.24 - accesslog.filename = logdir + "localhost-tank-access.log" 3.25 - include "awstats.conf" 3.26 - index-file.names += ( "index.php" ) 3.27 -} 3.28 - 3.29 -# slitaz.org 3.30 -# 3.31 -$HTTP["host"] =~ "(^|www\.)slitaz\.org$" { 3.32 - server.name = "website" 3.33 - server.document-root = basedir + server.name 3.34 - server.errorlog = logdir + "slitaz.org-error.log" 3.35 - accesslog.filename = logdir + "slitaz.org-access.log" 3.36 - 3.37 - include "awstats.conf" 3.38 - index-file.names += ( "index.php" ) 3.39 - index-file.names += ( "index.html" ) 3.40 - 3.41 - url.rewrite-once = ( 3.42 - "^/about" => "/fr/about", 3.43 - "^/artwork" => "/fr/artwork", 3.44 - "^/devel" => "/fr/devel", 3.45 - "^/doc" => "/fr/doc", 3.46 - "^/get" => "/fr/get", 3.47 - "^/packages" => "/fr/packages" 3.48 - ) 3.49 - 3.50 -} 3.51 - 3.52 -# pro.slitaz.org 3.53 -# 3.54 -$HTTP["host"] =~ "pro\.slitaz\.org$" { 3.55 - server.name = "pro" 3.56 - server.document-root = basedir + server.name 3.57 - server.errorlog = logdir + "pro.slitaz.org-error.log" 3.58 - accesslog.filename = logdir + "pro.slitaz.org-access.log" 3.59 - url.rewrite-final = ( 3.60 - "^/system/test/(.*)$" => "/index.php?q=system/test/$1", 3.61 - "^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2", 3.62 - "^/([^.?]*)$" => "/index.php?q=$1", 3.63 - "^/rss.xml" => "/index.php?q=rss.xml" 3.64 - ) 3.65 -} 3.66 - 3.67 -# people.slitaz.org 3.68 -# 3.69 -$HTTP["host"] =~ "people\.slitaz\.org$" { 3.70 - server.name = "people" 3.71 - userdir.path = "Public" 3.72 - userdir.exclude-user = ("root") 3.73 - server.document-root = basedir + server.name 3.74 - server.errorlog = logdir + "people.slitaz.org-error.log" 3.75 - accesslog.filename = logdir + "people.slitaz.org-access.log" 3.76 -} 3.77 - 3.78 -# pizza.slitaz.org 3.79 -# 3.80 -$HTTP["host"] =~ "pizza\.slitaz\.org$" { 3.81 - server.name = "pizza" 3.82 - server.document-root = basedir + server.name 3.83 - server.errorlog = logdir + "pizza.slitaz.org-error.log" 3.84 - accesslog.filename = logdir + "pizza.slitaz.org-access.log" 3.85 -} 3.86 - 3.87 -# boot.slitaz.org 3.88 -# 3.89 -$HTTP["host"] =~ "boot\.slitaz\.org$" { 3.90 - server.name = "boot" 3.91 - server.document-root = basedir + server.name 3.92 - server.errorlog = logdir + "boot.slitaz.org-error.log" 3.93 - accesslog.filename = logdir + "boot.slitaz.org-access.log" 3.94 -} 3.95 - 3.96 -# pkgs.slitaz.org 3.97 -# 3.98 -$HTTP["host"] =~ "pkgs\.slitaz\.org$" { 3.99 - server.name = "pkgs" 3.100 - server.document-root = basedir + server.name 3.101 - server.errorlog = logdir + "pkgs.slitaz.org-error.log" 3.102 - accesslog.filename = logdir + "pkgs.slitaz.org-access.log" 3.103 - cgi.assign = ( 3.104 - ".cgi" => "/bin/sh" 3.105 - ) 3.106 -} 3.107 - 3.108 -# bb.slitaz.org (Build Bot) 3.109 -# 3.110 -$HTTP["host"] =~ "bb\.slitaz\.org$" { 3.111 - server.name = "bb" 3.112 - server.document-root = basedir + server.name 3.113 - server.errorlog = logdir + "bb.slitaz.org-error.log" 3.114 - accesslog.filename = logdir + "bb.slitaz.org-access.log" 3.115 -} 3.116 - 3.117 -# hg.slitaz.org (Mercurial repos) 3.118 -# 3.119 -$HTTP["host"] =~ "hg\.slitaz\.org$" { 3.120 - cgi.assign = ( 3.121 - ".cgi" => "/usr/bin/python" 3.122 - ) 3.123 - server.name = "hg" 3.124 - server.document-root = basedir + server.name 3.125 - url.rewrite-once = ( "(.*)" => "/hgwebdir.cgi$1" ) 3.126 -} 3.127 - 3.128 -# repos.slitaz.org (Mercurial repos with auth and write access) 3.129 -# 3.130 -$HTTP["host"] =~ "repos\.slitaz\.org" { 3.131 - cgi.assign = ( 3.132 - ".cgi" => "/usr/bin/python" 3.133 - ) 3.134 - server.name = "hg" 3.135 - server.document-root = basedir + server.name 3.136 - url.rewrite-once = ( "(.*)" => "/hgwebdir.cgi$1" ) 3.137 - auth.backend = "plain" 3.138 - auth.backend.plain.userfile = "/etc/lighttpd/plain.passwd" 3.139 - auth.require = ( "/" => 3.140 - ( 3.141 - "method" => "basic", 3.142 - "realm" => "SliTaz Mercurial repositories protected area", 3.143 - "require" => "valid-user" 3.144 - ) 3.145 - ) 3.146 - 3.147 -} 3.148 - 3.149 -# doc.slitaz.org 3.150 -# 3.151 -$HTTP["host"] =~ "doc\.slitaz\.org" { 3.152 - server.name = "doc" 3.153 - server.document-root = basedir + server.name 3.154 - index-file.names = ("doku.php") 3.155 - var.dokudir = "" 3.156 - # Rewrites for dokuwiki 3.157 - url.rewrite = ( 3.158 - "^" + var.dokudir + "/lib/.*$" => "$0", 3.159 - "^" + var.dokudir + "/_media/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1&$2", 3.160 - "^" + var.dokudir + "/_media/(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1", 3.161 - "^" + var.dokudir + "/_detail/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/detail.php?media=$1&$2", 3.162 - "^" + var.dokudir + "/_detail/(.*)?$" => var.dokudir + "/lib/exe/detail.php?media=$1", 3.163 - "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3", 3.164 - "^" + var.dokudir + "/_export/([^/]+)/(.*)" => var.dokudir + "/doku.php?do=export_$1&id=$2", 3.165 - "^" + var.dokudir + "/doku.php.*" => "$0", 3.166 - "^" + var.dokudir + "/feed.php.*" => "$0", 3.167 - "^" + var.dokudir + "/(.*)\?(.*)" => var.dokudir + "/doku.php?id=$1&$2", 3.168 - "^" + var.dokudir + "/(.*)" => var.dokudir + "/doku.php?id=$1" 3.169 - ) 3.170 -} 3.171 - 3.172 - 3.173 -# mirror.slitaz.org (Server canonical hostname) 3.174 -# 3.175 -$HTTP["host"] =~ "^mirror([0-9]*)\.slitaz\.org$" { 3.176 - server.document-root = basedir + "/slitaz/mirror" 3.177 - server.errorlog = logdir + "mirror.slitaz.org-error.log" 3.178 - accesslog.filename = logdir + "mirror.slitaz.org-access.log" 3.179 - 3.180 - include "awstats.conf" 3.181 - 3.182 - alias.url += ( "/info" => basedir + "mirror-info/" ) 3.183 - 3.184 - alias.url += ( "/pizza" => basedir + "pizza/" ) 3.185 - 3.186 - alias.url += ( "/doc" => basedir + "doc/" ) 3.187 - var.dokudir = "/doc" 3.188 - # Rewrites for dokuwiki 3.189 - url.rewrite = ( 3.190 - "^" + var.dokudir + "/lib/.*$" => "$0", 3.191 - "^" + var.dokudir + "/_media/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1&$2", 3.192 - "^" + var.dokudir + "/_media/(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1", 3.193 - "^" + var.dokudir + "/_detail/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/detail.php?media=$1&$2", 3.194 - "^" + var.dokudir + "/_detail/(.*)?$" => var.dokudir + "/lib/exe/detail.php?media=$1", 3.195 - "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3", 3.196 - "^" + var.dokudir + "/_export/([^/]+)/(.*)" => var.dokudir + "/doku.php?do=export_$1&id=$2", 3.197 - "^" + var.dokudir + "/doku.php.*" => "$0", 3.198 - "^" + var.dokudir + "/feed.php.*" => "$0", 3.199 - "^" + var.dokudir + "/(.*)\?(.*)" => var.dokudir + "/doku.php?id=$1&$2", 3.200 - "^" + var.dokudir + "/(.*)" => var.dokudir + "/doku.php?id=$1" 3.201 - ) 3.202 - 3.203 - alias.url += ( "/webboot" => basedir + "boot/" ) 3.204 - 3.205 - alias.url += ( "/pkgs" => basedir + "pkgs/" ) 3.206 - index-file.names += ( "search.cgi" ) 3.207 - cgi.assign += ( 3.208 - ".cgi" => "/bin/sh" 3.209 - ) 3.210 - 3.211 - alias.url += ( "/hg" => basedir + "hg/" ) 3.212 -### url.rewrite-once = ( "/hg(.*)" => "/hg/hgwebdir.py$1" ) 3.213 - index-file.names += ( "hgwebdir.py" ) 3.214 - cgi.assign += ( 3.215 - ".py" => "/usr/bin/python" 3.216 - ) 3.217 - 3.218 - alias.url += ( "/www" => basedir + "website" ) 3.219 - 3.220 -# alias.url += ( "/tiny" => "/var/www/pizza/tiny/demos/192.168.0.6/var/www" ) 3.221 -# index-file.names += ( "index.sh" ) 3.222 - 3.223 - index-file.names += ( "index.html" ) 3.224 - index-file.names += ( "index.php" ) 3.225 - # Last but not least... 3.226 - index-file.names += ( "/dir-generator.php" ) 3.227 -} 3.228 \ No newline at end of file 3.229 +include "vhosts-local-tank.conf" 3.230 +include "vhosts-local-mirror.conf" 3.231 \ No newline at end of file
4.1 --- a/initramfs/etc/local-mirror.conf Tue Mar 08 15:48:30 2011 +0000 4.2 +++ b/initramfs/etc/local-mirror.conf Sat Mar 12 00:13:08 2011 +0000 4.3 @@ -9,9 +9,13 @@ 4.4 END_IP="1" 4.5 ADDRESS="www.slitaz.org pizza.slitaz.org boot.slitaz.org mirror.slitaz.org tank.slitaz.org doc.slitaz.org pkgs.slitaz.org hg.slitaz.org bb.slitaz.org people.slitaz.org" 4.6 VHOST_FILE="/etc/lighttpd/vhosts-local.conf" 4.7 +VHOST_MIRROR_FILE="/etc/lighttpd/vhosts-local-mirror.conf" 4.8 +VHOST_TANK_FILE="/etc/lighttpd/vhosts-local-tank.conf" 4.9 REPOS_DIR="/home/slitaz/repos" 4.10 +REPOS_WEB_DIR="/home/slitaz/repos-web" 4.11 WWW_DIR="/home/slitaz/www" 4.12 STABLE="/home/slitaz/stable" 4.13 COOKING="/home/slitaz/cooking" 4.14 +TANK="" 4.15 #PKGDIR 4.16 #SRCDIR 4.17 \ No newline at end of file
5.1 --- a/initramfs/usr/bin/local-mirror Tue Mar 08 15:48:30 2011 +0000 5.2 +++ b/initramfs/usr/bin/local-mirror Sat Mar 12 00:13:08 2011 +0000 5.3 @@ -11,10 +11,22 @@ 5.4 5.5 usage() { 5.6 echo "$0 $VERSION" 5.7 - echo "$0 [on|off]" 5.8 + echo "$0 [on|off|tank-only|mirror-only]" 5.9 exit 1 5.10 } 5.11 5.12 +if [ "$COMMAND" = "tank-only" ]; then 5.13 + WWW="${WWW/mirror/}" 5.14 + ADDRESS="${ADDRESS/mirror.slitaz.org/}" 5.15 + VHOST_FILE="$VHOST_TANK_FILE" 5.16 +fi 5.17 + 5.18 +if [ "$COMMAND" = "mirror-only" ]; then 5.19 + WWW="${WWW/tank/}" 5.20 + ADDRESS="mirror.slitaz.org" 5.21 + VHOST_FILE="$VHOST_MIRROR_FILE" 5.22 +fi 5.23 + 5.24 [ -d $REPOS_DIR ] || continue 5.25 [ -d $WWW_DIR ] || mkdir -p $WWW_DIR 5.26 [ -L /var/www/vhosts ] || ln -sf $WWW_DIR /var/www/vhosts 5.27 @@ -72,7 +84,7 @@ 5.28 if [ -d $SRCDIR ]; then 5.29 for i in $(ls $SRCDIR); do 5.30 [ -d $WWW_DIR/slitaz/mirror/sources/packages/${i:0:1} ] || mkdir -p $WWW_DIR/slitaz/mirror/sources/packages/${i:0:1} 5.31 - ln -sf $SRCDIR/$i $WWW_DIR/slitaz/mirror/sources/packages/${i:0:1}/$i 5.32 + [ -f $WWW_DIR/slitaz/mirror/sources/packages/${i:0:1}/$i ] || ln -s $SRCDIR/$i $WWW_DIR/slitaz/mirror/sources/packages/${i:0:1}/$i 5.33 done 5.34 fi 5.35 ;; 5.36 @@ -103,15 +115,24 @@ 5.37 repos() { 5.38 for repo in $REPOS; do 5.39 [ -d $REPOS_DIR/$repo ] || continue 5.40 + if [ -d $REPOS_DIR/$repo/.hg ]; then 5.41 + mkdir -p $REPOS_WEB_DIR/$repo 5.42 + [ -d $REPOS_WEB_DIR/$repo/.hg ] || ln -s $REPOS_DIR/$repo/.hg $REPOS_WEB_DIR/$repo/.hg 5.43 + if [ ! $(grep -l "$REPOS_WEB_DIR" /etc/mercurial/hgweb.config) ]; then 5.44 + [ -f /etc/mercurial/hgweb.config ] && sed -i "s|$REPOS_DIR|$REPOS_WEB_DIR|g" /etc/mercurial/hgweb.config 5.45 + fi 5.46 + fi 5.47 if [ ! -f $REPOS_DIR/$repo/.hg/hgrc-web ]; then 5.48 - [ -d $REPOS_DIR/$repo/.hg ] && touch $REPOS_DIR/$repo/.hg/hgrc-web 5.49 - [ -d $REPOS_DIR/$repo/.hg ] && echo "[web]" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.50 - [ -d $REPOS_DIR/$repo/.hg ] && echo "style = slitaz" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.51 - [ -d $REPOS_DIR/$repo/.hg ] && echo "staticurl = http://hg.slitaz.org/static/" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.52 - [ -d $REPOS_DIR/$repo/.hg ] && echo "push_ssl = false" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.53 - [ -d $REPOS_DIR/$repo/.hg ] && echo "allow_push = *" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.54 - [ ! -f $REPOS_DIR/$repo/.hg/hgrc-pull ] && mv $REPOS_DIR/$repo/.hg/hgrc $REPOS_DIR/$repo/.hg/hgrc-pull 5.55 - [ ! -f $REPOS_DIR/$repo/.hg/hgrc ] && cp -a $REPOS_DIR/$repo/.hg/hgrc-web $REPOS_DIR/$repo/.hg/hgrc 5.56 + touch $REPOS_DIR/$repo/.hg/hgrc-web 5.57 + echo "[paths]" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.58 + echo "path = http://hg.slitaz.org/$repo/" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.59 + echo "[web]" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.60 + #[ -d $REPOS_DIR/$repo/.hg ] && echo "style = slitaz" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.61 + echo "staticurl = http://hg.slitaz.org/static/" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.62 + echo "push_ssl = false" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.63 + echo "allow_push = *" >> $REPOS_DIR/$repo/.hg/hgrc-web 5.64 + #[ ! -f $REPOS_DIR/$repo/.hg/hgrc-pull ] && mv $REPOS_DIR/$repo/.hg/hgrc $REPOS_DIR/$repo/.hg/hgrc-pull 5.65 + cp -a $REPOS_DIR/$repo/.hg/hgrc-web $REPOS_DIR/$repo/.hg/hgrc 5.66 fi 5.67 5.68 if [ ! $(grep -l 'name = ' $REPOS_DIR/$repo/.hg/hgrc ) ]; then 5.69 @@ -169,23 +190,31 @@ 5.70 } 5.71 5.72 case "$COMMAND" in 5.73 - on) 5.74 + on|tank-only|mirror-only) 5.75 + [ -d $WWW_DIR/mirror-info ] && WWW="${WWW/mirror /}" 5.76 for c in $WWW; do 5.77 if [ ! -d $WWW_DIR/$c ]; then 5.78 www $c 5.79 + [ "$c" = "hg" ] && repos 5.80 fi 5.81 - [ "$c" = "hg" ] && repos 5.82 done 5.83 + echo "127.0.0.1 localhost $(cat /etc/hostname)" > /etc/hosts 5.84 for hostname in $ADDRESS; do 5.85 END_IP=$(($END_IP+1)) 5.86 for i in $END_IP; do 5.87 - if [ ! $(grep -l "${BASE_IP}.$i $hostname" /etc/hosts) ]; then 5.88 + #if [ ! $(grep -l "${BASE_IP}.$i $hostname" /etc/hosts) ]; then 5.89 echo "${BASE_IP}.$i $hostname" >> /etc/hosts 5.90 - fi 5.91 + #fi 5.92 done 5.93 done 5.94 - 5.95 - [ -f $VHOST_FILE ] && ln -sf $VHOST_FILE /etc/lighttpd/vhosts.conf 5.96 + if [ "$COMMAND" = "tank-only" ]; then 5.97 + [ -f $VHOST_TANK_FILE ] && ln -sf $VHOST_TANK_FILE /etc/lighttpd/vhosts.conf 5.98 + elif [ "$COMMAND" = "mirror-only" ]; then 5.99 + [ -f $VHOST_MIRROR_FILE ] && ln -sf $VHOST_MIRROR_FILE /etc/lighttpd/vhosts.conf 5.100 + 5.101 + else 5.102 + [ -f $VHOST_FILE ] && ln -sf $VHOST_FILE /etc/lighttpd/vhosts.conf 5.103 + fi 5.104 chown -R www.www /home/slitaz/www 5.105 [ -f /etc/init.d/lighttpd ] && /etc/init.d/lighttpd start 5.106 ;;
6.1 --- a/mkiso.sh Tue Mar 08 15:48:30 2011 +0000 6.2 +++ b/mkiso.sh Sat Mar 12 00:13:08 2011 +0000 6.3 @@ -157,11 +157,11 @@ 6.4 fi 6.5 6.6 if [ -f $INITRAMFS/etc/local-mirror.conf ]; then 6.7 - sed -i "s|^#PKGDIR|PKGDIR=$PKGISO_DIR|g" $INITRAMFS/etc/local-mirror.conf 6.8 - sed -i "s|^#SRCDIR|SRCDIR=$SRCISO_DIR|g" $INITRAMFS/etc/local-mirror.conf 6.9 + sed -i "s|^#PKGDIR|PKGDIR=/packages|g" $INITRAMFS/etc/local-mirror.conf 6.10 + sed -i "s|^#SRCDIR|SRCDIR=/src|g" $INITRAMFS/etc/local-mirror.conf 6.11 fi 6.12 6.13 - sed -i "s|^#MIRROR|MIRROR="$MIRROR_DIR"|g" $INITRAMFS/liblinuxlive 6.14 + sed -i "s|^#MIRROR|MIRROR=$MIRROR_DIR|g" $INITRAMFS/liblinuxlive 6.15 } 6.16 6.17 copy_hg() {