erlbot.git
4 years agoappup files inexplicably go in ebin/, not src/
Matt Mullins [Mon, 2 Dec 2019 04:40:46 +0000 (20:40 -0800)]
appup files inexplicably go in ebin/, not src/

Well, it's sort-of explicable: they should be available verbatim using
the Erlang interpreter's code path, and I'm not using any of the magical
rebar3 plugins for automatic appup generation.

4 years agoWithout sasl, there is no release_handler.
Matt Mullins [Mon, 2 Dec 2019 03:51:08 +0000 (19:51 -0800)]
Without sasl, there is no release_handler.

4 years agoFix up directory structure for rebar3
Matt Mullins [Mon, 2 Dec 2019 03:43:24 +0000 (19:43 -0800)]
Fix up directory structure for rebar3

8 years agoRelease 14!
Matt Mullins [Mon, 4 Jan 2016 07:49:35 +0000 (23:49 -0800)]
Release 14!

This release adds rate limits and failure (gen_server timeout) tolerance to the
AMQP codepaths, so that they always stay under their supervisor's restart
intensity.

This upgrade/downgrade path is a little racey:
  - It's not guaranteed that rate_limit is loaded before other modules.
  - The supervisors are running while the worker modules with shiny new init/1
    arguments are loaded.
This can cause full failure if something needs to restart while the upgrade is
ongoing.  Since these are just init codepaths, I'll take my chances.  It's like
the big sky theory, in the time domain.

8 years agorate limit irc_amqp_listener restarts
Matt Mullins [Mon, 4 Jan 2016 07:44:41 +0000 (23:44 -0800)]
rate limit irc_amqp_listener restarts

This protects the irc_net_sup (and thus irc_conn) from restarting if the amqp
application processes are currently unavailable - i.e. while they're waiting on
their own rate limits.

8 years agoMove IRC->AMQP message sending into AMQP process
Matt Mullins [Mon, 4 Jan 2016 07:38:43 +0000 (23:38 -0800)]
Move IRC->AMQP message sending into AMQP process

This allows the message to be dropped if, for example, the AMQP process is
sleeping on the rate limit timer and causes a timeout instead of handling the
get_connection call.  Previously, this would crash the init process of
irc_amqp_listener, and since the gen_server timeout is only 5 seconds, the
irc_object_sup would reach its max restart intensity and exit.

As an added bonus: this is actually more reasonable message passing anyway.

8 years agoamqp: Rate limit reconnections to AMQP
Matt Mullins [Mon, 4 Jan 2016 07:37:16 +0000 (23:37 -0800)]
amqp: Rate limit reconnections to AMQP

8 years agoFactor out the rate limiting behavior from irc.
Matt Mullins [Mon, 4 Jan 2016 07:28:57 +0000 (23:28 -0800)]
Factor out the rate limiting behavior from irc.

This will be more generically used to rate limit any code path that depends on
connecting to an external service.  Particularly: AMQP.

The goal is that external service availability should not tear down entire
supervisor hierarchies, and instead just the single worker connected to it.

9 years agoRelease 13, amqp app vsn 3
Matt Mullins [Wed, 20 May 2015 04:45:53 +0000 (21:45 -0700)]
Release 13, amqp app vsn 3

This release sets the auto_delete flag on AMQP queues.

9 years agoamqp: set the auto_delete bit on queues.
Matt Mullins [Wed, 20 May 2015 04:31:25 +0000 (21:31 -0700)]
amqp: set the auto_delete bit on queues.

Without this, AMQP queues are leaked whenever we reconnect to an ircd.
Exclusive queues are only deleted when the connection is torn-down;
auto-deleted queues are also deleted when the last (i.e. only in this case)
conusmer is removed.

Since the AMQP consumers are tied to processes running under the irc_object_sup
for the IRC connection, these will be torn-down when we reconnect to the ircd.

10 years agoRelease 12, IRC application vsn 12.
Matt Mullins [Tue, 9 Sep 2014 06:25:21 +0000 (23:25 -0700)]
Release 12, IRC application vsn 12.

This release switches the bot's replies to using NOTICE rather than PRIVMSG.

10 years agoirc: responses are sent with NOTICE, not PRIVMSG
Matt Mullins [Tue, 9 Sep 2014 06:24:35 +0000 (23:24 -0700)]
irc: responses are sent with NOTICE, not PRIVMSG

10 years agoRelease version 11. v11
Matt Mullins [Tue, 15 Apr 2014 06:34:28 +0000 (23:34 -0700)]
Release version 11.

This release updates the irc module to actively ping the server.

