From 95dbacdba6a99f6cffa4e95384be10e1233669b1 Mon Sep 17 00:00:00 2001 From: Mitchell Cooper Date: Wed, 12 Jul 2017 18:38:26 -0400 Subject: [PATCH] allow host to be specified in service bot block or per-network (cherry picked from commit 33630e8f9dc5152425622d885ff31a6201eef2c0) --- coremods/service_support.py | 4 ++-- example-conf.yml | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/coremods/service_support.py b/coremods/service_support.py index 248f195..cb9f930 100644 --- a/coremods/service_support.py +++ b/coremods/service_support.py @@ -31,8 +31,8 @@ def spawn_service(irc, source, command, args): nick = irc.serverdata.get("%s_nick" % name) or conf.conf.get(name, {}).get('nick') or sbot.nick or name ident = irc.serverdata.get("%s_ident" % name) or conf.conf.get(name, {}).get('ident') or sbot.ident or name - # TODO: make this configurable? - host = irc.hostname() + # Determine host the same way as above, except fall back to hostname. + host = irc.serverdata.get("%s_host" % name) or conf.conf.get(name, {}).get('host') or irc.hostname() # Spawning service clients with these umodes where supported. servprotect usage is a # configuration option. diff --git a/example-conf.yml b/example-conf.yml index 5e71e36..d163b37 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -253,12 +253,14 @@ servers: protocol: "unreal" autoconnect: 10 - # You can also define network-specific nicks and idents for various service - # bots, using the configuration options "servicename_nick" and "servicename_ident". + # You can also define network-specific nicks, idents, and hosts for various service + # bots, using the configuration options "servicename_nick", etc. #pylink_nick: MagicServ #pylink_ident: magicserv + #pylink_host: pylink.mynet.net #games_nick: MagicGames #games_ident: magicgames + #games_host: games.mynet.net nefarious: ip: somenet.ddns.local @@ -739,6 +741,10 @@ games: # Sets the nick of the Games service, if you're using it. This defaults to "games" if not defined. nick: Games + # Ident and host can also be specified here, but they may be overriden per-network. + #ident: games + #host: play.games + # Defines a fantasy prefix for the Games bot. prefix: "./"