gsamokovarov / rvt

Remote Terminal for the Browser.
MIT License
56 stars 17 forks source link

Feature Request: Add method to render rvt console in current view #5

Open drale2k opened 6 years ago

drale2k commented 6 years ago

I need to add a bit of UI around the console and i noticed that the rails web-console allows for it to be rendered in the current view, with calling <% console %>.

I believe this would be generally very useful to anyone using rvt.

gsamokovarov commented 6 years ago

IMO, you can render an iframe in this case. Placing a (web) console in your code is like leaving a breakpoint in a debugger, but RVT is a virtual terminal, powered by Rails, so we don't have a context to rendered it in.

drale2k commented 6 years ago

I am using an iframe right now as a workaround but there are some inherent issues

A naive question. if i render xterm.js on my site inside a div and just send input/output to RVT resources, wouldn't this be all it would take? For context, i am running "/bin/sh" so i can run commands on my linux server within the Rails app which is protected by authentication using Devise.

I say that because i think rails/web-console is taking care of rails console and context. RVT imo should be more generic and not care about rails context.

This is a python example (https://github.com/jupyter/terminado). Would love to not use a separate application as a proxy but instead have it inside a Rails app :)

gsamokovarov commented 6 years ago

RVT is what rails/web-console was in its 1.x days. I extracted it into a separate project, because Web Console changed it's scope for 2.x and we had 2 products in one package, which was hard to maintain. I can drop the CSP protection, but I don't want to blow up the scope of RVT.

I can add a more generic authentication support, so you can attach a rack app instead of just relying on IP whitelisting. This can help you authenticate requests coming from Device authenticated users.

drale2k commented 6 years ago

Ok thanks. I was under the impression that rails/web-console focused on being a rails console in the browser and RVT was extracted to allow and focus on general terminal emulator use.

More generic auth would definitely help. in the meantime i would like to try to use RVT in hte back but use a separate instance of xterm.js in my rails app and just point it to the RVT resources.

On top of your head, do you think this should just work or is there more to it?

gsamokovarov commented 6 years ago

There is a bit of frontend glue code. Check out the files in {app,lib}/assets/javascript.