Ticket #1010: 1010_anonymize_local_addresses.diff

File 1010_anonymize_local_addresses.diff, 1.2 KB (added by duck, at 2010-03-29T21:43:07Z)
  • src/allmydata/node.py

    diff --git src/allmydata/node.py src/allmydata/node.py
    index b68ee2f..2fcc9fa 100644
    class Node(service.MultiService): 
    256261
    257262        service.MultiService.startService(self)
    258263        d = defer.succeed(None)
    259         d.addCallback(lambda res: iputil.get_local_addresses_async())
     264        # I2P: don't give out our other addresses
     265        if self.get_config("node", "anonymize_local_addresses", False, boolean=True):
     266            d.addCallback(lambda res: ['127.0.0.1'])
     267        else:
     268            d.addCallback(lambda res: iputil.get_local_addresses_async())
    260269        d.addCallback(self._setup_tub)
    261270        def _ready(res):
    262271            self.log("%s running" % self.NODETYPE)
  • src/allmydata/scripts/create_node.py

    diff --git src/allmydata/scripts/create_node.py src/allmydata/scripts/create_node.py
    index 4e23ac0..1d02931 100644
    def write_node_config(c, config): 
    7373        webport = ""
    7474    c.write("web.port = %s\n" % webport)
    7575    c.write("web.static = public_html\n")
     76    c.write("anonymize_local_addresses = false\n")
    7677    c.write("#tub.port =\n")
    7778    c.write("#tub.location = \n")
    7879    c.write("#log_gatherer.furl =\n")