billchurch / webssh2

Web SSH Client using ssh2, socket.io, xterm.js, and express. webssh webssh2
MIT License
2.36k stars 536 forks source link

Example of usage as interactive Web based tutorial #354

Open Utopiah opened 10 months ago

Utopiah commented 10 months ago

Hi! I've been using WebSSH2 quite a bit. I'm preparing a backend tutorial for https://github.com/mozilla/hubs-cloud/tree/master/community-edition and I'm wondering how to make it interactive. My goal is to avoid the typical copy/paste explanation.

I've been considering few solutions, e.g https://github.com/leaningtech/webvm/ or https://github.com/play-with-docker/play-with-kubernetes.github.io but I'm not sure either are adequate.

I'm also considering a script that would do most of the steps while still explaining clearly how and why but I'm not sure it would be really pedagogical.

Finally, my last idea would be to intertwine explanations and interactive steps in a shell in the Web page. For this I'm wondering if WebSSH2 would help.

Specifically I have in mind

  1. is it feasible at all (i.e can I connect locally, i.e where localhost is not the hosting server but rather the client visiting the web page)
  2. can it be relatively easily integrated as sections of the page (i.e 10 lines of 80 characters, not the whole page)
  3. can commands, e.g ls be "injected" by clicking on a link or button, easily as JavaScript
  4. can the results of commands be easily parsed, e.g checking if a kubernete pod does run properly
  5. last but least, even though it's an obvious security concern, can it be relatively properly without the end user visiting the page worry for their data

I also wonder if there are existing examples where WebSSH2 isn't solely a terminal but rather something more interactive and integrated for pedagogical purposes, e.g learning the CLI.