Skip to content

Commit

Permalink
chore: Update Dockerfile to use OS Tor instead of self building.
Browse files Browse the repository at this point in the history
Tor2Web is no longer a supported argument. This means we can use the OS build of Tor since no modifications to Tor is needed.
  • Loading branch information
nepeat committed Sep 9, 2022
1 parent 38ab3d7 commit 8a245bb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 41 deletions.
18 changes: 2 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
FROM alpine:edge

RUN apk add --no-cache haproxy ruby libevent libressl2.6-libcrypto libressl2.6-libssl zlib zstd xz-libs zstd-dev zlib-dev

RUN apk --update add --virtual build-dependencies ruby-bundler ruby-dev git build-base automake autoconf libevent-dev libressl-dev ruby-nokogiri \
&& gem install --no-ri --no-rdoc socksify \
&& cd /tmp \
&& git clone https://github.com/torproject/tor.git \
&& cd tor \
&& ./autogen.sh \
&& ./configure --disable-asciidoc --enable-tor2web-mode \
&& make -j4 \
&& make install \
&& cd .. \
&& rm -rf tor \
&& apk del build-dependencies \
&& rm -rf /var/cache/apk/*

RUN apk add --no-cache tor haproxy ruby libevent libressl-dev zlib zstd xz-libs zstd-dev zlib-dev && \
gem install --no-document socksify

ADD haproxy.cfg.erb /usr/local/etc/haproxy.cfg.erb

Expand Down
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
alpine-tor
==================

# PLEASE NOTE THAT THIS IS INSECURE FOR GENERAL USAGE
# FORK THIS AND REMOVE TOR2WEB MODE IF YOU NEED SECURITY
# OR USE THIS FOR YOUR OWN TOR2WEB NODE IF YOU UNDERSTAND HOW BAD THIS IS


```
Docker Container
-------------------------------------
Expand All @@ -16,28 +11,30 @@ Client <----> HAproxy <-> Tor Proxy 2

Parents
-------
* [rdsubhas/docker-tor-privoxy-alpine](https://github.com/rdsubhas/docker-tor-privoxy-alpine)
* [Negashev/docker-haproxy-tor](https://github.com/Negashev/docker-haproxy-tor)
* [marcelmaatkamp/docker-alpine-tor](https://github.com/marcelmaatkamp/docker-alpine-tor)
* [mattes/rotating-proxy](https://github.com/mattes/rotating-proxy)

* [rdsubhas/docker-tor-privoxy-alpine](https://github.com/rdsubhas/docker-tor-privoxy-alpine)
* [Negashev/docker-haproxy-tor](https://github.com/Negashev/docker-haproxy-tor)
* [marcelmaatkamp/docker-alpine-tor](https://github.com/marcelmaatkamp/docker-alpine-tor)
* [mattes/rotating-proxy](https://github.com/mattes/rotating-proxy)

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

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)
* `haproxy_port_http` - Integer, port for http tunneling. (Default: 8118)
* `haproxy_port_socks` - 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)

* `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)
* `haproxy_port_http` - Integer, port for http tunneling. (Default: 8118)
* `haproxy_port_socks` - 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)

Usage
-----
Expand All @@ -53,7 +50,7 @@ docker pull zeta0/alpine-tor:latest
docker run -d -p 5566:5566 -p 2090:2090 -e tors=25 zeta0/alpine-tor

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

# or with http
curl --proxy localhost:8118 http://httpbin.org/ip
Expand All @@ -75,6 +72,6 @@ docker run -d -p 5566:5566 -p 2090:2090 -e haproxy_login=MySecureLogin \
Further Readings
----------------

* [Tor Manual](https://www.torproject.org/docs/tor-manual.html.en)
* [Tor Control](https://www.thesprawl.org/research/tor-control-protocol/)
* [HAProxy Manual](http://cbonte.github.io/haproxy-dconv/index.html)
* [Tor Manual](https://www.torproject.org/docs/tor-manual.html.en)
* [Tor Control](https://www.thesprawl.org/research/tor-control-protocol/)
* [HAProxy Manual](http://cbonte.github.io/haproxy-dconv/index.html)

0 comments on commit 8a245bb

Please sign in to comment.