Channel/User tree via JSONP

Ice/DBus, Web-Interfaces, Management tools

Channel/User tree via JSONP

Postby pavelhoral » Mon Mar 08, 2010 9:36 pm

Hi guys,
I want to share a little work I've done for my clan. The situation is that our Murmur runs on private server and our clan website is on free hosting. The task was to have a list of channels and users on the website.
Hosting the website on the same machine as Murmur server is not possible. Using remote Ice is not possible as well as the freehosting doesn't have the PHP libraries... Giving access to Ice interface to the webmaster is also not a good idea.

One solution is using IFRAME, but I really hate IFRAMes ;). Plain AJAX can not be used because the website and Murmur are not in the same domain (XSS). So the next solution is to use JSONP and create a little widget for webmaster:

* First I made a small PHP script to render Mumble Tree into JSON object (http://gambler.orchitech.cz/mumble-serv ... l-data.php).
* The script also handles optional 'callback' parameter so it can be used as JSONP (http://gambler.orchitech.cz/mumble-serv ... ack=foobar).
* Next I made simple JS widget, which loads the JSON (http://gambler.orchitech.cz/mumble-tree/MumbleTree.js).
* And at last using some simple CSS you can see the result - http://gambler.orchitech.cz/mumble-tree/mumble-tree/

This takes me about 4 hours to make - I stopped when I see it does the job I want it to do. Feel free to use it or leave a comment what do you think about it. If you want the PHP file which generates the JSON I can post it here.

Keep up the good work with Mumble
Pavel


Update (6th Jul 2010): I have translated test page (http://gambler.orchitech.cz/mumble-tree/) to the English and add some additional information. It is now more project-like page with about, downloads, and installation sections
Last edited by pavelhoral on Mon Dec 23, 2013 9:10 am, edited 2 times in total.
pavelhoral
 
Posts: 19
Joined: Mon Mar 08, 2010 9:12 pm

Re: Channel/User tree via JSONP

Postby ryry46d9 » Thu Mar 11, 2010 7:31 pm

nice
ryry46d9
 
Posts: 14
Joined: Fri Feb 19, 2010 10:16 pm

Re: Channel/User tree via JSONP

Postby rebroy » Mon May 03, 2010 5:01 pm

Sorry Pavel but could you please explain this to me in layman terms?

First let me tell you about my clans situation. We have a dedicated server which runs our Murmur server 1.2.2 (Windows 2003), this server does not have PHP installed.

We also have a webserver (Linux), which is shared, this does have PHP but we were not able to install Murmur on it, as we don't have rights to install and run programme files, we have to go through cPanel and/or FTP to do anything.

So we have no viewer for our Mumble server!
rebroy
 
Posts: 5
Joined: Mon May 03, 2010 4:44 pm

Re: Channel/User tree via JSONP

Postby kissaki » Mon May 03, 2010 5:41 pm

All the JS script he provided needs a json-encoded tree of the channel tree.
Thus, you'll have to get the tree out of your murmur server and provide it as JSON somewhere.

He did it as he wrote: "small PHP script to render Mumble Tree into JSON object"

The JSON could be any programming language though, as long as it somehow gets the mumble channel tree.
One way would be via Ice and PHP, or Ice and python, and so on…
MumPI: Your Mumble Web Interface in PHP
User avatar
kissaki
Team member
Team member
 
Posts: 1278
Joined: Sat Jan 09, 2010 12:15 pm

Re: Channel/User tree via JSONP

Postby rebroy » Tue May 04, 2010 12:31 pm

Thanks kissaki, I now understand a little better, my problem is, that I take care of our clans website but I have little or no real programming knowledge, most of what I do is graphic related.

Although we have over 50 members from 22 countries, we are short on programming guys, We had a French guy that was brilliant at this sort of thing and did a lot of work on our stats pages etc. but he just dropped out of sight one day! And now we are stuck when it comes to this type of stuff, I was hoping that this would be something I could understand and try but it is beyond my capabilities :cry: I don't even know what a JSON object is. I came across this forum in my Google search whilst searching for a viewer.

If there is anyone willing to do this for us or help me to do it, we would be glad to make a small donation to your clan or favourite charity etc. If so we could maybe talk about it on our Mumble.

Thanks
rebroy
 
Posts: 5
Joined: Mon May 03, 2010 4:44 pm

Re: Channel/User tree via JSONP

Postby kissaki » Tue May 04, 2010 5:27 pm

You said you had a dedicated server where murmur runs but no PHP and a hoste webserver/webspace without murmur.

To help you, please give some more details on:
*is your dedicated server a root server? or just murmur?
*Would installing PHP and the Ice PHP extension as well as a webserver on the root be an option for you?
*Can you install the PHP Ice extension for your webserver?

If it's a root dedicated server you could either run murmur with ice and add a script to provide the JSON data and use the JS script above on your website (where the providing script could be PHP which would require a webserver, a java program as a standalone server, …),
or enable Ice for murmur and, if you can install php-ice on your webserver, access murmur directly from your website.

JSON is just a formatted string representing data. Just like XML and the like.
MumPI: Your Mumble Web Interface in PHP
User avatar
kissaki
Team member
Team member
 
Posts: 1278
Joined: Sat Jan 09, 2010 12:15 pm

Re: Channel/User tree via JSONP

Postby rebroy » Tue May 04, 2010 10:13 pm

Not sure what you mean by "root server" my understanding of a root server is a machine that has the software and data to locate name servers that contain authoritative data for the top-level domains, I'm certain that's not what you mean!

Our dedicated server is a stand-alone machine in a rack in a London data centre, it's a 3.2 Ghz dual-core and the operating system is Windows server 2003, we use it for running our murmur server but it's main use is for us to set up and run public game servers, of which we have several.

Installing PHP and the Ice PHP extension is not an option for this dedi, a webserver would just use up our gaming resources, as well as presenting several security issues.

On our webserver, we do have PHP 5 installed but I don't think we have Ice for PHP.

Does this information help?
rebroy
 
Posts: 5
Joined: Mon May 03, 2010 4:44 pm

Re: Channel/User tree via JSONP

Postby kissaki » Wed May 05, 2010 9:33 am

yeah,
with root I meant full access, over the entire system.

As you will neither install php ice on the ded. server nor the webserver you could
a) run a standalone script (including server) on the ded machine (e.g. a java program with embedded jetty http server, which shouldn't really eat up much resources at all)
b) use a 3rd host to run the php ice scripts (or others) – This would result in communications: murmur data to 3rd host via Ice, 3rd host callable (JSON)/embeddable by website.

As you can't install php ice on your webserver you probably can neither install appropriate python or java packages, right? :) That's what I presumed here.
MumPI: Your Mumble Web Interface in PHP
User avatar
kissaki
Team member
Team member
 
Posts: 1278
Joined: Sat Jan 09, 2010 12:15 pm

Re: Channel/User tree via JSONP

Postby rebroy » Wed May 05, 2010 12:16 pm

Yeah, we have full access to the dedi via VNC and we have enough resource to run a java type applet, although I have no idea what a jetty http server is!

Our webserver is a basic package that we have with Lunapages, most of the software and scripts that they do supply, PHP, Joomla etc. we can install through the cPanel using Fantastico, they do support python but not it seems on the basic package so we are unable to install python although we do have perl installed, which I thought was simular. If any of this helps!
rebroy
 
Posts: 5
Joined: Mon May 03, 2010 4:44 pm

Re: Channel/User tree via JSONP

Postby pavelhoral » Sat May 22, 2010 2:25 pm

Hi,
somehow these replies did not end in my mailbox, so sorry for the late reaction. The easiest way is really to install Apache HTTP server with PHP on Murmur dedicated server. You mentioned two reasons why you don't want to do this:
  1. security
  2. performance
Security: You don't need to make any special configuration. You need only to place single PHP file in the document root folder. This PHP file is not including any other file and it is not processing any user input.
Performance: depends on how many request you think your server will handle. Our Murmur server is virtual server with only 256MB memory and it works just well.

If you think that these two are real issues, the only solution will be to use 3rd server (as kissaki suggested) to prepare the JSON data or use other webhosting with Ice extension.

Btw. you can find my small PHP script at http://gambler.orchitech.cz/mumble-tree ... e-json.txt . And please write back how (and if) you solved your situation as I think it is pretty common.
Last edited by pavelhoral on Mon Dec 23, 2013 9:11 am, edited 1 time in total.
pavelhoral
 
Posts: 19
Joined: Mon Mar 08, 2010 9:12 pm

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests

cron