Giter Site home page Giter Site logo

mumble-voip / mumo Goto Github PK

View Code? Open in Web Editor NEW
52.0 16.0 29.0 190 KB

Mumble Moderator framework simplifying development of plugins that connect to Mumble servers via Ice. (handles basic ICE connectivity, contains basic module loading and message multiplexing)

Python 98.02% Shell 1.84% Dockerfile 0.14%
mumble python zeroc-ice hacktoberfest ice

mumo's Introduction

mumo - The Mumble Moderator

Mumo is meant to provide a platform on which Python-based Mumble server ICE extension modules can be built upon. The goal is to reduce the boilerplate needed to interact with the Mumble server to a minimum.

To achieve this goal, tasks like Ice interface setup, basic error handling, configuration management, logging, and more are provided by mumo. Developers can focus on their specific functionality instead.

Requirements

mumo requires:

  • python >=3.2
  • python3-zeroc-ice
  • zeroc-ice-slice
  • mumble-server >=1.2.3 (not tested with lower versions)

Setting up

To configure and run mumo take a look at the mumo.ini and the module specific configurations in modules-available folder. Enabling modules is done by linking the configuration in modules-available to the modules-enabled folder.

Docker image

An official docker image is available at https://hub.docker.com/r/mumblevoip/mumo.

More information in docker.md.

Modules for Mumble moderator

Included modules

Currently, mumo comes with the following modules:

bf2

Battlefield 2 game management plugin that can dynamically move players into appropriate channels and groups to fit the in-game command structure. This is achieved by using data gathered from Mumble's positional audio system and does not require cooperation from the game server.

idlemove

Plugin for moving players that have been idle for a configurable amount of time into an idle channel. Optionally the players can be muted/deafened on move.

onjoin

Moves players into a specific channel on connect regardless of which channel they were in when they left last time.

seen

Makes the server listen for a configurable keyword to ask for the last time a specific nick was seen on the server.

source

Source game management plugin that can dynamically move players into on-the-fly-created channel structures representing in-game team setup. This is achieved by using data gathered from Mumble's positional audio system and does not require cooperation from the game server.

Currently, the following source-engine-based games are supported: Team Fortress 2, Day of Defeat: Source, Counter-Strike: Source, Half-Life 2: Deathmatch.

test

A debugging plugin that registers for all possible events and outputs every call with parameters into the debug log.

3rd party modules

See docs/third-party-modules.md

Contributing

We appreciate contributions. For example as issue or suggestion reports and comments, change pull requests, additional modules, or extending documentation.

You can talk to us in tickets or in chat in #mumble-dev:matrix.org.

mumo's People

Contributors

an0nfunc avatar azlux avatar davidebeatrici avatar hacst avatar kissaki avatar matthewlavine avatar muitocomplicado avatar natenom avatar raku-cat avatar z-bsod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mumo's Issues

Daemon Not working correctly

:/opt/mumo# pip install python-daemon
Requirement already satisfied (use --upgrade to upgrade): python-daemon in /usr/local/lib/python2.7/dist-packages
Cleaning up...

:/opt/mumo# python mumo.py -d

Fatal error, could not daemonize process due to missing "daemon" library, please install the missing dependency and restart the application
:/opt/mumo#

Any ideas?

Expose Authenticator callbacks

As the title says, it'd be nice to have the ServerAuthenticator and ServerUpdatingAuthenticator callbacks exposed. This would allow one to implement an authenticator as a Mumo module rather than having to rewrite most of the boilerplate handling Ice disconnects and such.

Unfortunately, at present, it doesn't seem to be possible at all to implement an authenticator within Mumo because the Ice adapter is never exposed.

Is mumo still alive?

Mainly interested for use with the antirec plugin: https://github.com/Natenom/mumblemoderator-module-collection. Not making abuse THIS easy is a must-have before I can consider using mumble.

