zet4 / alpine-tor

Just a simple rotating tor pool with haproxy load balancer. (with opt-in privoxy support)
108 stars 47 forks source link

v3 Hidden Service Addresses #10

Closed brooks-macbeth-shadowdragon closed 5 years ago

brooks-macbeth-shadowdragon commented 5 years ago

The current docker container does not seem to work with TOR v3 Hidden Service URLs; e.g.: http://dlegal66uj5u2dvcbrev7vv6fjtwnd4moqu7j6jnd42rmbypv3coigyd.onion/.

cURL:

~ ❯❯❯ curl --socks5 localhost:32779 http://dlegal66uj5u2dvcbrev7vv6fjtwnd4moqu7j6jnd42rmbypv3coigyd.onion
curl: (6) Could not resolve host: dlegal66uj5u2dvcbrev7vv6fjtwnd4moqu7j6jnd42rmbypv3coigyd.onion

Possible fix: update the tor package from 0.3.0.8 to 0.3.4.9 using apk or alpine:latest?

/ # which tor
/usr/bin/tor
/ # tor --version
Tor version 0.3.0.8 (git-802d30d9b71a6d54).

If anyone has had luck with v3 Hidden Service URLs, please let me know.

brooks-macbeth-shadowdragon commented 5 years ago

new Dockerfile that made v3 name resolution work for me; everything else remains unchanged:

FROM alpine:edge

RUN apk add 'tor' --no-cache \
  --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
  --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
  --allow-untrusted haproxy ruby privoxy

RUN apk --update add --virtual build-dependencies ruby-bundler ruby-dev  \
  && apk add ruby-nokogiri --update-cache --repository http://dl-4.alpinelinux.org/alpine/v3.3/main/ \
  && gem install --no-ri --no-rdoc socksify \
  && apk del build-dependencies \
  && rm -rf /var/cache/apk/*

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

ADD start.rb /usr/local/bin/start.rb
RUN chmod +x /usr/local/bin/start.rb

EXPOSE 2090 8118 5566

CMD ruby /usr/local/bin/start.rb

alpine:edge will correctly download all of the dependancies for the latest tor (version 0.3.4.9)

new test should look like / # curl --socks5-hostname localhost:5566 <url>. This is because --socks5 will not do name resolution through tor and will get responses like curl: (6) Could not resolve host: dlegal66uj5u2dvcbrev7vv6fjtwnd4moqu7j6jnd42rmbypv3coigyd.onion

zet4 commented 5 years ago

Your PR has been merged, thank you.