liftoff / GateOne

Gate One is an HTML5-powered terminal emulator and SSH client
http://liftoffsoftware.com/Products/GateOne
Other
6.27k stars 923 forks source link

OpenBSD Support #161

Open noregard opened 11 years ago

noregard commented 11 years ago

Do you have any plans to add OpenBSD support?

liftoff commented 11 years ago

I don't see any reason why Gate One wouldn't run on OpenBSD. Are you having trouble? As long as you have Python 2.6+ and Tornado installed it should work.

noregard commented 11 years ago

I have the following packages installed:

python-2.7.3p0 py-tornado-2.3

Like the Mac, OpenBSD doesn't have a /proc directory so I changed the string of line 42 of utils.py from Darwin to OpenBSD. I didn't look at changing the _macos functions yet.

The next error was due to no /dev/ptmx. I modified line 3065 of gateone.py to look for /dev/ptm instead. This deals with a lower level of the OS than I am familiar with, so I don't know if this was the right change to make.

After these two changes it starts up, but when I try to connect to the local SSH server I get the following error:

Got Exception: [Errno 14] Bad address Traceback (most recent call last): File "/opt/gateone/plugins/ssh/scripts/ssh_connect.py", line 771, in socket=options.socket File "/opt/gateone/plugins/ssh/scripts/ssh_connect.py", line 400, in openssh_co nnect os.execvpe(script_path, [], env) File "/usr/local/lib/python2.7/os.py", line 353, in execvpe _execvpe(file, args, env) File "/usr/local/lib/python2.7/os.py", line 368, in _execvpe func(file, *argrest) OSError: [Errno 14] Bad address

liftoff commented 11 years ago

Wow, this is going to be far more complicated than I thought. I'll see if I can get an OpenBSD VM up and running to see if I can get it to work. No promises though... That "Bad address" thing looks like a serious hurdle.

iMilnb commented 11 years ago

Hi,

I also have this issue when trying gateone on NetBSD 6.0.1, details:

. tornado-2.4.1 . Python 2.7.3

Host/IP or ssh:// URL [localhost]: Port [22]: User: imil Connecting to ssh://imil@localhost:22

Got Exception: [Errno 14] Bad address Traceback (most recent call last): File "/usr/pkg/gateone/plugins/ssh/scripts/ssh_connect.py", line 771, in socket=options.socket File "/usr/pkg/gateone/plugins/ssh/scripts/ssh_connect.py", line 400, in openssh_connect os.execvpe(script_path, [], env) File "/usr/pkg/lib/python2.7/os.py", line 353, in execvpe _execvpe(file, args, env) File "/usr/pkg/lib/python2.7/os.py", line 368, in _execvpe func(file, *argrest) OSError: [Errno 14] Bad address

Maybe a hint, it seems there are some oddities with IPv6, nevertheless, I'm actually testing (or trying) with IPv4 hosts/addresses. Any hint ? That project really is great, I'd love to promote it !

iMilnb commented 11 years ago

ok, passing an empty list to execvpe() is what is failing, now this works:

os.execvpe(script_path, [''], env)

liftoff commented 11 years ago

@iMilnb: Thanks for figuring that out! That fix (['']) will be in the next commit.

liftoff commented 11 years ago

I just pushed a commit that should (hopefully) fix OpenBSD support. Can someone please test?

noregard commented 11 years ago

@iMilnb's fix worked for me on OpenBSD 5.2. Here are all the changes I made to the 1.1 release to get it working:

diff -rup gateone.orig/gateone.py gateone/gateone.py
--- gateone.orig/gateone.py Thu Nov  1 18:53:52 2012
+++ gateone/gateone.py  Sun Feb  3 18:03:54 2013
@@ -316,6 +316,7 @@ def _(string):
         return string.encode('UTF-8')

 # Globals
+OPENBSD = os.uname()[0] == 'OpenBSD'
 SESSIONS = {} # We store the crux of most session info here
 CMD = None # Will be overwritten by options.command
 TIMEOUT = timedelta(days=5) # Gets overridden by options.session_timeout
@@ -3062,7 +3063,10 @@ def main():
         # First we have to make sure there's at least one pty present
         tempfd1, tempfd2 = pty.openpty()
         # Now check the owning group (doesn't matter which one so we use 0)
-        tty_gid = os.stat('/dev/ptmx').st_gid
+        if OPENBSD:
+            tty_gid = os.stat('/dev/ptm').st_gid
+        else:
+            tty_gid = os.stat('/dev/ptmx').st_gid
         # Close our temmporary pty/fds so we're not wasting them
         os.close(tempfd1)
         os.close(tempfd2)
