# HG changeset patch # User Antoine Bodin # Date 1297348586 -3600 # Node ID d307745794702d89f8f51b3dd3b58ebf4cf8ed64 # Parent a618127f3ce2696130e935df8e15093aaeeff4d2 Add functionnality: webserver diff -r a618127f3ce2 -r d30774579470 tazwok --- a/tazwok Wed Feb 09 23:19:01 2011 +0100 +++ b/tazwok Thu Feb 10 15:36:26 2011 +0100 @@ -92,7 +92,18 @@ else LOCAL_REPOSITORY=$SLITAZ_DIR/$SLITAZ_VERSION fi - + + if ! [ "$save_dir" ]; then + if [ -f $LOCAL_REPOSITORY/tazwok.conf ] || [ -f $LOCAL_REPOSITORY/slitaz.conf ]; then + save_dir=$LOCAL_REPOSITORY + [ -f $LOCAL_REPOSITORY/slitaz.conf ] && source $LOCAL_REPOSITORY/slitaz.conf + cd $save_dir + get_tazwok_config + unset save_dir + return + fi + fi + # The path to the most important files/dir used by Tazwok. PACKAGES_REPOSITORY=$LOCAL_REPOSITORY/packages WOK=$LOCAL_REPOSITORY/wok @@ -116,7 +127,7 @@ check_dir $INCOMING_REPOSITORY check_dir $LOCAL_REPOSITORY/log fi - + # Some files are needed by tazwok in PACKAGES_REPOSITORY. Create # them if they are missing. for file in broken blocked commit incoming cooklist; do @@ -2750,6 +2761,91 @@ exit 1 fi ;; + webserver) + check_root + get_tazwok_config + if [ "$ARG" = on ]; then + if [ "$WEBSERVER" ] && [ -f "$WEBSERVER/repositories.list" ] && \ + grep -q ^"${undigest:-$SLITAZ_VERSION}"$ $WEBSERVER/repositories.list; then + echo "Webserver is already enabled at $WEBSERVER for ${undigest:-$SLITAZ_VERSION}." >&2 + exit 1 + fi + if ! [ -f $LOCAL_REPOSITORY/tazchroot.conf ]; then + tazwok configure-chroot ${undigest:+--undigest=$undigest} --SLITAZ_VERSION=$SLITAZ_VERSION --SLITAZ_DIR=$SLITAZ_DIR + fi + for pkg in php lighttpd; do + [ -d $INSTALLED/$pkg ] || missing="$missing $pkg" + done + if [ "$missing" ]; then + echo "You need to install those packages to start webserver: $missing." >&2 + exit 1 + fi + if [ ! -f "$LOCAL_REPOSITORY/tazwok.conf" ]; then + echo "Copying /etc/slitaz/tazwok.conf to $LOCAL_REPOSITORY/tazwok.conf: webserver is configured repository-by-repository." + cp /etc/slitaz/tazwok.conf $LOCAL_REPOSITORY + fi + if ! [ "$WEBSERVER" ]; then + echo -n "Where to store php pages (default: /var/www/vhosts/bb)? " + read WEBSERVER + [ "$WEBSERVER" ] || WEBSERVER="/var/www/vhosts/bb" + fi + if [ -f "$WEBSERVER/repositories.list" ] && \ + grep -q ^"${undigest:-$SLITAZ_VERSION}"$ $WEBSERVER/repositories.list; then + echo "Webserver is already enabled at $WEBSERVER for ${undigest:-$SLITAZ_VERSION}." >&2 + exit 1 + fi + mkdir -p $WEBSERVER + echo "${undigest:-$SLITAZ_VERSION}" >> $WEBSERVER/repositories.list + for file in index.php log.php; do + [ -f "$WEBSERVER/$file" ] || ln -s /usr/share/slitaz/web-bb/$file $WEBSERVER + done + source $LOCAL_REPOSITORY/tazchroot.conf + echo "" > $WEBSERVER/conf-${undigest:-$SLITAZ_VERSION}.php + [ -L "$WEBSERVER/web" ] || ln -s /usr/share/slitaz/web $WEBSERVER + echo "WEBSERVER=\"$WEBSERVER\"" >> $LOCAL_REPOSITORY/tazwok.conf + if [ -L "$WEBSERVER/conf.php" ]; then + echo "Do yo want to make ${undigest:-$SLITAZ_VERSION} the default page (y/N) ? " + read answer + if [ "$answer" = y ]; then + rm $WEBSERVER/conf.php + ln -s $WEBSERVER/conf-${undigest:-$SLITAZ_VERSION}.php $WEBSERVER/conf.php + fi + else + ln -s $WEBSERVER/conf-${undigest:-$SLITAZ_VERSION}.php $WEBSERVER/conf.php + fi + elif [ "$ARG" = off ]; then + if ! [ "$WEBSERVER" ]; then + echo "No webserver running for ${undigest:-$SLITAZ_VERSION}" >&2 + exit 1 + fi + sed '/^WEBSERVER/d' -i $LOCAL_REPOSITORY/tazwok.conf + sed "/^${undigest:-$SLITAZ_VERSION}$/d" -i $WEBSERVER/repositories.list + rm $WEBSERVER/conf-${undigest:-$SLITAZ_VERSION}.php + if ! [ -s "$WEBSERVER/repositories.list" ]; then + echo "$WEBSERVER/repositories.list is empty; tazwok doesn't remove the server automatically in case you have important stuff in it. If it's not the case, you can remove it using: rm -r $WEBSERVER" + rm $WEBSERVER/conf.php + elif [ "$(readlink $WEBSERVER/conf.php)" = "$WEBSERVER/conf-${undigest:-$SLITAZ_VERSION}.php" ]; then + echo "${undigest:-$SLITAZ_VERSION} was the default version to use; switched to : $(sed 1!d $WEBSERVER/repositories.list)" + rm $WEBSERVER/conf.php + ln -s $WEBSERVER/conf-$(sed 1!d $WEBSERVER/repositories.list).php $WEBSERVER/conf.php + fi + else + echo "Usage: tazwok webserver on/off" >&2 + exit 1 + fi + ;; usage|*) # Print usage also for all unknown commands. # diff -r a618127f3ce2 -r d30774579470 web/conf.php --- a/web/conf.php Wed Feb 09 23:19:01 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - diff -r a618127f3ce2 -r d30774579470 web/index.php --- a/web/index.php Wed Feb 09 23:19:01 2011 +0100 +++ b/web/index.php Thu Feb 10 15:36:26 2011 +0100 @@ -1,13 +1,15 @@ + + @@ -17,101 +19,98 @@ - - + + + - - - - - - -
-
-
+ src="web/logo.png" + title="bb.slitaz.org" alt="bb.slitaz.org" /> +

