From b445055499c8ed51acfaaa0020616c06f558de68 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 16 Oct 2009 22:31:01 -0400 Subject: Adding anyterm package + stunnel support --- config/anyterm/access_anyterm.php | 44 ++++++++++++++++ config/anyterm/anyterm.inc | 108 ++++++++++++++++++++++++++++++++++++++ config/anyterm/anyterm.xml | 27 ++++++++-- config/anyterm/binaries7/anytermd | Bin 0 -> 3111332 bytes pkg_config.7.xml | 11 ++++ pkg_config.8.xml | 11 ++++ 6 files changed, 196 insertions(+), 5 deletions(-) create mode 100644 config/anyterm/access_anyterm.php create mode 100644 config/anyterm/anyterm.inc create mode 100755 config/anyterm/binaries7/anytermd diff --git a/config/anyterm/access_anyterm.php b/config/anyterm/access_anyterm.php new file mode 100644 index 00000000..bcbaa102 --- /dev/null +++ b/config/anyterm/access_anyterm.php @@ -0,0 +1,44 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +require("guiconfig.inc"); + +if($config['installedpackages']['anyterm']['config']['stunnelport']) { + $port = $config['installedpackages']['anyterm']['config']['port']; + $httpors = "http"; +} else { + $port = $config['installedpackages']['anyterm']['config']['stunnelport']; + $httpors = "https"; +} + +$location = "{$SERVER['SERVER_ADDR']}:{$port}"; + +Header("Location: {$httpors}://{$location}"); + +?> \ No newline at end of file diff --git a/config/anyterm/anyterm.inc b/config/anyterm/anyterm.inc new file mode 100644 index 00000000..6ae26147 --- /dev/null +++ b/config/anyterm/anyterm.inc @@ -0,0 +1,108 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +function anyterm_deinstall() { + global $g, $config; + conf_mount_rw(); + exec("killall anytermd"); + exec("rm /usr/local/etc/rc.d/anyterm.sh"); + exec("rm /usr/local/sbin/anytermd"); +} + +function anyterm_install() { + global $g, $config; + + conf_mount_rw(); + + // Grab latest version of executablevi / + $freebsdv=trim(`uname -r | cut -d'.' -f1`); + `fetch -q -o /usr/local/sbin/ http://www.pfsense.org/packages/config/anyterm/binaries{$freebsdv}/anytermd`; + exec("chmod a+rx /usr/local/sbin/anyterm"); + + if($config['installedpackages']['anyterm']['config']['username']) + $port = " --port {$config['installedpackages']['anyterm']['config']['port']}"; + + // This will bring up the pfSense style menu + $anytermd_command = "anytermd --user root --command \"/usr/libexec/getty Pc\" --auth trivial $port"; + + $anyterm = << \ No newline at end of file diff --git a/config/anyterm/anyterm.xml b/config/anyterm/anyterm.xml index 4bd1b445..0b87767d 100644 --- a/config/anyterm/anyterm.xml +++ b/config/anyterm/anyterm.xml @@ -8,7 +8,7 @@ /* ========================================================================== */ /* anyterm.xml - part of pfSense (http://www.pfSense.com) + pfSense package (http://www.pfSense.com) Copyright (C) 2009 Scott Ullrich All rights reserved. */ @@ -53,7 +53,7 @@ anyterm anyterm.sh anytermd - The Reliable, High Performance TCP/HTTP Load Balancer + Ajax Interactive Shell installedpackages->anyterm->config @@ -61,23 +61,40 @@ 077 http://www.pfsense.com/packages/config/anyterm/anyterm.inc + + + Settings + /pkg.php?xml=spamd.xml + + + + Ajax Shell + access_anyterm.php + + Username username - Enter the username for Anyterm + Enter the username for accessing Anyterm input Password password - Enter the password for Anyterm + Enter the password for accessing Anyterm password Port port - Enter the port that Anyterm will listen on. + Enter the port that Anyterm will listen on Default is 8080. + input + + + STunnel Port + stunnelport + [OPTIONAL] If you have setup a STunnel forward enter its port here. input diff --git a/config/anyterm/binaries7/anytermd b/config/anyterm/binaries7/anytermd new file mode 100755 index 00000000..ce5304e7 Binary files /dev/null and b/config/anyterm/binaries7/anytermd differ diff --git a/pkg_config.7.xml b/pkg_config.7.xml index b9f37e1c..d9bb39ba 100755 --- a/pkg_config.7.xml +++ b/pkg_config.7.xml @@ -2,6 +2,17 @@ + + anyterm + Ajax Interactive Shell - Have you ever wanted SSH or telnet access to your system from an “internet desert” - from behind a strict firewall, from an internet cafe, or even from a mobile phone? Anyterm is a combination of a web page and a process that runs on your web server that provides this access. WARNING! We suggest using Stunnel in combination with this package! + http://haproxy.1wt.eu/ + Diagnostics + 0.1 + ALPHA + 1.2.3 + http://www.pfsense.com/packages/config/anyterm/anyterm.xml + anyterm.xml + haproxy The Reliable, High Performance TCP/HTTP Load Balancer diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 8f965c57..1836de21 100755 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -2,6 +2,17 @@ + + anyterm + Ajax Interactive Shell - Have you ever wanted SSH or telnet access to your system from an “internet desert” - from behind a strict firewall, from an internet cafe, or even from a mobile phone? Anyterm is a combination of a web page and a process that runs on your web server that provides this access. WARNING! We suggest using Stunnel in combination with this package! + http://haproxy.1wt.eu/ + Diagnostics + 0.1 + ALPHA + 1.2.3 + http://www.pfsense.com/packages/config/anyterm/anyterm.xml + anyterm.xml + haproxy The Reliable, High Performance TCP/HTTP Load Balancer -- cgit v1.2.3