diff -rup gateone.orig/plugins/ssh/scripts/ssh_connect.py gateone/plugins/ssh/scripts/ssh_connect.py
--- gateone.orig/plugins/ssh/scripts/ssh_connect.py Thu Nov  1 18:53:52 2012
+++ gateone/plugins/ssh/scripts/ssh_connect.py  Sat Feb  2 23:37:50 2013
@@ -397,7 +397,7 @@ def openssh_connect(
         os.setsid() # This is the key
     # Execute then immediately quit so we don't use up any more memory than we
     # need.
-    os.execvpe(script_path, [], env)
+    os.execvpe(script_path, [''], env)
     os._exit(0)

 def telnet_connect(user, host, port=23, env=None):
diff -rup gateone.orig/utils.py gateone/utils.py
--- gateone.orig/utils.py   Thu Nov  1 18:53:52 2012
+++ gateone/utils.py    Sun Feb  3 18:05:14 2013
@@ -40,6 +40,7 @@ from tornado.escape import to_unicode, utf8

 # Globals
 MACOS = os.uname()[0] == 'Darwin'
+OPENBSD = os.uname()[0] == 'OpenBSD'
 # This matches JUST the PIDs from the output of the pstree command
 #RE_PSTREE = re.compile(r'\(([0-9]*)\)')
 # Matches Gate One's special optional escape sequence (ssh plugin only)
@@ -559,21 +560,26 @@ def kill_dtached_proc(session, term):
             except OSError:
                 pass # Process already died.  Not a problem.

-def kill_dtached_proc_macos(session, term):
+def kill_dtached_proc_bsd(session, term):
     """
     A Mac OS-specific implementation of `kill_dtached_proc` since Macs don't
     have /proc.  Seems simpler than :func:`kill_dtached_proc` but actually
     having to call a subprocess is less efficient (due to the sophisticated
     signal handling required by :func:`shell_command`).
     """
-    logging.debug('kill_dtached_proc_macos(%s, %s)' % (session, term))
+    logging.debug('kill_dtached_proc_bsd(%s, %s)' % (session, term))
     ps = which('ps')
+    if MACOS:
+      psopts = "-ef"
+    elif OPENBSD:
+      psopts = "-aux"
     cmd = (
-        "%s -ef | "
+        "%s %s | "
         "grep %s/dtach_%s | " # Limit to those matching our session/term combo
         "grep -v grep | " # Get rid of grep from the results (if present)
-        "awk '{print $2}' " % (ps, session, term) # Just the PID please
+        "awk '{print $2}' " % (ps, psopts, session, term) # Just the PID please
     )
+    logging.debug('kill cmd: %s' % (cmd))
     exitstatus, output = shell_command(cmd)
     for line in output.splitlines():
         pid_to_kill = line.strip() # Get rid of trailing newline
@@ -621,7 +627,7 @@ def killall(session_dir):
                         except OSError:
                             pass # PID is already dead--great

-def killall_macos(session_dir):
+def killall_bsd(session_dir):
     """
     A Mac OS X-specific version of `killall` since Macs don't have /proc.
     """
@@ -629,13 +635,18 @@ def killall_macos(session_dir):
     # don't have to enumerate the process table at all.
     sessions = os.listdir(session_dir)
     for session in sessions:
+        if MACOS:
+          psopts = "-ef"
+        elif OPENBSD:
+          psopts = "-aux"
         cmd = (
-            "ps -ef | "
+            "ps %s | "
             "grep %s | " # Limit to those matching the session
             "grep -v grep | " # Get rid of grep from the results (if present)
             "awk '{print $2}' | " # Just the PID please
-            "xargs kill" % session # Kill em'
+            "xargs kill" % (psopts, session) # Kill em'
         )
+        logging.debug(cmd)
         exitstatus, output = shell_command(cmd)

 def create_plugin_links(static_dir, templates_dir, plugin_dir):
@@ -1176,8 +1187,11 @@ def drop_privileges(uid='nobody', gid='nogroup', supl_
 # Misc
 _ = get_translation()
 if MACOS: # Apply mac-specific stuff
-    kill_dtached_proc = kill_dtached_proc_macos
-    killall = killall_macos
+    kill_dtached_proc = kill_dtached_proc_bsd
+    killall = killall_bsd
+if OPENBSD: # Apply mac-specific stuff
+    kill_dtached_proc = kill_dtached_proc_bsd
+    killall = killall_bsd

 # Used in case bell.ogg can't be found or can't be converted into a data URI
liftoff commented 11 years ago

Thanks for posting that diff! I'll be merging those changes in soon (in the middle of some changes at the moment and I'm about to hit the sack =). Expect them to be pushed sometime tomorrow.

liftoff commented 11 years ago

I just pushed a commit a little while ago that incorporated all of the changes in the diff listed above. Please pull the latest code and let me know if it works without modification. Thanks!

noregard commented 11 years ago

Just tried the latest and I get the following:

Traceback (most recent call last):
  File "gateone.py", line 295, in <module>
    from auth import NullAuthHandler, KerberosAuthHandler, GoogleAuthHandler
  File "/opt/gateone/auth.py", line 618, in <module>
    from authpam import PAMAuthMixin
  File "/opt/gateone/authpam.py", line 27, in <module>
    import gopam
  File "/opt/gateone/gopam.py", line 95, in <module>
    PAM_START = LIBPAM.pam_start
  File "/usr/local/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/usr/local/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: Unable to resolve symbol

I haven't dug into it, but I think this is probably caused by PAM not being available on OpenBSD. OpenBSD uses bsd_auth instead of PAM.

liftoff commented 11 years ago

I just pushed a commit that should fix the PAM problem. Please pull the latest code and let me know if it works.

noregard commented 11 years ago

Just tried the latest and I get the following:

[I 130217 23:13:19 gateone:2894] Gate One settings are incomplete.  A new settings/10server.conf will be generated.
Traceback (most recent call last):
  File "gateone.py", line 3308, in <module>
    main()
  File "gateone.py", line 2933, in main
    s.write("// This is Gate One's main settings file.\n")
TypeError: must be unicode, not str
liftoff commented 11 years ago

Doh, definitely broken. I'll fix it.

liftoff commented 11 years ago

I just pushed a commit that should fix this and several other Python 2/3 compatibility issues. Please grab the latest code and let me know how it goes. Thanks!

noregard commented 11 years ago

I had to change line 3282 in gateone.py to the following to get it to run:

ptm = '/dev/ptm' if os.path.exists('/dev/ptm') else '/dev/ptmx'

After getting the service running the rendering of the terminal is off. It is very tall and narrow:

Screen shot 2013-02-19 at 10 57 05 PM

Also got this error:

[E 130219 23:00:43 gateone:1109] Error/Unknown WebSocket action, terminal:set_terminal: set_terminal() takes exactly 2 arguments (1 given) (/opt/gateone/auth.py line 180)
liftoff commented 11 years ago

That ptm thing is definitely a bug. I'll fix it (quick & easy). Can you run gateone.py with '--logging=debug' and paste that output here? Just make sure to remove any lines like this:

[D 130220 10:33:56 gateone:1072] message: u'{"c":"\\u001b[A"}'
[D 130220 10:33:56 app_terminal:1281] char_handler(u'\x1b[A', None)

...because they can reveal things like passwords. Since it failed to load so early in the process you probably don't have to worry about that but having a little warning about it is pertinent.

Here's what I'm looking for: The 'message' line that calls "terminal:set_terminal" (and the surrounding log lines). It is probably sending a bad message like, {"terminal:set_terminal", "null"} or "NaN" which would indicate a problem with the client figuring out what the current terminal number is.

liftoff commented 11 years ago

Pull the latest code please... I believe this might have been related to an auth bug I fixed this morning.

noregard commented 11 years ago

Here's what I get with the latest and debug logging:

[D 130220 21:51:56 gateone:1073] message: u'{"terminal:set_terminal":null}'
[E 130220 21:51:56 gateone:1108] Error/Unknown WebSocket action, terminal:set_terminal: set_terminal() takes exactly 2 arguments (1 given) (/opt/gateone/auth.py line 180)
Traceback (most recent call last):
  File "gateone.py", line 1098, in on_message
    self.actions[key]()
  File "/opt/gateone/auth.py", line 180, in wrapped_f
    return f(self, *args, **kwargs)
TypeError: set_terminal() takes exactly 2 arguments (1 given)
[D 130220 21:51:56 gateone:1073] message: u'{"go:file_request":"term_colors.css"}'
[D 130220 21:51:56 gateone:1073] message: u'{"terminal:get_terminals":null}'
[D 130220 21:51:56 gateone:1073] message: u'{"terminal:set_terminal":null}'
[E 130220 21:51:56 gateone:1108] Error/Unknown WebSocket action, terminal:set_terminal: set_terminal() takes exactly 2 arguments (1 given) (/opt/gateone/auth.py line 180)
Traceback (most recent call last):
  File "gateone.py", line 1098, in on_message
    self.actions[key]()
  File "/opt/gateone/auth.py", line 180, in wrapped_f
    return f(self, *args, **kwargs)
TypeError: set_terminal() takes exactly 2 arguments (1 given)

The page is looking a bit better, but still not quite right:

Screen shot 2013-02-20 at 9 56 19 PM

liftoff commented 11 years ago

Can you paste the output from your JS console with the latest code? I added a check to the setTerminal() function that may offer clues as to what is going on.

noregard commented 11 years ago

Just grabbed the latest and ran with debug logging. Got the following errors:

[D 130225 20:54:59 gateone:1553] get_theme({u'go_url': u'https://192.168.1.219:8443/', u'theme': u'black', u'container': u'gateone', u'prefix': u'go_default_'})
[E 130225 20:54:59 websocket:261] Uncaught exception in /ws
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/tornado/websocket.py", line 258, in wrapper
        return callback(*args, **kwargs)
      File "gateone.py", line 1105, in on_message
        self.actions[key](value)
      File "gateone.py", line 1589, in get_theme
        theme_path, **template_args)
      File "gateone.py", line 1530, in render_style
        f.write(style_css.decode('utf-8'))
    UnicodeEncodeError: 'ascii' codec can't encode character u'\u239a' in position 3366: ordinal not in range(128)
[D 130225 20:54:59 gateone:1120] on_close()

