wok rev 12164

Moved cgi-bin files to slitaz-base-files (They can be used by any CGI compliant webserver not only BB httpd applet)
author Christophe Lincoln <pankso@slitaz.org>
date Sun Mar 18 00:54:36 2012 +0100 (2012-03-18)
parents 152948bea1dc
children 5c91c8ba3158
files busybox/stuff/applications/httpd-cgi.desktop busybox/stuff/www/cgi-bin/index.cgi busybox/stuff/www/cgi-env.sh
line diff
     1.1 --- a/busybox/stuff/applications/httpd-cgi.desktop	Sun Mar 18 00:36:21 2012 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,7 +0,0 @@
     1.4 -[Desktop Entry]
     1.5 -Encoding=UTF-8
     1.6 -Name=CGI SHell Environment
     1.7 -Exec=browser http://localhost/cgi-env.sh
     1.8 -Icon=text-x-script
     1.9 -Type=Application
    1.10 -Categories=Application;Development;
     2.1 --- a/busybox/stuff/www/cgi-bin/index.cgi	Sun Mar 18 00:36:21 2012 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,35 +0,0 @@
     2.4 -#!/bin/sh
     2.5 -
     2.6 -[ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT  
     2.7 -Content-type: text/html
     2.8 -
     2.9 -<!DOCTYPE html>
    2.10 -<html xmlns="http://www.w3.org/1999/xhtml">
    2.11 -<head>
    2.12 -	<title>Index of $QUERY_STRING</title>
    2.13 -	<meta charset="utf-8" />
    2.14 -	<link rel="stylesheet" type="text/css" href="/style.css" />
    2.15 -</head>
    2.16 -
    2.17 -<!-- Header -->
    2.18 -<div id="header">
    2.19 -	<h1>Index of $QUERY_STRING</h1>
    2.20 -</div>
    2.21 -
    2.22 -<!-- Content -->
    2.23 -<div id="content">
    2.24 -<body>
    2.25 -	<ul>
    2.26 -$({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \
    2.27 -  sed 's|.*|		<li><a href="&">&</a></li>|')
    2.28 -	</ul>
    2.29 -</div>
    2.30 -
    2.31 -<!-- Footer -->
    2.32 -<div id="footer">
    2.33 -    Copyright &copy; $(date +%Y) <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
    2.34 -</div>
    2.35 -
    2.36 -</body>
    2.37 -</html>
    2.38 -EOT
     3.1 --- a/busybox/stuff/www/cgi-env.sh	Sun Mar 18 00:36:21 2012 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,49 +0,0 @@
     3.4 -#!/bin/sh
     3.5 -. /usr/bin/httpd_helper.sh
     3.6 -header
     3.7 -
     3.8 -cat << EOT
     3.9 -<!DOCTYPE html>
    3.10 -<html xmlns="http://www.w3.org/1999/xhtml">
    3.11 -<head>
    3.12 -	<title>CGI SHell Environment</title>
    3.13 -	<meta charset="utf-8" />
    3.14 -	<link rel="stylesheet" type="text/css" href="style.css" />
    3.15 -</head>
    3.16 -<body>
    3.17 -
    3.18 -<!-- Header -->
    3.19 -<div id="header">
    3.20 -	<h1>CGI SHell Environment</h1>
    3.21 -</div>
    3.22 -
    3.23 -<!-- Content -->
    3.24 -<div id="content">
    3.25 -
    3.26 -<p>
    3.27 -	Welcome to the SliTaz web server CGI Shell environment. Let the power of
    3.28 -	SHell script meet the web! Here you can check HTTP info and try some
    3.29 -	requests. 
    3.30 -</p>
    3.31 -<p>
    3.32 -	Including /usr/bin/httpd_helper.sh in your scripts lets you
    3.33 -	use PHP-like syntax such as: \$(GET var)
    3.34 -</p>
    3.35 -<p>
    3.36 -	QUERY_STRING test: 
    3.37 -	<a href="$SCRIPT_NAME?var=value">$SCRIPT_NAME?var=value</a>
    3.38 -</p>
    3.39 -
    3.40 -<h2>HTTP Info</h2>
    3.41 -<pre>
    3.42 -$(httpinfo)
    3.43 -</pre>
    3.44 -
    3.45 -<!-- End content -->
    3.46 -</div>
    3.47 -
    3.48 -</body>
    3.49 -</html>
    3.50 -EOT
    3.51 -
    3.52 -exit 0