10 years agoirc application vsn 11
Matt Mullins [Tue, 15 Apr 2014 06:30:40 +0000 (23:30 -0700)]
irc application vsn 11

This upgrades irc_conn to actively ping the server.

10 years agoirc_conn: cancel the timer when downgrading
Matt Mullins [Tue, 15 Apr 2014 07:02:09 +0000 (00:02 -0700)]
irc_conn: cancel the timer when downgrading

10 years agoirc_conn: migrate state from vsn 4 to 5 and back
Matt Mullins [Tue, 15 Apr 2014 06:26:28 +0000 (23:26 -0700)]
irc_conn: migrate state from vsn 4 to 5 and back

This adds a "none" timer id on upgrade, and removes the timer id on downgrade.

10 years agoAdd the ability to actively PING the server.
Matt Mullins [Sun, 23 Mar 2014 07:06:35 +0000 (00:06 -0700)]
Add the ability to actively PING the server.

This currently forcefully kills the irc_conn process once a ping timeout
occurs, without any nice QUIT message or anything.

Bump the state version because I added another variable to irc_state.

11 years agoTrap exits in a converted irc_amqp_listener. v10
Matt Mullins [Sun, 5 May 2013 06:56:00 +0000 (23:56 -0700)]
Trap exits in a converted irc_amqp_listener.

Without this, an upgraded irc_amqp_listener still won't manage to terminate cleanly.

On the other hand, it doesn't anyway -- it's still brutal_kill'ed.  Drop this patch, maybe?

11 years agoFix shutdown parameters for irc app supervisors.
Matt Mullins [Sat, 4 May 2013 06:32:50 +0000 (23:32 -0700)]
Fix shutdown parameters for irc app supervisors.

Any supervisors it launches should wait infinitely, according to the
"supervisor" module docs.

Since irc_conn doesn't actually do anything on terminate/2, brutally kill it.
(It also doesn't trap exits, so it wouldn't get called /anyway/).

11 years agoWhitespace cleanup.
Matt Mullins [Sun, 5 May 2013 07:08:01 +0000 (00:08 -0700)]
Whitespace cleanup.

11 years agoirc application version 10.
Matt Mullins [Sun, 5 May 2013 07:04:46 +0000 (00:04 -0700)]
irc application version 10.

Upgrade includes:
  * new childspecs for all the irc application's supervisors
  * irc_amqp_listener will terminate its associated amqp_channel
  * irc_conn is [ab]used to recreate the irc_amqp_listener with a new
    childspec, since it's a transient process.

11 years agoUpgrade to irc_amqp_listener with new childspec.
Matt Mullins [Sun, 5 May 2013 07:00:20 +0000 (00:00 -0700)]
Upgrade to irc_amqp_listener with new childspec.

Bump the irc_conn state version and use the code_change capablities to recreate
the irc_amqp_listener process with the appropriate childspec upon up/downgrade.

11 years agoSplit out routing key creation into a new function
Matt Mullins [Sun, 5 May 2013 06:57:57 +0000 (23:57 -0700)]
Split out routing key creation into a new function

11 years agoClose Channel on irc_amqp_listener termination.
Matt Mullins [Sat, 4 May 2013 06:37:19 +0000 (23:37 -0700)]
Close Channel on irc_amqp_listener termination.

This fixes a bug wherein application:stop(irc) would leave a dangling Channel
that was consuming messages on a queue -- long after the process to which it
would deliver is dead.  That would cause the AMQP channel to exit with reason
unexpected_delivery_and_no_default_consumer, killing all of the rest of the
AMQP client and, by the transitive property of death, the irc application as
well.

The irc_amqp_listener must trap exits in order to receive a termination notice
from its supervisor.  I'm not actually sure if this has any implications for it
monitoring its AMQP Channel or not.

11 years agoCreate intermediate release. v9.5
Matt Mullins [Sun, 5 May 2013 07:23:56 +0000 (00:23 -0700)]
Create intermediate release.

This release only contains the changes needed to add a return value to
amqp_bot_listener:listen_for_events.  This must happen strictly /before/ the
changes that create/destroy new irc_amqp_listener processes, so that we can
forcibly keep the pattern matching in sync with the return value.

11 years agoBump amqp application version number.
Matt Mullins [Sun, 5 May 2013 06:50:31 +0000 (23:50 -0700)]
Bump amqp application version number.

amqp-2 contains the sole change that amqp_bot_listener:listen_for_events adds a
new value to the return tuple.

11 years agoBump irc_amqp_listener state version to 3.
Matt Mullins [Sat, 4 May 2013 06:56:59 +0000 (23:56 -0700)]
Bump irc_amqp_listener state version to 3.

