From b648dfce7f24e41efa143cfd721bbfa22f5d99b8 Mon Sep 17 00:00:00 2001 From: Le Philousophe Date: Sun, 20 Dec 2020 10:19:16 +0000 Subject: [PATCH] MASTER: Add IRC reporter --- master/config.py.example | 15 +++++++++++++++ master/ui.py | 24 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/master/config.py.example b/master/config.py.example index d6a81a8..ce36fbe 100644 --- a/master/config.py.example +++ b/master/config.py.example @@ -41,4 +41,19 @@ www_port = ("127.0.0.1", 8010) # URL used to reach Buildbot instance buildbotURL = "https://buildbot.scummvm.org/" +# IRC configuration +#irc = { +# 'server': 'chat.freenode.net', +# 'port': 7000, +# 'ssl': True, +# 'nick': 'Scummette', +# 'password': 'password', +# 'channels': [ +# '#scummvm' +# ], +# 'nicks': ['someuser'], +# 'admins': ['someuser'], +#} + + htfile = './scumm_htpasswd' diff --git a/master/ui.py b/master/ui.py index 50f739d..9e3c35b 100644 --- a/master/ui.py +++ b/master/ui.py @@ -41,3 +41,27 @@ try: except TypeError: www['port'] = "tcp:{0}".format(config.www_port) +if hasattr(config, 'irc') and config.irc: + services.append(reporters.IRC( + host=config.irc['server'], + port=config.irc.get('port', 6667), + useSSL=config.irc.get('ssl', False), + nick=config.irc['nick'], + password=config.irc.get('password', None), + channels=config.irc.get('channels', []), + pm_to_nicks=config.irc.get('nicks', []), + useColors=True, + authz={ + # Order of match is 'command', '*', ''/'!' + # Operation restricted to bot administrators + '': config.irc.get('admins', False), + # No dangerous command can be issued on IRC (real authentication required) + '!': False, + }, + notify_events=[ + 'exception', + 'problem', + 'recovery', + 'worker' + ] + ))