[D 130225 20:55:04 gateone:1553] get_theme({u'go_url': u'https://192.168.1.219:8443/', u'theme': u'black', u'container': u'gateone', u'prefix': u'go_d
efault_'})
[E 130225 20:55:04 websocket:261] Uncaught exception in /ws
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/tornado/websocket.py", line 258, in wrapper        return callback(*args, **kwargs)      File "gateone.py", line 1105, in on_message
        self.actions[key](value)
      File "gateone.py", line 1630, in get_theme
        theme_css_file, **template_args)
      File "gateone.py", line 1530, in render_style
        f.write(style_css.decode('utf-8'))
    UnicodeEncodeError: 'ascii' codec can't encode character u'\u2708' in position 55: ordinal not in range(128)
[D 130225 20:55:04 gateone:1120] on_close()

[D 130225 20:55:24 gateone:1077] message: u'{"terminal:set_terminal":null}'
[E 130225 20:55:24 gateone:1112] Error/Unknown WebSocket action, terminal:set_terminal: set_terminal() takes exactly 2 arguments (1 given) (/opt/gateone/auth.py line 180)
Traceback (most recent call last):
  File "gateone.py", line 1102, in on_message
    self.actions[key]()
  File "/opt/gateone/auth.py", line 180, in wrapped_f
    return f(self, *args, **kwargs)
TypeError: set_terminal() takes exactly 2 arguments (1 given)
[D 130225 20:55:24 gateone:1077] message: u'{"terminal:set_terminal":null}'
[E 130225 20:55:24 gateone:1112] Error/Unknown WebSocket action, terminal:set_terminal: set_terminal() takes exactly 2 arguments (1 given) (/opt/gateone/auth.py line 180)
Traceback (most recent call last):
  File "gateone.py", line 1102, in on_message
    self.actions[key]()
  File "/opt/gateone/auth.py", line 180, in wrapped_f
    return f(self, *args, **kwargs)
TypeError: set_terminal() takes exactly 2 arguments (1 given)
[D 130225 20:55:25 gateone:1077] message: u'{"terminal:new_terminal":{"term":1,"rows":35,"cols":160,"em_dimensions":{"w":8,"h":14}}}'

Here is the output from the Javascript console:

Viewport target-densitydpi is not supported. :8443/:5
2013-02-25 20:54:59 INFO GateOne.Storage.openDB(): Database version mismatch or missing store.  Creating/upgrading Database. gateone.js:1685
2013-02-25 20:54:59 ERROR Error communicating with server...  gateone.js:1670
GateOne.Base.update.logToConsole gateone.js:1670
GateOne.Base.update.log gateone.js:1747
GateOne.Base.update.logError gateone.js:1756
GateOne.Base.update.connectionError gateone.js:1918
GateOne.Base.update.connect.go.ws.onclose gateone.js:1987
2013-02-25 20:55:04 ERROR Error communicating with server...  gateone.js:1670
GateOne.Base.update.logToConsole gateone.js:1670
GateOne.Base.update.log gateone.js:1747
GateOne.Base.update.logError gateone.js:1756
GateOne.Base.update.connectionError gateone.js:1918
GateOne.Base.update.connect.go.ws.onclose gateone.js:1987
GET https://ssl.google-analytics.com/ga.js  :8443/:1
(anonymous function) :8443/:1
(anonymous function) :8443/:1
GateOne.Base.update.loadJSAction gateone.js:1132
GateOne.Base.update.onMessage gateone.js:2093
2013-02-25 20:55:24 INFO PONG: Gate One server round-trip latency: 485ms gateone.js:1685
2013-02-25 20:55:24 ERROR GateOne.Terminal.setTerminal() got an invalid term number: undefined gateone.js:1670
GateOne.Base.update.logToConsole gateone.js:1670
GateOne.Base.update.log gateone.js:1747
GateOne.Base.update.logError gateone.js:1756
go.Base.update.setTerminal :8443/:1
(anonymous function)
jmwright commented 11 years ago

I think I'm having a similar problem to the one shown in the errors above on CentOS 6.3. There's nothing in the webserver.log file.

Server side: [E 130219 23:44:33 gateone:1109] Error/Unknown WebSocket action, terminal:set_terminal: set_terminal() takes exactly 2 arguments (1 given) (/home/user/Downloads/GateOne-master/gateone/auth.py line 180)

Web console on Firefox 19.0: [15:49:27.877] 2013-02-26 15:49:27 ERROR GateOne.Terminal.setTerminal() got an invalid term number: undefined [15:49:28.553] 2013-02-26 15:49:28 INFO displayMessage(): Closed term 1: Gate One [15:49:28.951] TypeError: go.Terminal.terminals[term] is undefined @ https://192.168.1.135/ [15:49:29.370] 2013-02-26 15:49:29 INFO displayMessage(): Closed term 2: Gate One [15:49:29.372] TypeError: go.Terminal.terminals[term] is undefined @ https://192.168.1.135/ [15:49:29.567] 2013-02-26 15:49:29 INFO displayMessage(): Closed term 3: Gate One [15:49:29.581] TypeError: go.Terminal.terminals[term] is undefined @ https://192.168.1.135/ [15:49:30.023] 2013-02-26 15:49:30 INFO displayMessage(): Closed term 4: Gate One [15:49:30.035] TypeError: go.Terminal.terminals[term] is undefined @ https://192.168.1.135/ [15:49:30.536] 2013-02-26 15:49:30 INFO displayMessage(): Closed term 5: Gate One [15:49:30.549] TypeError: go.Terminal.terminals[term] is undefined @ https://192.168.1.135/

liftoff commented 11 years ago

I myself got that setTerminal error once this morning and I haven't been able to reproduce it. I'm trying to figure out what the heck is going on that causes it. Do you get that every time?

liftoff commented 11 years ago

Forgot to mention: I'll have that UnicodeEncodeError fixed in the next commit. I know precisely what is causing that.

jmwright commented 11 years ago

I don't get it every time, and have had trouble reproducing it myself. I almost posted something about it earlier today, but it went away. I just assumed that I was doing something wrong.

It doesn't seem to matter whether I clear the caches on the browser and/or server sides.

jmwright commented 11 years ago

I also forgot to mention that normally when I see this error, two terminals will automatically open in the browser instead of just one. This time though the terminals kept opening and closing. Again, it's not repeatable so I'm not sure what's going on.

jmwright commented 11 years ago

Ok, so I've been able to recreate this setTerminal issue by making sure that Firefox's cache is completely cleared. If I reload the page the error doesn't seem to happen again (most of the time).

I hard coded gateone.js to log level 10 (debug), and started gateone.py with --logging=debug

Below is what I got (both web console and GateOne output). There was nothing in webserver.log

****Web Console Output 14:52:36 Shows the Error***** [14:52:36.527] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.527] 2013-02-27 14:52:36 DEBUG Loading 1hmac_sha1.js from the cache... [14:52:36.527] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.527] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: theme.css [14:52:36.528] 2013-02-27 14:52:36 DEBUG message: {"go:file_sync": {"files": [{"kind": "js", "filename": "ssh.js", "requires": ["terminal.js"], "mtime": 1361985648.0}]}} [14:52:36.528] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: ssh.js [14:52:36.528] 2013-02-27 14:52:36 DEBUG message: {"go:file_sync": {"files": [{"kind": "css", "filename": "735af9e501", "requires": null, "mtime": 1361907300.6029766}]}} [14:52:36.529] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: 735af9e501 [14:52:36.529] 2013-02-27 14:52:36 DEBUG Loading 1smoothie.js from the cache... [14:52:36.529] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.530] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: help.js [14:52:36.530] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: 98b1579c3a [14:52:36.530] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: terminal.js [14:52:36.531] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: terminal_input.js [14:52:36.531] 2013-02-27 14:52:36 DEBUG message: {"terminal:terminals": []} [14:52:36.540] 2013-02-27 14:52:36 DEBUG Loading example.js from the cache... [14:52:36.540] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.540] 2013-02-27 14:52:36 DEBUG Loading convenience.js from the cache... [14:52:36.540] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.541] 2013-02-27 14:52:36 DEBUG message: {"go:file_sync": {"files": [{"kind": "css", "filename": "2116d2e478", "requires": null, "mtime": 1361993485.9689305}]}} [14:52:36.541] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: 2116d2e478 [14:52:36.541] 2013-02-27 14:52:36 DEBUG Loading theme.css from the cache... [14:52:36.541] 2013-02-27 14:52:36 DEBUG loadStyleAction() [14:52:36.546] 2013-02-27 14:52:36 DEBUG Triggering go:update_dimensions [14:52:36.547] 2013-02-27 14:52:36 DEBUG message: {"go:file_sync": {"files": [{"kind": "css", "filename": "553f7e64c3", "requires": null, "mtime": 1361993485.9731236}]}} [14:52:36.547] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: 553f7e64c3 [14:52:36.548] 2013-02-27 14:52:36 DEBUG message: {"go:file_sync": {"files": [{"kind": "css", "filename": "4c28b1905b", "requires": null, "mtime": 1361993485.9864902}]}} [14:52:36.548] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: 4c28b1905b [14:52:36.548] 2013-02-27 14:52:36 DEBUG message: {"go:set_username": "ANONYMOUS"} [14:52:36.548] 2013-02-27 14:52:36 DEBUG setUsername(ANONYMOUS) [14:52:36.548] 2013-02-27 14:52:36 DEBUG Triggering go:user_login [14:52:36.548] 2013-02-27 14:52:36 DEBUG message: {"go:applications": ["Terminal"]} [14:52:36.550] 2013-02-27 14:52:36 DEBUG Loading ssh.js from the cache... [14:52:36.550] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.550] 2013-02-27 14:52:36 DEBUG Loading 735af9e501 from the cache... [14:52:36.551] 2013-02-27 14:52:36 DEBUG loadStyleAction() [14:52:36.555] 2013-02-27 14:52:36 DEBUG Triggering go:update_dimensions [14:52:36.556] 2013-02-27 14:52:36 DEBUG Loading 98b1579c3a from the cache... [14:52:36.556] 2013-02-27 14:52:36 DEBUG loadStyleAction() [14:52:36.558] 2013-02-27 14:52:36 DEBUG Triggering go:update_dimensions [14:52:36.558] 2013-02-27 14:52:36 DEBUG Loading help.js from the cache... [14:52:36.558] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.558] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.559] 2013-02-27 14:52:36 DEBUG Loading help.js immediately because it has no dependencies. [14:52:36.559] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.559] 2013-02-27 14:52:36 DEBUG Running: GateOne.Help.init() [14:52:36.561] 2013-02-27 14:52:36 DEBUG Loading terminal.js from the cache... [14:52:36.561] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.561] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.567] 2013-02-27 14:52:36 DEBUG Loading terminal.js immediately because it has no dependencies. [14:52:36.567] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.568] 2013-02-27 14:52:36 DEBUG Running: GateOne.Terminal.init() [14:52:36.568] 2013-02-27 14:52:36 DEBUG Terminal.init() [14:52:36.571] 2013-02-27 14:52:36 DEBUG Attempting to download our WebWorker... [14:52:36.575] 2013-02-27 14:52:36 DEBUG Loading terminal_input.js from the cache... [14:52:36.576] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.576] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.576] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.576] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.578] 2013-02-27 14:52:36 DEBUG Loading terminal_input.js immediately because it has no dependencies. [14:52:36.578] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.579] 2013-02-27 14:52:36 DEBUG Running: GateOne.Terminal.Input.init() [14:52:36.588] 2013-02-27 14:52:36 DEBUG Loading 2116d2e478 from the cache... [14:52:36.588] 2013-02-27 14:52:36 DEBUG loadStyleAction() [14:52:36.591] 2013-02-27 14:52:36 DEBUG Triggering go:update_dimensions [14:52:36.635] 2013-02-27 14:52:36 DEBUG message: {"terminal:load_webworker": "// A Web Worker for processing incoming text\nvar consoleLog = [],\n SCREEN = [];\nvar log = function(msg) {\n // Appends msg to a global consoleLog variable which will be handled by the caller\n consoleLog.push(msg);\n}\nvar transformText = function(text, pattern, newString) {\n // Given text, find all strings matching pattern and turn them into clickable links using newString\n // If pattern is not provided, simply transforms URLs into clickable links.\n // Here's an example of replacing hypothetical ticket numbers with clickable links:\n // transformText(\"Please see ticket IM123456789\", /(\bIM\d{9,10}\b)/g, \"$1<\/a>\")\n if (!pattern) {\n pattern = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~|!:,.;]*[-A-Z0-9+&@#\/%=~|])/ig;\n }\n if (!newString) {\n newString = \"$1<\/a>\";\n }\n return text.replace(pattern, newString);\n};\nvar processLines = function(lines, textTransforms) {\n var output = []\n for (var i=0; i < lines.length; i++) {\n var line = lines[i];\n if (line == null) {\n output[i] = \"\"; // An empty string will do (emulates unchanged)\n } else if (line.length) {\n // Trim trailing whitespace only if the line isn't just full of whitespace\n var trimmedLine = line.replace(/\s*$/g, \"\");\n if (trimmedLine) {\n line = trimmedLine;\n }\n output[i] = line;\n } else {\n // Line is unchanged\n output[i] = '';\n }\n }\n outText = output.join('\n')\n // Linkify and transform the text inside the screen before we push it\n for (var trans in textTransforms) {\n // Have to convert the regex to a string and use eval since Firefox can't seem to pass regexp objects to Web Workers.\n var name = textTransforms[trans]['name'],\n pattern = textTransforms[trans]['pattern'],\n newString = textTransforms[trans]['newString'];\n try {\n pattern = eval(pattern);\n } catch(e) {\n // A SyntaxError likely means this is a function\n if (e instanceof SyntaxError) {\n try {\n pattern = Function(\"return \" + pattern)();\n } catch(e) {\n log(\"Error transforming text inside of the term_ww.js Worker: \" + e + \", name: \" + name + \", pattern: '\" + pattern + \"'\");\n }\n }\n }\n if (typeof(pattern) == \"function\") {\n outText = pattern(outText);\n } else {\n outText = transformText(outText, pattern, newString);\n }\n }\n output = transformText(outText).split('\n'); // Convert links to anchor tags and convert back to an array\n return output;\n}\nvar processScreen = function(scrollback, termUpdateObj, prefs, textTransforms, checkBackspace) {\n // Do all the necessary client-side processing of the terminal screen and scrollback buffer. The idea being that a web worker doing this stuff should make Gate One more responsive (at the client).\n // scrollback: go.terminals[term]['scrollback']\n // termUpdateObj: The object containing the terminal screen/scrollback provided by the server\n // termTitle: u.getNode('#' + go.prefs.prefix + 'term' + term).title (since we can't query the DOM from within a Worker)\n // prefs: GateOne.prefs\n // textTransforms: Textual transformations that will be passed to transformText(),\n // checkBackspace: null or the current value of the backspace key (if we're to check it).\n var term = termUpdateObj['term'],\n screen = [],\n incoming_scrollback = termUpdateObj['scrollback'],\n rateLimiter = termUpdateObj['ratelimiter'],\n backspace = \"\",\n outputObj = {'term': term};\n if (!scrollback.length) {\n scrollback = [];\n }\n if (incoming_scrollback.length) {\n // Process the scrollback buffer before we concatenate it\n incoming_scrollback = processLines(incoming_scrollback, textTransforms);\n scrollback = scrollback.concat(incoming_scrollback);\n }\n // Now trim the array to match the go.prefs['scrollback'] setting\n if (scrollback.length > prefs.scrollback) {\n scrollback.reverse();\n scrollback.length = prefs.scrollback; // I love that Array().length isn't just a read-only value =)\n scrollback.reverse(); // Put it back in the proper order\n }\n if (checkBackspace) {\n // Find the first non-empty line and check for ^H and ^? then return the opposite value\n for (var i=0; i < termUpdateObj['screen'].length; i++) {\n if (termUpdateObj['screen'][i].length) {\n if (termUpdateObj['screen'][i].indexOf('<span class=\"cursor\">') != -1) { // Only care about lines that have the cursor in them\n var beforeCursor = termUpdateObj['screen'][i].split('<span class=\"cursor\">')[0];\n if (beforeCursor.substr(beforeCursor.length - 2) == '^H') {\n if (checkBackspace != String.fromCharCode(127)) {\n backspace = String.fromCharCode(127); // Switch to ^H\n }\n } else if (beforeCursor.substr(beforeCursor.length - 2) == '^?') {\n if (checkBackspace != String.fromCharCode(8)) {\n backspace = String.fromCharCode(8); // Switch to ^?\n }\n }\n }\n }\n }\n }\n textTransforms['contenteditable cursor'] = {\n 'name': 'contentenditable cursor',\n 'pattern': '/\<span class=\"cursor\"\>/g',\n 'newString': '<span id=\"term'+term+'cursor\" class=\"cursor\">'\n };\n // Assemble the entire screen from what the server sent us (lines that haven't changed get sent as null)\n screen = processLines(termUpdateObj['screen'], textTransforms);\n outputObj['screen'] = screen;\n outputObj['scrollback'] = scrollback;\n outputObj['backspace'] = backspace;\n outputObj['log'] = consoleLog.join('\n');\n return outputObj\n}\nself.addEventListener('message', function(e) {\n var data = e.data,\n term = data.term,\n cmds = data.cmds,\n text = data.text,\n scrollback = data.scrollback,\n checkBackspace = data.checkBackspace,\n termUpdateObj = data.termUpdateObj,\n prefs= data.prefs,\n textTransforms = data.textTransforms,\n result = null;\n if (cmds) {\n cmds.forEach(function(cmd) {\n switch (cmd) {\n case 'transformText':\n // Linkify links before anything else so we don't clobber any follow-up linkification\n text = transformText(text);\n if (textTransforms) {\n for (var trans in textTransforms) {\n // Have to convert the regex to a string and use eval since Firefox can't seem to pass regexp objects to Web Workers.\n var pattern = eval(textTransforms[trans]['pattern']),\n newString = textTransforms[trans]['newString'];\n text = transformText(text, pattern, newString);\n }\n }\n break;\n case 'processScreen':\n result = processScreen(scrollback, termUpdateObj, prefs, textTransforms, checkBackspace);\n break;\n default:\n self.postMessage('Unknown command: ' + cmds);\n break\n };\n });\n if (text) {\n self.postMessage({'text': text, 'term': term, 'log': consoleLog.join('\n')});\n } else if (result) {\n self.postMessage(result);\n }\n result = null;\n consoleLog = []; // Reset\n }\n}, false);\n"} [14:52:36.636] 2013-02-27 14:52:36 DEBUG message: {"go:file_sync": {"files": [{"kind": "css", "filename": "term_colors.css", "element_id": "text_colors", "mtime": 1361993488.9370983}]}} [14:52:36.636] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: term_colors.css [14:52:36.637] 2013-02-27 14:52:36 DEBUG Loading 553f7e64c3 from the cache... [14:52:36.637] 2013-02-27 14:52:36 DEBUG loadStyleAction() [14:52:36.639] 2013-02-27 14:52:36 DEBUG Triggering go:update_dimensions [14:52:36.640] 2013-02-27 14:52:36 DEBUG Loading 4c28b1905b from the cache... [14:52:36.640] 2013-02-27 14:52:36 DEBUG loadStyleAction() [14:52:36.643] 2013-02-27 14:52:36 DEBUG Triggering go:update_dimensions [14:52:36.684] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: playback.js [14:52:36.684] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: logging.js [14:52:36.685] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: bookmarks.js [14:52:36.685] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: 1hmac_sha1.js [14:52:36.686] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: 1smoothie.js [14:52:36.687] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: example.js [14:52:36.687] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: convenience.js [14:52:36.688] 2013-02-27 14:52:36 DEBUG fileSyncAction() checking: ssh.js [14:52:36.758] 2013-02-27 14:52:36 DEBUG Loading term_colors.css from the cache... [14:52:36.758] 2013-02-27 14:52:36 DEBUG loadStyleAction() [14:52:36.761] 2013-02-27 14:52:36 DEBUG Triggering go:update_dimensions [14:52:36.809] 2013-02-27 14:52:36 DEBUG Loading playback.js from the cache... [14:52:36.809] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.809] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.809] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.809] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.810] 2013-02-27 14:52:36 DEBUG Loading playback.js immediately because it has no dependencies. [14:52:36.811] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.811] 2013-02-27 14:52:36 DEBUG Running: GateOne.Playback.init() [14:52:36.812] 2013-02-27 14:52:36 DEBUG Loading logging.js from the cache... [14:52:36.813] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.813] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.813] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.813] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.815] 2013-02-27 14:52:36 DEBUG Loading logging.js immediately because it has no dependencies. [14:52:36.815] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.816] 2013-02-27 14:52:36 DEBUG Running: GateOne.TermLogging.init() [14:52:36.823] 2013-02-27 14:52:36 DEBUG Loading convenience.js from the cache... [14:52:36.824] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.824] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.824] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.824] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.825] 2013-02-27 14:52:36 DEBUG Loading convenience.js immediately because it has no dependencies. [14:52:36.826] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.826] 2013-02-27 14:52:36 DEBUG Running: GateOne.Convenience.init() [14:52:36.828] 2013-02-27 14:52:36 DEBUG Loading bookmarks.js from the cache... [14:52:36.828] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.828] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.828] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.828] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.835] 2013-02-27 14:52:36 DEBUG Loading bookmarks.js immediately because it has no dependencies. [14:52:36.835] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.836] 2013-02-27 14:52:36 DEBUG Running: GateOne.Bookmarks.init() [14:52:36.840] 2013-02-27 14:52:36 DEBUG Loading 1smoothie.js from the cache... [14:52:36.840] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.840] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.840] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.840] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.841] 2013-02-27 14:52:36 DEBUG Loading 1smoothie.js immediately because it has no dependencies. [14:52:36.841] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.841] 2013-02-27 14:52:36 DEBUG Loading 1hmac_sha1.js from the cache... [14:52:36.841] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.842] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.842] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.842] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.843] 2013-02-27 14:52:36 DEBUG Loading 1hmac_sha1.js immediately because it has no dependencies. [14:52:36.843] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.843] 2013-02-27 14:52:36 DEBUG Loading example.js from the cache... [14:52:36.843] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.843] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.844] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.844] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.845] 2013-02-27 14:52:36 DEBUG Loading example.js immediately because it has no dependencies. [14:52:36.845] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.846] 2013-02-27 14:52:36 DEBUG Running: GateOne.Example.init() [14:52:36.846] 2013-02-27 14:52:36 DEBUG Loading ssh.js from the cache... [14:52:36.846] 2013-02-27 14:52:36 DEBUG This file requires a certain script be loaded first: terminal.js [14:52:36.846] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.847] 2013-02-27 14:52:36 DEBUG loadJSAction() [14:52:36.847] 2013-02-27 14:52:36 DEBUG Dependency loaded! [14:52:36.851] 2013-02-27 14:52:36 DEBUG Loading ssh.js immediately because it has no dependencies. [14:52:36.851] 2013-02-27 14:52:36 DEBUG Running runPostInit() [14:52:36.851] 2013-02-27 14:52:36 DEBUG Running: GateOne.SSH.init() [14:52:36.869] 2013-02-27 14:52:36 DEBUG switchTerminal(undefined) [14:52:36.869] 2013-02-27 14:52:36 ERROR GateOne.Terminal.setTerminal() got an invalid term number: undefined [14:52:36.870] 2013-02-27 14:52:36 DEBUG Triggering terminal:set_terminal [14:52:36.870] 2013-02-27 14:52:36 DEBUG Triggering terminal:switch_terminal [14:52:36.870] 2013-02-27 14:52:36 DEBUG switchTerminalEvent(undefined) [14:52:37.078] 2013-02-27 14:52:37 DEBUG message: {"terminal:terminals": []} [14:52:37.079] 2013-02-27 14:52:37 DEBUG reattachTerminalsAction() terminals: [14:52:37.080] 2013-02-27 14:52:37 DEBUG Triggering terminal:term_reattach [14:52:37.641] 2013-02-27 14:52:37 DEBUG loadBookmarks() [14:52:37.642] 2013-02-27 14:52:37 DEBUG createBookmark() bookmark: http://tempbookmark [14:52:37.645] 2013-02-27 14:52:37 DEBUG createBookmark() bookmark: http://liftoffsoftware.com/ [14:52:37.647] 2013-02-27 14:52:37 DEBUG createBookmark() bookmark: http://vimeo.com/26357093 [14:52:37.650] 2013-02-27 14:52:37 DEBUG createBookmark() bookmark: http://tempbookmark [14:52:37.696] 2013-02-27 14:52:37 DEBUG cleanupFiles() [14:52:38.078] 2013-02-27 14:52:38 DEBUG newTerminal(undefined) [14:52:38.090] 2013-02-27 14:52:38 DEBUG Triggering go:new_workspace [14:52:38.090] 2013-02-27 14:52:38 DEBUG go.Terminal.Input.disableCapture() [14:52:38.091] 2013-02-27 14:52:38 DEBUG Triggering go:switch_workspace [14:52:38.091] 2013-02-27 14:52:38 DEBUG slideToWorkspace(1) [14:52:38.091] 2013-02-27 14:52:38 DEBUG resetGrid() [14:52:38.092] 2013-02-27 14:52:38 DEBUG switchWorkspaceEvent(1) [14:52:38.093] 2013-02-27 14:52:38 DEBUG Triggering terminal:new_terminal [14:52:38.107] 2013-02-27 14:52:38 DEBUG message: {"terminal:set_mode": {"term": 1, "bool": false, "mode": "1"}} [14:52:38.107] 2013-02-27 14:52:38 DEBUG setModeAction modeObj: term,1,bool,false,mode,1 [14:52:38.107] 2013-02-27 14:52:38 DEBUG Setting Application Cursor Mode to: false on term: 1 [14:52:38.111] 2013-02-27 14:52:38 DEBUG message: {"terminal:set_mode": {"term": 1, "bool": true, "mode": "25"}} [14:52:38.111] 2013-02-27 14:52:38 DEBUG setModeAction modeObj: term,1,bool,true,mode,25 [14:52:38.112] 2013-02-27 14:52:38 DEBUG message: {"terminal:set_mode": {"term": 1, "bool": false, "mode": "7"}} [14:52:38.112] 2013-02-27 14:52:38 DEBUG setModeAction modeObj: term,1,bool,false,mode,7 [14:52:38.112] 2013-02-27 14:52:38 DEBUG message: {"notice": "WARNING: Logging is set to DEBUG. All keystrokes will be logged!"} [14:52:38.147] 2013-02-27 14:52:38 DEBUG message: {"terminal:set_mode": {"term": 1, "bool": true, "mode": "1034"}} [14:52:38.147] 2013-02-27 14:52:38 DEBUG setModeAction modeObj: term,1,bool,true,mode,1034 [14:52:38.147] 2013-02-27 14:52:38 DEBUG message: {"terminal:set_title": {"term": 1, "title": "SSH Connect"}} [14:52:38.189] 2013-02-27 14:52:38 DEBUG switchTerminal(1) [14:52:38.190] 2013-02-27 14:52:38 DEBUG Triggering terminal:set_terminal [14:52:38.190] 2013-02-27 14:52:38 DEBUG Triggering terminal:switch_terminal [14:52:38.190] 2013-02-27 14:52:38 DEBUG switchTerminalEvent(1) [14:52:38.191] 2013-02-27 14:52:38 DEBUG go.Terminal.Input.capture() [14:52:38.222] 2013-02-27 14:52:38 DEBUG message: {"terminal:termupdate": {"scrollback": [], "term": 1, "screen": [" ", "[Press Shift-F1 for help] ", " ", "Host/IP or ssh:// URL [localhost]: <span class=\"cursor\"> <\/span> […] [14:52:38.223] 2013-02-27 14:52:38 DEBUG screen length: 42 [14:52:38.240] 2013-02-27 14:52:38 DEBUG Triggering terminal:term_updated [14:52:38.296] 2013-02-27 14:52:38 DEBUG switchTerminal(1) [14:52:38.296] 2013-02-27 14:52:38 DEBUG Triggering terminal:set_terminal [14:52:38.298] 2013-02-27 14:52:38 DEBUG Triggering terminal:switch_terminal [14:52:38.298] 2013-02-27 14:52:38 DEBUG switchTerminalEvent(1) [14:52:38.299] 2013-02-27 14:52:38 DEBUG go.Terminal.Input.capture() [14:52:39.400] 2013-02-27 14:52:39 DEBUG disableScrollback() [14:52:39.401] 2013-02-27 14:52:39 DEBUG Triggering terminal:scrollback:disabled [14:52:39.412] 2013-02-27 14:52:39 DEBUG enableScrollback(1) [14:52:39.430] 2013-02-27 14:52:39 DEBUG Triggering terminal:scrollback:enabled [14:52:40.499] 2013-02-27 14:52:40 DEBUG PING... [14:52:40.503] 2013-02-27 14:52:40 DEBUG message: {"go:pong": "2013-02-27T19:52:40.499Z"} [14:52:40.503] 2013-02-27 14:52:40 INFO PONG: Gate One server round-trip latency: 4ms

