- add rc script (with help from aja@)

- update MESSAGE so it works correctly in a chroot

from Tom Doherty
This commit is contained in:
jasper 2012-06-12 17:20:05 +00:00
parent 4035a060c1
commit 26fb038dab
5 changed files with 28 additions and 12 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.13 2011/09/16 12:00:05 espie Exp $
# $OpenBSD: Makefile,v 1.14 2012/06/12 17:20:05 jasper Exp $
COMMENT = web-based SSH client
DISTNAME = Ajaxterm-0.10
PKGNAME = ajaxterm-0.10
REVISION = 6
REVISION = 7
CATEGORIES = net security www
PKG_ARCH = *
@ -39,6 +39,7 @@ do-install:
${INSTALL_DATA} ${WRKDIST}/sarissa_dhtml.js ${SHARE}
perl -pi -e 's/ajaxterm.py/ajaxterm/' ${WRKDIST}/ajaxterm.1
${INSTALL_MAN} ${WRKDIST}/ajaxterm.1 ${PREFIX}/man/man1/ajaxterm.1
${MODPY_BIN} ${MODPY_LIBDIR}/compileall.py ${PREFIX}/share/ajaxterm

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-ajaxterm_py,v 1.2 2009/04/06 15:30:13 ajacoutot Exp $
--- ajaxterm.py.orig Sun Oct 29 03:52:39 2006
+++ ajaxterm.py Tue Mar 31 12:32:31 2009
$OpenBSD: patch-ajaxterm_py,v 1.3 2012/06/12 17:20:05 jasper Exp $
--- ajaxterm.py.orig Thu Jun 7 13:54:38 2012
+++ ajaxterm.py Thu Jun 7 13:58:37 2012
@@ -1,12 +1,13 @@
-#!/usr/bin/env python
+#!${MODPY_BIN}
@ -14,7 +14,7 @@ $OpenBSD: patch-ajaxterm_py,v 1.2 2009/04/06 15:30:13 ajacoutot Exp $
+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('.');
+sys.path[0:0]=glob.glob('.')
import qweb
@ -32,7 +32,7 @@ $OpenBSD: patch-ajaxterm_py,v 1.2 2009/04/06 15:30:13 ajacoutot Exp $
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))
+ fcntl.ioctl(fd, termios.TIOCSWINSZ, 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):

View File

@ -1,6 +1,4 @@
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.
@ -11,5 +9,5 @@ LoadModule proxy_module /usr/lib/apache/modules/libproxy.so
section <VirtualHost _default_:443>
add something like:
ProxyPass /ajaxterm/ http://localhost:8022/
ProxyPassReverse /ajaxterm http://localhost:8022/
ProxyPass /ajaxterm/ http://127.0.0.1:8022/
ProxyPassReverse /ajaxterm http://127.0.0.1:8022/

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/02/03 10:52:36 espie Exp $
@comment $OpenBSD: PLIST,v 1.2 2012/06/12 17:20:05 jasper Exp $
@newgroup _ajaxterm:618
@newuser _ajaxterm:618:_ajaxterm:daemon:Ajaxterm Account:/nonexistent:/sbin/nologin
bin/ajaxterm
@ -8,5 +8,7 @@ share/ajaxterm/ajaxterm.css
share/ajaxterm/ajaxterm.html
share/ajaxterm/ajaxterm.js
share/ajaxterm/qweb.py
share/ajaxterm/qweb.pyc
share/ajaxterm/sarissa.js
share/ajaxterm/sarissa_dhtml.js
@rcscript ${RCDIR}/ajaxterm

View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# $OpenBSD: ajaxterm.rc,v 1.1 2012/06/12 17:20:05 jasper Exp $
daemon="${TRUEPREFIX}/bin/ajaxterm"
daemon_flags="-d -u _ajaxterm --command=/usr/bin/login"
. /etc/rc.d/rc.subr
pexp="${MODPY_BIN} ${daemon}${daemon_flags:+ ${daemon_flags}}"
rc_bg=YES
rc_reload=NO
rc_cmd $1