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

Tor endpoint for HTTP API #38

Closed
sr-gi opened this issue Mar 10, 2022 · 9 comments · Fixed by #48
Closed

Tor endpoint for HTTP API #38

sr-gi opened this issue Mar 10, 2022 · 9 comments · Fixed by #48
Labels
feature request New feature or request good first issue Good for newcomers

Comments

@sr-gi
Copy link
Member

sr-gi commented Mar 10, 2022

At the moment we're offering the service over HTTP/HTTPS. For privacy reasons, it'll be good to allow the HTTP endpoint to be served over Tor. This includes:

  • Adding a Tor option to both client and server so it can be run through Tor if set.
  • Offer the API in a .onion if the config flag is set.
  • Send request via Tor if flag is set.
@sr-gi sr-gi added feature request New feature or request good first issue Good for newcomers labels Mar 10, 2022
@tee8z
Copy link
Contributor

tee8z commented Mar 12, 2022

I am starting to work through this one, I'll let you know when I have something that might work & is ready for a review. Just to clarify, the goal here is to have the public & private APIs be running as hidden services with just a boolean flag in the configuration file needed to set it up?

@sr-gi
Copy link
Member Author

sr-gi commented Mar 12, 2022

Hi @tee8z

This should only apply to the public API.

Indeed, it should be configurable via a flag in the config file.

@mariocynicys
Copy link
Collaborator

I was looking into this issue and have found some possible tor implementations that could be used. IMO the best one for this task is libtor (arti will probably be better but it's not quite mature yet).
libtor won't require us to install a tor daemon on the system, and it is also cross platform, but will probably increase the build time so much since it statically builds a C tor daemon inside. Maybe it can be added as a feature in The Eye.

I will keep looking for some other candidate solutions for a little while. Wanted to know if you guys have any other crates in mind that can better deal with tor.

@mariocynicys
Copy link
Collaborator

For the client side we can use tor-stream, but I believe we won't need it, right?
Only the clients who are talking to the tower will need to send their requests via Tor?

@tee8z
Copy link
Contributor

tee8z commented Apr 18, 2022

I have this code basically ready to go, just need to finish up the unit tests, using the https://crates.io/crates/torut crate as it just communicates with a tor daemon setup on the given server. With the libtor library it adds a dependency to 'openssl' which can make building the project much more difficult and I try to avoid adding that dependency when possible. I agree arti would be best once that is ready to be used.

@sr-gi
Copy link
Member Author

sr-gi commented Apr 19, 2022

Only the clients who are talking to the tower will need to send their requests via Tor?

Not sure I follow what you mean there.

@sr-gi
Copy link
Member Author

sr-gi commented Apr 19, 2022

I have this code basically ready to go, just need to finish up the unit tests, using the https://crates.io/crates/torut crate as it just communicates with a tor daemon setup on the given server. With the libtor library it adds a dependency to 'openssl' which can make building the project much more difficult and I try to avoid adding that dependency when possible. I agree arti would be best once that is ready to be used.

Exciting!

@mariocynicys
Copy link
Collaborator

Only the clients who are talking to the tower will need to send their requests via Tor?

Not sure I follow what you mean there.

Nvm that, I got confused. No need to tor_stream.

@tee8z
Copy link
Contributor

tee8z commented Apr 23, 2022

I have a PR posted 'Tor endpoint http api', please let me know of any changes you would like me to make!

@sr-gi sr-gi linked a pull request May 18, 2022 that will close this issue
@sr-gi sr-gi closed this as completed in #48 May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants