theanomaly Posted December 7, 2010 Share Posted December 7, 2010 (edited) Hey all,I found out recently that the dbus interface is deprecated/unsupported, and so I rewrote the script in python to use the Ice interface to mumble. I have attached it here in case anyone wants to use it, or have a ready example of a forum auth script.Here's a quick overview of the config options:proxy = "Meta:tcp -h 127.0.0.1 -p 6502"slice = "-I /usr/share/Ice/slice /etc/php/ice/Murmur.ice"The setup of these first two options is essential for the Ice interface to work at all. My options will likely not work for you, so make sure to check http://mumble.sourceforge.net/ICE for an indication on how to set these up.ID_OFFSET=20000000This has the same function as in the original perl dbusauth.pl -- this allows the registrations for regularly registered mumble users to not interfere with externally authenticated ones. Not necessary if you only use external authentication.HOSTNAME="localhost"USERNAME="dbusername"PASSWORD="dbpass"DATABASE="dbname"The mysql database info for your simple machines forum. Note, I assume that you are using the default smf_ table prefix -- if not, you'll want to search this script for smf_ and replace with your prefix accordingly.MAX_AVATAR_SIZE=1024000 #Maximum avatar size in bytes, or 0 for unlimitedThis is the maximum sized image that the server will download for a user's avatar, so someone doesn't use a 50MB avatar and make the server download it.FORUM_URL="http://www.smf-forum.com" #No trailing slash here.SMF has (at least?) two ways of doing attachments -- one is by a simple external URL, and the other is by the forum attachments system -- this lets the script build URLs for the latter type.### Warning, enabling avatar support has the potential to lag the server while images ###### are downloading. However, images are cached once downloaded to speed things up. ###### Set this to False if it causes any problems. ###DOWNLOAD_AVATARS=TrueThis option lets you disable avatar support completely. Basically, when the Mumble server is busy downloading an avatar, it is unable to do anything else, and so will lag the server if the download doesn't happen quickly. This is mitigated by the fact that you can limit the max download size, and that most avatars download rather quickly. However, if you want to play it safe, you can disable avatar support altogether.Hope this helps somebody.Cheers,Anomsmfauth.zip Edited December 27, 2010 by theanomaly Quote Link to comment Share on other sites More sharing options...
wiciu Posted December 21, 2010 Share Posted December 21, 2010 Hi !Thanx for script.. but.. when i tried run smfauth.pypython smfauth.py i got this Traceback (most recent call last): File "smfauth.py", line 23, in ? import Murmur ImportError: No module named Murmur Is it this module :http://pypi.python.org/pypi/Murmur/ ?Sorry for maybe stupid question but i am not python programmer.--wiciu Quote Link to comment Share on other sites More sharing options...
Administrators hacst Posted December 21, 2010 Administrators Share Posted December 21, 2010 That script is kinda upsidedown. You have to move the configure section before the imports and the Ice.loadSlice(slice) line has to be before the import Murmur but after the import Ice or it won't work.On another note: I wrote authenticators for SMF and a phpBB3 some time ago. You can find them on http://gitorious.org/mumble-scripts/mumble-scripts/trees/master/Authenticators Quote Link to comment Share on other sites More sharing options...
wiciu Posted December 21, 2010 Share Posted December 21, 2010 On another note: I wrote authenticators for SMF and a phpBB3 some time ago. You can find them on http://gitorious.org/mumble-scripts/mumble-scripts/trees/master/Authenticators I tried your script but i found some errors line 467 @fortifyIceFu((-1 if cfg.user.reject_on_error else -2, None, None)) ^ SyntaxError: invalid syntax Any help ? :) Quote Link to comment Share on other sites More sharing options...
Administrators hacst Posted December 21, 2010 Administrators Share Posted December 21, 2010 Python 2.4 is pretty old by now ;-) That feature (inline if) was added in 2.5 iirc. Quote Link to comment Share on other sites More sharing options...
theanomaly Posted December 25, 2010 Author Share Posted December 25, 2010 That script is kinda upsidedown. You have to move the configure section before the imports and the Ice.loadSlice(slice) line has to be before the import Murmur but after the import Ice or it won't work. It works just fine for me as-is... though it would certainly be prettier the other way. Also, I noticed that for some reason the DB methods aren't rock solid, I had to add a self.conn.ping() before returning the cursor to make sure the DB was still there. I'd republish that, but the version you made seems more complete so maybe there's no need. On another note: I wrote authenticators for SMF and a phpBB3 some time ago. You can find them on http://gitorious.org/mumble-scripts/mumble-scripts/trees/master/Authenticators Is there some wiki page / database / something about these? I looked in this forum, but didn't find any mention of the smf authenticator. It seems there is a bunch of stuff that is just plain undocumented... If you want, I'd be happy to hack some stuff into the wiki about things I notice, but I don't know if it's already somewhere and I'm just not finding it or what. Quote Link to comment Share on other sites More sharing options...
Administrators hacst Posted December 25, 2010 Administrators Share Posted December 25, 2010 Hm. I didn't try to run the script so I might be mistaken but my python-spidy-senses strongly react to that part of the script import Murmur texturecache = dict() Ice.loadSlice(slice) ########## Configure your options here ############ proxy = "Meta:tcp -h 127.0.0.1 -p 6502" slice = "-I /usr/share/Ice/slice /etc/php/ice/Murmur.ice" As python, to my knowledge, executes in order import Murmur should fail because this (virtual) module is only created by Ice.loadSlice(slice) call and Ice.loadSlice(slice) should fail because the slice variable is only assigned a few lines down...that working would be...confusing to me.Anyway. No. There's not really any documentation on mumble scripts. I added a forum sticky to make it more visible but it could definitely need some referencing in our wiki or documentation of its own. Would be awesome if you'd be willing to do something in that area. Quote Link to comment Share on other sites More sharing options...
wiciu Posted December 27, 2010 Share Posted December 27, 2010 Hi !Thx guys for scripts:Conslusion:All your's scripts needs python 2.6 i think - (In CentOS 5.5 default is Python 2.4)1) Script by theanomaly not working for me, even with python2.62) Script by dd0t not working .. because it's dedicated for older version of SMF. 3) Here is my modification od dd0t's smfauth.py for SMF 2.0 RC2 and greater. http://pliki.g4g.pl/mumble/smfauth.zipAnd it's working like a charm :) Quote Link to comment Share on other sites More sharing options...
theanomaly Posted December 28, 2010 Author Share Posted December 28, 2010 Hey guys,Looks like I spoke too soon. Apparently the version I uploaded here was an older version than the one I was running, in which the Ice.loadSlice and Import Murmur were in the proper order (so yeah, sorry, looks like i was talking out of my arse, it looks like I debugged the script on my server without re-downloading it to my desktop). I have edited the original post with the updated version of the script, so that version should work now too!Also, thanks wiciu!Cheers,Anomaly Quote Link to comment Share on other sites More sharing options...
devorian Posted April 4, 2011 Share Posted April 4, 2011 heya guys, looks like i'm kind a stupid here and i'm not php programmer, but i get problems with this script....I've entered all data in configuration area, but when i'm trying to run this script throught SSH client? (am i write that i need to run it throught SSH?)i'm getting such errors in console:Traceback (most recent call last): File "./smfauth.py", line 45, in <module> import Ice ImportError: No module named Ice plz help me fix it. I'm currently using SMF 2.0RC5thanks. Quote Link to comment Share on other sites More sharing options...
devorian Posted April 4, 2011 Share Posted April 4, 2011 and i almost forgot regarding my second question:is there any chance to make this script some thing like cron - to run it automatically for example each hour or 30 mins, but do not get duplicates in murmur users DB? Also question how to make such option like ban user in mumble if it was banned on SMF board? or maybe i'm really stuipid and this potions already done? Quote Link to comment Share on other sites More sharing options...
devorian Posted April 4, 2011 Share Posted April 4, 2011 and btw i've tryed wiciu script and installed all what was required, and getting this error:./smfauth.py Traceback (most recent call last): File "./smfauth.py", line 867, in <module> do_main_program() File "./smfauth.py", line 248, in do_main_program Ice.loadSlice('', ['-I' + Ice.getSliceDir(), cfg.ice.slice]) AttributeError: 'module' object has no attribute 'getSliceDir' Quote Link to comment Share on other sites More sharing options...
Administrators kissaki Posted April 4, 2011 Administrators Share Posted April 4, 2011 You first have to setup python to use the ice module.See http://mumble.sourceforge.net/Ice Quote Link to comment Share on other sites More sharing options...
devorian Posted April 5, 2011 Share Posted April 5, 2011 That was done, i also installed all requied libraries which are listed in requierements. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.