Browse Source

Add Tor-specific port options for IRC

master
Shane Moore 8 years ago
parent
commit
0edff0056d
  1. 24
      docs/ENV-NOTES
  2. 12
      server/env.py
  3. 4
      server/irc.py

24
docs/ENV-NOTES

@ -86,15 +86,21 @@ BANDWIDTH_LIMIT - per-session periodic bandwith usage limit in bytes.
If you want IRC connectivity to advertise your node: If you want IRC connectivity to advertise your node:
IRC - set to anything non-empty IRC - set to anything non-empty
IRC_NICK - the nick to use when connecting to IRC. The default is a IRC_NICK - the nick to use when connecting to IRC. The default is a
hash of REPORT_HOST. Either way 'E_' will be prepended. hash of REPORT_HOST. Either way 'E_' will be prepended.
REPORT_HOST - the host to advertise. Defaults to HOST. REPORT_HOST - the host to advertise. Defaults to HOST.
REPORT_HOST_TOR - Tor .onion address to advertise. Uses TCP/SSL_PORT rather REPORT_TCP_PORT - the TCP port to advertise. Defaults to TCP_PORT.
- than REPORT_* ports. '0' disables publishing the port.
REPORT_TCP_PORT - the TCP port to advertise. Defaults to TCP_PORT. REPORT_SSL_PORT - the SSL port to advertise. Defaults to SSL_PORT.
- '0' disables publishing the port for public use. '0' disables publishing the port.
REPORT_SSL_PORT - the SSL port to advertise. Defaults to SSL_PORT. REPORT_HOST_TOR - Tor .onion address to advertise. Appends '_tor" to nick.
REPORT_TCP_PORT_TOR - the TCP port to advertise for Tor. Defaults to
REPORT_TCP_PORT, unless it is '0', then use TCP_PORT.
'0' disables publishing the port.
REPORT_SSL_PORT_TOR - the SSL port to advertise for Tor. Defaults to
REPORT_SSL_PORT, unless it is '0', then use SSL_PORT.
'0' disables publishing the port.
If synchronizing from the Genesis block your performance might change If synchronizing from the Genesis block your performance might change
by tweaking the following cache variables. Cache size is only checked by tweaking the following cache variables. Cache size is only checked

12
server/env.py

@ -51,12 +51,20 @@ class Env(LoggedClass):
self.max_session_subs = self.integer('MAX_SESSION_SUBS', 50000) self.max_session_subs = self.integer('MAX_SESSION_SUBS', 50000)
self.bandwidth_limit = self.integer('BANDWIDTH_LIMIT', 2000000) self.bandwidth_limit = self.integer('BANDWIDTH_LIMIT', 2000000)
# IRC # IRC
self.irc = self.default('IRC', False)
self.irc_nick = self.default('IRC_NICK', None)
self.report_tcp_port = self.integer('REPORT_TCP_PORT', self.tcp_port) self.report_tcp_port = self.integer('REPORT_TCP_PORT', self.tcp_port)
self.report_ssl_port = self.integer('REPORT_SSL_PORT', self.ssl_port) self.report_ssl_port = self.integer('REPORT_SSL_PORT', self.ssl_port)
self.report_host = self.default('REPORT_HOST', self.host) self.report_host = self.default('REPORT_HOST', self.host)
self.report_tcp_port_tor = self.integer('REPORT_TCP_PORT_TOR',
self.report_tcp_port
if self.report_tcp_port else
self.tcp_port)
self.report_ssl_port_tor = self.integer('REPORT_SSL_PORT_TOR',
self.report_ssl_port
if self.report_ssl_port else
self.ssl_port)
self.report_host_tor = self.default('REPORT_HOST_TOR', None) self.report_host_tor = self.default('REPORT_HOST_TOR', None)
self.irc_nick = self.default('IRC_NICK', None)
self.irc = self.default('IRC', False)
# Debugging # Debugging
self.force_reorg = self.integer('FORCE_REORG', 0) self.force_reorg = self.integer('FORCE_REORG', 0)

4
server/irc.py

@ -53,8 +53,8 @@ class IRC(LoggedClass):
if env.report_host_tor: if env.report_host_tor:
self.clients.append( IrcClient(irc_address, self.nick + '_tor', self.clients.append( IrcClient(irc_address, self.nick + '_tor',
env.report_host_tor, env.report_host_tor,
env.tcp_port, env.report_tcp_port_tor,
env.ssl_port) ) env.report_ssl_port_tor) )
self.peer_regexp = re.compile('({}[^!]*)!'.format(self.prefix)) self.peer_regexp = re.compile('({}[^!]*)!'.format(self.prefix))
self.peers = {} self.peers = {}

Loading…
Cancel
Save