Convert version 2 state to version 3 by hoping that the listener is only
monitoring one process.  Thankfully, amqp_bot_listener:listen_for_events
creates a monitor so that AMQP will kill IRC.

11 years agoReturn and save the AMQP Channel pid.
Matt Mullins [Sat, 4 May 2013 06:35:42 +0000 (23:35 -0700)]
Return and save the AMQP Channel pid.

11 years agoBump version number, add upgrade scripts v9
Matt Mullins [Tue, 22 Jan 2013 04:25:11 +0000 (20:25 -0800)]
Bump version number, add upgrade scripts

11 years agoSend !-commands to AMQP for other programs
Matt Mullins [Tue, 22 Jan 2013 04:00:16 +0000 (20:00 -0800)]
Send !-commands to AMQP for other programs

11 years agoUse erlang: prefix for integer conversion
Matt Mullins [Wed, 16 Jan 2013 06:01:35 +0000 (22:01 -0800)]
Use erlang: prefix for integer conversion

Apparently R14A doesn't see integer_to_list/2 and list_to_integer/2 without
the erlang: prefix.

11 years agoBump IRC app versions, disallow code_change. v8
Matt Mullins [Mon, 14 Jan 2013 06:47:16 +0000 (22:47 -0800)]
Bump IRC app versions, disallow code_change.

I am not planning to support upgrading/downgrading past this epoch.  It's
possible, but the existing IRC bot died for unrelated reasons, so there's no
real point in supporting it.  I'll just run with the new version.

11 years agoUse one AMQP listener with wildcard, per ircnet.
Matt Mullins [Mon, 14 Jan 2013 06:42:24 +0000 (22:42 -0800)]
Use one AMQP listener with wildcard, per ircnet.

11 years agoBump Erlang version numbers to Ubuntu precise
Matt Mullins [Mon, 14 Jan 2013 01:21:45 +0000 (17:21 -0800)]
Bump Erlang version numbers to Ubuntu precise

12 years agoBump release numbers. v7
Matt Mullins [Tue, 13 Dec 2011 06:47:10 +0000 (22:47 -0800)]
Bump release numbers.

12 years agoFix DoS where any IRC user can crash the bot.
Matt Mullins [Tue, 13 Dec 2011 06:33:13 +0000 (22:33 -0800)]
Fix DoS where any IRC user can crash the bot.

12 years agoLimit IRC reconnects to once every 30 seconds.
Matt Mullins [Tue, 13 Dec 2011 06:30:36 +0000 (22:30 -0800)]
Limit IRC reconnects to once every 30 seconds.

And I also fixed another bug that made reconnects fail anyway.

12 years agoAdded a !random command, and cut a new release. v6
Matt Mullins [Mon, 12 Dec 2011 07:09:53 +0000 (23:09 -0800)]
Added a !random command, and cut a new release.

Refactored IRC command handling, while I was at it.

13 years agoAdd an intermediate release 4.5, which allows clean downgrade from 5 to 4. v5
Matt Mullins [Sat, 3 Sep 2011 03:47:26 +0000 (22:47 -0500)]
Add an intermediate release 4.5, which allows clean downgrade from 5 to 4.

This is required because otherwise, the AMQP applications are destroyed before
the IRC application is downgraded, causing the whole thing to come crashing
down.

13 years agoProperly handle the instance name when upgraded from an old version
Matt Mullins [Sat, 3 Sep 2011 03:43:11 +0000 (22:43 -0500)]
Properly handle the instance name when upgraded from an old version

13 years agoHandle up/down-grade for the IRC application -- add/remove AMQP processes
Matt Mullins [Sat, 3 Sep 2011 03:39:53 +0000 (22:39 -0500)]
Handle up/down-grade for the IRC application -- add/remove AMQP processes

13 years agoAdd new modules to the IRC application
Matt Mullins [Thu, 1 Sep 2011 21:49:02 +0000 (16:49 -0500)]
Add new modules to the IRC application

13 years agoAdd AMQP client applications to release dependencies.
Matt Mullins [Thu, 1 Sep 2011 21:48:32 +0000 (16:48 -0500)]
Add AMQP client applications to release dependencies.

13 years agoUpdate ERTS version number to match Ubuntu maverick
Matt Mullins [Thu, 1 Sep 2011 21:48:17 +0000 (16:48 -0500)]
Update ERTS version number to match Ubuntu maverick

13 years agoAdd configuration support for AMQP username/password/vhost
Matt Mullins [Thu, 1 Sep 2011 20:33:21 +0000 (15:33 -0500)]
Add configuration support for AMQP username/password/vhost

13 years agoRefactored the way commands are sent from the AMQP listener to the irc_conn
Matt Mullins [Thu, 1 Sep 2011 20:31:49 +0000 (15:31 -0500)]
Refactored the way commands are sent from the AMQP listener to the irc_conn

13 years agoFix a bug to allow channels that do not have AMQP queues
Matt Mullins [Thu, 1 Sep 2011 19:42:22 +0000 (14:42 -0500)]
Fix a bug to allow channels that do not have AMQP queues

13 years agoUse the configuration file to determine AMQP routing key
Matt Mullins [Thu, 1 Sep 2011 19:07:29 +0000 (14:07 -0500)]
Use the configuration file to determine AMQP routing key

13 years agoFixed a bug caused by the Channel being killed out from under the AMQP module. RT...
Matt Mullins [Thu, 1 Sep 2011 05:23:32 +0000 (00:23 -0500)]
Fixed a bug caused by the Channel being killed out from under the AMQP module.  RT ticket #73.

13 years agoMove the irc_amqp_listener to be underneath the irc_object_sup
Matt Mullins [Thu, 1 Sep 2011 01:26:42 +0000 (20:26 -0500)]
Move the irc_amqp_listener to be underneath the irc_object_sup

13 years agoCreated the irc_object_supervisor, which is created by the irc_conn startup
Matt Mullins [Thu, 1 Sep 2011 01:25:18 +0000 (20:25 -0500)]
Created the irc_object_supervisor, which is created by the irc_conn startup

13 years agoAdd Supervisor, TableId, and the [future] irc_object_sup to the IRC connection state.
Matt Mullins [Thu, 1 Sep 2011 01:18:04 +0000 (20:18 -0500)]
Add Supervisor, TableId, and the [future] irc_object_sup to the IRC connection state.

13 years agoAdd the irc_conn PID to the ETS table
Matt Mullins [Thu, 1 Sep 2011 01:10:32 +0000 (20:10 -0500)]
Add the irc_conn PID to the ETS table

13 years agoRefactored the way configuration data is passed through the IRC application.
Matt Mullins [Tue, 30 Aug 2011 21:14:12 +0000 (16:14 -0500)]
Refactored the way configuration data is passed through the IRC application.

Instead of passing configuration data all the way from the irc_sup, all that is
passed is the instance name, and the irc_conn is responsible for getting the
configuration data from the config module.

13 years agoLink the AMQP channel to the process listening, so that it can correct server problems.
Matt Mullins [Sun, 28 Aug 2011 20:37:14 +0000 (15:37 -0500)]
Link the AMQP channel to the process listening, so that it can correct server problems.

13 years agoAdded registered process names to the AMQP application file
Matt Mullins [Sun, 28 Aug 2011 20:34:46 +0000 (15:34 -0500)]
Added registered process names to the AMQP application file

13 years agoUpdated version numbers for the release to match Ubuntu Maverick
Matt Mullins [Sun, 28 Aug 2011 20:34:15 +0000 (15:34 -0500)]
Updated version numbers for the release to match Ubuntu Maverick

13 years agoUpdated documentation on AMQP listener function.
Matt Mullins [Sun, 28 Aug 2011 20:00:30 +0000 (15:00 -0500)]
Updated documentation on AMQP listener function.

13 years agoVersion bump, added AMQP app to the release file
Matt Mullins [Sun, 28 Aug 2011 20:00:02 +0000 (15:00 -0500)]
Version bump, added AMQP app to the release file

13 years agoAdd irc application dependency on amqp application
Matt Mullins [Sun, 28 Aug 2011 19:53:01 +0000 (14:53 -0500)]
Add irc application dependency on amqp application

13 years agoAdded AMQP support to the irc application.
Matt Mullins [Fri, 26 Aug 2011 20:23:54 +0000 (15:23 -0500)]
Added AMQP support to the irc application.

13 years agoAMQP supports attaching a process to handle messages sent to an exchange.
Matt Mullins [Thu, 25 Aug 2011 05:02:26 +0000 (00:02 -0500)]
AMQP supports attaching a process to handle messages sent to an exchange.

13 years agoFix typo in names of irc_sup's children v4
Matt Mullins [Sun, 14 Aug 2011 20:34:50 +0000 (15:34 -0500)]
Fix typo in names of irc_sup's children

13 years agoRelease bump to upgrade the IRC app
Matt Mullins [Sun, 22 May 2011 06:31:07 +0000 (01:31 -0500)]
Release bump to upgrade the IRC app