#!/Build/Bot/

-
+
-

Build Bot

-

/usr/bin/tazbb

+ +
+ + + +
+

Build Bot

+

+ Tazwok-experimental is a SliTaz GNU/Linux + Build Bot, it automatically cooks and tests packages commited in + the wok. SliTaz packages are + cooked on the project main server: code name + Tank. This web interface gives + the current status of the build bot and the last report + about any packages modified by the SliTaz contributors in + the Mercurial repositories, aka + Hg repos. +

+ +
+ +
+ +

Cooklog

-Tazwok is the SliTaz GNU/Linux Build Bot, -it automatically cooks and tests packages commited in the wok. SliTaz -packages are cooked on the project -main server: code name Tank. This -web interface gives the current status of the build bot and the last report -about any packages modified by the SliTaz contributors in the Mercurial -repositories, aka Hg repos. +

+ +" /> + Show pkg log:
+ + +

+Note:
+Flavors/Iso build log are named iso-?flavor
+Temporary toolchain log are named tmp-toolchain-?package

-
+
 ';
-?>	Show cooklog: 
-	
-
-
-

Summary

-
-
 
@@ -122,13 +121,6 @@ ?>
-

Genpkglist

-
-
-
-

Cooklist

 Last cooked packages
 
 
 
@@ -173,26 +165,35 @@ cut -d. -f1); echo ' '\$file; done"); ?>
- +
- -
-

