3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-23 17:00:40 +01:00

relay: add server-specific server_suffix (closes #462) (#484)

This commit is contained in:
Mitchell Cooper 2017-07-12 17:10:36 -04:00 committed by James Lu
parent 1eb2743421
commit c92bb1e33b
2 changed files with 9 additions and 3 deletions

View File

@ -127,6 +127,11 @@ servers:
# Hostname we will use to connect to the remote server # Hostname we will use to connect to the remote server
hostname: "pylink.yournet.local" hostname: "pylink.yournet.local"
# Sets the suffix that relay subservers that this network should use.
# If not specified per network, falls back to the value at
# relay:server_suffix or "relay" if that is not set.
#server_suffix: "relay.yournet.net"
# SID - required for TS6 and TS6-like servers. This must be three characters: # SID - required for TS6 and TS6-like servers. This must be three characters:
# the first char must be a digit [0-9], and the remaining two chars may # the first char must be a digit [0-9], and the remaining two chars may
# be either uppercase letters [A-Z] or digits. # be either uppercase letters [A-Z] or digits.
@ -631,7 +636,7 @@ relay:
allow_clientbot_pms: false allow_clientbot_pms: false
# Sets the suffix that relay subservers should use. Defaults to "relay" (as in net1.relay, # Sets the suffix that relay subservers should use. Defaults to "relay" (as in net1.relay,
# net2.relay, etc.) if not specified. # net2.relay, etc.) if not specified. This can also be set per-network.
#server_suffix: "relay.yournet.net" #server_suffix: "relay.yournet.net"
# Sets whether Clientbot mode sync will be enabled. Valid options: # Sets whether Clientbot mode sync will be enabled. Valid options:

View File

@ -218,7 +218,8 @@ def spawn_relay_server(irc, remoteirc):
try: try:
# ENDBURST is delayed by 3 secs on supported IRCds to prevent # ENDBURST is delayed by 3 secs on supported IRCds to prevent
# triggering join-flood protection and the like. # triggering join-flood protection and the like.
suffix = conf.conf.get('relay', {}).get('server_suffix', 'relay') suffix = irc.serverdata.get('server_suffix', conf.conf.get('relay', {}).get('server_suffix', 'relay'))
# Strip any leading or trailing .'s # Strip any leading or trailing .'s
suffix = suffix.strip('.') suffix = suffix.strip('.')
sid = irc.spawn_server('%s.%s' % (remoteirc.name, suffix), sid = irc.spawn_server('%s.%s' % (remoteirc.name, suffix),