wok-current rev 10898

busybox/httpd: add directory index
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jul 15 11:34:28 2011 +0200 (2011-07-15)
parents ea5d77dc95b3
children 491decbaa244
files busybox/receipt busybox/stuff/busybox-1.18-httpd.u busybox/stuff/www/cgi-bin/index.cgi
line diff
     1.1 --- a/busybox/receipt	Mon Jul 11 13:56:46 2011 +0000
     1.2 +++ b/busybox/receipt	Fri Jul 15 11:34:28 2011 +0200
     1.3 @@ -10,7 +10,7 @@
     1.4  TARBALL="$PACKAGE-$VERSION.tar.bz2"
     1.5  WEB_SITE="http://www.busybox.net/"
     1.6  WGET_URL="http://www.busybox.net/downloads/$TARBALL"
     1.7 -CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf"
     1.8 +CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf /etc/httpd.conf"
     1.9  
    1.10  apply_bb_patchs()
    1.11  {
     2.1 --- a/busybox/stuff/busybox-1.18-httpd.u	Mon Jul 11 13:56:46 2011 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,22 +0,0 @@
     2.4 -Httpd already support directory listing. Install both files and try !
     2.5 -
     2.6 -===>8=== /etc/httpd.conf ===>8===
     2.7 -H:/var/www
     2.8 -===>8=== /var/www/cgi-bin/index.cgi ===>8===
     2.9 -#!/bin/sh
    2.10 -
    2.11 -[ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT  
    2.12 -Content-type: text/html
    2.13 -
    2.14 -<!DOCTYPE html>
    2.15 -<html xmlns="http://www.w3.org/1999/xhtml">
    2.16 -<head> <title>Index of $QUERY_STRING</title> </head>
    2.17 -<body>
    2.18 -	<h1>Index of $QUERY_STRING</h1>
    2.19 -	<ul>
    2.20 -$({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \
    2.21 -  sed 's|.*|		<li><a href="&">&</a></li>|')
    2.22 -	</ul>
    2.23 -</body>
    2.24 -</html>
    2.25 -EOT
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/busybox/stuff/www/cgi-bin/index.cgi	Fri Jul 15 11:34:28 2011 +0200
     3.3 @@ -0,0 +1,17 @@
     3.4 +#!/bin/sh
     3.5 +
     3.6 +[ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT  
     3.7 +Content-type: text/html
     3.8 +
     3.9 +<!DOCTYPE html>
    3.10 +<html xmlns="http://www.w3.org/1999/xhtml">
    3.11 +<head> <title>Index of $QUERY_STRING</title> </head>
    3.12 +<body>
    3.13 +	<h1>Index of $QUERY_STRING</h1>
    3.14 +	<ul>
    3.15 +$({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \
    3.16 +  sed 's|.*|		<li><a href="&">&</a></li>|')
    3.17 +	</ul>
    3.18 +</body>
    3.19 +</html>
    3.20 +EOT