-Copyright © 2010 SliTaz - -GNU General Public License -

- -
- - -
-

-Valid XHTML 1.0 -

+ + diff -r a618127f3ce2 -r d30774579470 web/log.php --- a/web/log.php Wed Feb 09 23:19:01 2011 +0100 +++ b/web/log.php Thu Feb 10 15:36:26 2011 +0100 @@ -1,118 +1,23 @@ - - - - Tazbb cooklog <?php echo $_GET['package']; ?> - - - - - - - - - - - - - - - -
- -

Build Bot

-

Cooklog

- -

-

- Show cooklog: - -Raw log ' . "\n"; - echo '

'; - echo '
' . "\n";
-		echo date ("F d Y H:i:s", filemtime("log/$pkg.log"))."\n";
-		include("$log_dir/$pkg.log");
-		echo '
'; +else { + if (file_exists("conf.php")) { + include("conf.php"); } +} +$package=$_GET["package"]; +if ("$package") { + if (file_exists("$log_dir/$package.html")) { + include ("$log_dir/$package.html"); + } else { - echo " No log file found for: $pkg"; - echo '

'; + echo "No log available for $package."; } } else { - echo '

'; + echo "Strange things happens..."; } - ?> - - -
- - -
-

-Copyright © 2010 SliTaz - -GNU General Public License -

- -
- - -
-

-Valid XHTML 1.0 -