****GateOne Terminal Output 11:52:40 Shows the Error***** $ sudo ./gateone.py --logging=debug [W 130227 11:52:12 app_terminal:1957] dtach command not found. dtach support has been disabled. [D 130227 11:52:12 gateone:2788] Imported applications: [<class 'appterminal.TerminalApplication'>] [I 130227 11:52:12 gateone:3322] Gate One 1.2.0 [I 130227 11:52:12 gateone:3323] Tornado version 2.4.1 [I 130227 11:52:12 gateone:3353] Connections to this server will be allowed from the following origins: '192.168.161.132 localhost 127.0.0.1 localhost.localdomain localhost4 localhost4.localdomain4 localhost6 localhost6.localdomain6' [W 130227 11:52:12 gateone:3380] Logging is set to DEBUG. Be aware that this will record the keystrokes of all users. Don't be evil! [I 130227 11:52:12 gateone:2281] No authentication method configured. All users will be ANONYMOUS [I 130227 11:52:12 gateone:2397] Loaded plugins: help [I 130227 11:52:12 gateone:3459] Listening on https://:443/ [I 130227 11:52:12 gateone:3465] Process running with pid 3829 [I 130227 11:52:39 web:1462] 302 GET / (192.168.161.1) 1.15ms [D 130227 11:52:39 auth:380] NullAuthHandler.user_login(ANONYMOUS) [I 130227 11:52:39 web:1462] 302 GET /auth?next=%2F (192.168.161.1) 3.68ms [I 130227 11:52:39 web:1462] 200 GET / (192.168.161.1) 19.22ms [I 130227 11:52:39 web:1462] 200 GET /static/gateone.css (192.168.161.1) 10.02ms [I 130227 11:52:39 web:1462] 200 GET /static/gateone.js (192.168.161.1) 41.15ms [I 130227 11:52:39 web:1462] 200 GET /static/favicon.ico (192.168.161.1) 0.89ms [I 130227 11:52:39 web:1462] 200 GET /auth?check=True (192.168.161.1) 1.92ms [D 130227 11:52:39 gateone:950] ApplicationWebSocket.initialize([<class 'app_terminal.TerminalApplication'>]) [D 130227 11:52:39 app_terminal:315] TerminalApplication.init(<main.ApplicationWebSocket object at 0x8e8ba8c>) [D 130227 11:52:39 gateone:963] Initializing GOApplication: <class 'app_terminal.TerminalApplication'> [D 130227 11:52:39 app_terminal:328] TerminalApplication.initialize() [I 130227 11:52:39 app_terminal:374] Active Terminal Plugins: bookmarks, convenience, example, html, logging, logging_plugin, notice, playback, ssh [D 130227 11:52:39 gateone:836] Adding handler: (/ssh, <class 'ssh.KnownHostsHandler'>) [D 130227 11:52:39 gateone:836] Adding handler: (/bookmarks/fetchicon, <class 'bookmarks.FaviconHandler'>) [D 130227 11:52:39 gateone:836] Adding handler: (/bookmarks/export, <class 'bookmarks.ExportHandler'>) [D 130227 11:52:39 gateone:836] Adding handler: (/bookmarks/import, <class 'bookmarks.ImportHandler'>) [D 130227 11:52:39 gateone:836] Adding handler: (/example, <class 'example.ExampleHandler'>) [D 130227 11:52:39 gateone:1017] open() origin: 192.168.161.132 [I 130227 11:52:39 gateone:1042] WebSocket opened (ANONYMOUS 192.168.161.1) via origin 192.168.161.132. [D 130227 11:52:39 app_terminal:441] TerminalApplication.open() [D 130227 11:52:39 onoff:138] OnOffMixin.triggering event(s): terminal:open [D 130227 11:52:39 gateone:1075] message: u'{"go:get_theme":{"go_url":"https://192.168.161.132/","container":"gateone","prefix":"go_default_","theme":"black"}}' [D 130227 11:52:39 gateone:1553] get_theme({u'go_url': u'https://192.168.161.132/', u'theme': u'black', u'container': u'gateone', u'prefix': u'godefault'}) [D 130227 11:52:39 gateone:1075] message: u'{"terminal:get_bell":null}' [D 130227 11:52:39 gateone:1075] message: u'{"go:authenticate":{"auth":"eyJ1cG4iOiAiQU5PTllNT1VTIiwgInNlc3Npb24iOiAiWWpnMFptTXhOVGxrTUdWak5EWTVOemsxWXpkaVpUZ3haV1JtTURoaU5ESTJNIn0=|1361994759|43bdae88946c59a0dafba6aa974b68d133c7549a","container":"gateone","prefix":"godefault","location":"default"}}' [D 130227 11:52:39 gateone:1156] authenticate(): {u'prefix': u'godefault', u'container': u'gateone', u'location': u'default', u'auth': u'eyJ1cG4iOiAiQU5PTllNT1VTIiwgInNlc3Npb24iOiAiWWpnMFptTXhOVGxrTUdWak5EWTVOemsxWXpkaVpUZ3haV1JtTURoaU5ESTJNIn0=|1361994759|43bdae88946c59a0dafba6aa974b68d133c7549a'} [D 130227 11:52:39 gateone:2035] send_plugin_static_files(/opt/gateone/plugins) [D 130227 11:52:39 gateone:1917] send_js_or_css(/opt/gateone/plugins/help/static/help.js) (mtime: 1361985648.0) [D 130227 11:52:39 app_terminal:453] TerminalApplication.authenticate() [D 130227 11:52:39 gateone:1917] send_js_or_css(/tmp/gateone_cache/renderedopt_gateone_applications_terminal_templates_terminal.css_1361985648) (mtime: 1361993485.96) [D 130227 11:52:39 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/static/terminal.js) (mtime: 1361985648.0) [D 130227 11:52:39 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/static/terminal_input.js) (mtime: 1361985648.0) [D 130227 11:52:39 gateone:2035] send_plugin_static_files(/opt/gateone/applications/terminal/plugins) [D 130227 11:52:39 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/plugins/logging/static/logging.js) (mtime: 1361985648.0) [D 130227 11:52:40 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/plugins/playback/static/playback.js) (mtime: 1361985648.0) [D 130227 11:52:40 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/plugins/bookmarks/static/bookmarks.js) (mtime: 1361985648.0) [D 130227 11:52:40 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/plugins/example/static/1hmac_sha1.js) (mtime: 1361985648.0) [D 130227 11:52:40 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/plugins/example/static/1smoothie.js) (mtime: 1361985648.0) [D 130227 11:52:40 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/plugins/example/static/example.js) (mtime: 1361985648.0) [D 130227 11:52:40 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/plugins/convenience/static/convenience.js) (mtime: 1361985648.0) [D 130227 11:52:40 gateone:1917] send_js_or_css(/opt/gateone/applications/terminal/plugins/ssh/static/ssh.js) (mtime: 1361985648.0) [D 130227 11:52:40 gateone:1917] send_js_or_css(/tmp/gateone_cache/256_colors.css) (mtime: 1361907300.6) [D 130227 11:52:40 onoff:138] OnOffMixin.triggering event(s): terminal:authenticate [D 130227 11:52:40 gateone:1917] send_js_or_css(/tmp/gateone_cache/renderedopt_gateone_applications_terminal_plugins_ssh_templates_ssh.css_1361985648) (mtime: 1361993485.97) [D 130227 11:52:40 ssh:1050] create_user_ssh_dir() [D 130227 11:52:40 gateone:1917] send_js_or_css(/tmp/gateone_cache/renderedopt_gateone_applications_terminal_plugins_logging_templates_logging.css_1361985648) (mtime: 1361993485.97) [D 130227 11:52:40 gateone:1917] send_js_or_css(/tmp/gateone_cache/renderedopt_gateone_applications_terminal_plugins_bookmarks_templates_bookmarks.css_1361985648) (mtime: 1361993485.99) [D 130227 11:52:40 onoff:138] OnOffMixin.triggering event(s): go:authenticate [D 130227 11:52:40 gateone:1075] message: u'{"terminal:get_webworker":null}' [D 130227 11:52:40 gateone:1075] message: u'{"terminal:get_colors":{"go_url":"https://192.168.161.132/","container":"gateone","prefix":"go_default_","colors":"default"}}' [D 130227 11:52:40 app_terminal:1408] get_colors({u'colors': u'default', u'go_url': u'https://192.168.161.132/', u'container': u'gateone', u'prefix': u'godefault'}) [D 130227 11:52:40 gateone:1075] message: u'{"terminal:set_terminal":null}' [E 130227 11:52:40 gateone:1110] Error/Unknown WebSocket action, terminal:set_terminal: set_terminal() takes exactly 2 arguments (1 given) (/opt/gateone/auth.py line 180) Traceback (most recent call last): File "./gateone.py", line 1100, in on_message self.actions[key]() File "/opt/gateone/auth.py", line 180, in wrapped_f return f(self, args, _kwargs) TypeError: set_terminal() takes exactly 2 arguments (1 given) [D 130227 11:52:40 gateone:1075] message: u'{"terminal:get_terminals":null}' [D 130227 11:52:41 gateone:1075] message: u'{"go:cache_cleanup":{"filenames":["2116d2e478","4c28b1905b","553f7e64c3","735af9e501","98b1579c3a","term_colors.css","theme.css"],"kind":"css"}}' [D 130227 11:52:41 gateone:1714] cache_cleanup({u'kind': u'css', u'filenames': [u'2116d2e478', u'4c28b1905b', u'553f7e64c3', u'735af9e501', u'98b1579c3a', u'term_colors.css', u'theme.css']}) [D 130227 11:52:41 gateone:1729] No expired css files at client 192.168.161.1 [D 130227 11:52:41 gateone:1075] message: u'{"go:cache_cleanup":{"filenames":["1hmac_sha1.js","1smoothie.js","bookmarks.js","convenience.js","example.js","help.js","logging.js","playback.js","ssh.js","terminal.js","terminal_input.js"],"kind":"js"}}' [D 130227 11:52:41 gateone:1714] cache_cleanup({u'kind': u'js', u'filenames': [u'1hmac_sha1.js', u'1smoothie.js', u'bookmarks.js', u'convenience.js', u'example.js', u'help.js', u'logging.js', u'playback.js', u'ssh.js', u'terminal.js', u'terminal_input.js']}) [D 130227 11:52:41 gateone:1729] No expired js files at client 192.168.161.1 [D 130227 11:52:41 gateone:1075] message: u'{"terminal:new_terminal":{"term":1,"rows":42,"cols":258,"em_dimensions":{"w":7,"h":14.390625}}}' [D 130227 11:52:41 app_terminal:697] ANONYMOUS new_terminal(): {u'em_dimensions': {u'h': 14.390625, u'w': 7}, u'term': 1, u'rows': 42, u'cols': 258} [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:new_multiplex [D 130227 11:52:41 termio:1271] spawn(rows=42, cols=258, env={'GO_SESSION_DIR': u'/tmp/gateone/Yjg0ZmMxNTlkMGVjNDY5Nzk1YzdiZTgxZWRmMDhiNDI2M', 'EXAMPLE_VAR': 'This was set via the Example plugin', 'GO_SESSION': u'Yjg0ZmMxNTlkMGVjNDY5Nzk1YzdiZTgxZWRmMDhiNDI2M', 'GO_USER': u'ANONYMOUS', 'GO_TERM': '1', 'GO_USER_DIR': u'/opt/gateone/users'}, em_dimensions={'width': 7, 'height': 14.390625}) [D 130227 11:52:41 termio:1327] spawn() pid: 3842 [D 130227 11:52:41 terminal:1476] init_screen() [D 130227 11:52:41 terminal:1494] init_renditions(\u03e8) [D 130227 11:52:41 app_terminal:1030] set_title(1, False) [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:set_title [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:add_terminal_callbacks [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:refresh_screen [D 130227 11:52:41 app_terminal:1098] mode_handler() term: 1, setting: 1, boolean: False [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:mode_handler [D 130227 11:52:41 app_terminal:1098] mode_handler() term: 1, setting: 25, boolean: True [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:mode_handler [D 130227 11:52:41 app_terminal:1098] mode_handler() term: 1, setting: 7, boolean: False [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:mode_handler [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): go:send_message [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:new_terminal [D 130227 11:52:41 gateone:1075] message: u'{"terminal:ssh_get_connect_string":1}' [D 130227 11:52:41 ssh:451] get_connect_string() term: 1 [D 130227 11:52:41 terminal:2674] set_expanded_mode(?1034) [D 130227 11:52:41 app_terminal:1098] mode_handler() term: 1, setting: 1034, boolean: True [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:mode_handler [D 130227 11:52:41 app_terminal:1030] set_title(1, False) [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:set_title [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:refresh_screen [D 130227 11:52:41 gateone:1075] message: u'{"terminal:set_terminal":1}' [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:set_terminal [D 130227 11:52:41 gateone:1075] message: u'{"terminal:set_terminal":1}' [D 130227 11:52:41 onoff:138] OnOffMixin.triggering event(s): terminal:set_terminal [D 130227 11:52:43 termio:1392] Resizing term 1 to rows: 42, cols: 258 [D 130227 11:52:43 terminal:1648] resize(42, 258) [D 130227 11:52:43 onoff:138] OnOffMixin.triggering event(s): terminal:refresh_screen [D 130227 11:52:43 gateone:1075] message: u'{"go:ping":"2013-02-27T19:52:40.499Z"}' [D 130227 11:57:40 gateone:397] cleanup_session_logs()

