diff -Nru ajaxterm-0.10/debian/apache.conf ajaxterm-0.10/debian/apache.conf
--- ajaxterm-0.10/debian/apache.conf 1970-01-01 00:00:00.000000000 +0000
+++ ajaxterm-0.10/debian/apache.conf 2011-02-13 20:32:58.000000000 +0000
@@ -0,0 +1,28 @@
+# Sample apache configuration file for ajaxterm
+
+Listen 443
+NameVirtualHost *:443
+
+
+ ServerName localhost
+ SSLEngine On
+ SSLCertificateKeyFile ssl/apache.pem
+ SSLCertificateFile ssl/apache.pem
+
+ # Suppresses the Via header
+ ProxyVia Off
+ # Do not flood the log
+ #CustomLog /var/log/apache2/access.log combined env=!dontlog
+ #SetEnvIf Request_URI "^/ajaxterm/u" dontlog
+
+ ProxyRequests Off
+
+ Order deny,allow
+ Allow from all
+
+
+ ProxyPass /ajaxterm/ http://localhost:8022/
+ ProxyPassReverse /ajaxterm/ http://localhost:8022/
+
+
+
diff -Nru ajaxterm-0.10/debian/changelog ajaxterm-0.10/debian/changelog
--- ajaxterm-0.10/debian/changelog 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/changelog 2011-03-29 07:46:00.000000000 +0000
@@ -1,3 +1,69 @@
+ajaxterm (0.10-10ubuntu2~ppamaverick1) maverick; urgency=low
+
+ * 90_token_based_access_control.diff:
+ - Add a -t option to pass a token that must be passed by clients
+ to get access.
+ * 91_terminate_on_idle.diff:
+ - Add -T option to terminate ajaxterm itself if idle for extended
+ periods of time.
+
+ -- Soren Hansen Wed, 23 Mar 2011 15:16:33 +0100
+
+ajaxterm (0.10-10ubuntu1) natty; urgency=low
+
+ * Merge from debian unstable. Remaining changes:
+ - debian/control: Build for python2.7.
+
+ -- Angel Abad Mon, 14 Feb 2011 14:06:10 +0100
+
+ajaxterm (0.10-10) unstable; urgency=low
+
+ * Update my email address
+ * Remove DMUA field, now useless
+ * Update copyright file for current revision of DEP-5
+ * Restrict recommends on python-psyco to i386 architectures
+ * Improve manpage to state all options
+ * Bump debhelper compat to 8
+
+ -- Julien Valroff Sat, 12 Feb 2011 15:07:52 +0100
+
+ajaxterm (0.10-9ubuntu1) natty; urgency=low
+
+ * debian/control: Build for python2.7.
+
+ -- Matthias Klose Sat, 11 Dec 2010 09:33:24 +0100
+
+ajaxterm (0.10-9build1) natty; urgency=low
+
+ * Rebuild with python 2.7 as the python default.
+
+ -- Matthias Klose Wed, 08 Dec 2010 15:00:29 +0000
+
+ajaxterm (0.10-9) unstable; urgency=low
+
+ * Fix typo in README.Debian (thanks to Julien Cristau for spotting this)
+ * Upload to unstable now that 0.10-7 has entered testing
+
+ -- Julien Valroff Sun, 17 Oct 2010 09:22:13 +0200
+
+ajaxterm (0.10-8) experimental; urgency=low
+
+ * Apply fix for bold attribute (Closes: #580977)
+ * Add patch to add support for Ctrl-@ and Ctrl-space (thanks to
+ Daniel Risacher )
+
+ -- Julien Valroff Sun, 26 Sep 2010 10:28:11 +0200
+
+ajaxterm (0.10-7) unstable; urgency=low
+
+ * Update to new policy 3.9.1 (no changes needed)
+ * Rephrase README.Debian - thanks to Jari Aalto
+ (Closes: #580164, #580166, #580167)
+ * Ship apache configuration as a separate example file (Closes: #580165)
+ * Suggest openssl
+
+ -- Julien Valroff Sun, 26 Sep 2010 08:54:33 +0200
+
ajaxterm (0.10-6) unstable; urgency=low
* Fix exception (remove spurious "del self.session[s]")
@@ -162,3 +228,4 @@
* Initial release (Closes: #366285)
-- Julien Valroff Tue, 23 May 2006 20:48:06 +0200
+
diff -Nru ajaxterm-0.10/debian/compat ajaxterm-0.10/debian/compat
--- ajaxterm-0.10/debian/compat 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/compat 2011-02-13 20:32:58.000000000 +0000
@@ -1 +1 @@
-7
+8
diff -Nru ajaxterm-0.10/debian/control ajaxterm-0.10/debian/control
--- ajaxterm-0.10/debian/control 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/control 2011-02-14 13:06:20.000000000 +0000
@@ -1,21 +1,22 @@
Source: ajaxterm
Section: web
Priority: optional
-Maintainer: Julien Valroff
-Build-Depends: debhelper (>= 7.0.50~)
+Maintainer: Ubuntu Developers
+XSBC-Original-Maintainer: Julien Valroff
+Build-Depends: debhelper (>= 8)
Build-Depends-Indep: python (>= 2.3),
python-support (>= 0.6)
-Standards-Version: 3.8.4
-XS-Python-Version: >=2.3, <<2.7
+Standards-Version: 3.9.1
+XS-Python-Version: >=2.3, <<2.8
Homepage: http://antony.lesuisse.org/qweb/trac/wiki/AjaxTerm
Vcs-Git: git://git.kirya.net/git/ajaxterm.git
Vcs-Browser: http://git.kirya.net/?p=ajaxterm.git;a=summary
-XS-DM-Upload-Allowed: yes
Package: ajaxterm
Architecture: all
Depends: ${python:Depends}, ${misc:Depends}, adduser
Recommends: apache2 | httpd, openssh-server, python-psyco
+Suggests: openssl
Description: Web based terminal written in Python
Ajaxterm is a web based terminal written in Python and some AJAX
javascript for client side. It can use almost any web browser
diff -Nru ajaxterm-0.10/debian/copyright ajaxterm-0.10/debian/copyright
--- ajaxterm-0.10/debian/copyright 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/copyright 2011-02-13 20:32:58.000000000 +0000
@@ -1,27 +1,48 @@
-Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat
-Debianized-By: Julien Valroff
-Debianized-Date: Sun, 7 May 2006 00:08:01 +0200.
-Original-Source: http://antony.lesuisse.org/qweb/trac/wiki/AjaxTerm
+Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=153
+Upstream-Name: Ajaxterm
+Source: http://antony.lesuisse.org/qweb/trac/wiki/AjaxTerm
-Copyright Holder: Antony Lesuisse
+Files: *
+Copyright: This software is in the public domain
+License: public-domain
+ This software is in the public domain
+
+Files: sarissa.js sarrissa_dhtml.js
+Copyright: Manos Batsis
+License: GPL-2 or LGPL-2.1
Files: debian/*
-Copyright: © 2006-2010 Julien Valroff
+Copyright: 2006-2011, Julien Valroff
License: GPL-2
- The Debian packaging information is under the GPL version 2.
-Files: sarissa.js, sarrissa_dhtml.js
-Copyright Manos Batsis
-License: GPL-2 | LGPL-2.1
+License: GPL-2
+ 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.
+ .
+ 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.
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+License: LGPL-2.1
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 or
the GNU Lesser General Public License version 2.1 as published by
the Free Software Foundation (your choice between the two).
.
- On Debian systems, the complete texts of these license can be found
- in files "/usr/share/common-licenses/GPL-2" and
- "/usr/share/common-licenses/LGPL-2.1".
-
-Files: *
-License: PD
- This software is in the public domain.
+ 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 or GNU Lesser General Public License for
+ more details.
+ .
+ On Debian systems, the complete texts of the GNU Lesser General Public
+ License version 2.1 can be found in the file
+ `/usr/share/common-licenses/LGPL-2.1'.
diff -Nru ajaxterm-0.10/debian/dirs ajaxterm-0.10/debian/dirs
--- ajaxterm-0.10/debian/dirs 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/dirs 1970-01-01 00:00:00.000000000 +0000
@@ -1,2 +0,0 @@
-etc/init.d
-usr/bin
diff -Nru ajaxterm-0.10/debian/examples ajaxterm-0.10/debian/examples
--- ajaxterm-0.10/debian/examples 1970-01-01 00:00:00.000000000 +0000
+++ ajaxterm-0.10/debian/examples 2011-02-13 20:32:58.000000000 +0000
@@ -0,0 +1 @@
+debian/apache.conf
diff -Nru ajaxterm-0.10/debian/patches/01_bin_dir.diff ajaxterm-0.10/debian/patches/01_bin_dir.diff
--- ajaxterm-0.10/debian/patches/01_bin_dir.diff 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/01_bin_dir.diff 2011-02-13 20:32:58.000000000 +0000
@@ -1,5 +1,5 @@
Description: Fix binary location for Debian
-Author: Julien Valroff
+Author: Julien Valroff
--- a/configure.ajaxterm.bin
+++ b/configure.ajaxterm.bin
diff -Nru ajaxterm-0.10/debian/patches/02_initd.diff ajaxterm-0.10/debian/patches/02_initd.diff
--- ajaxterm-0.10/debian/patches/02_initd.diff 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/02_initd.diff 2011-02-13 20:32:58.000000000 +0000
@@ -1,5 +1,5 @@
Description: Do not install the upstream initd script - we use our own init script
-Author: Julien Valroff
+Author: Julien Valroff
diff -Nur ajaxterm-0.10/configure ajaxterm-0.10.new/configure
--- ajaxterm-0.10/configure 2006-10-29 03:52:39.000000000 +0100
diff -Nru ajaxterm-0.10/debian/patches/03_fix_man.diff ajaxterm-0.10/debian/patches/03_fix_man.diff
--- ajaxterm-0.10/debian/patches/03_fix_man.diff 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/03_fix_man.diff 2011-02-13 20:32:58.000000000 +0000
@@ -1,5 +1,5 @@
Description: Fixes for manpage
-Author: Julien Valroff
+Author: Julien Valroff
--- a/ajaxterm.1
+++ b/ajaxterm.1
@@ -9,7 +9,7 @@
.SH NAME
ajaxterm \- Web based terminal written in python
-@@ -8,14 +8,14 @@
+@@ -8,20 +8,40 @@
It can use almost any web browser and even works through firewalls.
.SH USAGE
@@ -22,10 +22,37 @@
- \fB-pPORT, --port=PORT\fR Set the TCP port (default: 8022)
- \fB-cCMD, --command=CMD\fR set the command (default: /bin/login or ssh localhost)
- \fB-l, --log\fR log requests to stderr (default: quiet mode)
-+ \fB-h, \--help\fR show this help message and exit
-+ \fB-pPORT, \--port=PORT\fR Set the TCP port (default: 8022)
-+ \fB-cCMD, \--command=CMD\fR set the command (default: /bin/login or ssh localhost)
-+ \fB-l, \--log\fR log requests to stderr (default: quiet mode)
++.TP
++\fB\-h\fR, \fB\-\-help\fR
++show the help message and exit
++.TP
++\fB\-p\fR PORT, \fB\-\-port\fR=\fIPORT\fR
++Set the TCP port (default: 8022)
++.TP
++\fB\-c\fR CMD, \fB\-\-command\fR=\fICMD\fR
++set the command (default: /bin/login or ssh localhost)
++.TP
++\fB\-l\fR, \fB\-\-log\fR
++log requests to stderr (default: quiet mode)
++.TP
++\fB\-d\fR, \fB\-\-daemon\fR
++run as daemon in the background
++.TP
++\fB\-P\fR PIDFILE, \fB\-\-pidfile\fR=\fIPIDFILE\fR
++set the pidfile (default: /var/run/ajaxterm.pid)
++.TP
++\fB\-i\fR INDEX_FILE, \fB\-\-index\fR=\fIINDEX_FILE\fR
++default index file (default: ajaxterm.html)
++.TP
++\fB\-u\fR UID, \fB\-\-uid\fR=\fIUID\fR
++Set the daemon's user id
.SH AUTHOR
Antony Lesuisse
+
+ This manual page was written for the Debian system by
+-Julien Valroff (but may be used by others).
++Julien Valroff (but may be used by others).
+
+ .SH "REPORTING BUGS"
+ Report any bugs to the author: Antony Lesuisse
diff -Nru ajaxterm-0.10/debian/patches/04_use-default-python.diff ajaxterm-0.10/debian/patches/04_use-default-python.diff
--- ajaxterm-0.10/debian/patches/04_use-default-python.diff 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/04_use-default-python.diff 2011-02-13 20:32:58.000000000 +0000
@@ -1,5 +1,5 @@
Description: Use default python version
-Author: Julien Valroff
+Author: Julien Valroff
diff -Nur ajaxterm/qweb.py ajaxterm.new/qweb.py
--- ajaxterm/qweb.py 2006-07-10 18:27:05.000000000 +0200
diff -Nru ajaxterm-0.10/debian/patches/05_ssh-port.diff ajaxterm-0.10/debian/patches/05_ssh-port.diff
--- ajaxterm-0.10/debian/patches/05_ssh-port.diff 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/05_ssh-port.diff 2011-02-13 20:32:58.000000000 +0000
@@ -2,9 +2,8 @@
Author: Wolf Wiegand
Bug-Debian: http://bugs.debian.org/455245
-diff -Nur ajaxterm/ajaxterm.py ajaxterm.new/ajaxterm.py
---- ajaxterm/ajaxterm.py 2006-11-18 17:00:42.000000000 +0100
-+++ ajaxterm.new/ajaxterm.py 2007-12-09 15:20:25.000000000 +0100
+--- a/ajaxterm.py
++++ b/ajaxterm.py
@@ -367,9 +367,10 @@
return r
@@ -64,3 +63,16 @@
# f=lambda:os.system('firefox http://localhost:%s/&'%o.port)
# qweb.qweb_wsgi_autorun(at,ip='localhost',port=int(o.port),threaded=0,log=o.log,callback_ready=None)
try:
+--- a/ajaxterm.1
++++ b/ajaxterm.1
+@@ -36,6 +36,10 @@
+ .TP
+ \fB\-u\fR UID, \fB\-\-uid\fR=\fIUID\fR
+ Set the daemon's user id
++.TP
++\fB\-s\fR SERVERPORT, \fB\-\-serverport\fR=\fISERVERPORT\fR
++Use a different port than 22 to connect to the ssh
++server
+
+ .SH AUTHOR
+ Antony Lesuisse
diff -Nru ajaxterm-0.10/debian/patches/10_hostname-login.diff ajaxterm-0.10/debian/patches/10_hostname-login.diff
--- ajaxterm-0.10/debian/patches/10_hostname-login.diff 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/10_hostname-login.diff 2011-02-13 20:32:58.000000000 +0000
@@ -1,5 +1,5 @@
Description: Add the hostname to the login prompt
-Author: Julien Valroff
+Author: Julien Valroff
diff -Nur -x '*.orig' -x '*~' ajaxterm/ajaxterm.py ajaxterm.new/ajaxterm.py
--- ajaxterm/ajaxterm.py 2009-10-14 09:04:39.964957030 +0200
diff -Nru ajaxterm-0.10/debian/patches/15_add-configure-file.diff ajaxterm-0.10/debian/patches/15_add-configure-file.diff
--- ajaxterm-0.10/debian/patches/15_add-configure-file.diff 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/15_add-configure-file.diff 2011-02-13 20:32:58.000000000 +0000
@@ -35,8 +35,11 @@
var buf="";
--- a/configure.makefile
+++ b/configure.makefile
-@@ -6,7 +6,9 @@
+@@ -4,9 +4,12 @@
+ install:
+ install -d "%(bin)s"
install -d "%(lib)s"
++ install -d "%(etc)s"
install ajaxterm.bin "%(bin)s/ajaxterm"
install -m 644 ajaxterm.css ajaxterm.html ajaxterm.js qweb.py sarissa.js sarissa_dhtml.js "%(lib)s"
+ install -m 644 ajaxterm.conf "%(etc)s"
diff -Nru ajaxterm-0.10/debian/patches/30_utf8-support.diff ajaxterm-0.10/debian/patches/30_utf8-support.diff
--- ajaxterm-0.10/debian/patches/30_utf8-support.diff 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/30_utf8-support.diff 2011-02-13 20:32:58.000000000 +0000
@@ -4,14 +4,14 @@
--- a/ajaxterm.1
+++ b/ajaxterm.1
-@@ -20,6 +20,8 @@
+@@ -44,6 +44,8 @@
.SH AUTHOR
Antony Lesuisse
+Adopted to UTF-8 by Sergej Pupykin
+
This manual page was written for the Debian system by
- Julien Valroff (but may be used by others).
+ Julien Valroff (but may be used by others).
--- a/ajaxterm.js
+++ b/ajaxterm.js
@@ -138,7 +138,7 @@
else:
self.echo(i)
def read(self):
-@@ -333,35 +318,42 @@
+@@ -333,35 +318,41 @@
self.outbuf=""
return b
def dump(self):
@@ -166,7 +166,6 @@
- bg,fg=divmod(q,256)
+ bg,fg=divmod(q,16)
+ bg &= 0x7
-+ fg &= 0x7
else:
bg,fg=0,7
if i==self.cy*w+self.cx:
@@ -193,7 +192,7 @@
if self.last_html==r:
return ''
else:
-@@ -369,8 +361,8 @@
+@@ -369,8 +360,8 @@
# print self
return r
def __repr__(self):
@@ -204,7 +203,7 @@
for i in range(self.height):
r+="|%s|\n"%d[self.width*i:self.width*(i+1)]
return r
-@@ -432,7 +424,7 @@
+@@ -432,7 +423,7 @@
elif os.getuid()==0:
cmd=['/bin/login']
else:
@@ -319,9 +318,9 @@
t=ajaxterm.Terminal("term",width,height);
--- a/configure.makefile
+++ b/configure.makefile
-@@ -5,7 +5,7 @@
- install -d "%(bin)s"
+@@ -6,7 +6,7 @@
install -d "%(lib)s"
+ install -d "%(etc)s"
install ajaxterm.bin "%(bin)s/ajaxterm"
- install -m 644 ajaxterm.css ajaxterm.html ajaxterm.js qweb.py sarissa.js sarissa_dhtml.js "%(lib)s"
+ install -m 644 ajaxterm.css ajaxterm.html ajaxterm.js qweb.py sarissa.js sarissa_dhtml.js utf8-escape.js "%(lib)s"
diff -Nru ajaxterm-0.10/debian/patches/40_more-ctrl-catches.diff ajaxterm-0.10/debian/patches/40_more-ctrl-catches.diff
--- ajaxterm-0.10/debian/patches/40_more-ctrl-catches.diff 1970-01-01 00:00:00.000000000 +0000
+++ ajaxterm-0.10/debian/patches/40_more-ctrl-catches.diff 2011-02-13 20:32:58.000000000 +0000
@@ -0,0 +1,24 @@
+Description: support for Ctrl-space,@,[,\,^,],_ for Firefox 3.x
+ (and for IE7, except that IE7 catches Ctrl-_ as "reduce font size")
+Author: Daniel Risacher
+
+--- a/ajaxterm.js
++++ b/ajaxterm.js
+@@ -208,15 +208,14 @@
+ k=String.fromCharCode(27)+String.fromCharCode(kc);
+ }
+ } else if (ev.ctrlKey) {
+- if (kc>=65 && kc<=90) k=String.fromCharCode(kc-64); // Ctrl-A..Z
++ if (kc>=64 && kc<=95) k=String.fromCharCode(kc-64); // Ctrl-@,A..Z,[,\,^,],_
+ else if (kc>=97 && kc<=122) k=String.fromCharCode(kc-96); // Ctrl-A..Z
+ else if (kc==54) k=String.fromCharCode(30); // Ctrl-^
+ else if (kc==109) k=String.fromCharCode(31); // Ctrl-_
+ else if (kc==219) k=String.fromCharCode(27); // Ctrl-[
+ else if (kc==220) k=String.fromCharCode(28); // Ctrl-\
+ else if (kc==221) k=String.fromCharCode(29); // Ctrl-]
+- else if (kc==219) k=String.fromCharCode(29); // Ctrl-]
+- else if (kc==219) k=String.fromCharCode(0); // Ctrl-@
++ else if (kc==32) k=String.fromCharCode(0); // Ctrl-space
+ } else if (ev.which==0) {
+ if (kc==9) k=String.fromCharCode(9); // Tab
+ else if (kc==8) k=String.fromCharCode(127); // Backspace
diff -Nru ajaxterm-0.10/debian/patches/90_token_based_access_control.diff ajaxterm-0.10/debian/patches/90_token_based_access_control.diff
--- ajaxterm-0.10/debian/patches/90_token_based_access_control.diff 1970-01-01 00:00:00.000000000 +0000
+++ ajaxterm-0.10/debian/patches/90_token_based_access_control.diff 2011-03-23 14:16:10.000000000 +0000
@@ -0,0 +1,47 @@
+Index: ajaxterm-0.10/ajaxterm.py
+===================================================================
+--- ajaxterm-0.10.orig/ajaxterm.py 2011-03-23 14:18:54.846591114 +0100
++++ ajaxterm-0.10/ajaxterm.py 2011-03-23 15:16:06.281623963 +0100
+@@ -503,8 +503,9 @@
+ pass
+
+ class AjaxTerm:
+- def __init__(self,cmd=None,index_file='ajaxterm.html',serverport=None):
++ def __init__(self,cmd=None,index_file='ajaxterm.html',serverport=None,token=None):
+ self.files={}
++ self.token=token
+ for i in ['css','html','js']:
+ for j in glob.glob('*.%s'%i):
+ self.files[j]=file(j).read()
+@@ -576,11 +577,13 @@
+ if n in self.files:
+ req.response_headers['Content-Type'] = self.mime.get(os.path.splitext(n)[1].lower(), 'application/octet-stream')
+ req.write(self.files[n])
+- else:
++ elif (not self.token) or (req.REQUEST['token'] == self.token):
+ if self.cookie_name not in req.request_cookies:
+ self.genSidCookie(req)
+ req.response_headers['Content-Type'] = 'text/html; charset=UTF-8'
+ req.write(self.files['index'])
++ else:
++ raise Exception('Not Authorized')
+ return req
+ def genSidCookie(self, req):
+ m = sha1()
+@@ -605,6 +608,7 @@
+ parser.add_option("-i", "--index", dest="index_file", default="ajaxterm.html",help="default index file (default: ajaxterm.html)")
+ parser.add_option("-u", "--uid", dest="uid", help="Set the daemon's user id")
+ parser.add_option("-s", "--serverport", dest="serverport", help="Use a different port than 22 to connect to the ssh server")
++ parser.add_option("-t", "--token", dest="token", help="Set authorization token")
+ (o, a) = parser.parse_args()
+ if o.daemon:
+ pid=os.fork()
+@@ -630,7 +634,7 @@
+ sys.exit(0)
+ else:
+ print 'AjaxTerm at http://localhost:%s/' % o.port
+- at=AjaxTerm(o.cmd,o.index_file,o.serverport)
++ at=AjaxTerm(o.cmd,o.index_file,o.serverport,o.token)
+ # f=lambda:os.system('firefox http://localhost:%s/&'%o.port)
+ # qweb.qweb_wsgi_autorun(at,ip='localhost',port=int(o.port),threaded=0,log=o.log,callback_ready=None)
+ try:
diff -Nru ajaxterm-0.10/debian/patches/91_terminate_on_idle.diff ajaxterm-0.10/debian/patches/91_terminate_on_idle.diff
--- ajaxterm-0.10/debian/patches/91_terminate_on_idle.diff 1970-01-01 00:00:00.000000000 +0000
+++ ajaxterm-0.10/debian/patches/91_terminate_on_idle.diff 2011-03-23 14:15:35.000000000 +0000
@@ -0,0 +1,91 @@
+Index: ajaxterm-0.10/ajaxterm.py
+===================================================================
+--- ajaxterm-0.10.orig/ajaxterm.py 2011-03-23 15:13:53.861429744 +0100
++++ ajaxterm-0.10/ajaxterm.py 2011-03-23 15:15:27.491567073 +0100
+@@ -29,6 +29,8 @@
+ from socket import gethostname
+
+
++global g_server
++
+ def debug(str):
+ now = datetime.datetime.now()
+ print "%s - %s" % (now.isoformat(), str)
+@@ -395,7 +397,7 @@
+ class Multiplex:
+ INACTIVE_PROCESS_TIMEOUT=120 # I guess this is the IP max packet lifetime
+
+- def __init__(self,cmd=None,serverport=None):
++ def __init__(self,cmd=None,serverport=None,term_on_idle=0):
+ signal.signal(signal.SIGCHLD, signal.SIG_IGN)
+ self.cmd=cmd
+ self.serverport=serverport
+@@ -403,6 +405,8 @@
+ self.lock=threading.RLock()
+ self.thread=threading.Thread(target=self.loop)
+ self.alive=1
++ self.term_on_idle = term_on_idle
++ self.lastActivity=time.time()
+ # synchronize methods
+ for name in ['create','fds','proc_read','proc_write','dump','die','run']:
+ orig=getattr(self,name)
+@@ -493,6 +497,9 @@
+ while self.run():
+ fds=self.fds()
+ i,o,e=select.select(fds, [], [], 1.0)
++ if self.term_on_idle and time.time() - self.lastActivity > self.term_on_idle:
++ global g_server
++ g_server.shutdown()
+ for fd in i:
+ self.proc_read(fd)
+ if len(i):
+@@ -505,7 +512,7 @@
+ pass
+
+ class AjaxTerm:
+- def __init__(self,cmd=None,index_file='ajaxterm.html',serverport=None,token=None):
++ def __init__(self,cmd=None,index_file='ajaxterm.html',serverport=None,token=None,term_on_idle=0):
+ self.files={}
+ self.token=token
+ for i in ['css','html','js']:
+@@ -514,7 +521,7 @@
+ self.files['index']=file(index_file).read()
+ self.mime = mimetypes.types_map.copy()
+ self.mime['.html']= 'text/html; charset=UTF-8'
+- self.multi = Multiplex(cmd,serverport)
++ self.multi = Multiplex(cmd,serverport,term_on_idle)
+ self.reaper = Reaper(self.multi)
+ self.session = {}
+ self.session_ip = {}
+@@ -565,6 +572,7 @@
+ if k:
+ self.multi.proc_write(term,k)
+ time.sleep(0.002)
++ self.multi.lastActivity = time.time()
+ dump=self.multi.dump(term,c)
+ if isinstance(dump,str):
+ req.write(dump)
+@@ -611,6 +619,7 @@
+ parser.add_option("-u", "--uid", dest="uid", help="Set the daemon's user id")
+ parser.add_option("-s", "--serverport", dest="serverport", help="Use a different port than 22 to connect to the ssh server")
+ parser.add_option("-t", "--token", dest="token", help="Set authorization token")
++ parser.add_option("-T", "--terminate-on-idle", metavar="SEC", action="store", type="int", dest="term_on_idle", help="Terminate if idle for more than SEC seconds (0 means never)")
+ (o, a) = parser.parse_args()
+ if o.daemon:
+ pid=os.fork()
+@@ -636,11 +645,13 @@
+ sys.exit(0)
+ else:
+ print 'AjaxTerm at http://localhost:%s/' % o.port
+- at=AjaxTerm(o.cmd,o.index_file,o.serverport,o.token)
++ at=AjaxTerm(o.cmd,o.index_file,o.serverport,o.token,o.term_on_idle)
+ # f=lambda:os.system('firefox http://localhost:%s/&'%o.port)
+ # qweb.qweb_wsgi_autorun(at,ip='localhost',port=int(o.port),threaded=0,log=o.log,callback_ready=None)
+ try:
+- qweb.QWebWSGIServer(at,ip='localhost',port=int(o.port),threaded=1,log=o.log).serve_forever()
++ global g_server
++ g_server = qweb.QWebWSGIServer(at,ip='localhost',port=int(o.port),threaded=1,log=o.log)
++ g_server.serve_forever()
+ except KeyboardInterrupt,e:
+ sys.excepthook(*sys.exc_info())
+ at.multi.die()
diff -Nru ajaxterm-0.10/debian/patches/series ajaxterm-0.10/debian/patches/series
--- ajaxterm-0.10/debian/patches/series 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/patches/series 2011-03-23 13:02:30.000000000 +0000
@@ -10,5 +10,7 @@
20_bugfixes-tweaks-by-blt.diff
25_CVE-2009-1629.diff
30_utf8-support.diff
-
35_fix-sarissa.diff
+40_more-ctrl-catches.diff
+90_token_based_access_control.diff
+91_terminate_on_idle.diff
diff -Nru ajaxterm-0.10/debian/README.Debian ajaxterm-0.10/debian/README.Debian
--- ajaxterm-0.10/debian/README.Debian 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/README.Debian 2011-02-13 20:32:58.000000000 +0000
@@ -1,52 +1,48 @@
ajaxterm for Debian
-------------------
- * With the default settings, you have to install openssh-server and allow password
- authentication by setting "PasswordAuthentication yes" in /etc/ssh/sshd_config.
- As an alternative, you might choose to run ajaxterm as root, changing the default
- file (/etc/default/ajaxterm): ajaxterm would then fall back to use /bin/login.
-
- * Ajaxterm only support utf8.
-
- * By default Ajaxterm only listen at 127.0.0.1:8022. For remote access, it is
- strongly recommended to use https SSL/TLS, and that is simple to configure if
- you use the apache web server using mod_proxy.
-
- With apache2, simply run 'a2enmod proxy_http' and reload apache.
-
- Here is a configuration example:
-
- Listen 443
- NameVirtualHost *:443
-
-
- ServerName localhost
- SSLEngine On
- SSLCertificateKeyFile ssl/apache.pem
- SSLCertificateFile ssl/apache.pem
-
- # Suppresses the Via header
- ProxyVia Off
- # Do not flood the log
- #CustomLog /var/log/apache2/access.log combined env=!dontlog
- #SetEnvIf Request_URI "^/ajaxterm/u" dontlog
-
- ProxyRequests Off
-
- Order deny,allow
- Allow from all
-
- ProxyPass /ajaxterm/ http://localhost:8022/
- ProxyPassReverse /ajaxterm/ http://localhost:8022/
-
-
- * If apache2 is not already set up for for https SSL/TLS ensure openssl is installed
- The example configuration file can be added as /etc/apache2/site-available/ajaxterm
- This can be enabled by a2ensite ajaxterm
- Then create a self signed certificate (apache.pem)
- export RANDFILE=/dev/random;
- openssl req $@ -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem \
- -keyout /etc/apache2/ssl/apache.pem
- Then to enable ssl mod in apache run 'a2enmod ssl' and reload apache.
+ * Ajaxterm only supports utf8.
- -- Julien Valroff , Sun, 7 May 2006 00:08:01 +0200
+ * With the default settings, you have to install openssh-server and
+ allow password authentication. Open file /etc/ssh/sshd_config and
+ set:
+
+ PasswordAuthentication yes
+
+ As an alternative, you might choose to run ajaxterm as root. Change
+ the default daemon setting in file /etc/default/ajaxterm to:
+
+ AJAXTERM_UID="root"
+
+ Ajaxterm will then fall back to use /bin/login.
+
+ * Apache setup
+
+ By default Ajaxterm only listen at 127.0.0.1:8022. For remote
+ access, it is strongly recommended to use https SSL/TLS, and that is
+ simple to configure if you use the apache web server using
+ mod_proxy.
+
+ If apache2 is not already set up for for https SSL/TLS, ensure
+ openssl is installed to issue a self signed certificate (apache.pem):
+
+ export RANDFILE=/dev/random \
+ openssl req -new -x509 -days 365 -nodes \
+ -out /etc/apache2/ssl/apache.pem \
+ -keyout /etc/apache2/ssl/apache.pem
+
+ With apache2, copy the site file:
+
+ cp /usr/share/doc/ajaxterm/examples/apache.conf \
+ /etc/apache2/sites-available/ajaxterm.conf
+
+ Edit it to suit your needs, enable site, enable apache features, and restart:
+
+ a2ensite ajaxterm
+
+ a2enmod ssl
+ a2enmod proxy_http
+
+ /etc/init.d/apache reload
+
+ -- Julien Valroff Sun, 29 Aug 2010 21:12:33 +0200
diff -Nru ajaxterm-0.10/debian/rules ajaxterm-0.10/debian/rules
--- ajaxterm-0.10/debian/rules 2010-02-11 19:36:44.000000000 +0000
+++ ajaxterm-0.10/debian/rules 2011-02-13 20:32:58.000000000 +0000
@@ -3,4 +3,4 @@
dh $@
override_dh_auto_configure:
- ./configure --prefix=$(CURDIR)/debian/ajaxterm/usr --confdir=$(CURDIR)/debian/ajaxterm/etc
+ ./configure --prefix=debian/ajaxterm/usr --confdir=debian/ajaxterm/etc