GateOne
GateOne copied to clipboard
[SOLVED] Fix for location cannot contain dots (ie IP addresses)
trafficstars
When using GateOne direct URL (eg via LibreNMS or other), location string may not contain dots or it may lead to the following:
Example URI: https://gatone.local:8443/?ssh=ssh://10.0.10.1&location=10.0.10.1
/static/gateone.js:973 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#go_10.0.10.1_error_message' is not a valid selector.
at Object.getNode (/static/gateone.js:973:35)
at Object.connect (/static/gateone.js:2600:27)
at parseResponse (/static/gateone.js:464:28)
at XMLHttpRequest.http.onreadystatechange (/static/gateone.js:1727:17)
In order to fix that DOMException, easiest way is to modifiy /static/gateone.js
On my CentOS 7 setup:
/usr/lib/python2.7/site-packages/gateone-1.2.0-py2.7.egg/gateone/static/gateone.js
One line 478, replace the line:
go.prefs.prefix += go.location + '_';
with:
go.prefs.prefix += go.location.replace(/\./g, 'dot') + '_';
which will repace dots with litteral word "dot" on location.
Hope this helps somebody else ;)