From: <abe...@us...> - 2011-12-04 00:48:30
|
Revision: 5280 http://astlinux.svn.sourceforge.net/astlinux/?rev=5280&view=rev Author: abelbeck Date: 2011-12-04 00:48:24 +0000 (Sun, 04 Dec 2011) Log Message: ----------- shellinabox, new package, tie into lighttpd as proxy server, and add access logging variables for lighttpd Special thanks for David Kerr for laying the groundwork Modified Paths: -------------- branches/1.0/astlinux.config branches/1.0/astlinux18.config branches/1.0/package/Config.in branches/1.0/package/lighttpd/lighttpd.conf branches/1.0/package/lighttpd/lighttpd.init branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Added Paths: ----------- branches/1.0/package/shellinabox/ branches/1.0/package/shellinabox/Config.in branches/1.0/package/shellinabox/shellinabox-ios-vt100.patch branches/1.0/package/shellinabox/shellinabox.mk branches/1.0/package/shellinabox/shellinaboxd.init branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K15shellinaboxd branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S75shellinaboxd Modified: branches/1.0/astlinux.config =================================================================== --- branches/1.0/astlinux.config 2011-12-03 15:43:02 UTC (rev 5279) +++ branches/1.0/astlinux.config 2011-12-04 00:48:24 UTC (rev 5280) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Buildroot 2011.08-svn5274-dirty Configuration -# Mon Nov 28 11:40:38 2011 +# Buildroot 2011.08-svn5279-dirty Configuration +# Sat Dec 3 17:23:02 2011 # BR2_HAVE_DOT_CONFIG=y # BR2_arm is not set @@ -718,6 +718,7 @@ BR2_PACKAGE_RSYNC=y # BR2_PACKAGE_SAMBA is not set # BR2_PACKAGE_SER2NET is not set +BR2_PACKAGE_SHELLINABOX=y # BR2_PACKAGE_SOCAT is not set # BR2_PACKAGE_SPAWN_FCGI is not set # BR2_PACKAGE_SQUID is not set Modified: branches/1.0/astlinux18.config =================================================================== --- branches/1.0/astlinux18.config 2011-12-03 15:43:02 UTC (rev 5279) +++ branches/1.0/astlinux18.config 2011-12-04 00:48:24 UTC (rev 5280) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Buildroot 2011.08-svn5274-dirty Configuration -# Mon Nov 28 11:40:45 2011 +# Buildroot 2011.08-svn5279-dirty Configuration +# Sat Dec 3 17:23:03 2011 # BR2_HAVE_DOT_CONFIG=y # BR2_arm is not set @@ -713,6 +713,7 @@ BR2_PACKAGE_RSYNC=y # BR2_PACKAGE_SAMBA is not set # BR2_PACKAGE_SER2NET is not set +BR2_PACKAGE_SHELLINABOX=y # BR2_PACKAGE_SOCAT is not set # BR2_PACKAGE_SPAWN_FCGI is not set # BR2_PACKAGE_SQUID is not set Modified: branches/1.0/package/Config.in =================================================================== --- branches/1.0/package/Config.in 2011-12-03 15:43:02 UTC (rev 5279) +++ branches/1.0/package/Config.in 2011-12-04 00:48:24 UTC (rev 5280) @@ -489,6 +489,7 @@ source "package/rsync/Config.in" source "package/samba/Config.in" source "package/ser2net/Config.in" +source "package/shellinabox/Config.in" source "package/socat/Config.in" source "package/spawn-fcgi/Config.in" source "package/squid/Config.in" Modified: branches/1.0/package/lighttpd/lighttpd.conf =================================================================== --- branches/1.0/package/lighttpd/lighttpd.conf 2011-12-03 15:43:02 UTC (rev 5279) +++ branches/1.0/package/lighttpd/lighttpd.conf 2011-12-04 00:48:24 UTC (rev 5280) @@ -2,9 +2,10 @@ server.modules = ( "mod_access", + "mod_accesslog", "mod_auth", "mod_fastcgi", - "mod_accesslog" ) + "mod_proxy" ) server.document-root = "@HTTPDIR@" server.errorlog-use-syslog = "enable" @@ -68,7 +69,7 @@ "" => "application/octet-stream", ) -accesslog.filename = "/var/log/lighttpd/access.log" +accesslog.filename = "@HTTP_ACCESSLOG@" url.access-deny = ( "~", ".inc", ".htpasswd", ".htaccess"@HTTPCGI@ ) dir-listing.activate = "@HTTP_LISTING@" static-file.exclude-extensions = ( ".php" ) @@ -80,14 +81,14 @@ ssl.engine = "enable" ssl.pemfile = "@HTTPSCERT@" server.document-root = "/var/www" - accesslog.filename = "/var/log/lighttpd/ssl-access.log" + accesslog.filename = "@HTTPS_ACCESSLOG@" url.access-deny = ( "~", ".inc", ".htpasswd", ".htaccess"@HTTPSCGI@ ) dir-listing.activate = "@HTTPS_LISTING@" } @IPV6@$SERVER["socket"] == "[::]:80" { @IPV6@ server.document-root = "@HTTPDIR@" -@IPV6@ accesslog.filename = "/var/log/lighttpd/access.log" +@IPV6@ accesslog.filename = "@HTTP_ACCESSLOG@" @IPV6@ url.access-deny = ( "~", ".inc", ".htpasswd", ".htaccess"@HTTPCGI@ ) @IPV6@ dir-listing.activate = "@HTTP_LISTING@" @IPV6@} @@ -96,7 +97,7 @@ @IPV6@ ssl.engine = "enable" @IPV6@ ssl.pemfile = "@HTTPSCERT@" @IPV6@ server.document-root = "/var/www" -@IPV6@ accesslog.filename = "/var/log/lighttpd/ssl-access.log" +@IPV6@ accesslog.filename = "@HTTPS_ACCESSLOG@" @IPV6@ url.access-deny = ( "~", ".inc", ".htpasswd", ".htaccess"@HTTPSCGI@ ) @IPV6@ dir-listing.activate = "@HTTPS_LISTING@" @IPV6@} @@ -126,3 +127,15 @@ "require" => "valid-user" ) ) + +@CLI_PROXY_SERVER@$HTTP["scheme"] == "https" { +@CLI_PROXY_SERVER@ proxy.server = ( "/admin/cli/" => +@CLI_PROXY_SERVER@ ( "localhost" => +@CLI_PROXY_SERVER@ ( +@CLI_PROXY_SERVER@ "host" => "127.0.0.1", +@CLI_PROXY_SERVER@ "port" => "4200" +@CLI_PROXY_SERVER@ ) +@CLI_PROXY_SERVER@ ) +@CLI_PROXY_SERVER@ ) +@CLI_PROXY_SERVER@} + Modified: branches/1.0/package/lighttpd/lighttpd.init =================================================================== --- branches/1.0/package/lighttpd/lighttpd.init 2011-12-03 15:43:02 UTC (rev 5279) +++ branches/1.0/package/lighttpd/lighttpd.init 2011-12-04 00:48:24 UTC (rev 5280) @@ -41,6 +41,16 @@ else https_listing="enable" fi + if [ "$HTTP_ACCESSLOG" = "yes" ]; then + http_accesslog="/var/log/lighttpd/access.log" + else + http_accesslog="/dev/null" + fi + if [ "$HTTPS_ACCESSLOG" = "yes" ]; then + https_accesslog="/var/log/lighttpd/ssl-access.log" + else + https_accesslog="/dev/null" + fi if [ "$HTTPCGI" = "yes" ]; then httpcgi="" else @@ -56,15 +66,23 @@ else ipv6="#" fi + if [ "$CLI_PROXY_SERVER" = "shellinaboxd" ]; then + cli_proxy_server="" + else + cli_proxy_server="#" + fi sed -i -e "s|@HOSTNAME@|${HOSTNAME}|g" \ -e "s|@HTTPDIR@|${httpdir}|g" \ -e "s|@HTTPSCERT@|${httpscert}|g" \ -e "s|@HTTP_LISTING@|${http_listing}|g" \ -e "s|@HTTPS_LISTING@|${https_listing}|g" \ + -e "s|@HTTP_ACCESSLOG@|${http_accesslog}|g" \ + -e "s|@HTTPS_ACCESSLOG@|${https_accesslog}|g" \ -e "s|@HTTPCGI@|${httpcgi}|g" \ -e "s|@HTTPSCGI@|${httpscgi}|g" \ -e "s|@IPV6@|${ipv6}|g" \ + -e "s|@CLI_PROXY_SERVER@|${cli_proxy_server}|g" \ /tmp/etc/lighttpd.conf } Added: branches/1.0/package/shellinabox/Config.in =================================================================== --- branches/1.0/package/shellinabox/Config.in (rev 0) +++ branches/1.0/package/shellinabox/Config.in 2011-12-04 00:48:24 UTC (rev 5280) @@ -0,0 +1,12 @@ +config BR2_PACKAGE_SHELLINABOX + bool "shellinabox" + default n + depends on BR2_PACKAGE_LIGHTTPD + help + Shell In A Box implements a web server that can export arbitrary + command line tools to a web based terminal emulator. This + emulator is accessible to any JavaScript and CSS enabled web + browser and does not require any additional browser plugins. + + http://code.google.com/p/shellinabox/ + Added: branches/1.0/package/shellinabox/shellinabox-ios-vt100.patch =================================================================== --- branches/1.0/package/shellinabox/shellinabox-ios-vt100.patch (rev 0) +++ branches/1.0/package/shellinabox/shellinabox-ios-vt100.patch 2011-12-04 00:48:24 UTC (rev 5280) @@ -0,0 +1,24 @@ +--- shellinabox-239/shellinabox/vt100.js.orig 2011-11-30 22:55:50.000000000 -0600 ++++ shellinabox-239/shellinabox/vt100.js 2011-11-30 22:59:20.000000000 -0600 +@@ -289,6 +289,10 @@ + this.signature = Math.floor(16807*this.signature + 1) % + ((1 << 31) - 1); + } ++ var isMobile = navigator.userAgent.match(/iPad|iPhone|iPod/i) != null; ++ if (isMobile) { ++ this.softKeyboard = true; ++ } + if (typeof userCSSList != 'undefined') { + for (var i = 0; i < userCSSList.length; ++i) { + var label = userCSSList[i][0]; +@@ -971,6 +971,10 @@ + document.documentElement.clientWidth || + document.body.clientWidth) - + marginRight != x + this.container.offsetWidth; ++ var isMobile = navigator.userAgent.match(/iPad|iPhone|iPod/i) != null; ++ if (isMobile) { ++ this.isEmbedded = false; ++ } + if (!this.isEmbedded) { + // Some browsers generate resize events when the terminal is first + // shown. Disable showing the size indicator until a little bit after Added: branches/1.0/package/shellinabox/shellinabox.mk =================================================================== --- branches/1.0/package/shellinabox/shellinabox.mk (rev 0) +++ branches/1.0/package/shellinabox/shellinabox.mk 2011-12-04 00:48:24 UTC (rev 5280) @@ -0,0 +1,22 @@ +############################################################# +# +# shellinabox +# +############################################################# +SHELLINABOX_VERSION = 239 +SHELLINABOX_SOURCE = shellinabox-$(SHELLINABOX_VERSION).tar.gz +#SHELLINABOX_SITE = http://shellinabox.googlecode.com/files +SHELLINABOX_SITE = http://files.astlinux.org +SHELLINABOX_DEPENDENCIES = openssl + +define SHELLINABOX_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/shellinaboxd $(TARGET_DIR)/usr/bin/shellinaboxd + $(INSTALL) -D -m 0755 package/shellinabox/shellinaboxd.init $(TARGET_DIR)/etc/init.d/shellinaboxd +endef + +define SHELLINABOX_UNINSTALL_TARGET_CMDS + rm -f $(TARGET_DIR)/usr/bin/shellinaboxd + rm -f $(TARGET_DIR)/etc/init.d/shellinaboxd +endef + +$(eval $(call AUTOTARGETS,package,shellinabox)) Added: branches/1.0/package/shellinabox/shellinaboxd.init =================================================================== --- branches/1.0/package/shellinabox/shellinaboxd.init (rev 0) +++ branches/1.0/package/shellinabox/shellinaboxd.init 2011-12-04 00:48:24 UTC (rev 5280) @@ -0,0 +1,55 @@ +#!/bin/sh + +. /etc/rc.conf + +init () { + : +} + +start () { + + if [ "$CLI_PROXY_SERVER" = "shellinaboxd" ]; then + echo "Starting shellinaboxd..." + + shellinaboxd -u root -g nobody --no-beep --background=/var/run/shellinaboxd.pid \ + --disable-ssl --localhost-only --service=/admin/cli/:nobody:nobody:/:/bin/login + fi +} + +stop () { + + if [ -f /var/run/shellinaboxd.pid ]; then + echo "Stopping shellinaboxd..." + + kill $(cat /var/run/shellinaboxd.pid) >/dev/null 2>&1 + rm -f /var/run/shellinaboxd.pid + fi +} + +case $1 in + +start) + start + ;; + +stop) + stop + ;; + +init) + init + start + ;; + +restart) + stop + sleep 2 + start + ;; + +*) + echo "Usage: start|stop|restart" + ;; + +esac + Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K15shellinaboxd =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K15shellinaboxd (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K15shellinaboxd 2011-12-04 00:48:24 UTC (rev 5280) @@ -0,0 +1 @@ +link ../../init.d/shellinaboxd \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/K15shellinaboxd ___________________________________________________________________ Added: svn:special + * Added: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S75shellinaboxd =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S75shellinaboxd (rev 0) +++ branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S75shellinaboxd 2011-12-04 00:48:24 UTC (rev 5280) @@ -0,0 +1 @@ +link ../../init.d/shellinaboxd \ No newline at end of file Property changes on: branches/1.0/project/astlinux/target_skeleton/etc/runlevels/default/S75shellinaboxd ___________________________________________________________________ Added: svn:special + * Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-03 15:43:02 UTC (rev 5279) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2011-12-04 00:48:24 UTC (rev 5280) @@ -287,9 +287,15 @@ ## tftpd package is not installed. TFTPD=dnsmasq +## CLI (Command Line Interface) Proxy Server (shellinaboxd) +## Provides a 'login' prompt via the URL, https://pbx/admin/cli/ +## To start shellinaboxd, set to 'shellinaboxd'. Disabled by default. +CLI_PROXY_SERVER="" + ## HTTPS Server HTTPSDIR="/stat/var/www" # Define the location to serve HTTPS from HTTPS_LISTING="yes" # Allow directory listing if no index.* file exists +HTTPS_ACCESSLOG="no" # Enable access logging in /var/log/lighttpd/ssl-access.log HTTPSCGI="yes" # Define yes|no to enable CGI HTTPSCERT="/etc/ssl/mini_httpd.pem" # Path to the https certificate HTTPSUSER="root" # deprecated @@ -298,6 +304,7 @@ ## If you set HTTPDIR, serve files from that directory. HTTPDIR="/tftpboot" HTTP_LISTING="yes" +HTTP_ACCESSLOG="no" # Enable access logging in /var/log/lighttpd/access.log HTTPCGI="no" HTTPUSER="nobody" # deprecated This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |