Feature #17229

Integrate webshell

Added by Peter Amstutz 9 months ago. Updated 4 days ago.

In Progress
Assigned To:
Target version:
Start date:
Due date:
% Done:


Estimated time:
(Total: 0.00 h)
Story points:
Release relationship:


Webshell in Workbench has two main pieces:

1. Shell in a box Javascript. This is the main implementation of the terminal emulator and communication with the server. It is lightly modified from the original upstream code. Specifically, there are a few references to a static asset loaded from /webshell/enabled.gif


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:

  1. Go to the virtual machines page
  2. Click on "Webshell" link
  3. 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.


Task #18040: Review 17229-integrate-webshellIn ProgressPeter Amstutz


#1 Updated by Peter Amstutz about 1 month ago

  • Target version set to 2021-09-01 sprint
  • Assigned To set to Stephen Smith

#2 Updated by Peter Amstutz about 1 month ago

  • Description updated (diff)

#3 Updated by Stephen Smith 19 days ago

  • Status changed from New to In Progress

#4 Updated by Peter Amstutz 19 days ago

  • Target version changed from 2021-09-01 sprint to 2021-09-15 sprint

#5 Updated by Stephen Smith 11 days ago

Changes at arvados-workbench2|8faf40308b6ff0e78029a474276cbe9381ee9498 branch 17229-integrate-webshell
Tests https://ci.arvados.org/view/Developer/job/developer-tests-workbench2/473/

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

#6 Updated by Peter Amstutz 5 days ago

  • Target version changed from 2021-09-15 sprint to 2021-09-29 sprint

#7 Updated by Peter Amstutz 5 days ago

Two comments:

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.

#8 Updated by Peter Amstutz 4 days ago

It could also be configured to only use the URL for handoff when configured for session storage, and use local storage the other times.

Also available in: Atom PDF