Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

perl web shell

by baxy77bax (Deacon)
on Oct 11, 2009 at 10:01 UTC ( [id://800528]=perlquestion: print w/replies, xml ) Need Help??

baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:

hi ppl,

well my current project requires of me to create some sort of web interface for an interactive shell based program. and at the same time keep the functionality and flexibility of the main application.

so far users had to download putty (win) or if they used linux then it was much easier, but still win users (that most of my clients are) were pretty frustrated when they hat to know how to operate with 2-3 programs to get the job done. which means they have to use for example: putty, winscp + know the syntax to operate with the main program

so my idea was to gather all this into one package to which users could access through a web browser.

the idea came to me when i first encountered the goosh. i immediately fall in love with the idea and now the actual need for such tool was here, but i'm not so happy with the concept of java. i searched the net for some perl-lookalikes but all i managed to find is standard PerlWebShell (not good for interactive stuff), and AjaxTerm (phyton) which is promising but also based on java. problem with java is i don't have time to mess around with , to me , new syntax and some major changes have to be made to adopt it to my needs.

so my question now is do any of you know some abandoned webshell-terminal project (perl) which i could try to finish or there is nothing of sort done by perl community.

to write a wrapper around the goosh core, also requires of me to engage with java and i want to avoid that :)

thnx

baxy

Replies are listed 'Best First'.
Re: perl web shell
by toma (Vicar) on Oct 11, 2009 at 17:59 UTC
    I use the POE modules to do this sort of thing. POE enabled me to hook standard in and out of multiple programs to one console. I added a web server that sends and receives messages from the different programs. This provides a nice web UI or text area for simple commands, while at the same time the full capability of the command line is still available in a console window.

    It took me a while to get this all figured out, but it was worth it. POE terminology was not familiar to me, but once I figured out POE::Wheel::Run I had most of what I needed.

    I didn't have much luck with non-cygwin perls on Windows, but perhaps this has changed.

    It should work perfectly the first time! - toma

      wow I wanted to reply to the initial post but I don't know why I can't so I'll write here

      I think goosh is a very very good idea, it just takes out all the unnecessary stuff and you get to what you want

      but I saw goosh has the source on google code so I don't know why you say you have to mess with java. I looked at the source and it was pure js(maybe some google api not sure...havne't read it all).

      I think I'll use goosh from now on although I am a little bit concerned about cross-domain ajax and not sure how safe it is in that regard but apart from that it's good.

        Make it https and require http auth (and require modern browser like firefox3), and cross-domain is eliminated :)
Re: perl web shell
by Anonymous Monk on Oct 11, 2009 at 16:18 UTC
    Isn't using browser to avoid learning shell syntaxt? Can you use links, forms and buttons?
Re: perl web shell
by spx2 (Deacon) on Oct 12, 2009 at 10:12 UTC

    heh, it seems I can comment on the initial post as well

    I just took a look at at Perl Web Shell which is just a CGI script that runs some commands or changes the current directory or lists files/directories in cwd.

    The "interactivity" part that you complain about is given by goosh(which is client-side) which you need to integrate with Perl Web Shell.

    But my main concern remains security(anonymous monk has just provided a solution to cross-domain ajax) , the problem still remains about what the user can run on the server and I think you will find some nice code related to that in buubot which you can check out the source of here -> svn://erxz.com/bb3

    good luck and have fun(most important)

      thank you ppl, for all your replays!

      well concerning the security i was also thinking of https, and for restricting the user within it's user directory i was thinking of jailing the dir in question (chroot ssh) so the security should be on the level. (at least i hope)

      second :

      everything that has 'java' string in the word is making me allergic that is why i'm hesitating in scoping the goosh code :) but it seams i'll have to do it at some point.

      third :

      when i was referring to interactivity i was thinking more about how to evaluate each line that goes into input area (before the specific command appears) on a client-side and then after that command is entered the accumulated input is passed to the server for further evaluation.

      is something like this possible ?

      thnx

      baxy

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://800528]
Approved by AnomalousMonk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found