(Yes, it can be circumvented, but it's better than having a 1-click-abuse-button.

This unanswered issue suggests it's currently broken entirely. #23
The fix seems trivial, but what's the point of starting to use something, if it's not actively maintained?

The docker image is severely outdated as well.

Idlemove.py is not moving the user back to the original channel

As stated above, the user does not move back to the default channel. The log says this:

2018-03-26 17:40:47,255 INFO idlemove 13s > 10s: State transition for user Moonlighter (76/1) from mute False -> True / deaf False -> False | channel 7 -> 12 on server 1
2018-03-26 17:40:50,990 INFO idlemove Restore user Moonlighter (76/1) on server 1
2018-03-26 17:41:07,272 INFO idlemove 11s > 10s: State transition for user Moonlighter (76/1) from mute False -> True / deaf False -> False | channel 12 -> 12 on server 1
2018-03-26 17:41:13,716 INFO idlemove Restore user Moonlighter (76/1) on server 1
2018-03-26 17:41:27,282 INFO idlemove 11s > 10s: State transition for user Moonlighter (76/1) from mute False -> True / deaf False -> False | channel 12 -> 12 on server 1
2018-03-26 17:47:30,571 INFO idlemove Restore user Moonlighter (76/1) on server 1
2018-03-26 17:47:47,363 INFO idlemove 14s > 10s: State transition for user Moonlighter (76/1) from mute False -> True / deaf False -> False | channel 12 -> 12 on server 1
2018-03-26 17:48:15,288 INFO idlemove Restore user Moonlighter (76/1) on server 1
2018-03-26 17:48:27,374 INFO idlemove 12s > 10s: State transition for user Moonlighter (76/1) from mute False -> True / deaf False -> False | channel 2 -> 12 on server 1
2018-03-26 17:48:30,518 INFO idlemove Restore user Moonlighter (76/1) on server 1

(I set the timer to 10 seconds to reproduce this problem.)

However, when it says restore user Moonlighter, it still does not place the user back to the original channel.

protocol error: out of bounds during unmarshaling

Hello,

2024-02-11 20:07:40,563 WARNING Ice dispatch exception: src/Ice/InputStream.cpp:404: ::Ice::UnmarshalOutOfBoundsException:
protocol error: out of bounds during unmarshaling
identity: 0BC87-string
facet:
operation: userTextMessage
remote host: 127.0.0.1 remote port: 42520

I'm running mumo from git on a Debian Stable server, with murmur version=1.5.517 and ice packages from upstream repo:

ii python3-zeroc-ice 3.7.10-1
ii zeroc-ice-slice 3.7.10-1

I only loaded the "seen" module and I'm getting errors every time an event (like connection/disconnection) happens.

On Windows loadSlice failure, no information is printed

I tried setting it up/using it on Windows.

  1. Install python 3.10 from MS Store
  2. python -m pip install zeroc-ice
  3. python mumo.py --app

It works up to Ice.loadSlice() in load_slice, and then exits with code -1073740791, with no output whatsoever.

Supposedly, CustomLogger should ensure ice log messages should be logged too.

white list specific channels?

I wanted to be able to white list people in specific channels...

        # Check if the user or channel is whitelisted
        if user.name in scfg.whitelist:
            return

        if str(user.channel) in scfg.whitelist:
            return

        # Remember values so we can see changes later
        channel = user.channel
        threshold = None
        mute = user.mute

Cannot run docker container

https://paste.woodpeckersnest.space/?63cdb956502b10ec#FktKpwgvZuWgjD7G4SYVWbuTFamm9zffoLHSbBHxZYVy

At first I had a "modules" not found error, so I copied that dir from my mumo clone into /home/debian/docker/etc/mumo/data
After that looked like solved I tried setting the Murmur.ice file in mumo.ini in several ways, from absolute to relativa paths, but it was always looking for /mumo/Murmur.ini, without founding it
Then I added a volume just for that file and I made progress, but in the end there's always a traceback.

Everything is in the link above, please advice.

Thanks

syntax error

Hi,
when starting the daemon like so:
$ python mumo.py -a
I get this error:

  File "mumo.py", line 102
    if IcePy.intVersion() < 30500L:
                                 ^
SyntaxError: invalid syntax

I'm not familiar with python. Given that the file has been around like this for months, it's probably an issue with my setup. I'd appreciate any pointers on how to take care of this.
Cheers

Creating temporary channels

Hello!

So I am trying to create temporary channels dynamically. Unfortunately I can't find any documentation on doing this, and neither addChannel nor setChannelState allows for creating or changing a channel to a temporary one.

Is there a way to do this with the current API?

cannot start mumo probably a python problem

mumo@Downwind:~/mumo$ service mumo start
Traceback (most recent call last):
File "/home/mumo/mumo/mumo.py", line 43, in
from optparse import OptionParser
File "/usr/lib/python2.7/optparse.py", line 419, in
_builtin_cvt = { "int" : (_parse_int, _("integer")),
File "/usr/lib/python2.7/gettext.py", line 581, in gettext
return dgettext(_current_domain, message)
File "/usr/lib/python2.7/gettext.py", line 545, in dgettext
codeset=_localecodesets.get(domain))
File "/usr/lib/python2.7/gettext.py", line 480, in translation
mofiles = find(domain, localedir, languages, all=1)
File "/usr/lib/python2.7/gettext.py", line 437, in find
for nelang in _expand_lang(lang):
File "/usr/lib/python2.7/gettext.py", line 131, in _expand_lang
from locale import normalize
ImportError: cannot import name normalize

just looking for guidance, not sure if python changed something and I didn't catch it, thanks.

Not compatable with Debian 10

I recently upgrade my Debian 9 server to Debian 10, but mumo (or rather, some of the plugins) doesn't seem to work all that well.

  • The onjoin-module only seems to work sometimes, I've tested from multiple Operating Systems and Mumble clients (stable and development). I Need to try from a clean install to figure out if it's something cached in the clients or if it's simply not working at all. Confirmed - not working in a clean Debian 10 install with mumble from Debian repos.
  • The idelmove.ini and antirec.ini doesn't work at all.

So I'm thinking it might have something to do regarding any python upgrades, which (would) mean mumo is completely broken in Debian 10. Don't take my word for it though, I can't code at all :) Let me know if you need any log-files or similar.

# python2.7 mumo.py

Results in the following log-output:

2019-08-17 00:18:44,497 ERROR root Retrieving slice from server failed
2019-08-17 00:18:44,497 ERROR root Slice preprocessing failed for `'
Traceback (most recent call last):
  File "mumo.py", line 115, in dynload_slice
    load_slice(dynslicefilepath)
  File "mumo.py", line 90, in load_slice
    Ice.loadSlice('', slicedirs + [slice])
RuntimeError: Slice preprocessing failed for `'
Traceback (most recent call last):
  File "mumo.py", line 562, in <module>
    ret = do_main_program()
  File "mumo.py", line 152, in do_main_program
    dynload_slice(prx)
  File "mumo.py", line 115, in dynload_slice
    load_slice(dynslicefilepath)
  File "mumo.py", line 90, in load_slice
    Ice.loadSlice('', slicedirs + [slice])
RuntimeError: Slice preprocessing failed for `'

Mumo runs into RuntimeError; ends up not running

What happened?

When I try to run ./mumo.py, it almost instantly jumps back into my main terminal prompt.

Logs

2024-03-04 17:40:37,266 DEBUG root Initializing Ice
2024-03-04 17:40:37,299 INFO root Loading slice from server
/tmp/tmpm6_rlrw0.ice:5: error: Can't open include file "Ice/SliceChecksumDict.ice"
    #include <Ice/SliceChecksumDict.ice>
1 error in preprocessor.
2024-03-04 17:40:37,321 ERROR root Retrieving slice from server failed
2024-03-04 17:40:37,322 ERROR root Slice preprocessing failed for `'
Traceback (most recent call last):
  File "/home/alex/mumo/mumo.py", line 119, in dynload_slice
    load_slice(dynslicefilepath)
  File "/home/alex/mumo/mumo.py", line 91, in load_slice
    Ice.loadSlice('', slicedirs + [slice])
RuntimeError: Slice preprocessing failed for `'
Traceback (most recent call last):
  File "/home/alex/mumo/mumo.py", line 585, in <module>
    ret = do_main_program()
          ^^^^^^^^^^^^^^^^^
  File "/home/alex/mumo/mumo.py", line 157, in do_main_program
    dynload_slice(prx)
  File "/home/alex/mumo/mumo.py", line 119, in dynload_slice
    load_slice(dynslicefilepath)
  File "/home/alex/mumo/mumo.py", line 91, in load_slice
    Ice.loadSlice('', slicedirs + [slice])
RuntimeError: Slice preprocessing failed for `'
!! 03/04/24 17:40:37.860 error: communicator not destroyed during global destruction.2024-03-04 17:43:10,953 DEBUG root Initializing Ice
2024-03-04 17:43:10,957 INFO root Loading slice from server
/tmp/tmpznow3bs5.ice:5: error: Can't open include file "Ice/SliceChecksumDict.ice"
    #include <Ice/SliceChecksumDict.ice>
1 error in preprocessor.
2024-03-04 17:43:10,963 ERROR root Retrieving slice from server failed
2024-03-04 17:43:10,964 ERROR root Slice preprocessing failed for `'
Traceback (most recent call last):
  File "/home/alex/mumo/./mumo.py", line 119, in dynload_slice
    load_slice(dynslicefilepath)
  File "/home/alex/mumo/./mumo.py", line 91, in load_slice
    Ice.loadSlice('', slicedirs + [slice])
RuntimeError: Slice preprocessing failed for `'
Traceback (most recent call last):
  File "/home/alex/mumo/./mumo.py", line 585, in <module>
    ret = do_main_program()
          ^^^^^^^^^^^^^^^^^
  File "/home/alex/mumo/./mumo.py", line 157, in do_main_program
    dynload_slice(prx)
  File "/home/alex/mumo/./mumo.py", line 119, in dynload_slice
    load_slice(dynslicefilepath)
  File "/home/alex/mumo/./mumo.py", line 91, in load_slice
    Ice.loadSlice('', slicedirs + [slice])
RuntimeError: Slice preprocessing failed for `'
!! 03/04/24 17:43:11.397 error: communicator not destroyed during global destruction.2024-03-04 17:43:50,941 DEBUG root Initializing Ice
2024-03-04 17:43:50,946 INFO root Loading slice from server
/tmp/tmp3drhszfz.ice:5: error: Can't open include file "Ice/SliceChecksumDict.ice"
    #include <Ice/SliceChecksumDict.ice>
1 error in preprocessor.
2024-03-04 17:43:50,953 ERROR root Retrieving slice from server failed
2024-03-04 17:43:50,953 ERROR root Slice preprocessing failed for `'
Traceback (most recent call last):
  File "/home/alex/mumo/./mumo.py", line 119, in dynload_slice
    load_slice(dynslicefilepath)
  File "/home/alex/mumo/./mumo.py", line 91, in load_slice
    Ice.loadSlice('', slicedirs + [slice])
RuntimeError: Slice preprocessing failed for `'
Traceback (most recent call last):
  File "/home/alex/mumo/./mumo.py", line 585, in <module>
    ret = do_main_program()
          ^^^^^^^^^^^^^^^^^
  File "/home/alex/mumo/./mumo.py", line 157, in do_main_program
    dynload_slice(prx)
  File "/home/alex/mumo/./mumo.py", line 119, in dynload_slice
    load_slice(dynslicefilepath)
  File "/home/alex/mumo/./mumo.py", line 91, in load_slice
    Ice.loadSlice('', slicedirs + [slice])
RuntimeError: Slice preprocessing failed for `'
!! 03/04/24 17:43:51.438 error: communicator not destroyed during global destruction.

Config file (mumo.ini)

;
;Ice configuration
;
[ice]

; Host and port of the Ice interface on
; the target Murmur server.

host = 127.0.0.1
port = 6502

; Slicefile to use (e.g. /etc/slice/Murmur.ice), 
; if empty MuMo will load the slice file from the
; target server at startup.

slice = 

; Semicolon seperated list of slice include directories
; to consider. This is only used on legacy platforms
; with old or broken Ice versions.
slicedirs = /usr/share/slice;/usr/share/Ice/slice

; Shared secret between the MuMo and the Murmur
; server. For security reason you should always
; use a shared secret.

secret = ********

;Check Ice connection every x seconds

watchdog = 15

[murmur]
; Comma seperated list of server ids to listen on (empty for all)
; note that if a server isn't listed here no events for it can
; be received in any module
servers = 

[modules]
mod_dir = modules/
cfg_dir = modules-enabled/
timeout = 2

[system]
pidfile = mumo.pid


; Logging configuration
[log]
; Available loglevels: 10 = DEBUG (default) | 20 = INFO | 30 = WARNING | 40 = ERROR

level =
file = mumo.log


[iceraw]
Ice.ThreadPool.Server.Size = 5

Blanked out secret for privacy reasons

System information

OS: Raspberry Pi OS Lite (Uses Debian 12)
CPU Architecture: arm64 / aarch64
Kernel: 6.1.0-rpi8-rpi-v8
Python version: 3.11.2

Can not start mumo

I have installed all of the dependencies for mumo on Ubuntu 18.04 server, but each time I try to start it with python2 I get the error

File "mumo.py", line 547, in <module>
    pidfile = TimeoutPIDLockFile(cfg.system.pidfile, 5)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/daemon/pidfile.py", line                                                                                                                                                                                                                                              40, in __init__
    super().__init__(path, *args, **kwargs)
TypeError: super() takes at least 1 argument (0 given)

[Request] accept unicode usernames

unicode usernames seem to be rejected by default.

<91:[107] ๐•ฎ๐•ฏ(-1)> Rejected connection from 101.98.39.137:2925: Invalid username
<91:[107] ๐•ฎ๐•ฏ(-1)> Connection closed:  [-1]

Is it possible to update mumo to python 3?

I know mumo just works fine, but Python 2 is going to die very soon.

And another thing, it's really annoying to write non-ascii strings in Python 2 (either u'string' or import future)

I have tried to update it myself but turns out that is too complicated for me.

Error running mumo

Python 2.7.3
Debian 3.2.65-1+deb7u2
Latest Mumble-server from repo
Ice version 3.4.2

Mumo will not start. PHPInfo shows Ice is loaded.

python mumo.py -a

warning: unknown property: `Ice.Default.EncodingVersion'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.