oXis/alpine-tor

Just a simple rotating tor pool with haproxy load balancer. (with opt-in privoxy support)

★ 1Forks 0RubyGitHub ↗Compare

README

WARNING Personnal project modified to use debian-slim and squid. Not recommended.

alpine-tor

               Docker Container
               -------------------------------------
            (Optional)     (Optional)           <-> Tor Proxy 1
Client <----> Squid <---->  Privoxy <-> HAproxy <-> Tor Proxy 2
                                                <-> Tor Proxy n

Parents

Why: Lots of IP addresses. One single endpoint for your client. Load-balancing by HAproxy.

Optionaly adds support for Privoxy using -e privoxy=1, useful for http (default 8118, changable via -e privoxy_port=<port>) proxy forward and ad removal.

Optionaly adds support for Squid using -e squid=1, squid doesn't support socks5 so privoxy is also used (default port 8119 changable via -e squid_port=<port>). Setup password first with htpasswd -c passwords $USER (default admin:admin)

Environment Variables

  • tors - Integer, number of tor instances to run. (Default: 20)
  • new_circuit_period - Integer, NewCircuitPeriod parameter value in seconds. (Default: 2 minutes)
  • max_circuit_dirtiness - Integer, MaxCircuitDirtiness parameter value in seconds. (Default: 10 minutes)
  • circuit_build_timeout - Integer, CircuitBuildTimeout parameter value in seconds. (Default: 60 seconds)
  • privoxy - Boolean, whatever to run insance of privoxy in front of haproxy.
  • privoxy_port - Integer, port for privoxy. (Default: 8118)
  • privoxy_permit - Space-separated list of source addresses for permit-access option. (Default: Unset)
  • privoxy_deny - Space-separated list of source addresses for deny-access option. (Default: Unset)
  • squid - Boolean, whatever to run insance of squid in front of privoxy/haproxy.
  • squid_port - Integer, port for squid. (Default: 8119)
  • haproxy_port - Integer, port for haproxy. (Default: 5566)
  • haproxy_stats - Integer, port for haproxy monitor. (Default: 2090)
  • haproxy_login and haproxy_pass - BasicAuth config for haproxy monitor. (Default: admin in both variables)
  • test_url - URL for health check throught Tor proxy. (Default: http://google.com)
  • test_status - Integer, HTTP status code for test_url in working case. (Default: 302)

Usage

# build docker container
docker build -t oxis/alpine-tor:latest .

# start docker container
docker run -d -p 5566:5566 -p 2090:2090 -e tors=25 oxis/alpine-tor

# start docker with privoxy enabled and exposed
docker run -d -p 8118:8118 -p 2090:2090 -e tors=25 -e privoxy=1 oxis/alpine-tor

# start docker with squid enabled and exposed
docker run -d -p 8119:8119 -p 2090:2090 -e tors=25 -e squid=1 oxis/alpine-tor

# test with ...
curl --socks5 localhost:5566 http://httpbin.org/ip

# or if privoxy enabled ...
curl --proxy localhost:8118 http://httpbin.org/ip

# or to run chromium with your new found proxy
chromium --proxy-server="http://localhost:8118" \
    --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost"

# monitor
# auth login:admin
# auth pass:admin
http://localhost:2090 or http://admin:admin@localhost:2090

# start docket container with new auth
docker run -d -p 5566:5566 -p 2090:2090 -e haproxy_login=MySecureLogin \
    -e haproxy_pass=MySecurePassword oxis/alpine-tor

Further Readings

Contributors

oXisOtetzzet4NegashevdmitrysobolevZenitharbrooks-macbeth-shadowdragon

Issues