Submitted by sgrayban on Tue, 06/16/2009 - 04:01
I like the virtualmin CLI but parts of it are lacking some simple code to make it more webhosting dynamic...
For example "virtualmin list-available-scripts" will list all the scripts which is nice in console but how about a way to make it list these scripts dynamically ? EG; call the script from php with a --html switch ?
This way hosting companies can list all the available scripts and they wouldn't have to constantly keep them update manually.
So something like "virtualmin list-available-scripts --html" would format the output with summary in html format.
Status:
Closed (fixed)
Comments
i second that. My page is still from 2008 cause its too much work to update.
Submitted by sgrayban on Tue, 06/16/2009 - 10:03 Comment #2
I just updated mine if you want to copy it. Did it manually here and it took a hour to fix up right.
https://www.borgnet.net/clients/vm_scripts.php
Hope they will add this switch to make life easier for us.
Submitted by JamieCameron on Tue, 06/16/2009 - 11:40 Comment #3
There is actually a page in the Virtualmin docs that contains all the scripts in the latest version, which is generated by a trivial script that runs "virtualmin list-available-scripts".
Alternately, I have attached a small perl script to do this to this bug report. That is the recommended approach as the Virtualmin command-line programs aren't designed to output HTML.
I think a real long term solution to this would be the option to output the contents of the final data structure as a JSON or XML or YAML or Data::Dumper dump, whatever standard data format (Perl supports all sorts of data serializers, so all of these and more are available in CPAN; JSON-XS will be installed, by default on Virtualmin systems soon, because we need it for the ongoing JavaScript work). Then scripts in any language that supports one of those data formats could trivial import it into their own data structure and print it out.
Having a standardized data output format has been requested quite a bit for lots of the scripts; it's not specific to list-available-scripts, and I don't think a special-purpose solution is the right way to go here. Once there's a standard, easy-to-parse, data format output, I suspect a lot of folks would write scripts to do various things with the data.
Submitted by JamieCameron on Tue, 06/16/2009 - 16:08 Comment #5
Agreed, long-term an XML or JSON format would be a good thing. However, that format wouldn't be HTML, so some parsing to convert to a human-readable table would still be needed ..
Submitted by Issues on Tue, 06/30/2009 - 16:18 Comment #6
Automatically closed -- issue fixed for 2 weeks with no activity.
Submitted by sgrayban on Tue, 06/30/2009 - 23:40 Comment #7
I hope this is a todo list someplace ? Some sort of standardization would be nice.
I hope this is a todo list someplace ? Some sort of standardization would be nice.
Standardization of our todo lists? They're pretty standard...a flat text file in SVN for Jamie, and a text file in my home directory. ;-)
Or do you mean you'd like us to maintain a public roadmap of some sort?
Submitted by sgrayban on Wed, 07/01/2009 - 00:06 Comment #9
Standardization for the script output or are you just going to leave it this way and have us just use that perl above ?
We definitely plan to add other options for the output of all commands, probably including XML and JSON. HTML will probably be some sort of wrapper script (HTML is not a particularly easy to parse format for data structures, so it would be painful to use HTML as the basis of additional scripts; likewise integrating the output into existing CMS or blogs or wikis or whatever would be much easier from JSON or XML).
Submitted by sgrayban on Wed, 07/01/2009 - 00:24 Comment #11
ok
Submitted by JamieCameron on Wed, 07/01/2009 - 00:36 Comment #12
Yes, an option for JSON output is on my todo list .. which is really just a file I maintain with ideas for the future in it :-)