From 2ed8b68c444e6b00c3f7251c5f11c68b98d4ea95 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 23 Sep 2016 22:49:04 -0700 Subject: [PATCH] relay: allow configuring custom relay server suffixes Closes #333. (cherry picked from commit 39008334584023ddc540f7f62e45e7910ecd6783) --- example-conf.yml | 4 ++++ plugins/relay.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/example-conf.yml b/example-conf.yml index 9656db4..13c1a9e 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -477,6 +477,10 @@ relay: # False. allow_clientbot_pms: false + # Sets the suffix that relay subservers should use. Defaults to "relay" (as in net1.relay, + # net2.relay, etc.) if not specified. + #server_suffix: "relay.yournet.net" + games: # Sets the nick of the Games service, if you're using it. This defaults to "games" if not defined. nick: Games diff --git a/plugins/relay.py b/plugins/relay.py index 6174f25..5483730 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -252,7 +252,10 @@ def spawnRelayServer(irc, remoteirc): try: # ENDBURST is delayed by 3 secs on supported IRCds to prevent # triggering join-flood protection and the like. - sid = irc.proto.spawnServer('%s.relay' % remoteirc.name, + suffix = conf.conf.get('relay', {}).get('server_suffix', 'relay') + # Strip any leading or trailing .'s + suffix = suffix.strip('.') + sid = irc.proto.spawnServer('%s.%s' % (remoteirc.name, suffix), desc="PyLink Relay network - %s" % (remoteirc.serverdata.get('netname')\ or remoteirc.name), endburst_delay=3)