Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GateOne 1.2.0 autoConnectURL not working!! #226

Open
JohnSundarraj opened this issue Mar 20, 2013 · 6 comments
Open

GateOne 1.2.0 autoConnectURL not working!! #226

JohnSundarraj opened this issue Mar 20, 2013 · 6 comments

Comments

@JohnSundarraj
Copy link

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
Copy link
Owner

liftoff commented Mar 20, 2013

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

liftoff added a commit that referenced this issue Mar 22, 2013
…cts if a given module is an application and registers it accordingly in GateOne.loadedApplications.

gateone.js:  Renamed the 'NAME' variable that gets attached to all objects created with GateOne.Base.update() to '__name__' to clarify that it is meant to be a special-use variable.
gateone.js:  Renamed the 'parent' variable to '__parent__' for the same reason as above.
gateone.js:  Renamed the 'VERSION' variable to '__version__' for the same reason as above (and consistency).
gateone.js:  Added 'viewBox="0 0 18 18"' to all SVG icons so they will scale-to-fit better in certain situations.
gateone.js:  Fixed a bug where GateOne.Visual.slideLeft() would sometimes slide up too.
gateone.js:  Alphabetized GateOne.prefs defaults at the top of the script because I'm a freak like that.
gateone.js:  Implemented a keepalive mechanism that uses GateOne.Net.ping() to determine if the connection to the Gate One server has been lost.
gateone.js:  Added two new preferences:  GateOne.prefs.pingTimeout and GateOne.prefs.keepaliveInterval.  They're both set in milliseconds and control the new keepalive/ping timeout mechanism.  The defaults are 5000 (5 seconds) and 15000 (15 seconds), respectively.  This should resolve issue #217
gateone.js:  Fixed a bug in GateOne.Utils.isVisible() where it would fail to make a correct determination in certain situations (and sometimes cause an exception).
gateone.js:  Made some changes to GateOne.Utils.getEmDimensions() in order to make it more reliable in certain situations.
gateone.js:  Made some changes to GateOne.Utils.getRowsAndColumns() in order to make it work on elements that are not (currently) visible.
gateone.js:  Fixed a bug in GateOne.Events.off() where it was referencing an undefined variable (self) causing an exception (most commonly happened in conjunction with once()).
terminal.js:  newTerminal() now passes a 'termUndefined' variable when triggering the 'terminal:new_terminal' event so functions attached to that event can tell if this terminal is new or was merely re-created from an existing session (e.g. user reloads the page or reconnects).  e.g. trigger("terminal:new_terminal", term, termUndefined).
Themes:  Just a few tweaks here and there to the new prefs panel stuff.
SSH Plugin:  Fixed the bug where autoConnectURL was not working.  This should close issue #226.
@JohnSundarraj
Copy link
Author

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
Copy link
Owner

liftoff commented Mar 22, 2013

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

@JohnSundarraj
Copy link
Author

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
Copy link
Author

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)

liftoff added a commit that referenced this issue Mar 28, 2013
…rom ending up in the auto-generated settings/10server.conf. Just keeps things tidy and prevents confusion. It wouldn't hurt anything to have them in the file (in case you've already got them in your 10server.conf, don't worry about it).

gateone.py:  Fixed a bug where you could get an exception with the 'api_keys' setting.  This should correct the problem reported in #226.
gateone.py:  Fixed a bug where users were being sent client-side plugins that had been disabled globally via the 'enabled_plugins' setting.
gateone.js:  Fixed a bug in GateOne.Utils.isVisible() that could cause a NS_ERROR_XPC_BAD_CONVERT_JS exception in Firefox.
@JohnSundarraj
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants