Skip to content

Commit

Permalink
[Tor] Set default port 9050 for TorMode=EnabledOnlyRunning (WalletWas…
Browse files Browse the repository at this point in the history
…abi#13065)

* Set default port 9050 for TorMode=EnabledOnlyRunning
* Update WalletWasabi.Documentation/WasabiCompatibility.md

Co-authored-by: yahiheb <[email protected]>
  • Loading branch information
kiminuo and yahiheb authored May 22, 2024
1 parent 84f504a commit ede4ac5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion WalletWasabi.Documentation/WasabiCompatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ Wasabi dependencies are:
## What about Tails and Whonix?

Tails and Whonix are privacy-oriented OSs, so it makes sense to use them with Wasabi Wallet. At the moment, Wasabi is working properly on these platforms, but our dependencies do not officially support them, so we cannot make promises regarding future stability.
To make Wasabi work on these OSs, it should be started with the following start up parameters: `--UseTor=EnabledOnlyRunning --TorSocksPort=9050`.
To make Wasabi work on these OSs, it should be started with the following start up parameter: `--UseTor=EnabledOnlyRunning`.
19 changes: 14 additions & 5 deletions WalletWasabi/Tor/TorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public TorSettings(
string dataDir,
string distributionFolderPath,
bool terminateOnExit,
TorMode torMode = TorMode.Enabled,
TorMode torMode = TorMode.Enabled,
int socksPort = DefaultSocksPort,
int controlPort = DefaultControlPort,
string? torFolder = null,
Expand All @@ -40,11 +40,20 @@ public TorSettings(

bool defaultWasabiTorPorts = socksPort == DefaultSocksPort && controlPort == DefaultControlPort;

// Use different ports when user overrides Tor folder to avoid accessing the same control_auth_cookie file.
if (IsCustomTorFolder && defaultWasabiTorPorts)
if (defaultWasabiTorPorts)
{
socksPort = 37152;
controlPort = 37153;
// Use different ports when user overrides Tor folder to avoid accessing the same control_auth_cookie file.
if (IsCustomTorFolder)
{
socksPort = 37152;
controlPort = 37153;
}
else if (torMode == TorMode.EnabledOnlyRunning)
{
// Whonix & Tails use standard ports.
socksPort = 9050;
controlPort = 9051;
}
}

TorBinaryDir = torFolder ?? Path.Combine(MicroserviceHelpers.GetBinaryFolder(), "Tor");
Expand Down

0 comments on commit ede4ac5

Please sign in to comment.