# HG changeset patch # User Pascal Bellard <pascal.bellard@slitaz.org> # Date 1310722468 -7200 # Node ID 46c3a889a648dede3977bb893ce7d5a749a85b73 # Parent ea5d77dc95b3da9183f1ea4cb0a09aa8c97497b1 busybox/httpd: add directory index diff -r ea5d77dc95b3 -r 46c3a889a648 busybox/receipt --- a/busybox/receipt Mon Jul 11 13:56:46 2011 +0000 +++ b/busybox/receipt Fri Jul 15 11:34:28 2011 +0200 @@ -10,7 +10,7 @@ TARBALL="$PACKAGE-$VERSION.tar.bz2" WEB_SITE="http://www.busybox.net/" WGET_URL="http://www.busybox.net/downloads/$TARBALL" -CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf" +CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf /etc/httpd.conf" apply_bb_patchs() { diff -r ea5d77dc95b3 -r 46c3a889a648 busybox/stuff/busybox-1.18-httpd.u --- a/busybox/stuff/busybox-1.18-httpd.u Mon Jul 11 13:56:46 2011 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -Httpd already support directory listing. Install both files and try ! - -===>8=== /etc/httpd.conf ===>8=== -H:/var/www -===>8=== /var/www/cgi-bin/index.cgi ===>8=== -#!/bin/sh - -[ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT -Content-type: text/html - -<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> <title>Index of $QUERY_STRING</title> </head> -<body> - <h1>Index of $QUERY_STRING</h1> - <ul> -$({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \ - sed 's|.*| <li><a href="&">&</a></li>|') - </ul> -</body> -</html> -EOT diff -r ea5d77dc95b3 -r 46c3a889a648 busybox/stuff/www/cgi-bin/index.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/www/cgi-bin/index.cgi Fri Jul 15 11:34:28 2011 +0200 @@ -0,0 +1,17 @@ +#!/bin/sh + +[ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT +Content-type: text/html + +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> <title>Index of $QUERY_STRING</title> </head> +<body> + <h1>Index of $QUERY_STRING</h1> + <ul> +$({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \ + sed 's|.*| <li><a href="&">&</a></li>|') + </ul> +</body> +</html> +EOT