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 integrated Orbot support using NetCipher shim library #131

Closed
n8fr8 opened this issue Nov 10, 2020 · 9 comments
Closed

Add integrated Orbot support using NetCipher shim library #131

n8fr8 opened this issue Nov 10, 2020 · 9 comments
Assignees
Labels
P0 Priority: 0 (urgent and important)
Milestone

Comments

@n8fr8
Copy link

n8fr8 commented Nov 10, 2020

Orbot/Guardian Project/Tor dev here... ReThink is awesome, and I've manually set it up to use the SOCKS5 proxy to Orbot's localhost 9050 port. It works great... but we could make it better!

Using out simple NetCipher library and the OrbotHelper class, Rethink could detect that Orbot is installed, and offer one tap configuration.

https://github.com/guardianproject/NetCipher/blob/master/libnetcipher/src/info/guardianproject/netcipher/proxy/OrbotHelper.java

If this is something you might want to offer, and would accept a pull request, we'd consider implementing it.

Thanks for the great app.

@ignoramous
Copy link
Collaborator

ignoramous commented Nov 11, 2020

Hi there,

Thanks for those kind words.

If this is something you might want to offer, and would accept a pull request, we'd consider implementing it.

Yes, most definitely, I don't mind but I must warn you though the app, right now, is fairly complicated without much testing or documentation to go for it, and so, I am not sure it is fair to put you through the motions of figuring the hot-mess out. And btw, the connectivity (proxy) portions are in Golang and not Kotlin: https://github.com/celzero/outline-go-tun2socks/blob/81ff0f9992aa755550ef1d8b1177bbeb6c2d1ea0/tunnel/intra/tcp.go#L252-L273

Regardless, I'd want to see this feature in the app, and I am open to implementing it myself (eventually, but not right away since I am most likely to be busy with WireGuard integration and IPv6 support for the next month or two). Can you, in the meanwhile, point me to a reference implementation (of any app integrating the SOCK5 and HTTP(?) proxies using NetCipher) that I can take a look at?

To reiterate, you're free to send a pull-request but know what you're signing up for (:

@n8fr8
Copy link
Author

n8fr8 commented Nov 11, 2020

I think what needs to be done is quite simple, and operates mostly at the "auto set values in the Preferences" level.

  1. If Orbot is on the device, you show/enable the "Proxy traffic through Tor (Orbot)" preference.

  2. If the user enables that preference, then you can query Orbot (via intent/callbacks) what the SOCKS5 port is, and set that value. You already default to localhost:9050 which is what Orbot is, of course.

  3. Optionally, at start time, or whenever the user opens the app, if they have the "use tor" preference on, you can query to make sure the SOCKS5 port is still the same.

In the meantime, we are likely to write a blog post that just shows how the two apps can work together with the very simple step of enabling the existing preference you have.

Here's some examples from FDroid:

Setting preference state if Orbot is installed:
https://gitlab.com/fdroid/fdroidclient/-/blob/master/app/src/main/java/org/fdroid/fdroid/views/PreferencesFragment.java#L454

Using NetCipher to set proxy state:
https://gitlab.com/fdroid/fdroidclient/-/blob/master/app/src/main/java/org/fdroid/fdroid/FDroidApp.java#L648

@ignoramous
Copy link
Collaborator

That sounds straight forward. I was overwhelmed by NetCipher's readme. I'll give this a shot implementing it for the upcoming release.

You already default to localhost:9050 which is what Orbot is, of course.

It is on purpose that the defaults are set to Orbot's :D

@ignoramous ignoramous self-assigned this Nov 11, 2020
@ignoramous ignoramous added the P0 Priority: 0 (urgent and important) label Dec 10, 2020
@ignoramous ignoramous added this to the v054 milestone Dec 22, 2020
@ignoramous
Copy link
Collaborator

@hussainmohd-a has added the support for Orbot one-click integration in mainline: https://github.com/celzero/rethink-app/tree/b3e126e1de2cc78f61747b228ccc572696a0d6a3

14th (v053c) release is imminent and likely to land in f-droid as well. #210

@ignoramous
Copy link
Collaborator

@n8fr8 would you know how to fetch Orbot's DNS port to forward DNS packets to it?

@n8fr8
Copy link
Author

n8fr8 commented May 10, 2021

@n8fr8 would you know how to fetch Orbot's DNS port to forward DNS packets to it?

We don't have an API for that, but the default is 5400 unless the user changes it, or there is some conflict.

@ignoramous
Copy link
Collaborator

@n8fr8 would you know how to fetch Orbot's DNS port to forward DNS packets to it?

We don't have an API for that, but the default is 5400 unless the user changes it, or there is some conflict.

Thanks. Would forwarding DNS packets over SOCKS5 work? Does Orbot route DNS packets sent to it, even if over SOCKS5, appropriately?

@n8fr8
Copy link
Author

n8fr8 commented May 11, 2021 via email

@4-FLOSS-Free-Libre-Open-Source-Software

@n8fr8 would you know how to fetch Orbot's DNS port to forward DNS packets to it?

We don't have an API for that, but the default is 5400 unless the user changes it, or there is some conflict.

Thanks. Would forwarding DNS packets over SOCKS5 work? Does Orbot route DNS packets sent to it, even if over SOCKS5, appropriately?

Yes, but only limited for AAAA, A and PTR records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 Priority: 0 (urgent and important)
Projects
None yet
Development

No branches or pull requests

3 participants