XML-RPC Client GUI
Release date = 2006-05-27
perl gus_xml-rpc_client_tk.pl --help
An XML-RPC client GUI useful in triggering external Perl scripts on any PC running the companion server.
These are things you can and should change.
The companion server for this client employs a custom XML-RPC method named execute_script
where the client sends it a text string containing the path to an external Perl script. The server then opens said script as a script (aka 'runs' it). For security reasons, only a finite set of these will the server accept. This list is available to the client in the form of a line-delimited *.txt
file. So that the client may find this list, you will need your own default directory path and default file name in the obvious place near the head of this XML-RPC client script.
This is to say, when a common path is attainable by both server and client. Click the Execute
button on the client, then browse the shared network for a *.txt
file of server-approved *.pl
files. A pop-up menu of that very list will appear. Select any of the *.pl
files which you wish the server to run.
This is to say, when neither the server nor client share any hard drive resources. Click the Execute
button on the client, then browse the local network for an updated copy of the *.txt
file listing server-approved *.pl
files. A pop-up menu of that copied list will appear. Select any of the *.pl
files, et cetera, which you wish the server to execute.
The default local port for server URLs is 8080
. This may be overriden by calling the client via command line and listing some port other than 8080
as the first command-line argument. Or you may prefer to edit the built-in default near the head of this script. Chances are you need not change this. But if you should find that port 8080
is already in use for some other service (or blocked by a firewall), try instead port 8888
, or any other as deemed convenient.
This is a method where, upon clicking the Send
button, you browse for a pure ASCII document. A filtered copy thereof will be transmitted to selected servers. Upon receipt, each server will choose its own path for whatever kind of file it is.
The aforementioned filtering is accomplished skipping over any such lines as match against regular expressions from the %lines_to_skip
hash whose keys are likewise regular expressions matching the filenames of user-selected documents.
add_doc_elsewhere
method as follows. Certain MTS servo-hydraulic testing machines which are left to run unattended on weekends had formerly required on-site visitation by operators working on overtime, and at their considerable inconvenience. Most frequently, however, such efforts were merely to determine that, no, the machines in question had not stopped and did not therefor require any service.
At startup, this client will only know its own URL (on the assumption that the companion XML-RPC server runs there also...for testing purposes, or whatever). To change this, read in a list of any other URLs from a text file via the pull-down menu 'Config', sub-menu 'Load Server URLs'. Said text file should contain one URL per line, such as 168.192.0.1
or foo.bar.net:8080
or foo.bar.net:8080/RPC2
. On any such URL, if at front the http://
or at back either the :8080
or the /RPC2
are missing, they will be added. Or you may prefer to edit the built-in default list near the head of this script. Optionally, each listed URL may include a single TAB
followed by descriptive text on the same line.
The firewall-penetrating ability of XML-RPC can be exploited to relay communication with various daemons other than just XML-RPC itself.
$cipher_key
near the head of each). Or if this has been left empty, a default pass phrase (refer to $GUS::Crypt::DEFAULT_KEY
near the tail of each) will serve in its stead. The client may later propagate new pass phrases to selected servers at any time.
$GUS::Crypt::obfuscate
for details) and again each time the cipher is changed.
Transactions also require a password. At startup, both client and server must employ identical plain text passwords (refer to $plain_pw
near the head of each). The client may later propagate new passwords to selected servers at any time. Obviously, when leaving the client unattended, you should delete any stars from the password entry widget.
$script_list
) stripping away any ascending path elements. Secondly, it checks against its own list of allowable scripts (ref $script_list
). Thirdly it makes sure the script is pure ASCII. Lastly it insures against any modification since upload or server startup.
execute_script
method is free from any malicious tampering prior to startup. This is the sole responsibility of the user.
Install these into Perl via ActiveState PPM, else into NetBSD pkgsrc or CPAN as appropriate for your OS: Frontier::Client
, Tk
, Sys::Hostname::Long
, Crypt::CBC
, Crypt::Blowfish
, Log::Logger
, XML::Simple
, Data::Dumper
.
A number of my own GUS::*
packages are already embeded in both the client and server scripts. These do not add much that is truly novel but exist as separate packages for the sake of authorial convenience.
Nothing here presentes itself as a difficulty. Required external dependencies are available from the expected sources: /usr/pkgsrc
for NetBSD and/or CPAN for Perl. I cannot say for Linux, since I have yet to try it. If any report a problem for Linux, I would very like to help work it out and document the solution here.
No especial problems here either, except that some things are not where most folks expect to find them.
ppm> help repository
ppm> repository add ``Lincoln Stein'' http://stein.cshl.org/ppm
ppm> repository add ``Randy Kobes'' http://theoryx5.uwinnipeg.ca/ppms
Unless the companion Perl script gus_xml-rpc_server.pl
running on some other network-attached PC, this client GUI will lack any server to communicate with. Refer to documentation for the server at this URL: http://starling.us/tet/gus_perl/gus_xml-rpc_pl/gus_xml-rpc_server.html.
For testing purposes, of course, client and server may both be run on a single PC.
For use with the execute_script
method. Refer to documentation of the companion XML-RPC server for a complete list of these.
At startup the client only knows its own URL. That of course assumes the companion XML-RPC server to be running on the same PC. Other than for testing purposes this is clearly rather silly. To be useful then, create your own list of URLs storing these in a text file. Refer to the pull-down help menu for an example.
Gan Uesli Starling <gan@starling.us>
Copyright (c) 2005-2006, Gan Uesli Starling. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Network