liftoff commented 11 years ago

Excellent log output! Thanks to that the next commit will include a fix for that setTerminal() exception.

jmwright commented 11 years ago

Great!

liftoff commented 11 years ago

I just pushed a commit that should fix it. Let me know if you're still getting that setTerminal exception.

jmwright commented 11 years ago

I'm not able to get the error to happen again like I was earlier, so it looks like that bug is fixed. Thanks.

noregard commented 11 years ago

I'm still getting the following with the latest code:

[D 130227 22:25:59 gateone:1553] get_theme({u'go_url': u'https://192.168.1.219:8443/', u'theme': u'black', u'container': u'gateone', u'prefix': u'go_default_'})
[E 130227 22:25:59 websocket:261] Uncaught exception in /ws
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/tornado/websocket.py", line 258, in wrapper
        return callback(*args, **kwargs)
      File "gateone.py", line 1103, in on_message
        self.actions[key](value)
      File "gateone.py", line 1640, in get_theme
        f.write(io.open(path).read())
      File "/usr/local/lib/python2.7/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3384: ordinal not in range(128)
[D 130227 22:25:59 gateone:1118] on_close()
liftoff commented 11 years ago

I believe that UnicodeDecodeError related to get_theme() is fixed now (two commits ago). Can you pull the latest code and give it a try?