-
- - - diff -r a618127f3ce2 -r d30774579470 web/slitaz.css --- a/web/slitaz.css Wed Feb 09 23:19:01 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,366 +0,0 @@ -/* - CSS style for SliTaz GNU/Linux website - www.slitaz.org - (c) 2007 Pankso -*/ - -html { - height: 102%; -} - -body { - background: #ffffff; - color: black; - font: 13px sans-serif, vernada, arial; - margin: 0; -} - -/* Accessibility */ - -#access { - position: absolute; - top: 4px; - right: 4px; - text-align: right; - width: 100%; - margin: 0; - font-size: 11px; - font-weight: bold; -} - -#access a { - background: inherit; - color: white; - text-decoration: none; -} - -#access a:hover { - background: inherit; - color: #222222; -} - -/* Header and title */ - -#header{ - background: #f0ba08 url(pics/website/header.png) repeat-x top; - color: black; - width: 100%; - height: 50px; - border-top: 1px solid black; - border-bottom: 1px solid black; - margin-bottom: 30px; -} - -#titre { - position: absolute; - font-size: 16px; - font-weight: bolder ; - margin-left: 200px; - margin-top: 28px; -} - -#logo { - position: absolute; - float: left; - margin-left: 16px; - margin-top: 0px; -} - -/* Navigation */ - -#nav { - position: absolute; - top: 76px; - right: 80px; - color: #555555; - float: right; - width: 250px; - line-height: 1.5em; - text-align: left; - font-size: 12px; -} - -#nav ul { - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - list-style-type: none; - margin: 10px 0; - padding: 10px 24px 10px 24px; - background-color: #eaeaea; -} - -#nav .nav_box ul { - list-style-type: none; - margin: 0; - padding: 10px 24px 10px 0px; -} - -#nav li { - display: inline; -} - -#nav h4 { - font-size: 110%; - color: #666666; - font-weight: bold; - margin: 0; - padding: 0 0 1px 0; - border-bottom: 1px solid #cecece; -} - -#nav a { - color: #0F314E; - background: inherit; - display: block; - text-decoration: none; - font-weight: bold; -} - -#nav a:hover { - color: #DF8F06; - text-decoration: none; - display: block; -} - -#nav hr { - margin: 2px 0px 1px 0px; - border: 0px; - border-top: 1px solid #BDBDBD; - -} - -.nav_box { - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - margin: 10px 0; - padding: 10px 24px 10px 24px; - background-color: #eaeaea; - text-align: justify; -} - -#nav .nav_box p { - line-height: 1.3em; -} - -#nav .nav_box p a { - display: inline; - font-weight: normal; - text-decoration: underline; -} - -#nav .nav_box p a:hover { - text-decoration: none; - color: blue; - background: inherit; -} - -#nav hr { - height: 0px; - border: 0px solid #eaeaea; -} - -/* Page content */ - -#content, #content_bottom, #content_top { - background: white; - color: black; - text-align: justify; -} - -#content { - height: auto; - margin: 6px 320px 0px 0px; - padding: 0px 40px 60px 80px; -} - -#content li { - line-height: 1.5em; - text-align: left; -} - -/* Legal informations */ - -#copy { - font-size: 11px ; - text-align: left ; - background: transparent; - color: #a8a8a8; - padding-top: 10px; - margin: 0 0 0 80px; -} - -#copy a { - background: inherit; - color: #a8a8a8; -} - -#copy a:hover { - background: inherit; - color: #666666; -} - -/* Footer */ - -#bottom { - float: none; - background: inherit; - color: black; - width: auto; - clear: both; - padding: 0; - margin: 0 0 0 80px; - text-align: left; - vertical-align: middle; -} - -#news li { - list-style-type: square; - border-bottom: 1px dotted #BEBEBE; - margin-left: -25px; - padding: 4px 0px 4px 0px; -} - -#gallery { - text-align: center; -} - -#gallery table { - margin: 30px 0px 30px 0px; -} - -/* Clouds */ - -#cloud { - padding: 20px 0px 20px 0px; - line-height: 3em; - text-align: center; -} -#cloud a { padding: 4px; color: #956411; } -#cloud a.tag1 { font-size: 0.7em; font-weight: 100; } -#cloud a.tag2 { font-size: 0.8em; font-weight: 200; } -#cloud a.tag3 { font-size: 0.9em; font-weight: 300; } -#cloud a.tag4 { font-size: 1.0em; font-weight: 400; } -#cloud a.tag5 { font-size: 1.2em; font-weight: 500; } -#cloud a.tag6 { font-size: 1.4em; font-weight: 600; } -#cloud a.tag7 { font-size: 1.6em; font-weight: 700; } -#cloud a.tag8 { font-size: 1.8em; font-weight: 800; } -#cloud a.tag9 { font-size: 2.2em; font-weight: 900; } -#cloud a.tag10 { font-size: 2.5em; font-weight: 900; } - -/* CSS class. */ - -.infobox { - margin: 10px; - padding: 12px; - background: #f2f2f2; - border: 1px solid #eaeaea; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; -} - -/* HTML styles */ - -h1 { - color: blue; - background: inherit; - text-align: left; - margin: 0px 0px 10px 0px; - font-size: 140%; - font-weight: bold; -} - -h2 { - color: #DF8F06; - /* border-top: 1px solid #f3f3f3; */ - border-left: 8px solid #f3f3f3; - padding: 4px 0px 4px 4px; - margin: 0; - font-size: 140%; - font-weight: bold; -} - -h3 { - font-weight: bold; - color: #6c0023; - background: inherit; -} - -a { - text-decoration: underline; - color: #0F314E; - background: inherit; -} - -a:hover { - text-decoration: none; - color: blue; - background: inherit; -} - -code { - font-size: 12px; - color: #669900; - background: inherit; -} - -tt { - color: #15EE15; - background: inherit; -} - -img { - border: 0pt none; -} - -fieldset { - background: #E2ECf6; - color: black; - margin-top: 25px; - border: 1px solid black; -} - -legend { - border: 1px solid black; - color: #6c0023; - background: #eaeaea; - font-weight: bold; -} - -pre { - padding: 5px; - color: black; - background: #E1E0B0; -} - -pre.script, pre.log { - padding: 10px; - color: black; - background: #E8E8E8; - border: 1px inset #606060; -} - -textarea { - background: #E5E5E5; - margin-top: 12px; -} - -/* Packages pages */ - -.pkg_nav { - border-top: 1px solid black; - margin-top: 10px; - padding-top: 10px; -} - -pre.package { - padding: 0px; - color: black; - background: white; -} - -p.get { - text-align: center; - padding: 10px; - color: black; - background: #F3F3F3; - border: 1px solid #DEDEDE; -}