Webshell in Workbench has two main pieces:
2. The webshell page. This creates a "ShellInABox" object with the appropriate URL. It also has hooks that check for "username:" and "password:" prompts to automatically send the correct username and token:
For Workbench 2 integration we probably want it to behave the same way as Workbench 1:
- Go to the virtual machines page
- Click on "Webshell" link
- Load webshell in a new tab
It probably makes sense to have the webshell exist on a static HTML page separate from the react app, and just do a handoff of the the webshell server URL, username and token.
#5 Updated by Stephen Smith 11 days ago
Changes at arvados-workbench2|8faf40308b6ff0e78029a474276cbe9381ee9498 branch 17229-integrate-webshell
I wasn't sure if there was a better way to get the token / user / host over to the webshell so I just used url parameters
#7 Updated by Peter Amstutz 5 days ago
1) The token is available in local storage. However, we also support storing the token in session storage, which not shared between tabs. Then local storage will be empty. So I think using the URL for hand off is fine.
The first thing it should do when the page loads is read the token into a variable, and then remove it from the URL bar (it should replace the history item, not push a new one). This prevents the user from accidentally copying-and-pasting or bookmarking a URL with their token.
However, if the user reloads the page and the token has been removed from the URL bar, that won't work. So for that case (where there is no token in the URL) it should fall back and check local storage. If there is no token in local storage, it should render an error and offer a link to go back to the virtual machines page.
Also, once the token has been sent, there is no reason to keep it in memory, so we should clear the variable.
2) As Lucas mentioned, workbench2 has an idle timer. The webshell should also respect the idle timer. The timeout configuration item is Workbench.IdleTimeout. If there is no keyboard or mouse activity after the specified amount of time, it should disconnect the session. In addition, I think we have have a local storage item with a "last activity" timestamp. It should set / check this timestamp to coordinate activity across all the workbench2 or webshell tabs. Lucas can tell you more.