ajaxterm is a web <-> ssh proxy.

Common work with Laurent Moccellin at Lab'Free (epitech)
This commit is contained in:
espie 2009-02-03 10:52:36 +00:00
parent 32b14d0e1a
commit 7f05ef422b
6 changed files with 121 additions and 0 deletions

38
www/ajaxterm/Makefile Normal file
View File

@ -0,0 +1,38 @@
# $OpenBSD: Makefile,v 1.1.1.1 2009/02/03 10:52:36 espie Exp $
COMMENT = web-based SSH client
DISTNAME = Ajaxterm-0.10
PKGNAME = ajaxterm-0.10
CATEGORIES = net security www
HOMEPAGE = http://antony.lesuisse.org/software/ajaxterm/
MAINTAINER = Laurent Moccellin <moccel_l@epitech.eu>
# Public Domain
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes
MASTER_SITES = http://antony.lesuisse.org/software/ajaxterm/files/
NO_BUILD = Yes
MODULES = lang/python
SHARE = ${PREFIX}/share/ajaxterm
do-install:
${INSTALL_SCRIPT} ${WRKDIST}/ajaxterm.py ${PREFIX}/bin/ajaxterm
${INSTALL_DATA_DIR} ${SHARE}
${INSTALL_SCRIPT} ${WRKDIST}/qweb.py ${SHARE}
${INSTALL_DATA} ${WRKDIST}/ajaxterm.css ${SHARE}
${INSTALL_DATA} ${WRKDIST}/ajaxterm.html ${SHARE}
${INSTALL_DATA} ${WRKDIST}/ajaxterm.js ${SHARE}
${INSTALL_DATA} ${WRKDIST}/sarissa.js ${SHARE}
${INSTALL_DATA} ${WRKDIST}/sarissa_dhtml.js ${SHARE}
${INSTALL_MAN} ${WRKDIST}/ajaxterm.1 ${PREFIX}/man/man1/ajaxterm.1
.include <bsd.port.mk>

5
www/ajaxterm/distinfo Normal file
View File

@ -0,0 +1,5 @@
MD5 (Ajaxterm-0.10.tar.gz) = sQgwp6gdKkyfiBVRDa+4eg==
RMD160 (Ajaxterm-0.10.tar.gz) = R6MZ3hoWK/6nCQjGRUtf1DLFREU=
SHA1 (Ajaxterm-0.10.tar.gz) = wmLuEVFQ89kSsQQGOLdv4BE2aKQ=
SHA256 (Ajaxterm-0.10.tar.gz) = caHc/XMeVphTSLJjwWsFBsHBvaFI+zCT23dsQvWKlpw=
SIZE (Ajaxterm-0.10.tar.gz) = 34372

View File

@ -0,0 +1,44 @@
$OpenBSD: patch-ajaxterm_py,v 1.1.1.1 2009/02/03 10:52:36 espie Exp $
--- ajaxterm.py.orig Sun Oct 29 03:52:39 2006
+++ ajaxterm.py Tue Dec 9 11:31:25 2008
@@ -4,9 +4,10 @@
import array,cgi,fcntl,glob,mimetypes,optparse,os,pty,random,re,signal,select,sys,threading,time,termios,struct,pwd
-os.chdir(os.path.normpath(os.path.dirname(__file__)))
+os.chdir(os.path.normpath(os.path.dirname(__file__)+'/../share/ajaxterm'))
+print(os.path.normpath(os.path.dirname(__file__)+'/../share/ajaxterm'))
# Optional: Add QWeb in sys path
-sys.path[0:0]=glob.glob('../../python')
+sys.path[0:0]=glob.glob('.');
import qweb
@@ -394,7 +395,7 @@ class Multiplex:
if self.cmd:
cmd=['/bin/sh','-c',self.cmd]
elif os.getuid()==0:
- cmd=['/bin/login']
+ cmd=['/usr/bin/login']
else:
sys.stdout.write("Login: ")
login=sys.stdin.readline().strip()
@@ -415,7 +416,7 @@ class Multiplex:
else:
fcntl.fcntl(fd, fcntl.F_SETFL, os.O_NONBLOCK)
# python bug http://python.org/sf/1112949 on amd64
- fcntl.ioctl(fd, struct.unpack('i',struct.pack('I',termios.TIOCSWINSZ))[0], struct.pack("HHHH",h,w,0,0))
+ fcntl.ioctl(fd, long(struct.unpack('i',struct.pack('l', termios.TIOCSWINSZ))[0]), struct.pack("HHHH",h,w,0,0))
self.proc[fd]={'pid':pid,'term':Terminal(w,h),'buf':'','time':time.time()}
return fd
def die(self):
@@ -532,8 +533,7 @@ def main():
if o.daemon:
pid=os.fork()
if pid == 0:
- #os.setsid() ?
- os.setpgrp()
+ os.setsid()
nullin = file('/dev/null', 'r')
nullout = file('/dev/null', 'w')
os.dup2(nullin.fileno(), sys.stdin.fileno())

4
www/ajaxterm/pkg/DESCR Normal file
View File

@ -0,0 +1,4 @@
ajaxterm is a ssh frontend written for the web.
It's highly recommended to only deploy it on secured web
servers, and to run it as a dedicated user.

18
www/ajaxterm/pkg/MESSAGE Normal file
View File

@ -0,0 +1,18 @@
Some specific installation is needed:
- run the ajaxterm proxy from /etc/rc, e.g.,
ajaxterm -d -u _ajaxterm
- modify your http config to redirect to it, only from ssl modes.
That is:
- activate the proxy module
LoadModule proxy_module /usr/lib/apache/modules/libproxy.so
- activate proxy requests
ProxyRequests On
- choose a secure url and redirect it to ajaxterm. In the SSL VirtualHost
section <VirtualHost _default_:443>
add something like:
ProxyPass /ajaxterm/ http://localhost:8022/
ProxyPassReverse /ajaxterm http://localhost:8022/

12
www/ajaxterm/pkg/PLIST Normal file
View File

@ -0,0 +1,12 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/02/03 10:52:36 espie Exp $
@newgroup _ajaxterm:618
@newuser _ajaxterm:618:_ajaxterm:daemon:Ajaxterm Account:/nonexistent:/sbin/nologin
bin/ajaxterm
@man man/man1/ajaxterm.1
share/ajaxterm/
share/ajaxterm/ajaxterm.css
share/ajaxterm/ajaxterm.html
share/ajaxterm/ajaxterm.js
share/ajaxterm/qweb.py
share/ajaxterm/sarissa.js
share/ajaxterm/sarissa_dhtml.js