13 years agoAdded botsnack functionality to the irc application
Matt Mullins [Sun, 22 May 2011 06:26:00 +0000 (01:26 -0500)]
Added botsnack functionality to the irc application

13 years agoBug fix: include the irc_util module in the irc application
Matt Mullins [Sun, 22 May 2011 05:41:13 +0000 (00:41 -0500)]
Bug fix: include the irc_util module in the irc application

13 years agoIRC application version was not a string.
Matt Mullins [Sun, 22 May 2011 05:29:30 +0000 (00:29 -0500)]
IRC application version was not a string.

13 years agoInclude the irc application in the release.
Matt Mullins [Sun, 22 May 2011 05:13:42 +0000 (00:13 -0500)]
Include the irc application in the release.

13 years agoBug fix for irc.floofy-skirts.org: don't JOIN channels until we know we're connected.
Matt Mullins [Sun, 22 May 2011 05:11:54 +0000 (00:11 -0500)]
Bug fix for irc.floofy-skirts.org: don't JOIN channels until we know we're connected.

13 years agoWrote the boiler-plate code to start the IRC modules as an application.
Matt Mullins [Sun, 22 May 2011 05:11:25 +0000 (00:11 -0500)]
Wrote the boiler-plate code to start the IRC modules as an application.

13 years agoAdded a newline to release file so version mismatch is easier.
Matt Mullins [Sun, 22 May 2011 01:28:21 +0000 (20:28 -0500)]
Added a newline to release file so version mismatch is easier.

13 years agoAdded module version to core/config; also made it a new release.
Matt Mullins [Sun, 22 May 2011 00:39:39 +0000 (19:39 -0500)]
Added module version to core/config; also made it a new release.

13 years agoAdded a release file so we can actually boot this thing.
Matt Mullins [Sat, 21 May 2011 23:22:31 +0000 (18:22 -0500)]
Added a release file so we can actually boot this thing.

13 years agoAdded boilerplate code to load the core modules as an app.
Matt Mullins [Sat, 21 May 2011 22:53:59 +0000 (17:53 -0500)]
Added boilerplate code to load the core modules as an app.

13 years agoAdded module to handle configuration files
Matt Mullins [Sat, 21 May 2011 22:53:25 +0000 (17:53 -0500)]
Added module to handle configuration files

13 years agoFinished writing the buffering/parsing code for handling messages from the IRC server
Matt Mullins [Thu, 19 May 2011 23:00:45 +0000 (18:00 -0500)]
Finished writing the buffering/parsing code for handling messages from the IRC server

13 years agoFinished most of the IRC protocol-level work:
Matt Mullins [Thu, 19 May 2011 20:15:10 +0000 (15:15 -0500)]
Finished most of the IRC protocol-level work:

  * added module irc_util to hold the parser and writer for IRC commands
  * irc_conn module should at least be able to join channels

13 years agoUpdated how configuration is bubbled through
Matt Mullins [Wed, 18 May 2011 05:33:32 +0000 (00:33 -0500)]
Updated how configuration is bubbled through

13 years agoRemoved "Supervisor" from state tracked in irc_conn
Matt Mullins [Wed, 18 May 2011 05:19:56 +0000 (00:19 -0500)]
Removed "Supervisor" from state tracked in irc_conn

13 years agoDeleted some un-implemented things from irc_net_sup, and changed some formatting...
Matt Mullins [Wed, 18 May 2011 05:17:24 +0000 (00:17 -0500)]
Deleted some un-implemented things from irc_net_sup, and changed some formatting to be easier to read.

13 years agoRenamed irc_sup to irc_net_sup; added some documentation
Matt Mullins [Wed, 18 May 2011 05:04:18 +0000 (00:04 -0500)]
Renamed irc_sup to irc_net_sup; added some documentation

13 years agoCreated a "core" application that supports core bot activities.
Matt Mullins [Wed, 18 May 2011 04:44:03 +0000 (23:44 -0500)]
Created a "core" application that supports core bot activities.

13 years agoMoved around the IRC modules
Matt Mullins [Wed, 18 May 2011 04:36:11 +0000 (23:36 -0500)]
Moved around the IRC modules

This will support factoring the bot into several "applications".

13 years agoBasic structure of the IRC modules. Nothing does anything, and I still need to make...
Matt Mullins [Mon, 20 Dec 2010 04:26:36 +0000 (22:26 -0600)]
Basic structure of the IRC modules.  Nothing does anything, and I still need to make sure my pid accounting works properly, but at least it kind of has the supervisory structure I'm going to want.

I made lots of TODO notes in comments.