noregard commented 11 years ago

Getting a slightly different error with the latest:

[E 130302 23:23:43 websocket:261] Uncaught exception in /ws
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/tornado/websocket.py", line 258, in wrapper
        return callback(*args, **kwargs)
      File "gateone.py", line 1127, in on_message
        self.actions[key](value)
      File "gateone.py", line 1666, in get_theme
        f.write(io.open(path, 'r', encoding='utf-8').read())
    UnicodeEncodeError: 'ascii' codec can't encode character u'\u239a' in position 3384: ordinal not in range(128)
noregard commented 11 years ago

Latest code seems to work with some layout issues Screen shot 2013-03-19 at 11 01 05 PM

Also the --kill option is broken:

Traceback (most recent call last):
  File "gateone.py", line 3541, in <module>
    main()
  File "gateone.py", line 2891, in main
    module.init(all_settings)
  File "/opt/gateone/applications/terminal/app_terminal.py", line 2004, in init
    killall(go_settings['session_dir'], go_settings['pid_file'])
TypeError: killall_bsd() takes exactly 1 argument (2 given)
junefam commented 11 years ago

I saw someone post this same problem some weeks ago. I tried the latest version (downloaded yesterday) and this is what happened still

Gate One settings are incomplete. A new settings/10server.conf will be generated. Traceback (most recent call last): File "./gateone.py", line 3578, in main() File "./gateone.py", line 3040, in main all_setttings = options_to_settings(options) File "/opt/gateone/utils.py", line 292, in options_to_settings for key, value in options.items(): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/options.py", line 96, in getattr raise AttributeError("Unrecognized option %r" % name) AttributeError: Unrecognized option 'items'

liftoff commented 11 years ago

@bezoupham That error should be corrected now. It was a bug in Tornado 3.0 support. If you pull the latest code it should go away. Has nothing to do with OpenBSD :)