summaryrefslogtreecommitdiff
path: root/lib/rbot/ircbot.rb
AgeCommit message (Collapse)Author
2021-06-05bot: reorder fork sequenceGiuseppe Bilotta
We do the actual fork as the last step, after redirecting the standard I/O streams. This also ensures that no log messages are shown on console _after_ forking.
2021-06-05fix: write override behaviorGiuseppe Bilotta
IO.write() takes an arbitrary number of argumens, that are converted to string and joined on write. We should behave the same way. Moreover, the returned value is the number of bytes, and this is bytesize in modern Ruby.
2021-06-05fix: restore logging of session start/endGiuseppe Bilotta
2021-06-05logger: fix STDERR recursionGiuseppe Bilotta
Overriding (as we should do) the standard error write method when daemonizing introduces a recursion in the logger, due to the persistent presence of the console logger. The solution is obviously to stop logging on console after daemonization.
2021-06-05fix: stderr vs stdout write overrideGiuseppe Bilotta
In 96d13521d the STDOUT/STDERR write overrides were replaced by overrides to $stdout, but the second should have been to $stderr (obviously).
2021-05-29fix: restart logger thread after forkGiuseppe Bilotta
Logging was broken when daemonizing, due to the logger thread being dead after the fork. This can be solved by restarting the thread, if necessary when setting the log file (which we conveniently do right after the fork).
2020-04-24refactor: remove global bot instance, closes #42Matthias Hecker
2020-04-14fix nick renaming during connectionMatthias Hecker
2020-04-14refactor: httputil no longer core module see #38Matthias Hecker
This is intended to make testing/mocking of the http client easier.
2020-03-31refactor: logger moved away from ircbot (exp.)Matthias Hecker
This moves the logger management thread/queue to a seperate singleton. It removes the explicit stopping/restarting of the logging thread since the thread should behave like a daemon thread anyway. Still needs to be tested to work in daemonize.
2020-03-28always log to stdout with debug flagMatthias Hecker
This makes it so the -d debug flag on the rbot command line will always log to STDOUT, previously it would just force the log level.
2015-06-24journal: move journal accessor in coremoduleMatthias Hecker
2015-06-20journal: start with core botmodule, api changesMatthias Hecker
2015-06-14journal, integrated in botMatthias Hecker
2015-06-13logging, print >=warning to stderrMatthias Hecker
2015-06-13logging: proper stderr logger for error/fatalMatthias Hecker
2015-03-11plugins: allow rescanning of one botmodule onlyMatthias H
2015-03-09updated copyright notice and authorsMatthias H
2014-09-03[webservice] expose webservice to pluginsM. Hecker
2014-03-06[config] adds a new param store_defaultMatthias H
Creates a new option to store the default at first run. This fixes the problem that random auth passwords are not kept, it also allows us to always store the core.db config value.
2014-03-05[registry] migrate tc directory name to registry_tcMatthias Hecker
2014-03-05[ssl] fix for missing ca pathMatthias Hecker
2014-03-05[registry] use tc by-default if availableMatthias Hecker
2014-02-24[registry] refactoring into a abstract and factoryMatthias H
* a new abstract class AbstractAccessor is the new base for all concrete database implementations. * a factory now, dynamically discovers those implementations in the registry/ directory and will create the configured type for the plugins. * again: this makes db keys case-sensitive (aka 'the correct way of doing things' -.-) * re-added tokyocabinet
2014-02-24[agent] wip core mechanize agent pluginMatthias H
2014-02-21[webservice] control bot through http interfaceMatthias H
2014-02-19[registry] registry folder with suffix, added daybreak engineMatthias H
2014-02-18log fatal/error messages to stderr, but check if daemonized first!Matthias H
2014-02-18remove old/compat code no longer supportedMatthias H
2014-02-18removes bdb&tc registry; adds dbm registryMatthias H
This removes the existing registries, ruby-bdb (Berkeley DB) and tokyocabinet, instead it creates a new registry based on ruby DBM. Ruby-bdb has long since been abandoned in favor for rubys DBM and tokyocabinet also has been ceased development since 2011 (for kyotocabinet).
2013-12-06workaround for broken pretty_inspectMatthias H
2013-12-04Revert "always print FATAL and ERROR logmessages to STDERR"Matthias Hecker
This reverts commit c4d629ad86aae3b8bb4669650df57875252bea92.
2013-11-14always print FATAL and ERROR logmessages to STDERRMatthias Hecker
This adds a print to $stderr for log messages with the level ERROR or FATAL. I did this because in the past errors connecting to the server weren't immediately obvious but rather hidden in the logfile. I think it should be right in-your-face when the connection doesn't work. It would probaply be better to extend Logger to print to STDERR but this apparently requires monkeypatching ruby's Logger. Anyhow I think my solution works for now.
2013-11-14allow to verify ssl connections against a CA.Matthias H
This adds three new configuration variables to configure SSL verification against a CA. server.ssl_verify: true if it should verify and disconnect if it fails server.ssl_ca_file: a CA file, is set to the systems CA bundle by default (distri. dependent) server.ssl_ca_path: alternativly path to a directory with CA PEM files I tested it and this seems no longer an issue with >= 1.9.3 https://www.braintreepayments.com/braintrust/sslsocket-verify_mode-doesnt-verify
2013-11-02ruby 2.0.0: better fix for the ThreadErrorMatthias H
I revisited my fix for the ThreadError in ruby 2.0.0 this doesn't use a queue for signals but just starts a thread for each received signal, works much better for me. It also fixes a bug in Bot#reconnect where the SystemExit exception coming from quit is not handled correctly.
2013-11-02ruby 2.0.0: changes sigtrapping, fixes ThreadErrorMatthias H
Ruby 2.0.0 crashes with "ThreadError: can't be called from trap context" anytime a signal is received, because it tries to write a debug message within the "trap context". This changes signal handling so that signals are queued and processed in the main loop. More information: https://www.ruby-forum.com/topic/4411227
2011-10-24Exit for good when getting a DBFatal errorGiuseppe Bilotta
2011-09-15Better handling of akills and other form of disconnectionsGiuseppe Bilotta
2011-06-11Saner treatment for connect errorsGiuseppe Bilotta
Rather than raising changing the message (a message that would not be displayed anyway), display the (composed) error message and then reraise without further changes.
2011-05-03Preliminary support for the LIST commandGiuseppe Bilotta
2011-04-03* less eager quit message resetGiuseppe Bilotta
Only reset quit message when entering the main loop sanely.
2011-01-31comments and message fixesGiuseppe Bilotta
2010-09-27* wrap BDB::Fatal classes for abstract trappingGiuseppe Bilotta
When using a DB backend different from BDB, the BDB constant may not be defined, causing a NameError during error trapping in the main loop. Fix this by defining our own DBFatal error that maps to BDB::Fatal in the BDB case and is defined as an (unused) Exception for TokyoCabinet.
2010-03-16Tokyo Cabinet DB backendVoker57
2010-03-16DB backend optionVoker57
2010-03-16Moved DB stuff to registry/bdbVoker57
2009-12-21ircbot/rfc2812/message: Add banlist message handlingAlex Legler
2009-12-21ircbot: Delegate ERR_NOSUCHNICK and ERR_NOSUCHCHANNEL events to pluginsAlex Legler
2009-10-21Loop until connected in reconnect()Giuseppe Bilotta
Untrapped connect() failures would raise up to the mainloop, causing a burst of reconnect attempts without delay. Fix by rescuing in reconnect() and retrying after waiting.
2009-08-26ruby 1.9: fix *methods.include?franz
Since in 1.9 methods arrays have symbols instead of strings, fix it by changing into respond_to? and method_defined?