Giter VIP home page Giter VIP logo

brunobot's People

Contributors

andern avatar veiset avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

brunobot's Issues

Run as a background daemon

Adding a feature to run the bot as a daemon.

python2 main.py -v

for running it as a normal python script, and

python main.py

should run it as a daemon.

Loading extra modules concurrently while the bot connects

The bot is first trying to load the extra modules specified in the config.conf file and then connect.

The bot will have to wait for the modules to be verified. This is not desired. The bot should connect and load the modules concunrrelty.

Flood vulnerability

The bots current state responds to commands from ANY user on irc. Example:

.load yweather
You aren't allowed to do that. (requires admin)
.load yweather
You aren't allowed to do that. (requires admin)
.load yweather
You aren't allowed to do that. (requires admin)
.load yweather
You aren't allowed to do that. (requires admin)

This can easily be exploited with a 2 man botnet to flood the bot off a server over and over again. My proposal is to limit the amount of commands that can be executed in a certain time period or only respond verbosely to so many commands in a given time period. The time period should probably be user defined within the configuration file.

Running extra modules concurrently under Windows does not work

Forking new processes under Windows is not working.

Trace:

20:25:10        wx | Traceback (most recent call last):
20:25:10        wx |   File "<string>", line 1, in <module>
20:25:10        wx |   File "C:\Python27\lib\multiprocessing\forking.py", line 374, in main
20:25:10        wx |     self = load(from_parent) 
20:25:10        wx |   File "C:\Python27\lib\pickle.py", line 1378, in load
20:25:10        wx |     return Unpickler(file).load()
20:25:10        wx |   File "C:\Python27\lib\pickle.py", line 858, in load 
20:25:11        wx |     dispatch[key](self) 
20:25:11        wx |   File "C:\Python27\lib\pickle.py", line 880, in load_eof
20:25:12        wx |     raise EOFError
20:25:12        wx | EOFError
20:25:13        wx |  .. running:  <module 'module.extra.tvrage' from 'C:\Users\Russ\Desktop\Bruno\mo
20:25:13        wx | dule\extra\tvrage.pyc'>
20:25:14        wx |  .. extra module loaded: tvrage 1.0
20:25:14        wx | Can't pickle <type 'module'>: it's not found as __builtin__.module
20:25:15        wx |  !! Module 'tvrage 1.0' failed to run.

Might be incorrect usage of the pickle module for presisting data that causes the error.

.modlist

Usage of .modlist displays init which should be ignored. Without looking at the code I'm making an assumption that the current method of recognizing modules via .modlist is buy listing all files or ".py" files in the /extras directory. I would recommend a function which reads each module first checking for a she-bang line as well as verifying that all required variables for bruno are set within the file. Files like init would not contain these items and thus not be recognized as a bruno loadable module.

Bot crashed on utf8 encoding

Will not terminate the connection, but the parser thread will stop working when this happens:

Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/home/vz/dev/git/Brunobot/module/core/cparser.py", line 155, in run
self.parser.parse(line)
File "/home/vz/dev/git/Brunobot/module/core/cparser.py", line 57, in parse
unicode(privmatch.group(5),'utf-8'))
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe5 in position 13: invalid continuation byte

Execution of 3rd party modules

Upon execution of 3rd party modules and handler needs to be put in place to handle any exceptions thrown that are not handled by the 3rd party module itself. If this is not done and an exception is thrown by one of these modules the bot is then put into a "stalemate" where it is still running but not responding to anything else.

SQLite possibility for persistence core module

Currently only support the python pickle serialize module.

SQLite is standard in python install, and should be considered when needing to persist large amount of data.

The way the bot currently works the saved variables (pickle) are always loaded in memory, and for large enough datasets this could be a problem.

Bot sometimes not fully terminated with ctrl-c

Reproducible: Happened more than once. Don't know how.

Log from terminal:

^C   
> .. Core Parser cparser.BufferReader().run(self) terminated.
> .. ThreadedManager threadmanager.ThreadedManager().run(self) terminated.
^C
^C


From ps:


$ ps -eLf|grep -i python
andern    3104  2205  3104  0    2 Apr21 pts/3    00:00:01 python2.7 main.py
andern    3104  2205  3115  0    2 Apr21 pts/3    00:00:00 python2.7 main.py

Add CTCP capabilities to the bot

Send and listen to CTCP events.

04:03:26 wx | def ctcp(self, target, ctcp, params):
04:03:26 wx | self.connection.irc.send('PRIVMSG \001%s%s\001' % (target, ctcp and (" " + params) or ""))
04:03:44 wx | added that to communication (untested) but i think that should allow to ctcp someone
04:04:02 wx | according to the RFC's and a quick look at irclib

wx | http://www.irchelp.org/irchelp/rfc/ctcpspec.html

Unicode problems when running communication.say()

> .. running: <module 'module.extra.tvrage' from '/home/vz/dev/git/Brunobot/module/extra/tvrage.pyc'>
Process ThreadModule-36:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/home/vz/dev/git/Brunobot/threadedmanager.py", line 65, in run
    self.module.main(self.data)
  File "/home/vz/dev/git/Brunobot/module/extra/urltitle.py", line 39, in main
    communication.say(data['channel'], '[%s]' % header)
  File "/home/vz/dev/git/Brunobot/module/core/communication.py", line 56, in say
    self.connection.irc.send('PRIVMSG %s :%s\n' % (target, line))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb7' in position 24: ordinal not in range(128)

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.