liftoff / GateOne

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

GateOne 1.2.0 autoConnectURL not working!! #226

Open JohnSundarraj opened 11 years ago

JohnSundarraj commented 11 years ago

I tried accessing GateOne 1.2.0 with my application. I passed autoConnectURL param, but it doesn't seem to work!!. But i got GateOne loaded properly with no problems. Here is my code...

      $auth = array(
         'api_key' => $api_key,
         'upn' => $user_name,
         'timestamp' => time().'0000',
         'signature_method' => 'HMAC-SHA1',
         'api_version' => '1.0'
      );
      $webssh_auth['signature'] =   hash_hmac('sha1',$auth['api_key'].$auth['upn'].$auth['timestamp'],$secret_key);
   ?>
   <script>
      var url = '<?php print $base_url ?>';
      scriptTag = document.createElement('script');
      scriptTag.src = url + '/static/gateone.js';
      scriptTag.onload = function() {                
         GateOne.init({
            url:url,
            embedded:false,
            disableTermTransitions:true,
            showTitle:false,
            showToolbar:false,
            fillContainer:true,
            colors:'gnome-terminal',
            auth:<?php print json_encode($auth)?>,
            autoConnectURL:'ssh://<?php print $user ?>@<?php print $host ?>:22'
         });
      }
      document.body.appendChild(scriptTag);           
   </script>
   <div id="gateone"></div>```

Anyway i need help on this... Thanks in advance.
liftoff commented 11 years ago

Confirmed... It's a bug. I'll fix it.

JohnSundarraj commented 11 years ago

Tried your latest commit. gateone.py throws error "api_keys should be a base string", this error is from tornado options. cant even start gateone.py, becoz of this error.

Also i tried changing the ssh.js file(autoConnect function alone), but No luck!!

liftoff commented 11 years ago

That api_keys error is new to me. Can you paste your configuration files (from /settings)?

JohnSundarraj commented 11 years ago

Dan, a new bug. I installed GateOne 1.2.0 on my another Ubuntu 12.04, when is started gateone.py, i found errors!!. I have installed all the dependencies. This error is related to timestamp, please check this.

[E 130323 10:07:10 websocket:261] Uncaught exception in /ws
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/tornado/websocket.py", line 258, in wrapper
        return callback(*args, **kwargs)
      File "./gateone.py", line 1101, in on_message
        self.actions[key](value)
      File "./gateone.py", line 1268, in authenticate
        then = datetime.fromtimestamp(int(timestamp)/1000)
    ValueError: timestamp out of range for platform time_t

By the way ,i'll give you the api_keys error, when i again try your latest code. I forgot to copy the error, thats y !!. Thanks.

JohnSundarraj commented 11 years ago

Got this error when running gateone on api auth mode.

Traceback (most recent call last):
  File "./gateone.py", line 3548, in <module>
    main()
  File "./gateone.py", line 2877, in main
    options[key].set(value)
  File "/usr/local/lib/python2.7/dist-packages/tornado/options.py", line 238, in set
    (self.name, self.type.__name__, type(value)))
tornado.options.Error: Option 'api_keys' is required to be a basestring (<type 'dict'> given)
JohnSundarraj commented 11 years ago

Thanks for your fixes, Dan. I'll test your latest code commit and let you know if that works.