Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for system tor #3046

Merged

Conversation

HenrikJannsen
Copy link
Contributor

@HenrikJannsen HenrikJannsen commented Dec 7, 2024

Adds support for using external tor process.

We provide now the external_tor.config config file in the tor directory.
It has a flag UseExternalTor to enable the usage of external Tor.

Alternatively One can set the environment variable TOR_SKIP_LAUNCH, or use the the JVM config [1] -Dapplication.network.configByTransportType.tor.useExternalTor.

If Bisq runs on a Whonix system we use the Whonix system Tor process (The external_tor.config can be used for customizing the config).

If cookie authentication is enabled at the external Tor torrc file, the user need to edit the external_tor.config config file to mirror the CookieAuthentication and CookieAuthFile value from torrc.

ControlPort is set to the default value 127.0.0.1:9051.
The SOCKS port will be dynamically requested from the Tor control server.

In case the connection to the external Tor fails, Bisq falls back to the embedded Tor (except for Whonix, in which case we fail).

This PR addresses issues raised in #1924. In case @adrelanos would have time for a review, it would be highly appreciated.

Open issue:
It would be also a good feature to allow the embedded Tor process to stay running after Bisq gets closed. This would align better with Tor network usage and would speed up next Bisq start.
See #3048

[1] See https://github.com/bisq-network/bisq2/blob/main/docs/dev/build.md how to pass JVM args to the Bisq application.

@HenrikJannsen
Copy link
Contributor Author

Found some issues...

…artsWith.

Rename getProcessCommandLineStream to getProcessCommandStream
Add default values for embedded Tor and external Tor.
Add external_tor.config to resources.
Add support for TOR_SKIP_LAUNCH Environment variable.
Add BootstrapEvents and BootstrapStates for useExternalTor case.
Log commands (hiding auth data).
Treat Whonix as external Tor case.
Move setting of useExternalTor to TorService.
Move setting of CONNECT_TO_EXTERNAL_TOR to TorService.
@HenrikJannsen HenrikJannsen force-pushed the add-support-for-system-tor branch from b57c610 to 570f2bf Compare December 9, 2024 14:10
@HenrikJannsen HenrikJannsen marked this pull request as ready for review December 9, 2024 14:10
@HenrikJannsen
Copy link
Contributor Author

Changed the initial comment to reflect the changes after the initial commit.

@HenrikJannsen
Copy link
Contributor Author

HenrikJannsen commented Dec 9, 2024

If external tor is uses we show green tor icon and tooltip info.
Screenshot 2024-12-09 at 21 59 56

@HenrikJannsen HenrikJannsen merged commit 00a797d into bisq-network:main Dec 11, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant