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

How to use Tor with Searx when using Docker? #1723

Open
imadockerman opened this issue Oct 16, 2019 · 6 comments
Labels

Comments

@imadockerman
Copy link

@imadockerman imadockerman commented Oct 16, 2019

No description provided.

@MarcAbonce

This comment has been minimized.

Copy link
Contributor

@MarcAbonce MarcAbonce commented Oct 17, 2019

What do you mean? Do you want to create a searx onion service using Docker or do you mean something else?

@imadockerman

This comment has been minimized.

Copy link
Author

@imadockerman imadockerman commented Oct 19, 2019

I want to run Searx using Docker (in host network mode) and I am running Tor in local system. What I want is for Searx to channel all requests (DNS and POST search requests) through Tor. Is that possible? I want to exclusively run Searx in local network and would use local IP like https://192.168.0.20

@MarcAbonce

This comment has been minimized.

Copy link
Contributor

@MarcAbonce MarcAbonce commented Oct 19, 2019

It can be done, but I don't think there's a Dockerfile that does that out of the box.

If your container has Tor installed and running already, then you just have to modify your settings.yml to uncomment the proxies section and add:

proxies  :  
    http  : socks5h://127.0.0.1:9050  
    https : socks5h://127.0.0.1:9050

Assuming that Tor is listening to the 9050 port.

You will probably want to increase the request_timeout setting as well because requests take longer with Tor and probably also change the default engines because at least Google requires Captcha with almost every exit node.

@imadockerman

This comment has been minimized.

Copy link
Author

@imadockerman imadockerman commented Oct 20, 2019

Thanks for the prompt response. After reading your comment, I mounted the settings.yml manually through docker volume and modified the settings. However, I noticed that it is still using my local DNS provider for name resolution. Is there a way to fix this? I want it to tunnel all data, both DNS and search, through tor, so that it is oblivious to the outside world.

@MarcAbonce

This comment has been minimized.

Copy link
Contributor

@MarcAbonce MarcAbonce commented Oct 20, 2019

I haven't been able to reproduce your issue locally. Once I start searx with the socks5h proxies setting, I don't see any DNS lookups coming out.

You're using the socks5h scheme (with the h at the end) instead of socks5, right?
Do the local DNS lookups happen on every query or do they only happen with some engines?

@imadockerman

This comment has been minimized.

Copy link
Author

@imadockerman imadockerman commented Oct 20, 2019

Yeah, I am using the exact proxy setting as you mentioned above. In my server, Tor is running with default settings and some other applications are using Tor without any issues.

This is my docker-compose for searx:

 searx:
        container_name: searx
        image: {custom repo}
        restart: unless-stopped
        network_mode: "host"
        environment:
            IMAGE_PROXY: "True"
            BASE_URL: "https://192.168.1.20:42069"
        volumes:
            - "$HOME/Docker/Searx/:/usr/local/searx/searx/"

I have disabled bin/yahoo/google and using primarily DDG & Startpage and for every search through https://192.168.1.20:42069, my pihole (which is my default DNS server) is picking up all the queries. I am using nginx for the SSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.