feat: tor managed services support#1819
Conversation
2e34935 to
7ed5cff
Compare
2981e7a to
d289cac
Compare
d289cac to
6d97bec
Compare
|
The default values of PoW are way too high for jm-ref to handle. You probably need to play a bit with the values: https://onionservices.torproject.org/technology/security/pow/#configuring-an-onion-service-with-the-pow-protection. For jm-ng: Apart from that, Tor PoW defense is futile if a single connection and be reused with randomized nicks, or even with the same nick since there is no rate limiting. The attacker would take more time to connect but then the attack is the same. And since it looks like the attacker just has a handful of nicks for the current attack, would still happen the same way. Because it's not that there would ever be the situation of forcing a new Tor connection unless we kick peers/connections when the rate limiting is reached. Here is what I wrote in the TG chat:
|
This PR introduces support for Tor-managed hidden services, providing a more secure and simplified way to run persistent onion services without requiring Tor control port access.
Changes
Core Implementation
Modified
JMHiddenServiceclass insrc/jmbase/twisted_utils.py:tor-managed:prefixed hidden service directoriesstart_tor_managed_onion()method that polls for hostname file creationcreate_filesystem_onion_ep()for better code organizationDaemon Integration
Updated
OnionMessageChannelinsrc/jmdaemon/onionmc.py:_start_listener()method for cleaner listener setupTesting
Added comprehensive test coverage:
test/jmbase/test_twisted_utils.py: Tests for hidden service mode detection and ephemeral service creationtest/jmdaemon/test_onionmc.py: Tests for listener setup and different host/port configurationsBenefits
Usage
To use Tor-managed hidden services, configure your
joinmarket.cfg:The corresponding torrc entry would be:
The code automatically detects the
tor-managed:prefix and switches to managed mode, polling for the hostname file that Tor creates.