From 42718ed32313e47b02774ed13254b18466e39762 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 18 Apr 2016 12:29:15 -0700 Subject: [PATCH] relay: Allow IP sharing to be toggled per network Via a new "relay_no_ips" option in server blocks. Closes #201. --- example-conf.yml | 8 +++++++- plugins/relay.py | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/example-conf.yml b/example-conf.yml index 87ed747..af5cd09 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -118,6 +118,11 @@ servers: # Separator character (used by relay) separator: "/" + # If enabled, this opts this network out of relay IP sharing. i.e. this network + # will not have its users' IPs sent across the relay, and it will not see any + # IPs of other networks' users. + #relay_no_ips: true + # Sets the max nick length for the network. It is important this is # set correctly, or PyLink might introduce a nick that is too long and # cause netsplits! @@ -332,7 +337,8 @@ relay: # Determines whether real IPs should be sent across the relay. You should # generally have a consensus with your linked networks whether this should # be turned on. You will see other networks' user IP addresses, and they - # will see yours. + # will see yours. Individual networks can also opt out of IP sharing + # both ways by defining "relay_no_ips: true" in their server block. show_ips: false # Whether subservers should be spawned for each relay network (requires diff --git a/plugins/relay.py b/plugins/relay.py index df56dc6..0acdf9a 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -289,7 +289,9 @@ def getRemoteUser(irc, remoteirc, user, spawnIfMissing=True): rsid = getRemoteSid(remoteirc, irc) try: - showRealIP = irc.conf['relay']['show_ips'] + showRealIP = irc.conf['relay']['show_ips'] and not \ + irc.serverdata.get('relay_no_ips') and not \ + remoteirc.serverdata.get('relay_no_ips') except KeyError: showRealIP = False if showRealIP: