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

Support routing .onion traffic over tor #5152

Open
richvdh opened this issue May 8, 2019 · 19 comments
Open

Support routing .onion traffic over tor #5152

richvdh opened this issue May 8, 2019 · 19 comments

Comments

Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
@richvdh
Copy link
Member

@richvdh richvdh commented May 8, 2019

It would be nice to be able to configure synapse so that it can federate both with servers which are on .onion addresses, and those which are on regular clearnet addresses. Currently this is tricky, because there is no way to tell synapse to route some hostnames via a tor proxy whilst routing others as normal

@vsatmydynipnet
Copy link

@vsatmydynipnet vsatmydynipnet commented May 8, 2019

IMHO there would be need to:

  • enable Tor Y/N
  • settings for IP and Port of Tor socks Proxy. IP because it must not run on localhost
  • disable valid cert for Tor or accept clearnet cert for xyz1234.onion
  • alias xyz1234.onion for mydomain.com as user alias if routed through tor

@vsatmydynipnet
Copy link

@vsatmydynipnet vsatmydynipnet commented May 8, 2019

Remark: Tor is actually the only stable solution for real federation. There are alot of systems able to run synapse out there, but people have connectivity problems. IPv6 will not be available to the masses within the next 10 years, so Tor is the only chance for all people to run their own Synapse Homeserver.

@cyphar
Copy link

@cyphar cyphar commented May 26, 2019

