From 3a8648ba285491f67c75c92e5e532f2b6e74ad8b Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 6 Jan 2009 13:30:48 +0000 Subject: Move rapid-tunneling-gui package into the main source package. git-svn-id: svn+ssh://xorcom/home/svn/debs/components/rapid-tunneling@6557 283159da-0705-0410-b60c-f2062b4bb6ad --- Makefile | 8 ++++- gui/XPP_logo_watermark.gif | Bin 0 -> 2995 bytes gui/Xorcom_logo2.jpg | Bin 0 -> 14452 bytes gui/checkra.php | 43 +++++++++++++++++++++++++ gui/index.php | 76 +++++++++++++++++++++++++++++++++++++++++++++ rapid-tunneling.spec | 34 ++++++++++++++++++++ 6 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 gui/XPP_logo_watermark.gif create mode 100644 gui/Xorcom_logo2.jpg create mode 100644 gui/checkra.php create mode 100644 gui/index.php diff --git a/Makefile b/Makefile index 5d0e520..9e28b44 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,12 @@ SPEC = rapid-tunneling.spec SCRIPTS = rapid-tunneling rapid-tunneling-status rtadm rt-from-remote CONFIGS = rtadm.config sshd_support_config support_env INIT_D = sshd_support -SOURCES = Makefile $(SPEC) $(SCRIPTS) $(CONFIGS) $(INIT_D) .placeholder +GUI = gui +SOURCES = Makefile $(SPEC) $(SCRIPTS) $(CONFIGS) $(INIT_D) $(GUI) .placeholder SBINDIR = /usr/sbin BINDIR = /usr/share/rapid-tunneling/bin +WWWROOT = /var/www/html +WWWHOME = $(WWWROOT)/support VER = $(shell awk '/^Version: / {print $$2}' $(SPEC)| head -n 1) RPM_REL = $(shell awk '/^Release: / {print $$2}' $(SPEC)| head -n 1) @@ -21,6 +24,7 @@ rpm: checkver $(SPEC) SOURCES/$(PACKAGE)-$(VER).tar.gz mkdir -p OUTPUT cp RPMS/noarch/rapid-tunneling-$(VER)-$(RPM_REL).noarch.rpm OUTPUT/ cp RPMS/noarch/rapid-tunneling-server-$(VER)-$(RPM_REL).noarch.rpm OUTPUT/ + cp RPMS/noarch/rapid-tunneling-gui-$(VER)-$(RPM_REL).noarch.rpm OUTPUT/ cp SRPMS/rapid-tunneling-$(VER)-$(RPM_REL).src.rpm OUTPUT/ deb: checkver @@ -53,6 +57,8 @@ install: install -m 644 sshd_support_config $(DESTDIR)/etc/ssh/ install -m 755 -d $(DESTDIR)/var/lib/rapid-tunneling install -m 644 .placeholder $(DESTDIR)/var/lib/rapid-tunneling/ + install -m 755 -d $(DESTDIR)$(WWWHOME) + install -m 644 gui/* $(DESTDIR)$(WWWHOME)/ .PHONY: clean dummy dummy: diff --git a/gui/XPP_logo_watermark.gif b/gui/XPP_logo_watermark.gif new file mode 100644 index 0000000..62c597c Binary files /dev/null and b/gui/XPP_logo_watermark.gif differ diff --git a/gui/Xorcom_logo2.jpg b/gui/Xorcom_logo2.jpg new file mode 100644 index 0000000..a078c9e Binary files /dev/null and b/gui/Xorcom_logo2.jpg differ diff --git a/gui/checkra.php b/gui/checkra.php new file mode 100644 index 0000000..40f8f37 --- /dev/null +++ b/gui/checkra.php @@ -0,0 +1,43 @@ + + + + + + 0) + $pid = trim($pid[0]); + else + $pid = ""; + return array($pid, $status); + // $status = 0 if connected, 1 if connecting, 2 if not connected +} + +$res = get_status(); +$pid = $res[0]; +$status = $res[1]; +if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "disconnect" && $pid != "" && ($status == 0 || $status == 1)) { + // stop it + exec("sudo -H -u rapid-tunneling /usr/sbin/rapid-tunneling-status -s"); + $res = get_status(); + $pid = $res[0]; + $status = $res[1]; +} + +if ($status == 0) + $netstat = "Connected"; +elseif ($status == 1) + $netstat = "Connecting"; +else + $netstat = "Not connected"; + +echo "Connection status:
\n"; +echo date("r") . "    $netstat
\n"; +if ($status == 0 || $status == 1) { + echo "
"; +} +?> + + diff --git a/gui/index.php b/gui/index.php new file mode 100644 index 0000000..aede7c7 --- /dev/null +++ b/gui/index.php @@ -0,0 +1,76 @@ + + * Copyright (C) 2008 Xorcom + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +?> +Xorcom RapidTunneling + +/tmp/ra.log 2>&1", $ret); + if ($ret != 0) { + $error = "Invalid or corrupt file. Please try again."; + if ( $ret == 7) { + $error = "Invalid GPG signature. Please try again."; + } + break; + } + break; + } +} +if ($error != "") { +?> +
+ + +
+Click Browse and select the file 'remote-access.tar.gz' that you received from the Technical Support Service.
+Then click the "Connect" button to initiate the RapidTunneling™ secure communication.

+
+

+ +
+

+ +
+ diff --git a/rapid-tunneling.spec b/rapid-tunneling.spec index 7e342ce..49811b5 100644 --- a/rapid-tunneling.spec +++ b/rapid-tunneling.spec @@ -10,6 +10,8 @@ Requires: openssh-clients busybox gnupg BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +%define webroot /var/www/html/support + %description RapidTunneling (tm) allows remote access to machines behind firewalls and NAT routers via SSH port forwarding. @@ -22,6 +24,18 @@ Requires: openssh-server %description server This package contains the server files needed to run RapidTunneling Server. +%package gui +Summary: Xorcom RapidTunneling (tm) web GUI +Group: Applications/Internet +Requires: rapid-tunneling, sudo + +%description gui +RapidTunneling (tm) allows remote access to machines behind firewalls +and NAT routers via SSH port forwarding. + +This package contains the web-based user interface to initiate and +control tunnels to the server. + %prep %setup -q @@ -62,6 +76,22 @@ fi %postun server /sbin/service sshd_support condrestart > /dev/null 2>&1 || : +%post gui +SUDOERS=/etc/sudoers +LINE="asterisk ALL=(rapid-tunneling) NOPASSWD:/usr/sbin/rapid-tunneling" +LINE2="asterisk ALL=(rapid-tunneling) NOPASSWD:/usr/sbin/rapid-tunneling-status" +if ! fgrep -q "$LINE" $SUDOERS; then echo "$LINE" >> $SUDOERS; fi +if ! fgrep -q "$LINE2" $SUDOERS; then echo "$LINE2" >> $SUDOERS; fi + +%preun gui +if [ "$1" = 0 ]; then + SUDOERS=/etc/sudoers + LINE="asterisk ALL=(rapid-tunneling) NOPASSWD:/usr/sbin/rapid-tunneling" + LINE2="asterisk ALL=(rapid-tunneling) NOPASSWD:/usr/sbin/rapid-tunneling-status" + fgrep -v "$LINE" $SUDOERS > ${SUDOERS}.tmp && cp ${SUDOERS}.tmp $SUDOERS && rm ${SUDOERS}.tmp + fgrep -v "$LINE2" $SUDOERS > ${SUDOERS}.tmp && cp ${SUDOERS}.tmp $SUDOERS && rm ${SUDOERS}.tmp +fi + %files %defattr(-, root, root, 0755) %{_sbindir}/rapid-tunneling @@ -77,6 +107,10 @@ fi %{_datadir}/rapid-tunneling/bin/rt-from-remote /var/lib/rapid-tunneling +%files gui +%defattr(-, root, root, 0755) +%{webroot}/ + %changelog * Sun Dec 14 2008 Alex Landau 1.0-1 - Initial RPM release. -- cgit v1.2.3