Need to create a basic web page to wrap some CLI progs

DivideBYZero

Lifer
May 18, 2001
24,117
2
0
So I want to run a set of CLIs and pass positional arguments. What is my quickest method which will also be browser agnostic? Jscript? Other?

Assume vanilla apache and tomcat.

Thanks.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Are you wanting to run this on the server or on the client? I'm guessing it's the latter, but hopefully you realize the incredible security risk in such an implementation. Following that, you'll then know why it's not necessarily easy to do.

In short, you're not going to be able to do it in a browser agnostic (or even platform agnostic) fashion with anything rendered into the page itself; that is, you'll need something like Java, Flash, ActiveX, Silverlight, etc. Even those carry security restrictions which will make it extremely difficult to run client-side CLI apps.

So, are you sure you need to do that? If you tell us what you're actually wanting to do we can offer some alternatives.
 

DivideBYZero

Lifer
May 18, 2001
24,117
2
0
Well I have alternatives, I'm going to write a GUI to wrap all the CLIs, but this requires a local install and I'm after a web interface. I do understand the security issues, but this was intended to be a QADF.

As an example I need to run the command:

See totally inflexible 'code' box :|

So I want to pass the values for the strings from the web form to build the full command. If it's too much effort I'll just knock up a win/linux GUI to do it, but I'm trying to cut corners and reduce installation requirements for end users.
 

hooflung

Golden Member
Dec 31, 2004
1,190
1
0
You might want to wait for QT4.4 to realease. It adds webkit engine as a widget and that is probably the best damned browser engine on the planet.
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
I did something like that in Perl (it was for internal use, so security wasn't a big deal). Basically use CGI to grab the args, use backticks or the system command in Perl to execute the script you want, then display the results.

EDIT: Nevermind, misunderstood the question.
 

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
Originally posted by: esun
I did something like that in Perl (it was for internal use, so security wasn't a big deal). Basically use CGI to grab the args, use backticks or the system command in Perl to execute the script you want, then display the results.

That only works if you want to execute the app on the server, not the client.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: DivideBYZero
I'm trying to cut corners and reduce installation requirements for end users.
The web is a quick and easy solution for a lot of things. Running programs on the client side isn't really one of them.

You might look into java web start, which is geared towards this sort of thing, but it may be impractical for a number of reasons.
 

DivideBYZero

Lifer
May 18, 2001
24,117
2
0
Originally posted by: esun
I did something like that in Perl (it was for internal use, so security wasn't a big deal). Basically use CGI to grab the args, use backticks or the system command in Perl to execute the script you want, then display the results.

EDIT: Nevermind, misunderstood the question.

No. You got it right. This is what I'm after and perl would be a possible solution. Care to share?
 

DivideBYZero

Lifer
May 18, 2001
24,117
2
0
Originally posted by: tfinch2
Originally posted by: esun
I did something like that in Perl (it was for internal use, so security wasn't a big deal). Basically use CGI to grab the args, use backticks or the system command in Perl to execute the script you want, then display the results.

That only works if you want to execute the app on the server, not the client.

I want to run on the server.
 

DivideBYZero

Lifer
May 18, 2001
24,117
2
0
Originally posted by: kamper
Originally posted by: DivideBYZero
I'm trying to cut corners and reduce installation requirements for end users.
The web is a quick and easy solution for a lot of things. Running programs on the client side isn't really one of them.

You might look into java web start, which is geared towards this sort of thing, but it may be impractical for a number of reasons.

Trying to not feel patronised here...
 

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
Originally posted by: DivideBYZero
Originally posted by: tfinch2
Originally posted by: esun
I did something like that in Perl (it was for internal use, so security wasn't a big deal). Basically use CGI to grab the args, use backticks or the system command in Perl to execute the script you want, then display the results.

That only works if you want to execute the app on the server, not the client.

I want to run on the server.

It should be fairly simple then if you want to invoke a process on the server.

http://perldoc.perl.org/functions/system.html

Make sure you validate and escape your input.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Originally posted by: DivideBYZero
Trying to not feel patronised here...
Sorry, wasn't my intention at all. Somehow we all (except esun) got the idea that you wanted to run scripts on the client :confused: :p
 

DivideBYZero

Lifer
May 18, 2001
24,117
2
0
Originally posted by: kamper
Originally posted by: DivideBYZero
Trying to not feel patronised here...
Sorry, wasn't my intention at all. Somehow we all (except esun) got the idea that you wanted to run scripts on the client :confused: :p

Yeah, I noticed that. My bad on the description. Thanks anyway. :)
 

DivideBYZero

Lifer
May 18, 2001
24,117
2
0
Originally posted by: tfinch2
Originally posted by: DivideBYZero
Originally posted by: tfinch2
Originally posted by: esun
I did something like that in Perl (it was for internal use, so security wasn't a big deal). Basically use CGI to grab the args, use backticks or the system command in Perl to execute the script you want, then display the results.

That only works if you want to execute the app on the server, not the client.

I want to run on the server.

It should be fairly simple then if you want to invoke a process on the server.

http://perldoc.perl.org/functions/system.html

Make sure you validate and escape your input.

Hmm, sweet. I can check exit codes, too. Thanks!