I was just about to open an issue for this. There are a few things that would be important to implement:

  • Support using a proxy for all outgoing connections as a homeserver. This would be required for the .onion Matrix server to have any hope of being anonymous -- otherwise all federation out of the Matrix server (or through the Matrix server) would trivially reveal its IP address.

  • There is an argument that it should be possible to set (in a room's options) that only users which are on .onion homeservers are allowed to join (sort of like the "this room is not federated" option today) and for the server to have a configuration which only allows federation with .onion homeservers (but I think you can do that already with the federation whitelist). This way you can set up conversations that explicitly only will be shared by anonymous homeserver users.

  • Get most (if not all) homeservers to route .onion addresses. While I believe messages transit through federation as a broadcast, you don't want there to be only a few hot servers which route .onion traffic (not just because it becomes a pretty serious single point of failure but also for performance reasons). However, we should probably allow for .onion routing to be disabled since some users might not feel comfortable running a Tor client (even though there should be no reason to worry about this).

And it would be nice for clients to indicate when they are in a .onion room or if a .onion user is talking. IRC clients have in the past had issue with Tor users (effectively) social-engineering conversations to go to certain topics, but marking users as being anonymous would be useful. Clients should also tell users to use Tor if they're trying to log into a .onion homeserver.

@Thatoo
Copy link

@Thatoo Thatoo commented Jan 17, 2020

Is there any news on this topic?

@sneak
Copy link

@sneak sneak commented Jan 23, 2020

I'm also interested in running a .onion homeserver - am happy to contribute on this topic in any way I can.

@dr-bonez
Copy link

@dr-bonez dr-bonez commented Mar 12, 2020

I'm also looking into how to do this. Main features necessary for implementation seem to be adding SOCKS5 proxy support and disabling SSL for .onion urls. I'm not a huge python guy so I'm not sure, but it looks like changes for this could be confined to this file. Help from anyone with a better orientation of this codebase would be greatly appreciated with respect to integrating this.

@jh72de
Copy link

@jh72de jh72de commented Dec 5, 2020

This would de-anonymize each server that is set-up to do this (bridge traffic between .onion and clearnet) as well as expose metadata of all the clients of each of these servers.

@dr-bonez
Copy link

@dr-bonez dr-bonez commented Dec 7, 2020

Anyone who is bridging traffic between .onion and clearnet I'm assuming doesn't care about anonymity and probably is running their homeserver on clearnet. It would not reveal the IP addresses of .onion homeservers that route all traffic over Tor.

@cyphar
Copy link

@cyphar cyphar commented Dec 7, 2020

The simplest solution would be to just add Tor (as a client) to every synapse server which would avoid any privacy issues, but this might not be practical (some people may have concerns about running Tor on their homeservers -- in some countries, running Tor at all may result in a visit from the authorities). And if not all servers run Tor, then we should avoid fragmenting the federation (it probably isn't good for the Matrix ecosystem if you end up in a situation where publicly-federatable servers can only be accessed by users on some homeservers).

@dr-bonez
Copy link

@dr-bonez dr-bonez commented Dec 8, 2020

it probably isn't good for the Matrix ecosystem if you end up in a situation where publicly-federatable servers can only be accessed by users on some homeservers

why would this be an issue? especially since the alternative is those homeservers just not existing? Pretty sure matrix will handle this pretty gracefully. Ideally, big homeservers like matrix.org would have tor support, and if a user is running against a small homeserver that isn't running tor, and can't connect to rooms hosted on a .onion, the error would be pretty expected. Perhaps there is something about how matrix federation works that I'm missing.

@vsatmydynipnet
Copy link

@vsatmydynipnet vsatmydynipnet commented Dec 8, 2020

as mentioned in may 2019 above i still think matrix has massiv need for Tor routing. Especially where Dendrite will be able to run a homeserver as single binary on all OS soon, Tor is THE ONLY solution which allows connects to the HS without port forwarding, NAT and dynamic IP problems.

The is NO practicable soltuion for normal users to run their HS without Tor. And please do not name strange UDP something P2P stuff which is not even fully understood by profis. For non techies this will never be a replacement and these ones are also to easy blockable by providers aso. . Especially where Tor Libs exists for Go and others. So it would be possible to create a single static binary without extra Tor setup needed.

Federation as I see it is the possibility for EVERYBODY to run his own HS for himself or the familiy/friends. This needs Tor otherwise it will not work for non techies.

And in that case, anonymisation in not priority 1, it is the possibility to get a jfkslkjflks.onion address which is reachable without any extra setup. And it works everywhere, kinda unblockable compared to UDP stuff which is blocked in probably 90% of the firewalls anyway.

Would love to see this would be built in.

@xshadow
Copy link

@xshadow xshadow commented Jan 31, 2021

I would be interested as well :)

@ghost
Copy link

@ghost ghost commented Feb 11, 2021

Interested a lot. We need that feature

@garlicgambit
Copy link

@garlicgambit garlicgambit commented Mar 6, 2021

Not sure if this is the right place to ask.

Is it currently possible to setup a (non-anonymous) Tor onion service for Synapse? The location of the server doesn't need to be protected and server-to-server traffic doesn't need to be routed over Tor. Only the Matrix clients need to be able access the server via a .onion service.

@githuberyt

This comment was marked as spam.

@xshadow
Copy link

@xshadow xshadow commented Jul 10, 2021

Not sure if this is the right place to ask.

Is it currently possible to setup a (non-anonymous) Tor onion service for Synapse? The location of the server doesn't need to be protected and server-to-server traffic doesn't need to be routed over Tor. Only the Matrix clients need to be able access the server via a .onion service.

Except cloudflares global onion service, which is enabled for matrix.org, I haven't seen any implementation in the wild, where you have an additional onion service next to your public matrix service.

@cysea
Copy link

@cysea cysea commented Aug 12, 2021

Let's make this happen.

It is pretty pointless having a secret server for people to chat on, without the server being anonymous.

TOR is the ideal option.

@wi18b088
Copy link

@wi18b088 wi18b088 commented Sep 18, 2021

Is there any progress on this? Are SOCKS5 proxies already supported in either Synapse or Dendrite? This would be the only missing piece right now for federating .onion homeservers without clearnet federation. TLS checks can be disabled already on both.

@jeanlucmongrain
Copy link

@jeanlucmongrain jeanlucmongrain commented Sep 30, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment