Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] How to add orion shell command that will execute on the server shell

Hi Philip,

The Orion server doesn't provide a way to execute arbitrary shell commands out-of-the-box. Assuming you're using the Java-based Orion server, it is designed to be accessed by multiple users, and the ability to run shell commands with server privileges is a security problem.

However, you could extend the Orion server and write a new servlet that provides this functionality. For example, you can register it with a servlet path like /shellcommand/{command}?{arguments}. Then your client-side plugin could simply make an XHR call to this new servlet, passing the user's command arguments received from gcli. You can use NpmServlet.java as a starting point, since it captures process output and forwards it back to the client, which you will probably have to do.

Keep in mind though, that the existing gcli-based Orion shell page doesn't provide a way for shell commands to receive standard input from the user. So any pagers or interactive programs that prompt the user will not work. Orion contributors are working on a TTY-based shell that will replace the gcli shell, and will solve this problem.

There is also ongoing work to integrate Docker with Orion, which allows each user to get a separate, fully-featured *nix shell to play with. This may be of interest to you, as you could potentially create a virtual filesystem that mounts the user's Orion projects as well as other locations in the filesystem that the user needs to access.

Mark



On Thu, May 1, 2014 at 11:02 PM, Philip Chan <philip@xxxxxxxxxxx> wrote:

I am using orion as the web-based IDE for our team development work. I need to have a way to execute command to copy files/directories from the orion workspace to a locations outside of the workspace via the orion shell. But since it is not just a single file I would like to use something like a shell script or even ant. 


So I start playing with the plugins. In particular trying to add more command to the orion shell (gcli). I was able to follow the example in adding the arbitrary command from the online documentation. (https://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Plugging_into_the_shell) However I cannot find anything that point to adding command that will run shell command on the server.


I was able to clone the repos and see there are npm plugins for orion shell. But since I'm so new to orion, I can't quite follow how it was able to execute the command on the server side. If anyone can point me to documentation or example on how to do this would be greatly appreciated. Suggestion of alternative is also welcome.


So to summarize: How to implement orion shell plugin that will execute arbitrary shell script on the server that orion is running?






_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



Back to the top