OpenRTMFP / Cumulus

CumulusServer is a complete open source and cross-platform RTMFP server extensible by way of scripting
http://groups.google.com/group/openrtmfp-cumulus
GNU General Public License v3.0
593 stars 222 forks source link

Manage all (sub-)applications from a single main.lua #69

Closed dcodeIO closed 12 years ago

dcodeIO commented 12 years ago

I am trying to manage all connections to cumulus/DEVKEY just via LUA with mysql. However it seems that I have to create a www/DEVKEY/main.lua or I'll receive a NetConnection.Connect.InvalidApp response. It would be great if there'd be the possibility to manage all applications/developers from within a single www/main.lua without the need to create subfolders for everyone.

Keep up the good work!

cumulusdev commented 12 years ago

Hi,

Yes, I understand completly your problem! But for security and performance reasons I don't want change it (if the folder doesn't exist, the client have to be rejected immediatly, with minimum processing, to avoid server attack).

2 solutions for you:

function onConnection(client,response) print(client.key) end

function onConnection(client,response,key) print(key) end

dcodeIO commented 12 years ago

Thank you, that will absolutely do it for me!

dcodeIO commented 12 years ago

Tried it this way:

        con = new NetConnection();
        con.addEventListener(NetStatusEvent.NET_STATUS, this.onStatusEvent);
        con.connect(SERVER_ADDRESS, DEVELOPER_KEY);

and:

function onConnection(client, response, ckey) print(ckey)

and alternatively:

function onConnection(client, response, ...) ckey = unpack(arg)

but ckey is always "nil". Also double checked the DEVELOPER_KEY constant.

Any ideas?

cumulusdev commented 12 years ago

mmm strange, I have just tried now, it works wonderfull :-( send me your client maybe, I don't know, it's a basic feature that a lot of users used... odd. DEVELOPER_KEY is not null too? :D

cumulusdev commented 12 years ago

you had gotten it working so?

dcodeIO commented 12 years ago

Yes, sorry, got it finally working. My mistake obviously, even if I don't know what exactly it has been. Thanks anyway!

dcodeIO commented 12 years ago

Nearly forgot: I'd like to come back to the "Manage all (sub-)applications from a single main.lua" topic in short. What about calling the onStart(path) handler of the www/main.lua for every sub-application and allow this behaviour (i.e. not requiring another www/subapp/main.lua) only if www:onStart(path) explicitly returns "true" after checking if the path is allowed? This would save me a lot of empty directories and files and it should also be kinda straight forward. If it just returns nothing, the current behaviour could still be used and, even better, backward compatibility wouldn't be broken.

cumulusdev commented 12 years ago

Hi Daniel,

Actually (and sorry :() I will keep things like that. The pb is that a LUA call (onStart) is already an entry in the server (in considerating server application inheritance, it can give multiple onStart call!), I prefer for security reason today reject immediatly a user who calls an unexisting application. And it doesn't seem me to be a limitation (for server side conceptual requirement).

But it could change one day :-)

2012/4/23 Daniel < reply@reply.github.com

Nearly forgot: I'd like to come back to the "Manage all (sub-)applications from a single main.lua" topic in short. What about calling the onStart(path) handler of the www/main.lua for every sub-application and allow this behaviour (i.e. not requiring another www/subapp/main.lua) only if www:onStart(path) explicitly returns "true" after checking if the path is allowed? This would save me a lot of empty directories and files and it should also be kinda straight forward. If it just returns nothing, the current behaviour could still be used and, even better, backward compatibility wouldn't be broken.


Reply to this email directly or view it on GitHub: https://github.com/OpenRTMFP/Cumulus/issues/69#issuecomment-5283576

dcodeIO commented 12 years ago

What I am trying to accomplish is to create a single main.lua for CumulusAdmin, then fire up the openrtmfp.net cumulus cluster and later allow my clients to dynamically create accounts and applications much like Cirrus is doing this but with all those little additional features built in out of the box and simply configurable, including relaying etc.. For that to work it would be very handy not to need to create and maintain all those directories since clients anyway won't have the option to change LUA code. Everything is handled and provided by CumulusAdmin from within a single main.lua and configured from a database-backed administration tool. Would be cool if there'd be such an option :)